Advertisement
Kijan

Hunt Event Roller

Oct 20th, 2018
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 92.86 KB | None | 0 0
  1. -- Tables and Variables --------------------------------------------------------
  2. name = ""
  3. monsterSelected = ""
  4. pos = {24.96, 4.01, 1.79}
  5. showdown_box = nil
  6. -- updated
  7. pos_deckBasic = { - 27.98, 2, 16.82}
  8. pos_deckMonst = { - 24.77, 2, 16.70}
  9. huntPos1 = { - 13.10, 4.00, 27.57}
  10. huntPos2 = { - 10.46, 4.00, 27.57}
  11. huntPos3 = { - 7.85, 4.00, 27.57}
  12. huntPos4 = { - 5.21, 4.00, 27.57}
  13. huntPos5 = { - 2.61, 4.00, 27.57}
  14. huntPos6 = {2.60, 4.00, 27.57}
  15. huntPos7 = {5.27, 4.00, 27.57}
  16. huntPos8 = {7.89, 4.00, 27.57}
  17. huntPos9 = {10.52, 4.00, 27.57}
  18. huntPos10 = {13.15, 4.00, 27.57}
  19.  
  20. indom_pos = {3.95, 0.33, - 22.20}
  21. indom_rot = {2.00, 180, 0.00}
  22.  
  23. -- Card/Deck takeObject Rotations
  24. zoneAI_rot = {5.86, 180.0, 180.00}
  25. trait_rot = {4.87, 180.0, 0.00}
  26. surv_status_rot = {4.94, 180, 0.00}
  27.  
  28. -- monster figure positions
  29. monst_2x2_pos = {0.09, 4, 5.31}
  30. monst_3x3_pos = {1.56, 4, 4.01}
  31. monst_4x4_pos = {0.06, 4, 5.10}
  32.  
  33. hunt_Phase = false
  34.  
  35. monstersSetup = {}
  36.  
  37.  
  38. -- Dice Rolling Functions ------------------------------------------------------
  39. -- function clickRollButton
  40. -- function rollDice
  41. -- function clearDice
  42. -- function watchDice
  43. -- function getd100Total
  44. -- function get_hunt_event
  45.  
  46. -- Buttons ---------------------------------------------------------------------
  47. -- function set_btn_params
  48. -- function createButtons_nemesis
  49. -- function createButtons_quarry
  50.  
  51. -- View Quarries and Nemesis ---------------------------------------------------
  52. -- function view_Quarry
  53. -- function close_Quarry
  54. -- function view_Nemesis
  55. -- function close_Nemesis
  56. -- function view_legendaries
  57. -- function special_showdown
  58.  
  59. -- Depart ----------------------------------------------------------------------
  60. -- function departClick
  61. -- function calculate_departing_bonuses
  62. -- function departCoroutine
  63. -- function departSurv
  64. -- function checkStinkyGear
  65. -- function checkOtherGear
  66.  
  67. -- Return ----------------------------------------------------------------------
  68. -- function returnClick
  69. -- function returnCoroutine
  70. -- function returnSurv
  71. -- function spawnEndeavor
  72. -- function spawnTinkerEndeavor
  73.  
  74. -- Set Quarries ----------------------------------------------------------------
  75. -- Set Nemesis -----------------------------------------------------------------
  76.  
  77. -- Setup Levels ----------------------------------------------------------------
  78. -- function setup_level1
  79. -- function setup_level2
  80. -- function setup_level3
  81. -- function setup_level4
  82.  
  83. -- Get Showdown Bag / Monster Story --------------------------------------------
  84. -- function load_monster_box
  85. -- function load_showdown_story_set_board_state
  86.  
  87. -- Setup Terrain Decks ---------------------------------------------------------
  88. -- function get_terrain_deck
  89. -- function set_terrain_cards
  90.  
  91. -- Setup Hunt Decks ------------------------------------------------------------
  92. -- function get_hunt_decks
  93. -- function deal_hunt_event_cards
  94.  
  95. -- Utility Functions -----------------------------------------------------------
  96. -- function updateDisplay
  97. -- function resetTemps
  98. -- function plus
  99. -- function minus
  100. -- function changeAllSurvivors
  101. -- function changeSurvivors
  102. -- function changeMonster
  103. -- function wait
  104. -- function raise_hunt_figurine_after_load
  105. -- function dud
  106.  
  107.  
  108. function onLoad()
  109.   createButtons()
  110.   reset_obj_toLoad()
  111.   spawnedDice = {}
  112.   -- Objects ------------------------------------------------------------------
  113.   bag_d100 = getObjectFromGUID('d0d4ff')
  114.   bag_d10 = getObjectFromGUID('2989bc')
  115.   deck_hunt_events = getObjectFromGUID('c14d81')
  116.   gameBox = getObjectFromGUID(Global.getTable('bags').gameBox.guid)
  117.   monsterBoard = getObjectFromGUID(Global.getTable("boards").boardMonster.guid)
  118.   current_showdown_lvl = getObjectFromGUID(Global.getTable('user_settings').current_showdown_lvl.guid)
  119.   terrainBox = getObjectFromGUID(Global.getTable('bags').terrainBox.guid)
  120.   -- Zones --------------------------------------------------------------------
  121.   zoneInjuryBoard = getObjectFromGUID(Global.getTable('zones').zoneInjuryBoard.guid)
  122.   zoneShowdown = getObjectFromGUID(Global.getTable('zonesDestruct').zoneShowdown.guid)
  123.   zoneAIBoard = getObjectFromGUID(Global.getTable('zones').zoneAIBoard.guid)
  124.   -- Positions ----------------------------------------------------------------
  125.   monster_resource_pos = Global.getTable('monster_resource_pos')
  126.   basic_action_pos = Global.getTable('basic_action_pos')
  127.   -----------------------------------------------------------------------------
  128.   HL_discard_pos = Global.getTable('HL_discard_pos')
  129.   HL_deck_pos = Global.getTable('HL_deck_pos')
  130.   -----------------------------------------------------------------------------
  131.   surv_status_card_p1 = Global.getTable('surv_status_card_p1')
  132.   surv_status_card_p2 = Global.getTable('surv_status_card_p2')
  133.   surv_status_card_p3 = Global.getTable('surv_status_card_p3')
  134.   surv_status_card_p4 = Global.getTable('surv_status_card_p4')
  135.   -----------------------------------------------------------------------------
  136.   AI_discard_pos = Global.getTable('AI_discard_pos')
  137.   AI_deck_pos = Global.getTable('AI_deck_pos')
  138.   AI_wound_pos = Global.getTable('AI_wound_pos')
  139.   basic_deck_pos = Global.getTable('basic_deck_pos')
  140.   advanced_deck_pos = Global.getTable('advanced_deck_pos')
  141.   legendary_deck_pos = Global.getTable('legendary_deck_pos')
  142.   -----------------------------------------------------------------------------
  143.   terrainPos1 = Global.getTable('terrainPos1')
  144.   terrainPos2 = Global.getTable('terrainPos2')
  145.   terrainPos3 = Global.getTable('terrainPos3')
  146.   terrainPos4 = Global.getTable('terrainPos4')
  147.   terrainPos5 = Global.getTable('terrainPos5')
  148.   terrainPos6 = Global.getTable('terrainPos6')
  149.   terrainPos7 = Global.getTable('terrainPos7')
  150.   terrainPos8 = Global.getTable('terrainPos8')
  151.   -----------------------------------------------------------------------------
  152.   inj_pos = {
  153.     Global.getTable('inj_pos_1'),
  154.     Global.getTable('inj_pos_2'),
  155.     Global.getTable('inj_pos_3'),
  156.     Global.getTable('inj_pos_4'),
  157.     Global.getTable('inj_pos_5'),
  158.     Global.getTable('inj_pos_6'),
  159.     Global.getTable('inj_pos_7'),
  160.     Global.getTable('inj_pos_8'),
  161.     Global.getTable('inj_pos_9'),
  162.     Global.getTable('inj_pos_10'),
  163.     Global.getTable('inj_pos_11'),
  164.     Global.getTable('inj_pos_12'),
  165.     Global.getTable('inj_pos_13'),
  166.     Global.getTable('inj_pos_14'),
  167.     Global.getTable('inj_pos_15'),
  168.   }
  169.  
  170.   -- bag_quarry_showdowns = getObjectFromGUID('f18343')
  171.   -- bag_nemesis_showdowns = getObjectFromGUID('3cb738')
  172.  
  173.   -- Available Monster Display
  174.   -- bag_Quarry = getObjectFromGUID('6e836f')
  175.   -- bag_Nemesis = getObjectFromGUID('e59309')
  176.  
  177.   -- Hunt Phase Setup Bag
  178.   -- bag_Hunt = getObjectFromGUID('3bc832')
  179.  
  180.   -- For Setting Monster Stats
  181.  
  182.   -- Token used to get Rotation for ifHunt
  183.   -- huntLoaded = getObjectFromGUID('50ec55')
  184.   loadMonsterStats()
  185. end
  186.  
  187. function loadMonsterStats()
  188.   monstersSetup["Dragon King"] = {
  189.     stats = {{mov = 10, tgh = 13}, {mov = 10, tgh = 15, spd = 1, dmg = 1}, {mov = 10, tgh = 17, spd = 2, dmg = 2, lck = 1}},
  190.     hunt_fig_pos = {huntPos5, huntPos7, huntPos9},
  191.     obj_toLoad_all = {"Irradiate", "Unseen Agony"},
  192.     obj_toLoad_lvl = {{}, {}, {"Smolder"}},
  193.     obj_toLoad_pos = {{pos = inj_pos[1], rot = trait_rot}, {pos = inj_pos[2], rot = trait_rot}, {pos = inj_pos[3], rot = trait_rot}},
  194.     terrain_toLoad = {"Toppled Pillar 1", "Toppled Pillar 2", "Stone Columns 1", "Stone Columns 2", "Stone Columns 3", "Lava Pool", "Obsidian Tower"},
  195.     terrain_toLoad_pos = {{pos = { - 12.46, 0.62, 15.12}, rot = {0, 270, 0}}, {pos = {12.87, 0.62, - 4.60}, rot = {0, 270, 0}}, {pos = { - 5.32, 0.50, - 6.69}, rot = {0, 180, 0}}, {pos = { - 11.66, 0.45, - 0.92}, rot = {0, 90, 0}}, {pos = {5.38, 0.50, 16.96}, rot = {0, 270, 0}}, {pos = {26.56, 1.25, 0.65}, rot = {0, 0, 0}}, {pos = {26.47, 1.28, 4.11}, rot = {0, 0, 0}}},
  196.     card_toLoad = {},
  197.     card_toLoad_pos = {},
  198.     font_toLoad = "Irradiate Font", monst_fig_pos = monst_4x4_pos
  199.   }
  200.   monstersSetup["Dung Beetle Knight"] = {
  201.     stats = {{mov = 7, tgh = 12}, {mov = 7, tgh = 14, spd = 1, dmg = 1}, {mov = 9, tgh = 11, spd = 1, dmg = 2}, {mov = 8, tgh = 18, spd = 2, dmg = 2, acc = 1, evs = 1}},
  202.     hunt_fig_pos = {huntPos5, huntPos7, huntPos9},
  203.     obj_toLoad_all = {"Baller", "Power Forward", "Separation Anxiety", "Ground Pound"},
  204.     obj_toLoad_lvl = {{}, {"Heavy Load"}, {"Heavy Load", "Burrow"}},
  205.     obj_toLoad_pos = {{pos = inj_pos[1], rot = trait_rot}, {pos = inj_pos[2], rot = trait_rot}, {pos = inj_pos[3], rot = trait_rot}, {pos = inj_pos[4], rot = trait_rot}, {pos = inj_pos[5], rot = trait_rot}, {pos = inj_pos[6], rot = trait_rot}},
  206.     terrain_toLoad = {"Stone Columns 1", "Stone Columns 2", "Stone Columns 3", "Stone Columns 4", "Stone Columns 5", "Stone Columns 6", "Resin Dung Ball", "Bug Patch"},
  207.     terrain_toLoad_pos = {{pos = { - 15.30, 0.44, 13.45}, rot = {0, 90, 0}}, {pos = {15.52, 0.44, 13.52}, rot = {0, 90, 0}}, {pos = {11.85, 0.44, 5.92}, rot = {0, 90, 0}}, {pos = { - 11.61, 0.44, 5.91}, rot = {0, 90, 0}}, {pos = { - 15.43, 0.44, - 3.20}, rot = {0, 90, 0}}, {pos = {15.56, 0.44, - 3.09}, rot = {0, 90, 0}}, {pos = {0.09, 0.53, 8.76}, rot = {0, 270, 0}}, {pos = { - 0.82, 0.60, 11.49}, rot = {0, 180, 180}}},
  208.     card_toLoad = {},
  209.     card_toLoad_pos = {},
  210.     font_toLoad = "Smell World Font", monst_fig_pos = monst_2x2_pos
  211.   }
  212.   monstersSetup["Flower Knight"] = {
  213.     stats = {{mov = 7, tgh = 6}, {mov = 8, tgh = 8, dmg = 1}, {mov = 9, tgh = 11, spd = 1, dmg = 2}},
  214.     hunt_fig_pos = {huntPos7, huntPos8, huntPos9},
  215.     obj_toLoad_all = {"Bloom", "Set Roots", "The Forest Gate"},
  216.     obj_toLoad_lvl = {{}, {"Razor Bulbs"}, {"Razor Bulbs", "Perfect Aim", "Heart of the Woods"}},
  217.     obj_toLoad_pos = {{pos = inj_pos[1], rot = trait_rot}, {pos = inj_pos[2], rot = trait_rot}, {pos = {0.02, 3.37, 27.58}, rot = {4.07, 179.99, 0.00}}, {pos = inj_pos[3], rot = trait_rot}, {pos = inj_pos[4], rot = trait_rot}, {pos = inj_pos[5], rot = trait_rot}},
  218.     terrain_toLoad = {"Fairy Ring", "Flower Patches"},
  219.     terrain_toLoad_pos = {{pos = {0.14, 0.77, 5.16}, rot = {0, 90, 0}}, {pos = { - 7.92, 0.69, 0.62}, rot = {0, 180, 0}}},
  220.     card_toLoad = {},
  221.     card_toLoad_pos = {},
  222.     font_toLoad = "Flower Funnel Font", monst_fig_pos = monst_2x2_pos
  223.   }
  224.   monstersSetup["Gorm"] = {
  225.     stats = {{mov = 6, tgh = 8}, {mov = 9, tgh = 11, spd = 1, dmg = 1}, {mov = 8, tgh = 15, spd = 2, dmg = 2, lck = 1}},
  226.     hunt_fig_pos = {huntPos4, huntPos6, huntPos10},
  227.     obj_toLoad_all = {},
  228.     obj_toLoad_lvl = {{}, {"Musth", "Gorm's Den"}, {"Ancient Tusks", "Gormyard"}},
  229.     obj_toLoad_pos = {{pos = inj_pos[1], rot = trait_rot}, {pos = inj_pos[2], rot = trait_rot}},
  230.     terrain_toLoad = {"Tall Grass 1", "Tall Grass 2"},
  231.     terrain_toLoad_pos = {{pos = { - 3.49, 0.57, 8.78}, rot = {0, 270, 0}}, {pos = {5.53, 0.57, - 0.21}, rot = {0, 270, 0}}},
  232.     card_toLoad = {},
  233.     card_toLoad_pos = {},
  234.     -- fromGameBox = {"Gorm Bulb Effect", "Posturing Piss Miasma"},
  235.     -- fromGameBox_pos = {{pos = {79.50, 4.11, 46.94}, rot = {0, 0, 0}}, {pos = {79.50, 4.11, 50}, rot = {0, 0, 0}}},
  236.     font_toLoad = "", monst_fig_pos = monst_3x3_pos
  237.   }
  238.   -- if obj.name == "Gorm Bulb Effect" then
  239.   --    gameBox.takeObject({guid = obj.guid, position = {79.50, 4.11, 46.94}, rotation = {0, 0, 0}, smooth = false})
  240.   -- elseif obj.name == "Posturing Piss Miasma" then
  241.   --    gameBox.takeObject({guid = obj.guid, position = {79.50, 4.11, 50}, rotation = {0, 0, 0}, smooth = false})
  242.   -- end
  243.   monstersSetup["Phoenix"] = {
  244.     stats = {{mov = 8, tgh = 14}, {mov = 8, tgh = 12, spd = 1, dmg = 1}, {mov = 8, tgh = 17, spd = 2, dmg = 3, lck = 2}, {mov = 10, tgh = 25, spd = 3, dmg = 3, lck = 1000, evs = 1, acc = 2}},
  245.     hunt_fig_pos = {huntPos5, huntPos7, huntPos10, huntPos10},
  246.     obj_toLoad_all = {"Materialize", "Spiral Age", "Zeal"},
  247.     obj_toLoad_lvl = {{}, {"Top of the Food Chain"}, {"Top of the Food Chain"}, {"Top of the Food Chain", "Life Trait", "Berserker", "Golden Eyes"}},
  248.     obj_toLoad_pos = {{pos = inj_pos[1], rot = trait_rot}, {pos = inj_pos[2], rot = trait_rot}, {pos = inj_pos[3], rot = trait_rot}, {pos = inj_pos[4], rot = trait_rot}, {pos = AI_discard_pos, rot = zoneAI_rot}, {pos = { - 2.67, 0.51, - 17.23}, rot = zoneAI_rot}, {pos = inj_pos[11], rot = trait_rot}},
  249.     terrain_toLoad = {"Nightmare Tree", "Proxy P1", "Proxy P2", "Proxy P3", "Proxy P4", "Age Counter P1", "Age Counter P2", "Age Counter P3", "Age Counter P4"},
  250.     terrain_toLoad_pos = {{pos = {1.09, 0.60, 6.11}, rot = {0, 180, 0}}, {pos = { - 2.19, 0.62, 7.73}, rot = {0, 180, 0}}, {pos = { - 2.19, 0.62, 6.62}, rot = {0, 180, 0}}, {pos = { - 2.19, 0.62, 5.53}, rot = {0, 180, 0}}, {pos = { - 2.19, 0.62, 4.42}, rot = {0, 180, 0}}, {pos = { - 2.25, 0.36, - 22.40}, rot = {5, 180, 0}}, {pos = { - 0.75, 0.36, - 22.40}, rot = {5, 180, 0}}, {pos = {0.75, 0.33, - 22.40}, rot = {5, 180, 0}}, {pos = {2.25, 0.33, - 22.40}, rot = {5, 180, 0}}},
  251.     card_toLoad = {},
  252.     card_toLoad_pos = {},
  253.     font_toLoad = "", monst_fig_pos = {1.09, 4.00, 6.11}
  254.   }
  255.   monstersSetup["Lion God"] = {
  256.     stats = {{mov = 8, tgh = 10}, {mov = 9, tgh = 16, spd = 1, dmg = 1, lck = 1}, {mov = 10, tgh = 21, spd = 2, dmg = 3, evs = 1, lck = 2}},
  257.     hunt_fig_pos = {huntPos6, huntPos8, huntPos10},
  258.     obj_toLoad_all = {"Whiplash", "Hollow Earth", "Heft"},
  259.     obj_toLoad_lvl = {{}, {"Divine Prowess"}, {"Divine Prowess", "Immaculate Intuition"}},
  260.     obj_toLoad_pos = {{pos = inj_pos[1], rot = trait_rot}, {pos = inj_pos[2], rot = trait_rot}, {pos = inj_pos[3], rot = trait_rot}, {pos = inj_pos[4], rot = trait_rot}, {pos = inj_pos[5], rot = trait_rot}},
  261.     terrain_toLoad = {"Toppled Pillar 1", "Toppled Pillar 2", "Stone Columns 1", "Stone Columns 2", "Stone Columns 3", "Stone Columns 4", "Lion Statue 1", "Lion Statue 2", "Lion Statue 3", "Lion Statue 4", "Giant Stone Face 1", "Giant Stone Face 2", "Sinkhole Terrain"},
  262.     terrain_toLoad_pos = {{pos = { - 8.80, 0.62, 4.22}, rot = {0, 270, 0}}, {pos = {11.05, 0.62, 4.33}, rot = {0, 270, 0}}, {pos = { - 17.17, 0.44, 9.49}, rot = {0, 270, 0}}, {pos = { - 17.18, 0.44, 0.42}, rot = {0, 270, 0}}, {pos = {17.36, 0.44, 9.68}, rot = {0, 270, 0}}, {pos = {17.38, 0.44, 0.47}, rot = {0, 270, 0}}
  263.     , {pos = { - 5.29, 0.65, 10.51}, rot = {0, 0, 0}}, {pos = { - 5.24, 0.65, - 2.08}, rot = {0, 0, 0}}, {pos = {7.30, 0.65, 10.52}, rot = {0, 0, 0}}, {pos = {7.30, 0.65, - 2.13}, rot = {0, 0, 0}}, {pos = {0.91, 0.25, 12.44}, rot = {0, 270, 0}}, {pos = {1.11, 0.25, - 3.93}, rot = {0, 90, 0}}, {pos = {26.13, 1.33, 16.01}, rot = {0, 180, 0}}},
  264.     card_toLoad = {"Stone Columns", "Giant Stone Face", "Toppled Pillar"},
  265.     card_toLoad_pos = {{pos = terrainPos1, rot = surv_status_rot}, {pos = terrainPos2, rot = surv_status_rot}, {pos = terrainPos3, rot = surv_status_rot}},
  266.     font_toLoad = "Impaled Font", monst_fig_pos = monst_3x3_pos
  267.   }
  268.   monstersSetup["Screaming Antelope"] = {
  269.     stats = {{mov = 6, tgh = 8}, {mov = 6, tgh = 10, spd = 1, dmg = 1}, {mov = 8, tgh = 12, spd = 2, dmg = 2, evs = 1}},
  270.     hunt_fig_pos = {huntPos4, huntPos7, huntPos9},
  271.     obj_toLoad_all = {},
  272.     obj_toLoad_lvl = {{}, {"Diabolical"}, {"Diabolical", "Hypermetabolism", "Legendary Horns"}},
  273.     obj_toLoad_pos = {{pos = inj_pos[1], rot = trait_rot}, {pos = inj_pos[2], rot = trait_rot}, {pos = inj_pos[3], rot = trait_rot}},
  274.     terrain_toLoad = {"Acanthus Plants 1", "Acanthus Plants 2", "Acanthus Plants 3", "Acanthus Plants 4", "Acanthus Plants 5", "Acanthus Plants 6", "Bug Patch Terrain"},
  275.     terrain_toLoad_pos = {{pos = { - 4.55, 0.71, 9.87}, rot = {0, 180, 0}}, {pos = { - 8.01, 0.71, 6.12}, rot = {0, 180, 0}}, {pos = { - 4.36, 0.71, 0.69}, rot = {0, 180, 0}}, {pos = {4.67, 0.71, 9.74}, rot = {0, 180, 0}}, {pos = {8.27, 0.71, 4.42}, rot = {0, 180, 0}}, {pos = {4.55, 0.71, 0.72}, rot = {0, 180, 0}}, {pos = {1.00, 0.60, - 4.76}, rot = {0, 180, 0}}},
  276.     card_toLoad = {},
  277.     card_toLoad_pos = {},
  278.     font_toLoad = "Gobbled Up Font", monst_fig_pos = monst_2x2_pos
  279.   }
  280.   monstersSetup["Spidicules"] = {
  281.     stats = {{mov = 11, tgh = 8}, {mov = 14, tgh = 10, spd = 1, dmg = 1}, {mov = 16, tgh = 12, spd = 2, dmg = 2}},
  282.     hunt_fig_pos = {huntPos4, huntPos6, huntPos9},
  283.     obj_toLoad_all = {"Twitching Leg Pile", "Spawn", "Spiderling Action", "The Forest Gate"},
  284.     obj_toLoad_lvl = {{"Frantic Spinning"}, {"Hivemind", "Feeding Time"}, {"Hivemind", "Necrotoxins", "10,000 Teeth"}},
  285.     obj_toLoad_pos = {{pos = inj_pos[1], rot = trait_rot}, {pos = inj_pos[2], rot = trait_rot}, {pos = inj_pos[3], rot = trait_rot}, {pos = {0.02, 3.37, 27.58}, rot = {4.07, 179.99, 0.00}}, {pos = inj_pos[4], rot = trait_rot}, {pos = inj_pos[5], rot = trait_rot}, {pos = inj_pos[6], rot = trait_rot}},
  286.     terrain_toLoad = {"Egg Sacs 1", "Egg Sacs 2", "Silk Nest", "Spiderlings"},
  287.     terrain_toLoad_pos = {{pos = { - 8.00, 0.58, 4.19}, rot = {0, 270, 0}}, {pos = {8.20, 0.58, 6.14}, rot = {0, 270, 0}}, {pos = {0.20, 0.49, 5.13}, rot = {0, 0, 0}}, {pos = { - 21.32, 0.15, - 11.41}, rot = {0, 0, 0}}},
  288.     card_toLoad = {},
  289.     card_toLoad_pos = {},
  290.     font_toLoad = "", monst_fig_pos = monst_2x2_pos
  291.   }
  292.   monstersSetup["Sunstalker"] = {
  293.     stats = {{mov = 16, tgh = 10}, {mov = 16, tgh = 12, spd = 1, dmg = 1}, {mov = 16, tgh = 16, spd = 2, dmg = 2, acc = 1, lck = 1}},
  294.     hunt_fig_pos = {huntPos4, huntPos7, huntPos10},
  295.     obj_toLoad_all = {"Light and Shadow", "Shade", "Shadows of Darkness", "Solar Energy", "Sun Dial"},
  296.     obj_toLoad_lvl = {{}, {"Living Shadows"}, {"Living Shadows", "Monochrome", "Black Blood Red", "Black Blood Yellow", "Black Blood Green", "Black Blood Blue"}},
  297.     obj_toLoad_pos = {{pos = inj_pos[1], rot = trait_rot}, {pos = inj_pos[2], rot = trait_rot}, {pos = inj_pos[3], rot = trait_rot}, {pos = inj_pos[13], rot = trait_rot}, {pos = { - 26.38, 1.46, 12.35}, rot = {0, 180, 0}}, {pos = inj_pos[4], rot = trait_rot}, {pos = inj_pos[5], rot = trait_rot}
  298.     , {pos = { - 25.08, 0.23, - 33.59}, rot = {0, 180, 0}}, {pos = { - 7.82, 0.23, - 33.59}, rot = {0, 180, 0}}, {pos = {19.40, 0.23, - 33.61}, rot = {0, 180, 0}}, {pos = {36.40, 0.23, - 33.59}, rot = {0, 180, 0}}},
  299.     terrain_toLoad = {"Stone Columns", "Stone Columns", "Stone Columns", "Stone Columns", "Salt Sculptures", "Salt Sculptures", "Bag_Shades", "Solar Flare Tracker", "Shadow Up", "bag shadow up", "Shadow Down", "bag shadow down", "Shadow Left", "bag shadow left", "Shadow Right", "bag shadow right", "Stone Columns"},
  300.     terrain_toLoad_pos = {{pos = { - 15.28, 0.49, 14.15}, rot = {0, 270, 0}}, {pos = {2.60, 0.44, - 4.84}, rot = {0, 0, 0}}, {pos = { - 15.41, 0.50, - 4.05}, rot = {0, 270, 0}}, {pos = {2.59, 0.44, 13.33}, rot = {0, 0, 0}}, {pos = {10.05, 0.54, - 0.19}, rot = {0, 0, 0}}, {pos = {10.10, 0.54, 10.63}, rot = {0, 0, 0}}
  301.       , {pos = { - 21.30, 0.15, - 11.50}, rot = {0, 0, 0}}, {pos = { - 26.40, 1.34, 8.75}, rot = {0, 180, 0}}, {pos = {32.70, 0.05, 16.74}, rot = {0, 0, 0}}, {pos = {34.29, 0.16, 16.74}, rot = {0, 0, 0}}, {pos = {32.70, 0.05, 14.23}, rot = {0, 0, 0}}, {pos = {34.29, 0.16, 14.23}, rot = {0, 0, 0}}
  302.     , {pos = {32.70, 0.05, 11.82}, rot = {0, 0, 0}}, {pos = {34.29, 0.16, 11.82}, rot = {0, 0, 0}}, {pos = {32.70, 0.05, 9.41}, rot = {0, 0, 0}}, {pos = {34.29, 0.16, 9.41}, rot = {0, 0, 0}}, {pos = terrainPos1, rot = {0, 180, 0}}},
  303.     card_toLoad = {},
  304.     card_toLoad_pos = {},
  305.     fromGameBox = {"Shade Miasma"},
  306.     fromGameBox_pos = {{pos = {73.23, 4.10, 44.54}, rot = {0, 0, 0}}},
  307.     font_toLoad = "Rotate Sun Dial", monst_fig_pos = monst_4x4_pos
  308.   }
  309.  
  310.   monstersSetup["White Lion"] = {
  311.     stats = {{mov = 6, tgh = 8}, {mov = 7, tgh = 10, spd = 1, dmg = 1}, {mov = 8, tgh = 14, spd = 2, dmg = 2, acc = 2, lck = 1}},
  312.     hunt_fig_pos = {huntPos4, huntPos6, huntPos11},
  313.     obj_toLoad_all = {"Weak Spot"},
  314.     obj_toLoad_lvl = {{}, {"Cunning"}, {"Cunning", "Merciless"}},
  315.     obj_toLoad_pos = {{pos = inj_pos[1], rot = trait_rot}, {pos = inj_pos[2], rot = trait_rot}, {pos = inj_pos[3], rot = trait_rot}},
  316.     terrain_toLoad = {},
  317.     terrain_toLoad_pos = {},
  318.     card_toLoad = {},
  319.     card_toLoad_pos = {},
  320.     font_toLoad = "", monst_fig_pos = monst_2x2_pos
  321.   }
  322.   monstersSetup["Black Lion"] = {
  323.     stats = {{mov = 7, tgh = 10}, {mov = 8, tgh = 12, spd = 1, dmg = 1}, {mov = 9, tgh = 18, spd = 2, dmg = 2, acc = 3, lck = 2}, {mov = 10, tgh = 25, spd = 4, dmg = 4, acc = 7, lck = 5}},
  324.     hunt_fig_pos = {huntPos4, huntPos6, huntPos9},
  325.     obj_toLoad_all = {"Ghost Step"},
  326.     obj_toLoad_lvl = {{}, {"Cunning"}, {"Cunning", "Merciless"}, {"Cunning", "Merciless", "Golden Eyes"}},
  327.     obj_toLoad_pos = {{pos = inj_pos[1], rot = trait_rot}, {pos = inj_pos[2], rot = trait_rot}, {pos = inj_pos[3], rot = trait_rot}, {pos = inj_pos[4], rot = trait_rot}},
  328.     terrain_toLoad = {},
  329.     terrain_toLoad_pos = {},
  330.     card_toLoad = {},
  331.     card_toLoad_pos = {},
  332.     font_toLoad = "", monst_fig_pos = monst_2x2_pos
  333.   }
  334.   monstersSetup["Butcher"] = {
  335.     stats = {{mov = 5, tgh = 9}, {mov = 5, tgh = 12, spd = 1, dmg = 1}, {mov = 8, tgh = 15, spd = 2, dmg = 2, acc = 2}},
  336.     hunt_fig_pos = {},
  337.     obj_toLoad_all = {"Fast Target", "Dreaded Trophies", "Infectious Lunacy P1", "Infectious Lunacy P2", "Infectious Lunacy P3", "Infectious Lunacy P4"},
  338.     obj_toLoad_lvl = {{"Berserker"}, {"Frenzied Berserker"}, {"Frenzied Berserker", "Invincible"}},
  339.     obj_toLoad_pos = {{pos = inj_pos[1], rot = trait_rot}, {pos = inj_pos[2], rot = trait_rot}, {pos = { - 2.25, 0.38, - 22.48}, rot = {0, 180, 0}}, {pos = { - 0.75, 0.38, - 22.48}, rot = {0, 180, 0}}, {pos = {0.75, 0.35, - 22.48}, rot = {0, 180, 0}}, {pos = {2.25, 0.40, - 22.48}, rot = {0, 180, 0}}
  340.     , {pos = inj_pos[3], rot = trait_rot}, {pos = inj_pos[4], rot = trait_rot}, {pos = inj_pos[5], rot = trait_rot}},
  341.     terrain_toLoad = {},
  342.     terrain_toLoad_pos = {},
  343.     card_toLoad = {},
  344.     card_toLoad_pos = {},
  345.     font_toLoad = "", monst_fig_pos = monst_2x2_pos
  346.   }
  347.   monstersSetup["The Hand"] = {
  348.     stats = {{mov = 5, tgh = 14}, {mov = 6, tgh = 15, spd = 1, dmg = 1}, {mov = 6, tgh = 30, spd = 3, dmg = 6}},
  349.     hunt_fig_pos = {},
  350.     obj_toLoad_all = {"Red Lens", "Green Lens", "Blue Lens", "Ghost Step", "Applause", "Impossible Eyes", "Polarized Aura P1", "Polarized Aura P2", "Polarized Aura P3", "Polarized Aura P4"},
  351.     obj_toLoad_lvl = {{}, {}, {}},
  352.     obj_toLoad_pos = {{pos = inj_pos[1], rot = trait_rot}, {pos = inj_pos[2], rot = trait_rot}, {pos = inj_pos[3], rot = trait_rot}, {pos = inj_pos[4], rot = trait_rot}, {pos = AI_deck_pos, rot = zoneAI_rot}, {pos = inj_pos[5], rot = {5.86, 180.00, 0.00}}
  353.     , {pos = surv_status_card_p1, rot = surv_status_rot}, {pos = surv_status_card_p2, rot = surv_status_rot}, {pos = surv_status_card_p3, rot = surv_status_rot}, {pos = surv_status_card_p4, rot = surv_status_rot}},
  354.     terrain_toLoad = {},
  355.     terrain_toLoad_pos = {},
  356.     card_toLoad = {},
  357.     card_toLoad_pos = {},
  358.     font_toLoad = "", monst_fig_pos = {0.09, 6, 5.31}
  359.   }
  360.   monstersSetup["King's Man"] = {
  361.     stats = {{mov = 5, tgh = 12}, {mov = 6, tgh = 15, spd = 1, dmg = 1}, {mov = 6, tgh = 18, spd = 2, dmg = 2, acc = 2}},
  362.     hunt_fig_pos = {},
  363.     -- obj_toLoad_all = {"King's Aura", "Battle Pressure", "Battle Tempo P1", "Battle Tempo P2", "Battle Tempo P3", "Battle Tempo P4", "Out-Fighting", "Weak Spot", "King's Combat"},
  364.     obj_toLoad_all = {"** DO NOT ALTER THIS OR MOVE IT **", "Battle Pressure", "Battle Tempo P1", "Battle Tempo P2", "Battle Tempo P3", "Battle Tempo P4", "Out-Fighting", "Weak Spot", "King's Combat"},
  365.     obj_toLoad_lvl = {{}, {"Silent Hymn"}, {"Silent Hymn"}},
  366.     obj_toLoad_pos = {{pos = {6.30, 0.24, - 10.56}, rot = surv_status_rot}, {pos = {7.68, 0.43, - 13.95}, rot = surv_status_rot}, {pos = surv_status_card_p1, rot = surv_status_rot}, {pos = surv_status_card_p2, rot = surv_status_rot}, {pos = surv_status_card_p3, rot = surv_status_rot}
  367.     , {pos = surv_status_card_p4, rot = surv_status_rot}, {pos = inj_pos[1], rot = trait_rot}, {pos = inj_pos[2], rot = trait_rot}, {pos = inj_pos[3], rot = trait_rot}, {pos = inj_pos[4], rot = trait_rot}},
  368.     terrain_toLoad = {},
  369.     terrain_toLoad_pos = {},
  370.     card_toLoad = {},
  371.     card_toLoad_pos = {},
  372.     font_toLoad = "Rebel", monst_fig_pos = monst_2x2_pos
  373.   }
  374.   monstersSetup["Lion Knight"] = {
  375.     stats = {{mov = 7, tgh = 10}, {mov = 8, tgh = 12}, {mov = 9, tgh = 15, spd = 1, dmg = 1}},
  376.     hunt_fig_pos = {},
  377.     obj_toLoad_all = {"Zeal", "Outburst", "Roles"},
  378.     obj_toLoad_lvl = {{}, {"Drama Lessons"}, {"Drama Lessons", "Last Act"}},
  379.     obj_toLoad_pos = {{pos = inj_pos[1], rot = trait_rot}, {pos = inj_pos[2], rot = trait_rot}, {pos = HL_discard_pos, rot = zoneAI_rot}, {pos = inj_pos[3], rot = trait_rot}, {pos = inj_pos[4], rot = trait_rot}},
  380.     terrain_toLoad = {"Stage", "Balcony", "Throne", "Horn"},
  381.     terrain_toLoad_pos = {{pos = {0.15, 1.85, 6.95}, rot = {0, 0, 180}}, {pos = {0.00, 2.77, 18.58}, rot = {0, 90, 180}}, {pos = { - 13.47, 0.53, 6.07}, rot = {0, 180, 0}}, {pos = {11.85, 0.54, 6.07}, rot = {0, 180, 0}}},
  382.     card_toLoad = {},
  383.     card_toLoad_pos = {},
  384.     font_toLoad = "Lion Knight Roles", monst_fig_pos = monst_2x2_pos
  385.   }
  386.   monstersSetup["Manhunter"] = {
  387.     stats = {{mov = 6, tgh = 8}, {mov = 7, tgh = 11, spd = 1, dmg = 1}, {mov = 8, tgh = 11, spd = 1, dmg = 1}, {mov = 9, tgh = 13, spd = 2, dmg = 2, acc = 2}},
  388.     hunt_fig_pos = {},
  389.     obj_toLoad_all = {"Gun Action", "Gritty Armament", "Tombstone", "Mangled Groin"},
  390.     obj_toLoad_lvl = {{"Short Stride"}, {"Full Stride"}, {"Full Stride"}, {"Full Stride"}},
  391.     obj_toLoad_pos = {{pos = inj_pos[1], rot = trait_rot}, {pos = inj_pos[2], rot = trait_rot}, {pos = inj_pos[3], rot = trait_rot}, {pos = inj_pos[4], rot = trait_rot}, {pos = inj_pos[5], rot = trait_rot}},
  392.     terrain_toLoad = {"Stone Column 1", "Stone Column 2", "Stone Column 3", "Stone Column 4", "Stone Column 5", "Stone Column 6"},
  393.     terrain_toLoad_pos = {{pos = { - 4.63, 0.45, 7.84}, rot = {0, 0, 0}}, {pos = {1.08, 0.45, 11.79}, rot = {0, 90, 0}}, {pos = {4.82, 0.45, 7.92}, rot = {0, 180, 0}}, {pos = {4.83, 0.45, 2.49}, rot = {0, 180, 0}}, {pos = { - 0.81, 0.45, - 1.25}, rot = {0, 270, 0}}, {pos = { - 4.59, 0.45, 2.45}, rot = {0, 0, 0}}},
  394.     card_toLoad = {},
  395.     card_toLoad_pos = {},
  396.     font_toLoad = "", monst_fig_pos = monst_2x2_pos
  397.   }
  398.   monstersSetup["Slenderman"] = {
  399.     stats = {{mov = 6, tgh = 11}, {mov = 6, tgh = 13, spd = 1, dmg = 1, acc = 1}, {mov = 6, tgh = 17, spd = 2, dmg = 2, acc = 2, lck = 1}},
  400.     hunt_fig_pos = {},
  401.     obj_toLoad_all = {"Ensnare", "Gloom", "Madness Inversion"},
  402.     obj_toLoad_lvl = {{}, {}, {"Hounds"}},
  403.     obj_toLoad_pos = {{pos = inj_pos[1], rot = trait_rot}, {pos = inj_pos[2], rot = trait_rot}, {pos = inj_pos[3], rot = trait_rot}, {pos = inj_pos[4], rot = trait_rot}},
  404.     terrain_toLoad = {"Stone Column 1", "Stone Column 2", "Stone Column 3", "Bug Patch"},
  405.     terrain_toLoad_pos = {{pos = { - 15.31, 0.44, - 1.10}, rot = {0, 90, 0}}, {pos = { - 15.34, 0.44, 14.79}, rot = {0, 270, 0}}, {pos = {15.55, 0.44, 14.86}, rot = {0, 270, 0}}, {pos = {15.49, 0.60, 0.66}, rot = {0, 180, 0}}},
  406.     card_toLoad = {},
  407.     card_toLoad_pos = {},
  408.     font_toLoad = "Pod Imprisonment", monst_fig_pos = monst_2x2_pos
  409.   }
  410.   monstersSetup["The Tyrant"] = {
  411.     stats = {{mov = 6, tgh = 8}, {mov = 7, tgh = 10, spd = 1, dmg = 1}, {mov = 7, tgh = 14, spd = 2, dmg = 2}},
  412.     hunt_fig_pos = {},
  413.     obj_toLoad_all = {"Crooked Step", "Spectral Blast", "Destiny's Marrow", "Gates"},
  414.     obj_toLoad_lvl = {{}, {"Quickened"}, {"Quickened"}},
  415.     obj_toLoad_pos = {{pos = inj_pos[1], rot = trait_rot}, {pos = inj_pos[2], rot = trait_rot}, {pos = inj_pos[3], rot = trait_rot}, {pos = { - 20.19, 0.15, - 11.06}, rot = {0, 0, 0}}, {pos = inj_pos[4], rot = trait_rot}},
  416.     terrain_toLoad = {},
  417.     terrain_toLoad_pos = {},
  418.     card_toLoad = {},
  419.     card_toLoad_pos = {},
  420.     font_toLoad = "", monst_fig_pos = monst_2x2_pos
  421.   }
  422.   monstersSetup["Lonely Tree"] = {
  423.     stats = {{mov = 0, tgh = 11, dmg = -1}, {tgh = 13}, {tgh = 17, spd = 1, dmg = 1}},
  424.     hunt_fig_pos = {},
  425.     obj_toLoad_all = {"Bear Fruit", "Impenetrable Trunk"},
  426.     obj_toLoad_lvl = {{}, {"Moving Ground"}, {"Moving Ground", "Life Trait", "Level 3 AI Deck"}},
  427.     obj_toLoad_pos = {{pos = inj_pos[1], rot = trait_rot}, {pos = inj_pos[2], rot = trait_rot}, {pos = inj_pos[3], rot = trait_rot}, {pos = AI_discard_pos, rot = trait_rot}, {pos = AI_deck_pos, rot = zoneAI_rot}},
  428.     -- terrain_toLoad = {"Tall Grass 1", "Tall Grass 2", "Tall Grass 3", "Tall Grass 4", "Nightmare Fruit 1", "Nightmare Fruit 2", "Nightmare Fruit 3", "Nightmare Fruit 4", "Nightmare Fruit 5", "Nightmare Fruit 6"},
  429.     terrain_toLoad = {"Tall Grass 1", "Tall Grass 2", "Tall Grass 3", "Tall Grass 4"},
  430.     terrain_toLoad_pos = {{pos = { - 12.55, 0.57, - 5.76}, rot = {0, 0, 0}}, {pos = { - 12.59, 0.57, 17.95}, rot = {0, 0, 0}}, {pos = {12.76, 0.57, 17.88}, rot = {0, 0, 0}}, {pos = {12.77, 0.57, - 5.62}, rot = {0, 0, 0}}},
  431.     fromGameBox = {"Egg Sac Explosion Effect"},
  432.     fromGameBox_pos = {{pos = {72.14, 4.17, 48.02}, rot = {0, 0, 0}}},
  433.     font_toLoad = "Bear Fruit Font", monst_fig_pos = monst_3x3_pos
  434.   }
  435.   --   local desc = current_showdown_lvl.getDescription()
  436.   --   if desc == "The Lonely Tree Lvl 3" then
  437.   --     delete_LT_AI_decks()
  438.   --   end
  439.   -- end
  440.   --
  441.   -- function delete_LT_AI_decks()
  442.   --   for _, obj in ipairs(zoneAIBoard.getObjects()) do
  443.   --     local name = obj.getName()
  444.   --     if name == "Basic" or name == "Advanced" or name == "Legendary" then
  445.   --       obj.destruct()
  446.   --     end
  447.   --   end
  448.   -- end
  449.  
  450.   monstersSetup["Watcher"] = {
  451.     stats = {{mov = 100}},
  452.     hunt_fig_pos = {},
  453.     obj_toLoad_all = {"Life Trait", "Audience", "Vapor of Nothingness", "Lantern Vortex", "Indomitable", "Retinues", "Watcher Basic AI Deck"},
  454.     obj_toLoad_lvl = {{}, {}, {}},
  455.     obj_toLoad_pos = {{pos = AI_discard_pos, rot = trait_rot}, {pos = inj_pos[1], rot = trait_rot}, {pos = inj_pos[2], rot = trait_rot}, {pos = inj_pos[3], rot = trait_rot}, {pos = indom_pos, rot = indom_rot}, {pos = inj_pos[4], rot = {0, 0, 0}}, {pos = AI_deck_pos, rot = zoneAI_rot}},
  456.     terrain_toLoad = {},
  457.     terrain_toLoad_pos = {},
  458.     card_toLoad = {},
  459.     card_toLoad_pos = {},
  460.     font_toLoad = "Stolen Dreams", monst_fig_pos = monst_2x2_pos
  461.   }
  462.   monstersSetup["Gold Smoke Knight"] = {
  463.     stats = {{mov = 8, tgh = 27}, {mov = 8, tgh = 27}, {mov = 8, tgh = 27}, {mov = 8, tgh = 27}},
  464.     hunt_fig_pos = {},
  465.     obj_toLoad_all = {"Secondary Forge", "Frustration", "Blacken", "Mauler", "Indomitable", "Gold Smoke Knight AI Deck"},
  466.     obj_toLoad_lvl = {{}, {}, {}},
  467.     obj_toLoad_pos = {{pos = inj_pos[1], rot = trait_rot}, {pos = inj_pos[2], rot = trait_rot}, {pos = inj_pos[3], rot = trait_rot}, {pos = inj_pos[4], rot = trait_rot}, {pos = indom_pos, rot = indom_rot}, {pos = AI_deck_pos, rot = zoneAI_rot}},
  468.     terrain_toLoad = {},
  469.     terrain_toLoad_pos = {},
  470.     card_toLoad = {},
  471.     card_toLoad_pos = {},
  472.     font_toLoad = "", monst_fig_pos = monst_3x3_pos
  473.   }
  474.   -- monstersSetup[""] = {
  475.   --    stats = {},
  476.   --    hunt_fig_pos = {},
  477.   --    obj_toLoad_all = {},
  478.   --    obj_toLoad_lvl = {{}, {}, {}},
  479.   --    obj_toLoad_pos = {{pos = inj_pos[1], rot = trait_rot}, {pos = inj_pos[2], rot = trait_rot}},
  480.   --    terrain_toLoad = {},
  481.   --    terrain_toLoad_pos = {{pos = , rot = {0, 270, 0}}, {pos = , rot = {0, 270, 0}}},
  482.   --    card_toLoad = {},
  483.   --   card_toLoad_pos = {},
  484.   --    font_toLoad = "", monst_fig_pos = monst_3x3_pos
  485.   -- }
  486.  
  487.  
  488.  
  489.   monsterSelected = "White Lion"
  490.   box_toGet = "White Lion"
  491.  
  492.   -- -phoenix Legendary
  493.  
  494.   -- -Screaming Antelope Legendary
  495.   -- obj_toLoad_1 = "Trample"
  496.   -- elseif name == obj_toLoad_6 then
  497.   -- showdown_box.takeObject({position = { - 2.66, 0.49, - 17.21}, rotation = zoneAI_rot, smooth = false, guid = obj.guid})
  498.   --
  499.   -- elseif name == obj_toLoad_7 then
  500.   -- showdown_box.takeObject({position = {7.59, 0.43, - 13.97}, rotation = zoneAI_rot, smooth = false, guid = obj.guid})
  501.   --
  502.   -- elseif name == obj_toLoad_8 then
  503.   -- battle_pressure_tool = showdown_box.takeObject({position = {6.16, 0.24, - 10.57}, rotation = {0, 180, 0}, smooth = false, guid = obj.guid})
  504.   -- if battle_pressure_tool ~= nil then
  505.   --    battle_pressure_tool.setScale({0.35, 1.00, 0.35})
  506.   -- end
  507.   --
  508.   -- elseif name == obj_toLoad_9 then
  509.   -- showdown_box.takeObject({position = AI_wound_pos, rotation = zoneAI_rot, smooth = false, guid = obj.guid})
  510.   -- function setup_mad_steed()
  511.   --   btn_clicked = 23
  512.   --   hunt_deck_toGet = "Screaming Antelope Hunt Events Deck"
  513.   --   box_toGet = "Screaming Antelope"
  514.   --   name = "Mad Steed"
  515.   --   hunt_fig_pos = huntPos9
  516.   --   obj_toLoad_2 = "Diabolical"
  517.   --   obj_toLoad_3 = "Hypermetabolism"
  518.   --   obj_toLoad_4 = "Legendary Horns"
  519.   --   obj_toLoad_5 = "Indomitable"
  520.   --   obj_toLoad_6 = "Berserker"
  521.   --   obj_toLoad_7 = "Battle Pressure"
  522.   --   obj_toLoad_8 = "** DO NOT ALTER THIS OR MOVE IT **"
  523.   --   obj_toLoad_9 = "Life Trait"
  524.   --   obj_toLoad_HL = "The Mad Steed Hit Location Deck"
  525.   --   reset_obj_toLoad()
  526.   --   set_obj_toLoad_SA()
  527.   --   set_terrain_toLoad_SA()
  528.   --   changeMonster({mov = 9, tgh = 22, spd = 3, dmg = 5, lck = 1, acc = 1})
  529.   --   load_monster_box()
  530.   --   Wait.time(execute_SA, 2)
  531.   --   calculate_departing_bonuses()
  532.   -- end
  533.  
  534.   -- function setup_great_golden_cat()
  535.   --   obj_toLoad_HL = "White Lion Hit Location Deck"
  536.   --   obj_toLoad_AI = "Great Golden Cat AI Deck"
  537.   --   obj_toLoad_1 = "Life Trait"
  538.   --   obj_toLoad_6 = "Cunning"
  539.   --   obj_toLoad_7 = "Merciless"
  540.   --   obj_toLoad_8 = "Trample"
  541.   --   btn_clicked = 21
  542.   --   box_toGet = "White Lion"
  543.   --   hunt_deck_toGet = "White Lion Hunt Events"
  544.   --   hunt_fig_pos = huntPos10
  545.   --   current_showdown_lvl.setDescription("Great Golden Cat")
  546.   --   changeMonster({mov = 9, tgh = 17, spd = 3, dmg = 5, lck = 1, acc = 3})
  547.   --   load_monster_box()
  548.   --   calculate_departing_bonuses()
  549.   --   Wait.time(execute_WL, 2)
  550.   -- end
  551.  
  552.   -- function setup_beast_of_sorrow()
  553.   --   obj_toLoad_HL = "White Lion Hit Location Deck"
  554.   --   obj_toLoad_6 = "Cunning"
  555.   --   obj_toLoad_8 = "Trample"
  556.   --   btn_clicked = 22
  557.   --   hunt_deck_toGet = "White Lion Hunt Events"
  558.   --   box_toGet = "White Lion"
  559.   --   hunt_fig_pos = huntPos10
  560.   --   current_showdown_lvl.setDescription("Beast of Sorrow")
  561.   --   changeMonster({mov = 7, tgh = 13, spd = 1, dmg = 1})
  562.   --   load_monster_box()
  563.   --   calculate_departing_bonuses()
  564.   --   Wait.time(execute_WL, 2)
  565.   -- end
  566.  
  567.   -- function setup_prologue_lion()
  568.   --   obj_toLoad_AI = "White Lion Prologue Deck"
  569.   --   obj_toLoad_2 = "Prologue Setup"
  570.   --   obj_toLoad_3 = "Claw"
  571.   --   obj_toLoad_4 = "Strange Hand"
  572.   --   obj_toLoad_HL = "White Lion Prologue Hit Location Deck"
  573.   --   box_toGet = "White Lion"
  574.   --   current_showdown_lvl.setDescription("Prologue White Lion")
  575.   --   changeMonster({mov = 6, tgh = 6})
  576.   --   load_monster_box()
  577.   --   Wait.time(execute_WL, 2)
  578.   -- end
  579.  
  580. end
  581.  
  582.  
  583.  
  584. function counter(player, value, id)
  585.   local amount = tonumber(id)
  586.   local stat = tonumber(self.UI.getAttribute(value, "text")) + amount
  587.   local base = tonumber(self.UI.getAttribute(value, "base")) + amount
  588.  
  589.  
  590.   --Maximo Negative ???
  591.   stat = math.max(stat, 0)
  592.   base = math.max(base, 0)
  593.  
  594.   self.UI.setAttribute(value, "text", stat)
  595.   self.UI.setAttribute(value, "base", base)
  596.  
  597. end
  598.  
  599.  
  600. -- Dice Rolling Functions ------------------------------------------------------
  601. function clickRollButton()
  602.   local pos = self.getPosition()
  603.   local hitList = Physics.cast({
  604.     origin = {pos.x, pos.y, pos.z + 2},
  605.     direction = {1, 0, 0},
  606.     type = 2,
  607.     size = {3, 3, 3},
  608.     max_distance = 10
  609.   })
  610.   for _, entry in ipairs(hitList) do
  611.     if entry.hit_object.tag == "Card" then
  612.       local pos = deck_hunt_events.getPosition()
  613.       entry.hit_object.setRotation({0, 180, 0})
  614.       entry.hit_object.setPosition({pos.x, pos.y + 3, pos.z})
  615.       entry.hit_object.setLock(false)
  616.     elseif entry.hit_object.getName() == "Portcullis Key" then
  617.       gameBox.putObject(entry.hit_object)
  618.     end
  619.   end
  620.  
  621.   clearDice()
  622.  
  623.   die_d100 = bag_d100.takeObject({
  624.     position = { - 0.71, 9, 30.16},
  625.     smooth = false,
  626.   })
  627.   die_d10 = bag_d10.takeObject({
  628.     position = {0.77, 9, 30.17},
  629.     smooth = false,
  630.   })
  631.   table.insert(spawnedDice, die_d100.guid)
  632.   table.insert(spawnedDice, die_d10.guid)
  633.   Wait.time(rollDice, 0.1)
  634. end
  635.  
  636. function rollDice(obj)
  637.   die_d100.roll()
  638.   die_d10.roll()
  639.   startLuaCoroutine(self, "watchDice")
  640. end
  641.  
  642. function clearDice()
  643.   for i, v in pairs(spawnedDice) do
  644.     local die = getObjectFromGUID(v)
  645.     if die ~= nil then destroyObject(die) end
  646.   end
  647.   spawnedDice = {}
  648. end
  649.  
  650. function watchDice()
  651.   startTime = os.time()
  652.   repeat
  653.     local restingCount = 0
  654.     for i, dieGUID in ipairs(spawnedDice) do
  655.       local die = getObjectFromGUID(dieGUID)
  656.       if not die or die.resting == true then
  657.         restingCount = restingCount + 1
  658.       end
  659.     end
  660.     coroutine.yield(0)
  661.   until restingCount == #spawnedDice or os.time() > startTime + 5
  662.   watchingDice = false
  663.   getd100Total()
  664.   return 1
  665. end
  666.  
  667. function getd100Total()
  668.  
  669.   value_d100 = die_d100.getValue()
  670.   if value_d100 == 10 then value_d100 = 0 end
  671.   value_d100_mult = value_d100 * 10
  672.  
  673.   value_d10 = die_d10.getValue()
  674.   if value_d10 == 10 then value_d10 = 0 end
  675.  
  676.   total_value = tostring(value_d100_mult + value_d10)
  677.   if value_d100 == 10 and value_d10 == 10 then total_value = "100" end
  678.   broadcastToAll("Hunt Event: " .. total_value, {1, 1, 1})
  679.   get_hunt_event()
  680. end
  681.  
  682. function get_hunt_event()
  683.   local pos = deck_hunt_events.getPosition()
  684.   for _, card in ipairs(deck_hunt_events.getObjects()) do
  685.     local name = card.name
  686.     if name == total_value then
  687.       hunt_event = deck_hunt_events.takeObject({
  688.         position = {0.00, 5.92, 36.17},
  689.         rotation = {35, 180, 0},
  690.         smooth = false,
  691.         guid = card.guid,
  692.         callback = "lock_callback",
  693.         callback_owner = Global
  694.       })
  695.     end
  696.   end
  697.  
  698.   if total_value == "65" then
  699.     local zone = getObjectFromGUID(Global.getTable('zones').zoneGraveyard_Left.guid)
  700.     for _, obj in ipairs(zone.getObjects()) do
  701.       if obj.getName() == "Store Survivor in Here" then
  702.         obj.setPosition({3.59, 3.42, 32.94})
  703.         obj.setRotation({0, 180, 0})
  704.         obj.call("createButton ")
  705.       else
  706.         for _, obj in ipairs(gameBox.getObjects()) do
  707.           if obj.name == "Store Survivor in Here" then
  708.             gameBox.takeObject({
  709.               position = {3.59, 3.42, 32.94},
  710.               rotation = {0, 180, 0},
  711.               smooth = false,
  712.               guid = obj.guid,
  713.               callback = "lock_callback",
  714.               callback_owner = Global
  715.             })
  716.           end
  717.         end
  718.       end
  719.     end
  720.   end
  721.  
  722.   if total_value == "99" then
  723.     for _, obj in ipairs(gameBox.getObjects()) do
  724.       if obj.name == "Portcullis Key" then
  725.         gameBox.takeObject({
  726.           position = {3.21, 4.99, 34.89},
  727.           rotation = {35, 180, 0},
  728.           smooth = false,
  729.           guid = obj.guid,
  730.           callback = "lock_callback",
  731.           callback_owner = Global
  732.         })
  733.       end
  734.     end
  735.   end
  736. end
  737.  
  738.  
  739.  
  740.  
  741. -- Buttons ---------------------------------------------------------------------
  742. function createButtons()
  743.   btn_params = {
  744.     position = {0, 0.2, - 24.8},
  745.     rotation = {20, 180, 0},
  746.     click_function = "end_hunt",
  747.     function_owner = self,
  748.     label = "",
  749.     width = 4900,
  750.     height = 1300,
  751.     color = {0, 0, 0, 0.9},
  752.     font_color = {1, 1, 1},
  753.     tooltip = "",
  754.     font_size = 50
  755.   }
  756.   self.createButton(btn_params)
  757. end
  758.  
  759.  
  760.  
  761. -- View Quarries and Nemesis ---------------------------------------------------
  762. function view_Quarry()
  763.   returnFont()
  764.   Wait.frames(function() showMonster("Quarries") end, 2)
  765. end
  766.  
  767. function view_Nemesis()
  768.   returnFont()
  769.   Wait.frames(function() showMonster("Nemesis") end, 2)
  770. end
  771.  
  772. function view_legendaries()
  773.   returnFont()
  774.   Wait.frames(function() showMonster("Legendaries") end, 2)
  775. end
  776.  
  777. function special_showdown()
  778.   returnFont()
  779.   Wait.frames(function() showMonster("Special") end, 2)
  780. end
  781.  
  782. function returnFont()
  783.   local monsters = {Quarries = true, Nemesis = true, Legendaries = true, Special = true}
  784.   local hitList = Physics.cast({
  785.     origin = {0, 0, 0},
  786.     direction = {1, 0, 0},
  787.     type = 2,
  788.     size = {1, 1, 1},
  789.     max_distance = 1
  790.   })
  791.   for _, entry in ipairs(hitList) do
  792.     if entry.hit_object.getDescription() == "font" and monsters[entry.hit_object.getName()] then
  793.       gameBox.putObject(entry.hit_object)
  794.     end
  795.   end
  796. end
  797.  
  798. function showMonster(name)
  799.   local font = nil
  800.   for _, obj in ipairs(gameBox.getObjects()) do
  801.     if obj.name == name then
  802.       font = gameBox.takeObject({
  803.         position = {0, 0, 0},
  804.         rotation = {0, 0, 0},
  805.         smooth = false,
  806.         guid = obj.guid
  807.       }).lock()
  808.     end
  809.   end
  810. end
  811.  
  812.  
  813.  
  814. -- Depart ----------------------------------------------------------------------
  815. function departClick(nemesis)
  816.   if isCampaignLoaded() == false then
  817.     goToCampaignStartButton()
  818.     return
  819.   end
  820.  
  821.   -- Reset Game State for Start of Showdown without triggering monster AI cards in Injury Board Zone
  822.   local next_round_tool = getObjectFromGUID('b94669')
  823.   next_round_tool.call("nextRound")
  824.  
  825.   local zone = getObjectFromGUID(Global.getTable('zones').zoneInjuryBoard.guid)
  826.   for _, obj in ipairs(zone.getObjects()) do
  827.     if string.find(obj.getDescription(), "board") then
  828.       board = obj
  829.       break
  830.     end
  831.   end
  832.   local btns = board.getButtons()
  833.   if btns ~= nil then
  834.     for i, v in pairs(btns) do
  835.       if v.label == "Main Menu" then
  836.         board.call("main_menu")
  837.       end
  838.     end
  839.   end
  840.  
  841.   if nemesis then
  842.     createNemesisButtons()
  843.     --local showdownTool = getObjectFromGUID('c3451a')
  844.     --showdownTool.call("createNemesisButtons")
  845.   else
  846.     createQuarryButtons()
  847.     bag_Hunt.call('buttonClick_place')
  848.     huntLoaded.setRotation({0, 180, 0})
  849.   end
  850. end
  851.  
  852. function calculate_departing_bonuses(nemesis)
  853.   changeAllSurvivors("survival", tonumber(self.UI.getAttribute("allSurvival", "text")) + tonumber(self.UI.getAttribute("thsSurvival", "text")) + (nemesis and (tonumber(self.UI.getAttribute("allNemesis", "text")) + tonumber(self.UI.getAttribute("thsNemesis", "text"))) or 0))
  854.   changeAllSurvivors("insanity", tonumber(self.UI.getAttribute("allInsanity", "text")) + tonumber(self.UI.getAttribute("thsInsanity", "text")))
  855.   broadcastToAll("_____________ Departing Bonuses Gained _____________", {1, 1, 1})
  856.   startLuaCoroutine(self, "departCoroutine")
  857. end
  858.  
  859. function departCoroutine()
  860.   local gridTable = Global.getTable('grids')
  861.   local zonesTable = Global.getTable('zones')
  862.   local players = {player1 = {getObjectFromGUID(gridTable.red.guid), getObjectFromGUID(zonesTable.zoneP1.guid), "Player 1"},
  863.     player2 = {getObjectFromGUID(gridTable.yellow.guid), getObjectFromGUID(zonesTable.zoneP2.guid), "Player 2"},
  864.     player3 = {getObjectFromGUID(gridTable.green.guid), getObjectFromGUID(zonesTable.zoneP3.guid), "Player 3"},
  865.     player4 = {getObjectFromGUID(gridTable.blue.guid), getObjectFromGUID(zonesTable.zoneP4.guid), "Player 4"}
  866.   }
  867.   wait(1)
  868.   for _, player in pairs(players) do
  869.     departSurv(player[1], player[2], player[3])
  870.   end
  871.   return 1
  872. end
  873.  
  874. function departSurv(grid, zone, name)
  875.   hasArmor = false
  876.   isInsane = false
  877.  
  878.   local broadcastTable = {}
  879.   for _, object in ipairs(zone.getObjects()) do
  880.     local desc = object.getDescription()
  881.     local rotZ = object.getRotation().z
  882.  
  883.     -- True / False Settings
  884.     if string.find(desc, 'armor') then
  885.       hasArmor = true
  886.     end
  887.  
  888.     if object.getName() == "isInsane" and (rotZ > 165 and rotZ < 195) then
  889.       isInsane = true
  890.     end
  891.  
  892.     if string.find(desc, "green_affinities") then
  893.       affinity_green = object
  894.     elseif string.find(desc, "blue_affinities") then
  895.       affinity_blue = object
  896.     elseif string.find(desc, "red_affinities") then
  897.       affinity_red = object
  898.     end
  899.   end
  900.  
  901.   for _, object in ipairs(zone.getObjects()) do
  902.     local desc = object.getDescription()
  903.     local rotZ = object.getRotation().z
  904.     -- Crystal Skin
  905.     if object.getName() == "Crystal Skin" then
  906.       if hasArmor then
  907.         table.insert(broadcastTable, "[b]Crystal Skin[/b]: You have Armor ~ No Bonus")
  908.       end
  909.       if not hasArmor then
  910.         if object.getName() == "Crystal Skin" then
  911.           object.translate({0, 6, 0})
  912.           wait(1)
  913.           local desc = object.getDescription()
  914.           local new_desc = (object.getDescription() .. ", armor, 3head, 3body, 3waist, 3legs, 3arms")
  915.           object.setDescription(new_desc)
  916.           table.insert(broadcastTable, "[b]Crystal Skin[/b]: You gained 3 to all Hit Locations")
  917.         end
  918.       end
  919.     end
  920.  
  921.     -- Binge Eating Disorder
  922.     if object.getName() == "Binge Eating Disorder" then
  923.       table.insert(broadcastTable, "[b]Binge Eating Disorder[/b]: You cannot depart unless you have 'consumable' gear.")
  924.  
  925.       -- Quixotic
  926.     elseif object.getName() == "Quixotic" then
  927.       local insanity = tonumber(getObjectFromGUID(grid.getVar("FullCharSheetGUID")).getTable("buttons").insanity.label)
  928.       if isInsane or insanity >= 3 then
  929.         table.insert(broadcastTable, "[b]Quixotic[/b]: You are insane ~ You gained +1 Survival and +1 Strength Token")
  930.         changeSurvivors("survival", 1, grid)
  931.         local strTokenBag = getObjectFromGUID('0bf641')
  932.         local pos = grid.getPosition()
  933.         local quixoticToken = strTokenBag.takeObject({position = { - 21.90, 4.12, - 26.91}, rotation = {0, 180, 0}})
  934.         quixoticToken.setPosition({pos.x + 3.07, pos.y + 2, pos.z + 3.39})
  935.         quixoticToken.setName("Quixotic")
  936.       end
  937.  
  938.       -- Squeamish
  939.     elseif object.getName() == "Squeamish" then
  940.       table.insert(broadcastTable, "[b]Squeamish[/b]: You cannot depart with 'stinky' gear.")
  941.       stinky = checkStinkyGear(zone)
  942.       if stinky ~= "" then
  943.         table.insert(stinky)
  944.       end
  945.  
  946.       -- Superstitous
  947.     elseif object.getName() == "Superstitous" then
  948.       table.insert(broadcastTable, "[b]Superstitious[/b]: You cannot depart with 'other' gear.")
  949.       other = checkOtherGear(zone)
  950.       if other ~= "" then
  951.         table.insert(other)
  952.       end
  953.  
  954.       -- Flower Addiction
  955.     elseif object.getName() == "Flower Addiction" then
  956.       table.insert(broadcastTable, "[b]Flower Addiction[/b]: You may only depart to hunt the Flower Knight.")
  957.  
  958.       -- Megalophobia
  959.     elseif object.getName() == "Megalophobia" then
  960.       table.insert(broadcastTable, "[b]Megalophobia[/b]: You cannot depart to hunt a monster that occupies more than 4 spaces.")
  961.  
  962.       -- Necromancer
  963.     elseif object.getName() == "Necromancer" then
  964.       table.insert(broadcastTable, "[b]Necromancer[/b]: Gain +1 to All hit locations for each gear card in your grid with the symbol keyword.")
  965.  
  966.       -- Ageless Apprentice
  967.     elseif object.getName() == "Ageless Apprentice" then
  968.       table.insert(broadcastTable, "[b]Ageless Apprenctice[/b]: You may rotate up to 3 gear cards in your gear grid; changing the affinity locations.")
  969.  
  970.       -- Seasoned Monster Meat
  971.     elseif object.getName() == "Seasoned Monster Meat" then
  972.       table.insert(broadcastTable, "[b]Seasoned Monster Meat[/b]: You gained (+3) Survival.")
  973.       changeSurvivors("survival", 3, grid)
  974.  
  975.       -- Gloom Bracelets
  976.     elseif object.getName() == "Gloom Bracelets" then
  977.       table.insert(broadcastTable, "[b]Gloom Bracelets[/b]: You gained (+2) Insanity.")
  978.       changeSurvivors("insanity", 2, grid)
  979.  
  980.       -- Slender Ovule
  981.     elseif object.getName() == "Slender Ovule" then
  982.       table.insert(broadcastTable, "[b]Slender Ovule[/b]: You gained (+3) Insanity.")
  983.       changeSurvivors("insanity", 3, grid)
  984.  
  985.       -- Silk Robes
  986.     elseif object.getName() == "Silk Robes" then
  987.       table.insert(broadcastTable, "[b]Silk Robes[/b]: You gained (+1) Survival.")
  988.       changeSurvivors("survival", 1, grid)
  989.  
  990.       -- Silk Sash
  991.     elseif object.getName() == "Silk Sash" then
  992.       table.insert(broadcastTable, "[b]Silk Sash[/b]: You gained (+1) Survival.")
  993.       changeSurvivors("survival", 1, grid)
  994.  
  995.       -- Almanac
  996.     elseif object.getName() == "Almanac" then
  997.       table.insert(broadcastTable, "[b]Almanac[/b]: You gained (+2) Insanity.")
  998.       changeSurvivors("insanity", 2, grid)
  999.  
  1000.       -- Lantern Cuirass
  1001.     elseif object.getName() == "Lantern Cuirass" and (rotZ > 165 and rotZ < 195) then
  1002.       table.insert(broadcastTable, "[b]Lantern Cuirass[/b]: Add 3 to all hit locations.")
  1003.  
  1004.       -- Leather Bracers
  1005.     elseif object.getName() == "Leather Bracers" then
  1006.       table.insert(broadcastTable, "[b]Leather Bracers[/b]: You gained (+2) Survival.")
  1007.       changeSurvivors("survival", 2, grid)
  1008.  
  1009.       -- Leather Mask
  1010.     elseif object.getName() == "Leather Mask" then
  1011.       table.insert(broadcastTable, "[b]Leather Mask[/b]: You gained (+2) Insanity.")
  1012.       changeSurvivors("insanity", 2, grid)
  1013.  
  1014.       -- Dried Acanthus
  1015.     elseif object.getName() == "Dried Acanthus" then
  1016.       table.insert(broadcastTable, "[b]Dried Acanthus[/b]: You gained (+2) Survival.")
  1017.       changeSurvivors("survival", 2, grid)
  1018.  
  1019.       -- Fecal Salve
  1020.     elseif object.getName() == "Fecal Salve" then
  1021.       table.insert(broadcastTable, "[b]Fecal Salve[/b]: You gained (+1) Survival.")
  1022.       changeSurvivors("survival", 1, grid)
  1023.  
  1024.       -- Crest Crown
  1025.     elseif object.getName() == "Crest Crown" and (rotZ > 165 and rotZ < 195) then
  1026.       local numBlueAffinity = tonumber(affinity_blue.call("getCount"))
  1027.       for i = 1, numBlueAffinity do
  1028.         changeSurvivors("survival", 1, grid)
  1029.         changeSurvivors("insanity", 1, grid)
  1030.       end
  1031.       if numBlueAffinity >= 1 then
  1032.         table.insert(broadcastTable, "[b]Crest Crown[/b]: You gained (+" .. numBlueAffinity .. ") Survival and (+" .. numBlueAffinity .. ") Insanity")
  1033.       end
  1034.  
  1035.       -- Phoenix Faulds
  1036.     elseif object.getName() == "Phoenix Faulds" then
  1037.       table.insert(broadcastTable, "[b]Phoenix Faulds[/b]: You gained (+1) Insanity.")
  1038.       changeSurvivors("insanity", 1, grid)
  1039.  
  1040.       -- Phoenix Gauntlet
  1041.     elseif object.getName() == "Phoenix Gauntlet" then
  1042.       table.insert(broadcastTable, "[b]Phoenix Gauntlet[/b]: You gained (+1) Insanity.")
  1043.       changeSurvivors("insanity", 1, grid)
  1044.  
  1045.       -- Rawhide Boots
  1046.     elseif object.getName() == "Rawhide Boots" then
  1047.       table.insert(broadcastTable, "[b]Rawhide Boots[/b]: You gained (+1) Survival.")
  1048.       changeSurvivors("survival", 1, grid)
  1049.  
  1050.       -- Rawhide Gloves
  1051.     elseif object.getName() == "Rawhide Gloves" then
  1052.       table.insert(broadcastTable, "[b]Rawhide Gloves[/b]: You gained (+1) Survival.")
  1053.       changeSurvivors("survival", 1, grid)
  1054.  
  1055.       -- Rawhide Drum
  1056.     elseif object.getName() == "Rawhide Drum" then
  1057.       table.insert(broadcastTable, "[b]Rawhide Drums[/b]: You gained (+1) Insanity.")
  1058.       changeSurvivors("insanity", 1, grid)
  1059.  
  1060.       -- Partner
  1061.     elseif object.getName() == "Partner" then
  1062.       table.insert(broadcastTable, "[b]Partner[/b]: If your Partner also departed, (+2) Survival.")
  1063.  
  1064.       -- Endless Babble
  1065.     elseif object.getName() == "Endless Babble" then
  1066.       table.insert(broadcastTable, "[b]Endless Babble[/b]: Departing Survivors gained (+1) Insanity.")
  1067.       changeAllSurvivors("insanity", 1)
  1068.  
  1069.       -- Gloom Mehndi
  1070.     elseif object.getName() == "Gloom Mehndi" then
  1071.       object.setDescription(desc .. ", once per showdown used, set, 1head, 1body, 1waist, 1arms, 1legs")
  1072.       object.translate({0, 6, 0})
  1073.       table.insert(broadcastTable, "[b]Gloom Mehndi[/b]: You gained 1 Armor to all Hit Locations.")
  1074.  
  1075.       -- Cycloid Scale Skirt
  1076.     elseif object.getName() == "Cycloid Scale Skirt" and (rotZ > 165 and rotZ < 195) then
  1077.       local numBlueAffinity = tonumber(affinity_blue.call("getCount"))
  1078.       for i = 1, numBlueAffinity do
  1079.         changeSurvivors("survival", 1, grid)
  1080.       end
  1081.       if numBlueAffinity >= 1 then
  1082.         table.insert(broadcastTable, "[b]Cycloid Scale Skirt[/b]: You gained (+" .. numBlueAffinity .. ") Survival" )
  1083.       end
  1084.  
  1085.       -- Gloom Cream
  1086.     elseif object.getName() == "Gloom Cream" and (rotZ > 165 and rotZ < 195) then
  1087.       table.insert(broadcastTable, "[b]Gloom Cream[/b]: Gain (-3) Hunt XP and (-1) Understanding. If you have no Understanding, die immediately")
  1088.  
  1089.       -- Acanthus Doctor
  1090.     elseif object.getName() == "Acanthus Doctor" and (rotZ < 165 or rotZ > 345) then
  1091.       if hasArmor then
  1092.         table.insert(broadcastTable, "[b]Acanthus Doctor[/b]: You are wearing Armor ~ You do not gain any Strength Tokens")
  1093.       end
  1094.       if not hasArmor then
  1095.         local pos = object.getPosition()
  1096.         local numGreenAffinity = tonumber(affinity_green.call("getCount"))
  1097.         for i = 1, numGreenAffinity do
  1098.           local strToken = getObjectFromGUID('4c2300')
  1099.           local strToken_temp = strToken.takeObject({position = {pos.x, pos.y + i * 0.5, pos.z}, rotation = {0, 180, 0}})
  1100.           strToken_temp.setScale({0.46, 1.00, 0.46})
  1101.         end
  1102.         table.insert(broadcastTable, "[b]Acanthus Doctor[/b]: You gained (+" .. numGreenAffinity .. ") Strength Tokens")
  1103.       end -- End Acanthus Doctor
  1104.  
  1105.       -- Sun Lure and Hook
  1106.     elseif object.getName() == "Sun Lure and Hook" then
  1107.       changeSurvivors("survival", 1, grid)
  1108.       table.insert(broadcastTable, "[b]Sun Lure and Hook[/b]: You gained (+1) Survival.")
  1109.  
  1110.     end
  1111.   end
  1112.   if #broadcastTable > 0 then
  1113.     broadcastToAll("~~~~~~~[b]" .. name .. "[/b]~~~~~~~", {1, 1, 1})
  1114.     for _, b in pairs(broadcastTable) do
  1115.       broadcastToAll(b, {1, 1, 1})
  1116.       wait(1.5)
  1117.     end
  1118.     wait(0.50) -- wait between each players itemcheck
  1119.   end
  1120. end
  1121.  
  1122. function checkStinkyGear(zone)
  1123.   wait(2)
  1124.   local objectsInZone = zone.getObjects()
  1125.   for _, object in ipairs(objectsInZone) do
  1126.     local desc = object.getDescription()
  1127.     if string.find(desc, 'stinky') then
  1128.       return "You have 'stinky' gear in your gear grid."
  1129.     end
  1130.   end
  1131.   return ""
  1132. end
  1133.  
  1134. function checkOtherGear(zone)
  1135.   wait(2)
  1136.   local objectsInZone = zone.getObjects()
  1137.   for _, object in ipairs(objectsInZone) do
  1138.     local desc = object.getDescription()
  1139.     if string.find(desc, 'other') then
  1140.       return "You have 'other' gear in your gear grid."
  1141.     end
  1142.   end
  1143.   return ""
  1144. end
  1145.  
  1146. -- Return ----------------------------------------------------------------------
  1147. function returnClick()
  1148.   startLuaCoroutine(self, "returnCoroutine")
  1149. end
  1150.  
  1151. function returnCoroutine()
  1152.   local gridTable = Global.getTable('grids')
  1153.   local zonesTable = Global.getTable('zones')
  1154.   local players = {player1 = {getObjectFromGUID(gridTable.red.guid), getObjectFromGUID(zonesTable.zoneP1.guid), "Player 1"},
  1155.     player2 = {getObjectFromGUID(gridTable.yellow.guid), getObjectFromGUID(zonesTable.zoneP2.guid), "Player 2"},
  1156.     player3 = {getObjectFromGUID(gridTable.green.guid), getObjectFromGUID(zonesTable.zoneP3.guid), "Player 3"},
  1157.     player4 = {getObjectFromGUID(gridTable.blue.guid), getObjectFromGUID(zonesTable.zoneP4.guid), "Player 4"}
  1158.   }
  1159.   wait(0.1)
  1160.   for _, player in pairs(players) do
  1161.     returnSurv(player[1], player[2], player[3])
  1162.   end
  1163.   return 1
  1164. end
  1165.  
  1166. function returnSurv(grid, zone, name)
  1167.   local broadcastTable = {}
  1168.   local bag = ""
  1169.   local tempBag = ""
  1170.   if grid.getVar("FullCharSheetGUID") == '' or grid.getVar("FullCharSheetGUID") == nil then
  1171.     table.insert(broadcastTable, "__________" .. name .. " Died __________")
  1172.   else
  1173.     table.insert(broadcastTable, "__________" .. name .. " Returned __________")
  1174.     if name == "Player 1" then
  1175.       bag = getObjectFromGUID('d202ed')
  1176.     elseif name == "Player 2" then
  1177.       bag = getObjectFromGUID('6b02af')
  1178.     elseif name == "Player 3" then
  1179.       bag = getObjectFromGUID('98eafe')
  1180.     elseif name == "Player 4" then
  1181.       bag = getObjectFromGUID('38ac5c')
  1182.     end
  1183.     local objectsInZone = zone.getObjects()
  1184.     for _, object in ipairs(objectsInZone) do
  1185.       if object.getName() == "Hoarder" then
  1186.         table.insert(broadcastTable, "[b]Hoarder[/b]: Archive 1 resource gained from this showdown and gain (+1) Courage")
  1187.  
  1188.       elseif object.getName() == "Matchmaker" then
  1189.         table.insert(broadcastTable, "[b]Matchmaker[/b]: You may spend an Endeavor for Intimacy")
  1190.         bag = getObjectFromGUID('5dffd3')
  1191.  
  1192.       elseif object.getName() == "Secretive" then
  1193.         table.insert(broadcastTable, "[b]Secretive[/b]: You must skip the next hunt")
  1194.  
  1195.       elseif object.getName() == "Post Traumatic Stress" then
  1196.         table.insert(broadcastTable, "[b]Post Traumatic Stress[/b]: You must skip the next hunt and cannot contribute to any endeavors")
  1197.  
  1198.       elseif object.getName() == "Fear of the Dark" then
  1199.         table.insert(broadcastTable, "[b]Fear of the Dark[/b]: You Retire")
  1200.  
  1201.       elseif object.getName() == "Tinker" then
  1202.         spawnTinkerEndeavor(name)
  1203.  
  1204.       elseif object.getName() == "Heart of the Storm" then
  1205.         table.insert(broadcastTable, "[b]Heart of the Storm[/b]: If you gain Weapon XP, gain (+3) Weapon XP and 1 Iron Strange Resource")
  1206.  
  1207.       elseif object.getName() == "Elder Earrings" then
  1208.         table.insert(broadcastTable, "[b]Elder Earrings[/b]: Gain (+1) Hunt XP")
  1209.  
  1210.       elseif object.getName() == "Scavenger Kit" then
  1211.         table.insert(broadcastTable, "[b]Scavenger Kit[/b]: Gain either +1 Random Basic or +1 Random Monster resource from this monster.")
  1212.  
  1213.       elseif object.getName() == "Healing Potion" then
  1214.         table.insert(broadcastTable, "[b]Healing Potion[/b]: If you suffered any Severe Injuries ~ You may archive Healing Potion to remove it")
  1215.  
  1216.       elseif object.getName() == "Torn Achilles Tendon" then
  1217.         table.insert(broadcastTable, "Torn Achilles ~ Skip the Next Hunt")
  1218.         object.destroy()
  1219.  
  1220.       elseif object.getName() == "Dislocated Shoulder" then
  1221.         object.destroy()
  1222.  
  1223.       elseif object.getName() == "Ruptured Spleen" then
  1224.         table.insert(broadcastTable, "Ruptured Spleen ~ Skip the Next Hunt")
  1225.         object.destroy()
  1226.  
  1227.       elseif object.getName() == "Torn Muscle" then
  1228.         table.insert(broadcastTable, "Torn Muscle ~ Skip the Next Hunt")
  1229.         object.destroy()
  1230.  
  1231.       elseif object.getName() == "Bruised Tailbone" then
  1232.         object.destroy()
  1233.  
  1234.       elseif object.getName() == "Spiral Fracture" then
  1235.         table.insert(broadcastTable, "Spiral Fracture ~ Skip the Next Hunt")
  1236.         object.destroy()
  1237.  
  1238.       elseif object.getName() == "Slashed Back" then
  1239.         object.destroy()
  1240.  
  1241.       end
  1242.     end
  1243.     spawnEndeavor(bag)
  1244.   end
  1245.   if #broadcastTable > 0 then
  1246.     for _, b in pairs(broadcastTable) do
  1247.       broadcastToAll(b, {1, 1, 1})
  1248.       wait(1)
  1249.     end
  1250.     wait(0.4)
  1251.   end
  1252.   return 1
  1253. end
  1254.  
  1255. function spawnEndeavor(bag)
  1256.   local pos = bag.getPosition()
  1257.   pos.y = pos.y + 2
  1258.   pos.x = pos.x - 2
  1259.   bag.takeObject({position = pos})
  1260. end
  1261.  
  1262. function spawnTinkerEndeavor(name)
  1263.   local bag = ""
  1264.   if name == "Player 1" then
  1265.     bag = getObjectFromGUID('d202ed')
  1266.   elseif name == "Player 2" then
  1267.     bag = getObjectFromGUID('6b02af')
  1268.   elseif name == "Player 3" then
  1269.     bag = getObjectFromGUID('98eafe')
  1270.   elseif name == "Player 4" then
  1271.     bag = getObjectFromGUID('38ac5c')
  1272.   end
  1273.   local pos = bag.getPosition()
  1274.   pos.y = pos.y + 2
  1275.   pos.x = pos.x - 3
  1276.   bag.takeObject({position = pos})
  1277. end
  1278.  
  1279. -- Setup Levels ----------------------------------------------------------------
  1280. function setup_level(player, value, id)
  1281.   -- Wait.time(function() setupMonster(1) end, 10)
  1282.   local nemesis = load_monster_box(tonumber(id))
  1283.   if nemesis == -1 then
  1284.     return
  1285.   end
  1286.   calculate_departing_bonuses(nemesis)
  1287. end
  1288. -- additional levels
  1289. -- DBK - changeMonster({mov = 9, tgh = 25, spd = 2, dmg = 5, acc = 1, lck = 3})
  1290. -----------------------------------------------------------------------------
  1291.  
  1292. function setupMonster(lvl)
  1293.   if monsterSelected == "" then
  1294.     broadcastToAll("No Monster Selected!", {1, 0, 0})
  1295.     return
  1296.   end
  1297.   current_showdown_lvl.setDescription(monsterSelected .. " Lvl " .. lvl)
  1298.   changeMonster(monstersSetup[monsterSelected].stats[lvl])
  1299.   getFromBox(monsterSelected .. " (hunt)", monstersSetup[monsterSelected].hunt_fig_pos[lvl], {0, 180, 0})
  1300.   getFromBox(monsterSelected, monstersSetup[monsterSelected].monst_fig_pos, {0, 180, 0})
  1301.   getFromBox(monstersSetup[monsterSelected].font_toLoad, {0, 0, 0}, {0, 0, 0}, "lock_callback", Global)
  1302.  
  1303.   for i, obj in pairs(monstersSetup[monsterSelected].obj_toLoad_all) do
  1304.     getFromBox(obj, monstersSetup[monsterSelected].obj_toLoad_pos[i].pos, monstersSetup[monsterSelected].obj_toLoad_pos[i].rot)
  1305.   end
  1306.   for i, obj in pairs(monstersSetup[monsterSelected].obj_toLoad_lvl[lvl]) do
  1307.     getFromBox(obj, monstersSetup[monsterSelected].obj_toLoad_pos[#monstersSetup[monsterSelected].obj_toLoad_all + i].pos, monstersSetup[monsterSelected].obj_toLoad_pos[#monstersSetup[monsterSelected].obj_toLoad_all + i].rot)
  1308.   end
  1309.  
  1310.   if lvl > 2 then
  1311.     getFromBox("Indomitable", indom_pos, indom_rot, "scale_indom_callback", Global)
  1312.   end
  1313.  
  1314.   if monstersSetup[monsterSelected].terrain_toLoad ~= nil then
  1315.     for i, obj in pairs(monstersSetup[monsterSelected].terrain_toLoad) do
  1316.       getFromBox(obj, monstersSetup[monsterSelected].terrain_toLoad_pos[i].pos, monstersSetup[monsterSelected].terrain_toLoad_pos[i].rot, "lock_callback", Global)
  1317.     end
  1318.   end
  1319.  
  1320.   if monstersSetup[monsterSelected].card_toLoad ~= nil then
  1321.     for i, obj in pairs(monstersSetup[monsterSelected].card_toLoad) do
  1322.       getFromBox(obj, monstersSetup[monsterSelected].card_toLoad_pos[i].pos, monstersSetup[monsterSelected].card_toLoad_pos[i].rot)
  1323.     end
  1324.   end
  1325.  
  1326.   if monstersSetup[monsterSelected].fromGameBox ~= nil then
  1327.     for i, obj in pairs(monstersSetup[monsterSelected].fromGameBox) do
  1328.       getFromGameBox(obj, monstersSetup[monsterSelected].fromGameBox_pos[i].pos, monstersSetup[monsterSelected].fromGameBox_pos[i].rot)
  1329.     end
  1330.   end
  1331.  
  1332.  
  1333. end
  1334.  
  1335. function getFromBox(objName, objPos, objRot, callb, callb_owner)
  1336.   for _, obj in ipairs(showdown_box.getObjects()) do
  1337.     if obj.name == objName then
  1338.       return showdown_box.takeObject({position = objPos, rotation = objRot, smooth = false, guid = obj.guid, callback = callb, callback_owner = callb_owner})
  1339.     end
  1340.   end
  1341. end
  1342.  
  1343. function getFromGameBox(objName, objPos, objRot, callb, callb_owner)
  1344.   for _, obj in ipairs(gameBox.getObjects()) do
  1345.     if obj.name == objName then
  1346.       return gameBox.takeObject({position = objPos, rotation = objRot, smooth = false, guid = obj.guid, callback = callb, callback_owner = callb_owner})
  1347.     end
  1348.   end
  1349. end
  1350.  
  1351.  
  1352.  
  1353. -- Set Monster -----------------------------------------------------------------
  1354. -- Set Quarries ----------------------------------------------------------------
  1355. -- Set Nemesis -----------------------------------------------------------------
  1356. -- Set Legendaries -------------------------------------------------------------
  1357. -- Get Showdown Bag / Monster Story --------------------------------------------
  1358. function load_monster_box(lvl)
  1359.   if lvl > #monstersSetup[monsterSelected].stats then
  1360.     broadcastToAll(monsterSelected .. " has no Level " .. lvl .. ". The highest level is " .. #monstersSetup[monsterSelected].stats, {1, 0, 0})
  1361.     return - 1
  1362.   end
  1363.  
  1364.  
  1365.   for _, box in ipairs(gameBox.getObjects()) do
  1366.     if box.name == box_toGet then
  1367.       showdown_box = gameBox.takeObject({position = {26.19, 1.31, - 5.23}, rotation = {0, 0, 0}, smooth = false, guid = box.guid})
  1368.     end
  1369.   end
  1370.  
  1371.   Wait.condition(function() returnFont() load_common_objects() set_terrain_cards() get_hunt_decks() setupMonster(lvl) end, function() return checkLoaded(showdown_box) end)
  1372.  
  1373.   --[[
  1374.     if hunt_Phase then
  1375.         -- Lighting
  1376.         local set_Lighting = getObjectFromGUID(Global.getTable('user_settings').set_Lighting.guid)
  1377.         local rotZ = set_Lighting.getRotation().z
  1378.         if rotZ < 10 or rotZ > 350 then
  1379.             tool_Lighting = getObjectFromGUID('cdef09')
  1380.             tool_Lighting.call("setLightingTable_hunt")
  1381.         end
  1382.         -- Music
  1383.         local set_Sound = getObjectFromGUID(Global.getTable('user_settings').set_Sound.guid)
  1384.         local rotZ = set_Sound.getRotation().z
  1385.         if rotZ < 10 or rotZ > 350 then
  1386.             local music_player = getObjectFromGUID(Global.getTable('user_settings').music_player.guid)
  1387.             local hunt_phase_soundtrack = getObjectFromGUID(Global.getTable('user_settings').hunt_phase_soundtrack.guid)
  1388.             local track = tonumber(hunt_phase_soundtrack.getDescription())
  1389.             if music_player ~= nil then
  1390.                 music_player.AssetBundle.playLoopingEffect(track)
  1391.             end
  1392.         end
  1393.     end
  1394.     hunt_Phase = false
  1395.     --]]
  1396.   if #monstersSetup[monsterSelected].hunt_fig_pos > 0 then
  1397.     return false
  1398.   end
  1399.   return true
  1400. end
  1401.  
  1402. function load_common_objects()
  1403.   for _, obj in ipairs(showdown_box.getObjects()) do
  1404.     local name = obj.name
  1405.     local desc = obj.description
  1406.     if name == "Basic" then
  1407.       showdown_box.takeObject({position = basic_deck_pos, rotation = zoneAI_rot, smooth = false, guid = obj.guid})
  1408.  
  1409.     elseif name == "Advanced" then
  1410.       showdown_box.takeObject({position = advanced_deck_pos, rotation = zoneAI_rot, smooth = false, guid = obj.guid})
  1411.  
  1412.     elseif name == "Legendary" then
  1413.       showdown_box.takeObject({position = legendary_deck_pos, rotation = zoneAI_rot, smooth = false, guid = obj.guid})
  1414.  
  1415.     elseif string.find(name, "Basic Action") then
  1416.       showdown_box.takeObject({position = basic_action_pos, rotation = zoneAI_rot, smooth = false, guid = obj.guid})
  1417.  
  1418.     elseif string.find(name, "Resources Deck") then
  1419.       showdown_box.takeObject({position = monster_resource_pos, rotation = zoneAI_rot, smooth = false, guid = obj.guid})
  1420.  
  1421.     elseif string.find(name, "Hit Location Deck") then
  1422.       showdown_box.takeObject({position = HL_deck_pos, rotation = zoneAI_rot, smooth = false, guid = obj.guid})
  1423.  
  1424.     elseif name == "Story Page Left" then
  1425.       showdown_page_L = showdown_box.takeObject({position = { - 5.33, 6.24, 39.47}, rotation = {22.00, 179.98, 0.00}, smooth = false, guid = obj.guid})
  1426.     elseif string.find(name, "Showdown") and string.find(desc, "one") then
  1427.       showdown_page_L = showdown_box.takeObject({position = { - 5.33, 6.24, 39.47}, rotation = {22.00, 179.98, 0.00}, smooth = false, guid = obj.guid})
  1428.  
  1429.     elseif name == "Story Page Right" then
  1430.       showdown_page_R = showdown_box.takeObject({position = {5.33, 6.18, 39.52}, rotation = {22.00, 179.98, 0.00}, smooth = false, guid = obj.guid})
  1431.     elseif string.find(name, "Showdown") and string.find(desc, "two") then
  1432.       showdown_page_R = showdown_box.takeObject({position = {5.33, 6.18, 39.52}, rotation = {22.00, 179.98, 0.00}, smooth = false, guid = obj.guid})
  1433.     end
  1434.   end
  1435.  
  1436.   showdown_page_L.setLock(true)
  1437.   showdown_page_R.setLock(true)
  1438.   showdown_page_L.setScale({2.64, 1.00, 2.64})
  1439.   showdown_page_R.setScale({2.64, 1.00, 2.64})
  1440. end
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448. -- Setup Terrain Decks ---------------------------------------------------------
  1449. -- deprecate
  1450. --[[
  1451. function get_terrain_deck()
  1452. for _, deck in ipairs(terrainBox.getObjects()) do
  1453. if deck.name == "Terrain Deck ** loaded" then
  1454. deckTerrain = bag.takeObject({
  1455. position = {-24.61, 5, -5.01},
  1456. rotation = {0, 180, 180},
  1457. smooth = false,
  1458. guid = deck.guid
  1459. })
  1460. end
  1461. Wait.time(set_terrain_cards, 3)
  1462. end
  1463. end
  1464. ]]
  1465.  
  1466. function set_terrain_cards()
  1467.  
  1468.   deckTerrain = getObjectFromGUID(Global.getTable('decks_toSearch').deckTERRAIN.guid)
  1469.  
  1470.   if btn_clicked == 1 then
  1471.     local card1 = {cardName = "Toppled Pillar", zone = "", deck = deckTerrain}
  1472.     Global.setTable("card", card1)
  1473.     local pos = terrainPos1
  1474.     Global.setTable("pos_toSpawn", pos)
  1475.     Global.call("get_Card")
  1476.  
  1477.     wait(0.25)
  1478.     local card2 = {cardName = "Toppled Pillar", zone = "", deck = deckTerrain}
  1479.     Global.setTable("card", card2)
  1480.     local pos = terrainPos2
  1481.     Global.setTable("pos_toSpawn", pos)
  1482.     Global.call("get_Card")
  1483.  
  1484.     wait(0.25)
  1485.     local card3 = {cardName = "Stone Columns", zone = "", deck = deckTerrain}
  1486.     Global.setTable("card", card3)
  1487.     local pos = terrainPos3
  1488.     Global.setTable("pos_toSpawn", pos)
  1489.     Global.call("get_Card")
  1490.  
  1491.   elseif btn_clicked == 2 then
  1492.     local card1 = {cardName = "Resin Dung Ball", zone = "", deck = deckTerrain}
  1493.     Global.setTable("card", card1)
  1494.     local pos = terrainPos1
  1495.     Global.setTable("pos_toSpawn", pos)
  1496.     Global.call("get_Card")
  1497.  
  1498.     wait(0.25)
  1499.     local card2 = {cardName = "Stone Columns", zone = "", deck = deckTerrain}
  1500.     Global.setTable("card", card2)
  1501.     local pos = terrainPos2
  1502.     Global.setTable("pos_toSpawn", pos)
  1503.     Global.call("get_Card")
  1504.  
  1505.     wait(0.25)
  1506.     local card3 = {cardName = "Bug Patch", zone = "", deck = deckTerrain}
  1507.     Global.setTable("card", card3)
  1508.     local pos = terrainPos3
  1509.     Global.setTable("pos_toSpawn", pos)
  1510.     Global.call("get_Card")
  1511.  
  1512.   elseif btn_clicked == 3 then
  1513.     local card1 = {cardName = "Flower Patch", zone = "", deck = deckTerrain}
  1514.     Global.setTable("card", card1)
  1515.     local pos = terrainPos1
  1516.     Global.setTable("pos_toSpawn", pos)
  1517.     Global.call("get_Card")
  1518.  
  1519.     wait(0.25)
  1520.     local card2 = {cardName = nil, zone = "", deck = deckTerrain}
  1521.     Global.setTable("card", card2)
  1522.     local pos = terrainPos2
  1523.     Global.setTable("pos_toSpawn", pos)
  1524.     Global.call("get_Card")
  1525.  
  1526.   elseif btn_clicked == 4 then
  1527.     local card1 = {cardName = "Tall Grass", zone = "", deck = deckTerrain}
  1528.     Global.setTable("card", card1)
  1529.     local pos = terrainPos1
  1530.     Global.setTable("pos_toSpawn", pos)
  1531.     Global.call("get_Card")
  1532.  
  1533.     wait(0.25)
  1534.     local card2 = {cardName = nil, zone = "", deck = deckTerrain}
  1535.     Global.setTable("card", card2)
  1536.     local pos = terrainPos2
  1537.     Global.setTable("pos_toSpawn", pos)
  1538.     Global.call("get_Card")
  1539.  
  1540.     wait(0.25)
  1541.     local card3 = {cardName = nil, zone = "", deck = deckTerrain}
  1542.     Global.setTable("card", card3)
  1543.     local pos = terrainPos3
  1544.     Global.setTable("pos_toSpawn", pos)
  1545.     Global.call("get_Card")
  1546.  
  1547.   elseif btn_clicked == 5 or btn_clicked == 24 then
  1548.     local card1 = {cardName = "Nightmare Tree", zone = "", deck = deckTerrain}
  1549.     Global.setTable("card", card1)
  1550.     local pos = terrainPos1
  1551.     Global.setTable("pos_toSpawn", pos)
  1552.     Global.call("get_Card")
  1553.  
  1554.     wait(0.25)
  1555.     local card2 = {cardName = nil, zone = "", deck = deckTerrain}
  1556.     Global.setTable("card", card2)
  1557.     local pos = terrainPos2
  1558.     Global.setTable("pos_toSpawn", pos)
  1559.     Global.call("get_Card")
  1560.  
  1561.     wait(0.25)
  1562.     local card3 = {cardName = nil, zone = "", deck = deckTerrain}
  1563.     Global.setTable("card", card3)
  1564.     local pos = terrainPos3
  1565.     Global.setTable("pos_toSpawn", pos)
  1566.     Global.call("get_Card")
  1567.  
  1568.     if btn_clicked == 24 then -- golden eyed king additional terrain
  1569.       wait(0.25)
  1570.       local card = {cardName = "Ore Vein", zone = "", deck = deckTerrain}
  1571.       Global.setTable("card", card)
  1572.       local pos = terrainPos4
  1573.       Global.setTable("pos_toSpawn", pos)
  1574.       Global.call("get_Card")
  1575.  
  1576.       wait(0.25)
  1577.       local card = {cardName = "Bug Patch", zone = "", deck = deckTerrain}
  1578.       Global.setTable("card", card)
  1579.       local pos = terrainPos4
  1580.       Global.setTable("pos_toSpawn", pos)
  1581.       Global.call("get_Card")
  1582.     end
  1583.  
  1584.   elseif btn_clicked == 6 then
  1585.     local card1 = {cardName = "Stone Columns", zone = "", deck = deckTerrain}
  1586.     Global.setTable("card", card1)
  1587.     local pos = terrainPos1
  1588.     Global.setTable("pos_toSpawn", pos)
  1589.     Global.call("get_Card")
  1590.  
  1591.     wait(0.25)
  1592.     local card2 = {cardName = "Toppled Pillar", zone = "", deck = deckTerrain}
  1593.     Global.setTable("card", card2)
  1594.     local pos = terrainPos2
  1595.     Global.setTable("pos_toSpawn", pos)
  1596.     Global.call("get_Card")
  1597.  
  1598.     wait(0.25)
  1599.     local card3 = {cardName = "Giant Stone Face", zone = "", deck = deckTerrain}
  1600.     Global.setTable("card", card3)
  1601.     local pos = terrainPos3
  1602.     Global.setTable("pos_toSpawn", pos)
  1603.     Global.call("get_Card")
  1604.  
  1605.     wait(0.25)
  1606.     local card4 = {cardName = "Lion God Statue", zone = "", deck = deckTerrain}
  1607.     Global.setTable("card", card4)
  1608.     local pos = terrainPos4
  1609.     Global.setTable("pos_toSpawn", pos)
  1610.     Global.call("get_Card")
  1611.  
  1612.   elseif btn_clicked == 7 or btn_clicked == 23 then
  1613.     local card1 = {cardName = "Acanthus Plants", zone = "", deck = deckTerrain}
  1614.     Global.setTable("card", card1)
  1615.     local pos = terrainPos1
  1616.     Global.setTable("pos_toSpawn", pos)
  1617.     Global.call("get_Card")
  1618.  
  1619.     wait(0.25)
  1620.     local card2 = {cardName = "Acanthus Plants", zone = "", deck = deckTerrain}
  1621.     Global.setTable("card", card2)
  1622.     local pos = terrainPos2
  1623.     Global.setTable("pos_toSpawn", pos)
  1624.     Global.call("get_Card")
  1625.  
  1626.     wait(0.25)
  1627.     local card3 = {cardName = "Acanthus Plants", zone = "", deck = deckTerrain}
  1628.     Global.setTable("card", card3)
  1629.     local pos = terrainPos3
  1630.     Global.setTable("pos_toSpawn", pos)
  1631.     Global.call("get_Card")
  1632.  
  1633.     wait(0.25)
  1634.     local card4 = {cardName = nil, zone = "", deck = deckTerrain}
  1635.     Global.setTable("card", card4)
  1636.     local pos = terrainPos4
  1637.     Global.setTable("pos_toSpawn", pos)
  1638.     Global.call("get_Card")
  1639.  
  1640.     wait(0.25)
  1641.     local card5 = {cardName = nil, zone = "", deck = deckTerrain}
  1642.     Global.setTable("card", card5)
  1643.     local pos = terrainPos5
  1644.     Global.setTable("pos_toSpawn", pos)
  1645.     Global.call("get_Card")
  1646.  
  1647.     wait(0.25)
  1648.     local card6 = {cardName = "Bug Patch", zone = "", deck = deckTerrain}
  1649.     Global.setTable("card", card6)
  1650.     local pos = terrainPos6
  1651.     Global.setTable("pos_toSpawn", pos)
  1652.     Global.call("get_Card")
  1653.  
  1654.     if btn_clicked == 23 then -- mad steed + 2 random
  1655.       wait(0.25)
  1656.       local card = {cardName = nil, zone = "", deck = deckTerrain}
  1657.       Global.setTable("card", card)
  1658.       local pos = terrainPos7
  1659.       Global.setTable("pos_toSpawn", pos)
  1660.       Global.call("get_Card")
  1661.  
  1662.       wait(0.25)
  1663.       local card = {cardName = nil, zone = "", deck = deckTerrain}
  1664.       Global.setTable("card", card)
  1665.       local pos = terrainPos8
  1666.       Global.setTable("pos_toSpawn", pos)
  1667.       Global.call("get_Card")
  1668.     end
  1669.  
  1670.   elseif btn_clicked == 8 then
  1671.     local card1 = {cardName = "Egg Sac", zone = "", deck = deckTerrain}
  1672.     Global.setTable("card", card1)
  1673.     local pos = terrainPos1
  1674.     Global.setTable("pos_toSpawn", pos)
  1675.     Global.call("get_Card")
  1676.  
  1677.     wait(0.25)
  1678.     local card2 = {cardName = "Silk Nest", zone = "", deck = deckTerrain}
  1679.     Global.setTable("card", card2)
  1680.     local pos = terrainPos2
  1681.     Global.setTable("pos_toSpawn", pos)
  1682.     Global.call("get_Card")
  1683.  
  1684.     wait(0.25)
  1685.     local card3 = {cardName = nil, zone = "", deck = deckTerrain}
  1686.     Global.setTable("card", card3)
  1687.     local pos = terrainPos3
  1688.     Global.setTable("pos_toSpawn", pos)
  1689.     Global.call("get_Card")
  1690.  
  1691.     wait(0.25)
  1692.     local card4 = {cardName = nil, zone = "", deck = deckTerrain}
  1693.     Global.setTable("card", card4)
  1694.     local pos = terrainPos4
  1695.     Global.setTable("pos_toSpawn", pos)
  1696.     Global.call("get_Card")
  1697.  
  1698.   elseif btn_clicked == 9 then
  1699.     local card1 = {cardName = "Salt Sculpture", zone = "", deck = deckTerrain}
  1700.     Global.setTable("card", card1)
  1701.     local pos = terrainPos1
  1702.     Global.setTable("pos_toSpawn", pos)
  1703.     Global.call("get_Card")
  1704.  
  1705.     wait(0.25)
  1706.     local card2 = {cardName = "Stone Columns", zone = "", deck = deckTerrain}
  1707.     Global.setTable("card", card2)
  1708.     local pos = terrainPos2
  1709.     Global.setTable("pos_toSpawn", pos)
  1710.     Global.call("get_Card")
  1711.  
  1712.   elseif btn_clicked == 10 or btn_clicked == 22 then
  1713.     local card1 = {cardName = "Tall Grass", zone = "", deck = deckTerrain}
  1714.     Global.setTable("card", card1)
  1715.     local pos = terrainPos1
  1716.     Global.setTable("pos_toSpawn", pos)
  1717.     Global.call("get_Card")
  1718.  
  1719.     wait(0.25)
  1720.     local card2 = {cardName = nil, zone = "", deck = deckTerrain}
  1721.     Global.setTable("card", card2)
  1722.     local pos = terrainPos2
  1723.     Global.setTable("pos_toSpawn", pos)
  1724.     Global.call("get_Card")
  1725.  
  1726.     wait(0.25)
  1727.     local card3 = {cardName = nil, zone = "", deck = deckTerrain}
  1728.     Global.setTable("card", card3)
  1729.     local pos = terrainPos3
  1730.     Global.setTable("pos_toSpawn", pos)
  1731.     Global.call("get_Card")
  1732.  
  1733.   elseif btn_clicked == 11 then
  1734.     local card1 = {cardName = "Stone Columns", zone = "", deck = deckTerrain}
  1735.     Global.setTable("card", card1)
  1736.     local pos = terrainPos1
  1737.     Global.setTable("pos_toSpawn", pos)
  1738.     Global.call("get_Card")
  1739.  
  1740.   elseif btn_clicked == 12 then
  1741.     local card1 = {cardName = nil, zone = "", deck = deckTerrain}
  1742.     Global.setTable("card", card1)
  1743.     local pos = terrainPos1
  1744.     Global.setTable("pos_toSpawn", pos)
  1745.     Global.call("get_Card")
  1746.  
  1747.     wait(0.25)
  1748.     local card2 = {cardName = "Stone Columns", zone = "", deck = deckTerrain}
  1749.     Global.setTable("card", card2)
  1750.     local pos = terrainPos2
  1751.     Global.setTable("pos_toSpawn", pos)
  1752.     Global.call("get_Card")
  1753.  
  1754.     wait(0.25)
  1755.     local card3 = {cardName = "Giant Stone Face", zone = "", deck = deckTerrain}
  1756.     Global.setTable("card", card3)
  1757.     local pos = terrainPos3
  1758.     Global.setTable("pos_toSpawn", pos)
  1759.     Global.call("get_Card")
  1760.  
  1761.   elseif btn_clicked == 13 then
  1762.     local card1 = {cardName = nil, zone = "", deck = deckTerrain}
  1763.     Global.setTable("card", card1)
  1764.     local pos = terrainPos1
  1765.     Global.setTable("pos_toSpawn", pos)
  1766.     Global.call("get_Card")
  1767.  
  1768.     wait(0.25)
  1769.     local card2 = {cardName = "Stone Columns", zone = "", deck = deckTerrain}
  1770.     Global.setTable("card", card2)
  1771.     local pos = terrainPos2
  1772.     Global.setTable("pos_toSpawn", pos)
  1773.     Global.call("get_Card")
  1774.  
  1775.     wait(0.25)
  1776.     local card3 = {cardName = nil, zone = "", deck = deckTerrain}
  1777.     Global.setTable("card", card3)
  1778.     local pos = terrainPos3
  1779.     Global.setTable("pos_toSpawn", pos)
  1780.     Global.call("get_Card")
  1781.  
  1782.   elseif btn_clicked == 14 then
  1783.     local card1 = {cardName = "Horn", zone = "", deck = deckTerrain}
  1784.     Global.setTable("card", card1)
  1785.     local pos = terrainPos1
  1786.     Global.setTable("pos_toSpawn", pos)
  1787.     Global.call("get_Card")
  1788.  
  1789.     wait(0.25)
  1790.     local card2 = {cardName = "Throne", zone = "", deck = deckTerrain}
  1791.     Global.setTable("card", card2)
  1792.     local pos = terrainPos2
  1793.     Global.setTable("pos_toSpawn", pos)
  1794.     Global.call("get_Card")
  1795.  
  1796.     wait(0.25)
  1797.     local card3 = {cardName = "Balcony", zone = "", deck = deckTerrain}
  1798.     Global.setTable("card", card3)
  1799.     local pos = terrainPos3
  1800.     Global.setTable("pos_toSpawn", pos)
  1801.     Global.call("get_Card")
  1802.  
  1803.     wait(0.25)
  1804.     local card4 = {cardName = "Stage", zone = "", deck = deckTerrain}
  1805.     Global.setTable("card", card4)
  1806.     local pos = terrainPos4
  1807.     Global.setTable("pos_toSpawn", pos)
  1808.     Global.call("get_Card")
  1809.  
  1810.   elseif btn_clicked == 15 then
  1811.     local card1 = {cardName = "Stone Columns", zone = "", deck = deckTerrain}
  1812.     Global.setTable("card", card1)
  1813.     local pos = terrainPos1
  1814.     Global.setTable("pos_toSpawn", pos)
  1815.     Global.call("get_Card")
  1816.  
  1817.     wait(0.25)
  1818.     local card2 = {cardName = "Stone Columns", zone = "", deck = deckTerrain}
  1819.     Global.setTable("card", card2)
  1820.     local pos = terrainPos2
  1821.     Global.setTable("pos_toSpawn", pos)
  1822.     Global.call("get_Card")
  1823.  
  1824.     wait(0.25)
  1825.     local card3 = {cardName = nil, zone = "", deck = deckTerrain}
  1826.     Global.setTable("card", card3)
  1827.     local pos = terrainPos3
  1828.     Global.setTable("pos_toSpawn", pos)
  1829.     Global.call("get_Card")
  1830.  
  1831.   elseif btn_clicked == 16 then
  1832.     local card1 = {cardName = "Stone Columns", zone = "", deck = deckTerrain}
  1833.     Global.setTable("card", card1)
  1834.     local pos = terrainPos1
  1835.     Global.setTable("pos_toSpawn", pos)
  1836.     Global.call("get_Card")
  1837.  
  1838.     wait(0.25)
  1839.     local card2 = {cardName = "Bug Patch", zone = "", deck = deckTerrain}
  1840.     Global.setTable("card", card2)
  1841.     local pos = terrainPos2
  1842.     Global.setTable("pos_toSpawn", pos)
  1843.     Global.call("get_Card")
  1844.  
  1845.     wait(0.25)
  1846.     local card3 = {cardName = nil, zone = "", deck = deckTerrain}
  1847.     Global.setTable("card", card3)
  1848.     local pos = terrainPos3
  1849.     Global.setTable("pos_toSpawn", pos)
  1850.     Global.call("get_Card")
  1851.  
  1852.   elseif btn_clicked == 17 then
  1853.     local card1 = {cardName = nil, zone = "", deck = deckTerrain}
  1854.     Global.setTable("card", card1)
  1855.     local pos = terrainPos1
  1856.     Global.setTable("pos_toSpawn", pos)
  1857.     Global.call("get_Card")
  1858.  
  1859.   elseif btn_clicked == 19 then
  1860.     local card1 = {cardName = nil, zone = "", deck = deckTerrain}
  1861.     Global.setTable("card", card1)
  1862.     local pos = terrainPos1
  1863.     Global.setTable("pos_toSpawn", pos)
  1864.     Global.call("get_Card")
  1865.  
  1866.     wait(0.25)
  1867.     local card2 = {cardName = nil, zone = "", deck = deckTerrain}
  1868.     Global.setTable("card", card2)
  1869.     local pos = terrainPos2
  1870.     Global.setTable("pos_toSpawn", pos)
  1871.     Global.call("get_Card")
  1872.  
  1873.     wait(0.25)
  1874.     local card3 = {cardName = nil, zone = "", deck = deckTerrain}
  1875.     Global.setTable("card", card3)
  1876.     local pos = terrainPos3
  1877.     Global.setTable("pos_toSpawn", pos)
  1878.     Global.call("get_Card")
  1879.  
  1880.   elseif btn_clicked == 20 then
  1881.     local card = {cardName = "Acanthus Plants", zone = "", deck = deckTerrain}
  1882.     Global.setTable("card", card)
  1883.     local pos = terrainPos7
  1884.     Global.setTable("pos_toSpawn", pos)
  1885.     Global.call("get_Card")
  1886.  
  1887.   elseif btn_clicked == 21 then
  1888.     local card = {cardName = "Tall Grass", zone = "", deck = deckTerrain}
  1889.     Global.setTable("card", card)
  1890.     local pos = terrainPos1
  1891.     Global.setTable("pos_toSpawn", pos)
  1892.     Global.call("get_Card")
  1893.  
  1894.     wait(0.25)
  1895.     local card = {cardName = nil, zone = "", deck = deckTerrain}
  1896.     Global.setTable("card", card)
  1897.     local pos = terrainPos2
  1898.     Global.setTable("pos_toSpawn", pos)
  1899.     Global.call("get_Card")
  1900.  
  1901.     wait(0.25)
  1902.     local card = {cardName = nil, zone = "", deck = deckTerrain}
  1903.     Global.setTable("card", card)
  1904.     local pos = terrainPos3
  1905.     Global.setTable("pos_toSpawn", pos)
  1906.     Global.call("get_Card")
  1907.  
  1908.     wait(0.25)
  1909.     local card = {cardName = nil, zone = "", deck = deckTerrain}
  1910.     Global.setTable("card", card)
  1911.     local pos = terrainPos4
  1912.     Global.setTable("pos_toSpawn", pos)
  1913.     Global.call("get_Card")
  1914.  
  1915.     wait(0.25)
  1916.     local card = {cardName = nil, zone = "", deck = deckTerrain}
  1917.     Global.setTable("card", card)
  1918.     local pos = terrainPos5
  1919.     Global.setTable("pos_toSpawn", pos)
  1920.     Global.call("get_Card")
  1921.  
  1922.   elseif btn_clicked == 25 then
  1923.     local card = {cardName = nil, zone = "", deck = deckTerrain}
  1924.     Global.setTable("card", card)
  1925.     local pos = terrainPos1
  1926.     Global.setTable("pos_toSpawn", pos)
  1927.     Global.call("get_Card")
  1928.  
  1929.     local card = {cardName = nil, zone = "", deck = deckTerrain}
  1930.     Global.setTable("card", card)
  1931.     local pos = terrainPos2
  1932.     Global.setTable("pos_toSpawn", pos)
  1933.     Global.call("get_Card")
  1934.  
  1935.     local card = {cardName = nil, zone = "", deck = deckTerrain}
  1936.     Global.setTable("card", card)
  1937.     local pos = terrainPos3
  1938.     Global.setTable("pos_toSpawn", pos)
  1939.     Global.call("get_Card")
  1940.  
  1941.   end
  1942. end
  1943.  
  1944.  
  1945. -- Setup Hunt Decks ------------------------------------------------------------
  1946. function get_hunt_decks()
  1947.     huntBox = getObjectFromGUID(Global.getTable('bags').huntBox.guid)
  1948.     for _, deck in ipairs(huntBox.getObjects()) do
  1949.       if deck.name == "Basic Hunt Events Deck" then
  1950.         basic = huntBox.takeObject({
  1951.           position = pos_deckBasic,
  1952.           rotation = {0, 180, 180},
  1953.           smooth = false,
  1954.           guid = deck.guid
  1955.         })
  1956.       elseif deck.name == monsterSelected .. " Hunt Events Deck" then
  1957.         monst = huntBox.takeObject({
  1958.           position = pos_deckMonst,
  1959.           rotation = {0, 180, 180},
  1960.           smooth = false,
  1961.           guid = deck.guid
  1962.         })
  1963.       end
  1964.     end
  1965.     Wait.time(deal_hunt_event_cards, 0.5)
  1966. end
  1967.  
  1968. function deal_hunt_event_cards()
  1969.   if monsterSelected == "Dragon King" then
  1970.     basic.shuffle()
  1971.     basic.takeObject({top = true, position = huntPos2, smooth = false})
  1972.     basic.takeObject({top = true, position = huntPos5, smooth = false})
  1973.     basic.takeObject({top = true, position = huntPos7, smooth = false})
  1974.     basic.takeObject({top = true, position = huntPos8, smooth = false})
  1975.     basic.takeObject({top = true, position = huntPos10, smooth = false})
  1976.  
  1977.     monst.shuffle()
  1978.     monst.takeObject({top = true, position = huntPos1, smooth = false})
  1979.     monst.takeObject({top = true, position = huntPos3, smooth = false})
  1980.     monst.takeObject({top = true, position = huntPos4, smooth = false})
  1981.     monst.takeObject({top = true, position = huntPos6, smooth = false})
  1982.     monst.takeObject({top = true, position = huntPos9, smooth = false})
  1983.  
  1984.   elseif monsterSelected == "Dung Beetle Knight" then
  1985.     basic.shuffle()
  1986.     basic.takeObject({top = true, position = huntPos1, smooth = false})
  1987.     basic.takeObject({top = true, position = huntPos4, smooth = false})
  1988.     basic.takeObject({top = true, position = huntPos5, smooth = false})
  1989.     basic.takeObject({top = true, position = huntPos7, smooth = false})
  1990.     basic.takeObject({top = true, position = huntPos8, smooth = false})
  1991.     basic.takeObject({top = true, position = huntPos10, smooth = false})
  1992.  
  1993.     monst.shuffle()
  1994.     monst.takeObject({top = true, position = huntPos2, smooth = false})
  1995.     monst.takeObject({top = true, position = huntPos3, smooth = false})
  1996.     monst.takeObject({top = true, position = huntPos6, smooth = false})
  1997.     monst.takeObject({top = true, position = huntPos9, smooth = false})
  1998.  
  1999.  
  2000.   elseif monsterSelected == "Flower Knight" then
  2001.     basic.shuffle()
  2002.     basic.takeObject({top = true, position = huntPos1, smooth = false})
  2003.     basic.takeObject({top = true, position = huntPos2, smooth = false})
  2004.     basic.takeObject({top = true, position = huntPos3, smooth = false})
  2005.     basic.takeObject({top = true, position = huntPos4, smooth = false})
  2006.     basic.takeObject({top = true, position = huntPos5, smooth = false})
  2007.  
  2008.     monst.shuffle()
  2009.     monst.takeObject({top = true, position = huntPos6, smooth = false})
  2010.     monst.takeObject({top = true, position = huntPos7, smooth = false})
  2011.     monst.takeObject({top = true, position = huntPos8, smooth = false})
  2012.     monst.takeObject({top = true, position = huntPos9, smooth = false})
  2013.     monst.takeObject({top = true, position = huntPos10})
  2014.  
  2015.  
  2016.   elseif monsterSelected == "Gorm" then
  2017.     basic.shuffle()
  2018.     basic.takeObject({top = true, position = huntPos3, smooth = false})
  2019.     basic.takeObject({top = true, position = huntPos4, smooth = false})
  2020.     basic.takeObject({top = true, position = huntPos6, smooth = false})
  2021.     basic.takeObject({top = true, position = huntPos7, smooth = false})
  2022.     basic.takeObject({top = true, position = huntPos10, smooth = false})
  2023.  
  2024.     monst.shuffle()
  2025.     monst.takeObject({top = true, position = huntPos1, smooth = false})
  2026.     monst.takeObject({top = true, position = huntPos2, smooth = false})
  2027.     monst.takeObject({top = true, position = huntPos5, smooth = false})
  2028.     monst.takeObject({top = true, position = huntPos8, smooth = false})
  2029.     monst.takeObject({top = true, position = huntPos9, smooth = false})
  2030.  
  2031.  
  2032.   elseif monsterSelected == "Phoenix" or monsterSelected == "PhoenixLegendary" then
  2033.     basic.shuffle()
  2034.     basic.takeObject({top = true, position = huntPos1, smooth = false})
  2035.     basic.takeObject({top = true, position = huntPos3, smooth = false})
  2036.     basic.takeObject({top = true, position = huntPos5, smooth = false})
  2037.     basic.takeObject({top = true, position = huntPos6, smooth = false})
  2038.     basic.takeObject({top = true, position = huntPos8, smooth = false})
  2039.     basic.takeObject({top = true, position = huntPos10, smooth = false})
  2040.  
  2041.     monst.shuffle()
  2042.     monst.takeObject({top = true, position = huntPos2, smooth = false})
  2043.     monst.takeObject({top = true, position = huntPos4, smooth = false})
  2044.     monst.takeObject({top = true, position = huntPos7, smooth = false})
  2045.     monst.takeObject({top = true, position = huntPos9, smooth = false})
  2046.  
  2047.   elseif monsterSelected == "Lion God" then
  2048.     basic.shuffle()
  2049.     basic.takeObject({top = true, position = huntPos1, smooth = false})
  2050.     basic.takeObject({top = true, position = huntPos3, smooth = false})
  2051.     basic.takeObject({top = true, position = huntPos5, smooth = false})
  2052.     basic.takeObject({top = true, position = huntPos7, smooth = false})
  2053.     basic.takeObject({top = true, position = huntPos9, smooth = false})
  2054.     basic.takeObject({top = true, position = huntPos10, smooth = false})
  2055.  
  2056.     monst.shuffle()
  2057.     monst.takeObject({top = true, position = huntPos2, smooth = false})
  2058.     monst.takeObject({top = true, position = huntPos4, smooth = false})
  2059.     monst.takeObject({top = true, position = huntPos6, smooth = false})
  2060.     monst.takeObject({top = true, position = huntPos8, smooth = false})
  2061.  
  2062.  
  2063.   elseif monsterSelected == "Screaming Antelope" then
  2064.     basic.shuffle()
  2065.     basic.takeObject({top = true, position = huntPos2, smooth = false})
  2066.     basic.takeObject({top = true, position = huntPos4, smooth = false})
  2067.     basic.takeObject({top = true, position = huntPos5, smooth = false})
  2068.     basic.takeObject({top = true, position = huntPos7, smooth = false})
  2069.     basic.takeObject({top = true, position = huntPos9, smooth = false})
  2070.     basic.takeObject({top = true, position = huntPos10, smooth = false})
  2071.  
  2072.     monst.shuffle()
  2073.     monst.takeObject({top = true, position = huntPos1, smooth = false})
  2074.     monst.takeObject({top = true, position = huntPos3, smooth = false})
  2075.     monst.takeObject({top = true, position = huntPos6, smooth = false})
  2076.     monst.takeObject({top = true, position = huntPos8, smooth = false})
  2077.  
  2078.   elseif monsterSelected == "Spidicules" then
  2079.     basic.shuffle()
  2080.     basic.takeObject({top = true, position = huntPos3, smooth = false})
  2081.     basic.takeObject({top = true, position = huntPos4, smooth = false})
  2082.     basic.takeObject({top = true, position = huntPos6, smooth = false})
  2083.     basic.takeObject({top = true, position = huntPos9, smooth = false})
  2084.     basic.takeObject({top = true, position = huntPos10, smooth = false})
  2085.  
  2086.     monst.shuffle()
  2087.     monst.takeObject({top = true, position = huntPos1, smooth = false})
  2088.     monst.takeObject({top = true, position = huntPos2, smooth = false})
  2089.     monst.takeObject({top = true, position = huntPos5, smooth = false})
  2090.     monst.takeObject({top = true, position = huntPos7, smooth = false})
  2091.     monst.takeObject({top = true, position = huntPos8, smooth = false})
  2092.  
  2093.   elseif monsterSelected == "Sunstalker" then
  2094.     basic.shuffle()
  2095.     basic.takeObject({top = true, position = huntPos1, smooth = false})
  2096.     basic.takeObject({top = true, position = huntPos4, smooth = false})
  2097.     basic.takeObject({top = true, position = huntPos5, smooth = false})
  2098.     basic.takeObject({top = true, position = huntPos7, smooth = false})
  2099.     basic.takeObject({top = true, position = huntPos8, smooth = false})
  2100.     basic.takeObject({top = true, position = huntPos10, smooth = false})
  2101.  
  2102.     monst.shuffle()
  2103.     monst.takeObject({top = true, position = huntPos2, smooth = false})
  2104.     monst.takeObject({top = true, position = huntPos3, smooth = false})
  2105.     monst.takeObject({top = true, position = huntPos6, smooth = false})
  2106.     monst.takeObject({top = true, position = huntPos9, smooth = false})
  2107.  
  2108.   elseif monsterSelected == "White Lion" or monsterSelected == "White Lion Prolog" or monsterSelected == "Great Golden Cat" then
  2109.     basic.shuffle()
  2110.     basic.takeObject({top = true, position = huntPos3, smooth = false})
  2111.     basic.takeObject({top = true, position = huntPos4, smooth = false})
  2112.     basic.takeObject({top = true, position = huntPos6, smooth = false})
  2113.     basic.takeObject({top = true, position = huntPos9, smooth = false})
  2114.     basic.takeObject({top = true, position = huntPos10, smooth = false})
  2115.  
  2116.     monst.shuffle()
  2117.     monst.takeObject({top = true, position = huntPos1, smooth = false})
  2118.     monst.takeObject({top = true, position = huntPos2, smooth = false})
  2119.     monst.takeObject({top = true, position = huntPos5, smooth = false})
  2120.     monst.takeObject({top = true, position = huntPos7, smooth = false})
  2121.     monst.takeObject({top = true, position = huntPos8, smooth = false})
  2122.  
  2123.   elseif monsterSelected == "Black Lion" then
  2124.     basic.shuffle()
  2125.     basic.takeObject({top = true, position = huntPos2, smooth = false})
  2126.     basic.takeObject({top = true, position = huntPos4, smooth = false})
  2127.     basic.takeObject({top = true, position = huntPos6, smooth = false})
  2128.     basic.takeObject({top = true, position = huntPos7, smooth = false})
  2129.     basic.takeObject({top = true, position = huntPos8, smooth = false})
  2130.     basic.takeObject({top = true, position = huntPos10, smooth = false})
  2131.  
  2132.     monst.shuffle()
  2133.     monst.takeObject({top = true, position = huntPos1, smooth = false})
  2134.     monst.takeObject({top = true, position = huntPos3, smooth = false})
  2135.     monst.takeObject({top = true, position = huntPos5, smooth = false})
  2136.     monst.takeObject({top = true, position = huntPos9, smooth = false})
  2137.  
  2138.   end
  2139. end
  2140.  
  2141. -- Utility Functions -----------------------------------------------------------
  2142. function changeAllSurvivors(location, amount)
  2143.   for i, v in pairs(Global.getTable("grids")) do
  2144.     changeSurvivors(location, amount, getObjectFromGUID(v.guid))
  2145.   end
  2146. end
  2147.  
  2148. function changeSurvivors(location, amount, grid)
  2149.   local survSheet = getObjectFromGUID(grid.getVar("survSheetGUID"))
  2150.   if survSheet ~= nil then
  2151.     tableForCall = {}
  2152.     tableForCall[location] = amount
  2153.     survSheet.call("addStats", tableForCall)
  2154.   end
  2155. end
  2156.  
  2157. function changeMonster(stats)
  2158.   local buttons = monsterBoard.getTable("buttons")
  2159.   for i, v in pairs(stats) do
  2160.     buttons.counts[i] = v
  2161.   end
  2162.   monsterBoard.setTable("buttons", buttons)
  2163.   monsterBoard.call("updateDisplay")
  2164. end
  2165.  
  2166. function wait(time)
  2167.   local start = os.time()
  2168.   --each frame the coroutine is given control back, but we immediately call coroutine.yield() again until we exceed the time limit
  2169.   repeat coroutine.yield(0)
  2170.   until os.time() > start + time
  2171. end
  2172.  
  2173. function checkLoaded(obj)
  2174.   if not obj.loading_custom and not obj.spawning then
  2175.     return true
  2176.   end
  2177.   return false
  2178. end
  2179.  
  2180. function reset_obj_toLoad()
  2181.   hunt_fig_pos = {}
  2182.   obj_toLoad_HL = "Hit Location"
  2183.   obj_toLoad_AI = ""
  2184.   ------------------
  2185.   font_toLoad = ""
  2186. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement