-- Circus module -- *add_instance_dungeon_monster( monsterRespawnID, dungeonID, layer ): Spawns a monster group with the given respawn ID in the specified dungeon layer* -- Script used to handle the next dungeon stage when a specific monster group in the Circus dungeon is completely defeated function circus_check_respawn_group_clear( monster_group, layer ) -- Count alive monsters in the specified monster_group; if all dead, proceed to next dungeon stage local cnt = get_alive_instance_respawn_group_monster_count( 50000, layer, monster_group ) local monsterGroupObjHandle = { 10, 13, 13, 23, 19 } -- Handle counting broadcast_mission_objective_progress( 1, 0, monsterGroupObjHandle[monster_group] - cnt, 50000, layer ) -- Total count if cnt == 0 then if monster_group == 1 then -- If the defeated group is #1 broadcast_notice( 1, "@90606228", 50000, layer ) add_field_prop( 60186, 0, 38958, 137159, layer, 0, 0, 0, 1.5, 0.3, 0.3, 0.3 ) -- Create prop at small room entrance -- Respawn Group 2 add_instance_dungeon_monster( 50023, 50000, layer ) add_instance_dungeon_monster( 50024, 50000, layer ) add_instance_dungeon_monster( 50025, 50000, layer ) add_instance_dungeon_monster( 50026, 50000, layer ) add_instance_dungeon_monster( 50027, 50000, layer ) add_instance_dungeon_monster( 50028, 50000, layer ) add_instance_dungeon_monster( 50029, 50000, layer ) broadcast_mission_title( 1, '@9901', 50000, layer ) broadcast_mission_objective( 1, 0, 13, '@1224', 50000, layer ) elseif monster_group == 2 then -- If the defeated group is #2 broadcast_notice( 1, "@90606229", 50000, layer ) add_field_prop( 60187, 0, 38836, 137150, layer, 0, 0, 0, -1.5, 0.3, 0.3, 0.3 ) -- Create prop at small room exit -- Respawn Group 3 add_instance_dungeon_monster( 50030, 50000, layer) add_instance_dungeon_monster( 50031, 50000, layer) add_instance_dungeon_monster( 50032, 50000, layer) add_instance_dungeon_monster( 50033, 50000, layer) add_instance_dungeon_monster( 50034, 50000, layer) add_instance_dungeon_monster( 50035, 50000, layer) broadcast_mission_title( 1, '@9902', 50000, layer ) broadcast_mission_objective( 1, 0, 13, '@1224', 50000, layer ) elseif monster_group == 3 then -- If the defeated group is #3 broadcast_notice( 1, "@90606230", 50000, layer ) add_field_prop( 60188, 0, 40155, 137132, layer, 0, 0, 0, -1.5, 0.3, 0.3, 0.3 ) -- Create prop at mid-boss room entrance -- Respawn Group 4 add_instance_dungeon_monster( 50036, 50000, layer) add_instance_dungeon_monster( 50037, 50000, layer) add_instance_dungeon_monster( 50038, 50000, layer) add_instance_dungeon_monster( 50039, 50000, layer) add_instance_dungeon_monster( 50040, 50000, layer) add_instance_dungeon_monster( 50041, 50000, layer) add_instance_dungeon_monster( 50042, 50000, layer) add_instance_dungeon_monster( 50043, 50000, layer) add_instance_dungeon_monster( 50044, 50000, layer) add_instance_dungeon_monster( 50045, 50000, layer) add_instance_dungeon_monster( 50046, 50000, layer) add_instance_dungeon_monster( 50047, 50000, layer) add_instance_dungeon_monster( 50048, 50000, layer) broadcast_mission_title( 1, '@9903', 50000, layer ) broadcast_mission_objective( 1, 0, 23, '@1224', 50000, layer ) elseif monster_group == 4 then -- If the defeated group is #4 broadcast_notice( 1, "@90606231", 50000, layer ) add_field_prop( 60189, 0, 40271, 136657, layer, 0, 0, 0, 1.5, 0.3, 0.3, 0.3 ) -- Mid-boss room exit add_field_prop( 60190, 0, 39554, 136281, layer, 0, 0, 0, 0, 0.3, 0.3, 0.3 ) -- Boss room entrance -- Respawn Group 5 add_instance_dungeon_monster( 50049, 50000, layer) add_instance_dungeon_monster( 50050, 50000, layer) add_instance_dungeon_monster( 50051, 50000, layer) add_instance_dungeon_monster( 50052, 50000, layer) add_instance_dungeon_monster( 50053, 50000, layer) add_instance_dungeon_monster( 50054, 50000, layer) add_instance_dungeon_monster( 50055, 50000, layer) add_instance_dungeon_monster( 50056, 50000, layer) add_instance_dungeon_monster( 50057, 50000, layer) broadcast_mission_title( 1, '@9904', 50000, layer ) broadcast_mission_objective( 1, 0, 19, '@1224', 50000, layer ) elseif monster_group == 5 then -- If the defeated group is #5 (dungeon cleared) add_field_prop( 60191, 0, 39552, 136341, layer, 0, 0, 0, 3, 0.3, 0.3, 0.3 ) -- Boss room exit if get_instance_dungeon_type_id( 50000, layer ) == 3 then add_field_prop( 9006, 0, 39556, 137014, layer, -3, 0, 0, 0, 1, 1, 1 ) -- Boss room exit broadcast_notice( 1, "@90610144", 50000, layer ) -- The revived boss will appear after activating the strange pillar. end broadcast_mission_title( 1, '', 50000, layer ) broadcast_notice( 1, "@90606232", 50000, layer ) -- The main stage of the Red Spider Circus is cleared.
If you take this new portal, you will be teleported to the entrance of the Circus. end end end function circus_entrance_NPC_init() local minimumRequiredLevel = tonumber(get_env("game.circus_required_level")) or 160 local playerLevel = gv("level") local isAutoUser = is_auto_user() dlg_title( "@90606149" ) if isAutoUser then dlg_text("@37100001") -- You are currently in our blacklist. Consider changing your behavior else if playerLevel < minimumRequiredLevel then -- It's too dangerous here. Please leave! If you're not at least level 150, you'll end up like the drained villagers. dlg_text(sconv("@90605763", "#@level@#", minimumRequiredLevel)) elseif playerLevel >= minimumRequiredLevel then -- You came to a very dangerous place. A number of Rondo Guards searched the area with no luck. What I heard is you have to be careful about her eyes. I don't know what it means, but I know you can lift the curse on this Circus. We trust you. dlg_text( "@90606148" ) dlg_menu("@690000141", "warp_to_instance_dungeon(50000, 0)") -- Stage 1 dlg_menu("@690000142", "warp_to_instance_dungeon(50000, 1)") -- Stage 2 if playerLevel >= minimumRequiredLevel + 10 then dlg_menu("@690000143", "warp_to_instance_dungeon(50000, 2)") -- Stage 3 dlg_menu("@690000144", "warp_to_instance_dungeon(50000, 3)") -- Stage 4 end end end dlg_end() end function on_create_circus( layer ) end function on_join_circus( layer ) local cnt_1 = get_alive_instance_respawn_group_monster_count( 50000, layer, 1 ) local cnt_2 = get_alive_instance_respawn_group_monster_count( 50000, layer, 2 ) local cnt_3 = get_alive_instance_respawn_group_monster_count( 50000, layer, 3 ) local cnt_4 = get_alive_instance_respawn_group_monster_count( 50000, layer, 4 ) local cnt_5 = get_alive_instance_respawn_group_monster_count( 50000, layer, 5 ) -- Currently on mission #1 if( cnt_1 > 0 ) then send_mission_title( '@9900' ) -- Eliminate the monsters in the warehouse send_mission_objective( 0, 10, '@1224' ) -- Kill them all! send_mission_objective_progress( 0, 10 - cnt_1 ) -- Currently on mission #2 elseif( cnt_2 > 0 ) then send_mission_title( '@9901' ) -- Eliminate the monsters in the changing room send_mission_objective( 0, 13, '@1224' ) -- Kill them all! send_mission_objective_progress( 0, 13 - cnt_2 ) -- Currently on mission #3 elseif( cnt_3 > 0 ) then send_mission_title( '@9902' ) -- Eliminate the monsters that have escaped from their cages send_mission_objective( 0, 13, '@1224' ) -- Kill them all! send_mission_objective_progress( 0, 13 - cnt_3 ) -- Currently on mission #4 elseif( cnt_4 > 0 ) then send_mission_title( '@9903' ) -- Eliminate the monsters in the training hall send_mission_objective( 0, 20, '@1224' ) -- Kill them all! send_mission_objective_progress( 0, 20 - cnt_4 ) -- Currently on mission #5 elseif( cnt_5 > 0 ) then send_mission_title( '@9904' ) -- Eliminate the monsters in the performance theater send_mission_objective( 0, 19, '@1224' ) -- Kill them all! send_mission_objective_progress( 0, 19 - cnt_5 ) end end function on_leave_circus( layer ) end function circus_portal_activate() local playerLevel = gv("level") local minimumRequiredLevel = tonumber(get_env("game.circus_required_level")) or 160 if playerLevel >= minimumRequiredLevel then dlg_special( 'confirm_window', 'warp(35692 , 120963 )', '@9852' ) -- Are you ready to move to the deepest Pitch Black Woods area? else cprint(sconv("@9254"), "#@level@#", minimumRequiredLevel) -- Required Level: #@level@#. end end