Jump to content

Spawn zombie_ghost_door with the right direction


Recommended Posts

Hi,

 

I wanted to spawn a zombie_ghost_door (ID:30111) for my new created dungeon. But i just dont get the direction on it right, it never fits in the place i build for it. One time its facing north, and the other time its facing west.

 

I already tried it with d.spawn_mob in the dungeon quest,

I tried to do it with the regen file like this: "m    223    39    1    0    0   7   1000s    100    1    30111" 

The 7 is for the direction as i remember right, but it always changes the direction...

 

I looked at the devils_catacomb_quest too, but its just too hard for me, i dont understand the  code.

Maybe some of you can help me adapt it to my quest.

 

Spoiler

    function setting()
        return
        {      

Spoiler

 

 ["base"]={["x"] = 3072  , ["y"]= 12032 ,},
        ["floor1_s"] = { ["x"] = 20, ["y"] = 20, },
        ["floor1_e"] = { ["x"] = 500, ["y"] = 470,},
        ["floor2_s"] = { ["x"] = 510, ["y"] = 18, },
        ["floor2_e"] = { ["x"] = 978, ["y"] = 470,},
        ["floor1_entry"] = {["x"] = 73, ["y"] = 63,},
        ["floor2_entry"] = {["x"] = 550, ["y"] = 45,},
        ["floor3_entry"] = {["x"] = 1378, ["y"] = 249,},
        ["floor4_entry"] = {["x"] = 70, ["y"] = 592,},
        ["floor5_entry"] = {["x"] = 846, ["y"] = 898},
        ["floor6_entry"] = {["x"] = 1362, ["y"] = 666},
        ["floor7_entry"] = {["x"] = 73, ["y"] = 1156},

        ["map_idx"] = 216,
        ["rag"] = 30311,

        ["devil_king"] = 2591,

        ["reapers_credit1"] = 30319,
        ["reapers_credit2"] = 30320,
        ["reapers_credit3"] = 76002,

        ["floor3_stone"] = 8038,  
        ["floor3_stone_pos"] = {
                {1366,    150},
                {1366,    351},
                {1234,    365},
                {1234,    140},
                {1150,    135},
                {1130,    365},
                {1135,    253}
        },

        ["mob_regen_file_path"] = "data/dungeon/devilcatacomb/",
        ["floor4_regen_file"] = {"devilcatacomb_floor4_regen1.txt",
                               "devilcatacomb_floor4_regen2.txt",
                               "devilcatacomb_floor4_regen3.txt",
                               "devilcatacomb_floor4_regen4.txt",
                               "devilcatacomb_floor4_regen5.txt"} ,

        ["credit_stone"] = 30101,
        ["credit_stone_pos"] = {307,323},
        ["floor2_stone"] = 30103,
        ["floor2_stone_pos"] = {741,217},
        ["floor2_merchant_npc"] = 20368,
        ["floor2_merchant_npc_pos"] = {734,214},
        
        ["floor4_npc"] = 30104,
        ["floor4_npc_pos"] = {500, 717},

        ["devil_king_pos"] = {{673,829},{691,638},{848,568},{1026,642},{1008,862}},

        ["unlock_stone"] = 30312,
        ["floor5_stone"] = 30102,
        ["floor5_stone_pos"] = {848, 735},

        ["devil_great_king"] = 2597 ,
        ["devil_great_king_pos"] = {1303,704},
        ["devil_emperor"] = 2598,
        ["devil_emperor_pos"] = {74,1103},        ["dc2_door_set_size"] = {4,2,3,2},

 


        ["dc2_door_set1"] = {
                                {{30111,    566,    117,    5},{30112,  562,    311,    5,},{30118, 663,    434,    7},{30119,  881,    434,    7}},
                                {{30116,    743,    390,    3},{30119,  612,    251,    1,}},
                                {{30113,    654,    211,    5},{30111,  707,    338,    7,},{30112, 775,    336,    7}},
                                {{30117,    733,    294,    3},{30113,  694,    271,    1,}}
                            },
        ["dc2_door_set2"] = {
                                {{30115,    942,    141,    5},{30116,  942,    245,    5},{30117,  942,    321,    5},{30115,  763,    64, 7}},
                                {{30118,    643,    116,    3},{30114,  900,    167,    1}},
                                {{30114,    850,    293,    5},{30113,  715,    164,    7},{30114,  817,    162,    7}},
                                {{30111,    802,    277,    1},{30112,  800,    241,    1}}
                            },

        }

Spoiler

 

    end
        when login begin
            local setting = devilcatacomb_zone.setting()
            local idx = pc.get_map_index()
            if idx >= (setting.map_idx * 10000) and idx < ((setting.map_idx + 1) * 10000) then
--                pc.set_warp_location(65, 5914, 992)         -----------¾Æ±Íµ¿±¼ ÁÂÇ¥·Î
                local level = d.getf("level")
                -- warp locationÀÌ 0,0 ÀÌ¸é ½Ã½ºÅÛ »óÀ¸·Î, Á¾·á ½Ã, Á¾·á À§Ä¡¸¦ ½ÃÀÛ À§Ä¡·Î ÀúÀåÇÑ´Ù.
                d.set_warp_location (0, 0, 0)
                    
                if level == 2 then
                    say(gameforge.devilcatacomb_zone._10_say)
                    say(string.format(gameforge.devilcatacomb_zone._20_say, 60))
                elseif level == pc.getqf ("level") then
--                    say ("³«¿ÀµÇÁö ¾Ê±â À§ÇØ µ¿·áµé°ú ÇÕ·ùÇϽʽÿÀ.")
                    say(gameforge.devilcatacomb_zone._30_say)
                else
                    say(gameforge.devilcatacomb_zone._40_say)
--                    say ("´ç½ÅÀº ³«¿ÀµÇ¾ú½À´Ï´Ù. ¿ë½ÅÀÇ ÈûÀ» ºô¾î Àá½Ã µÚ µ¿±¼ ¹ÛÀ¸·Î À̵¿ÇÕ´Ï´Ù.")
                    timer ("devilcatacomb_ban_timer", 5)
                end
            end
            if idx == setting.map_idx then
                pc.setf("devilcatacomb_zone","last_exit_time", get_global_time())
                -- 2ÃþÀÌ»óÀ̸é, ÂѰܳª
                if pc.get_x() < setting.floor1_s.x + setting.base.x
                    or pc.get_y() < setting.floor1_s.y + setting.base.y
                    or pc.get_x() > setting.floor1_e.x + setting.base.x
                    or pc.get_y() > setting.floor1_e.y + setting.base.y
                then
                    -- ¾Æ±Íµ¿±¼ ÀÔ±¸·Î
--                    if not is_test_server() then
                        say(gameforge.devilcatacomb_zone._40_say)
                        timer ("devilcatacomb_ban_timer", 5)
--                    end
                else 
                    -- ¾Æ±Íµ¿±¼ ÀÔ±¸·Î
--                    pc.set_warp_location(65, 5914, 992)
                    say(gameforge.devilcatacomb_zone._50_say)
                end
            end
        end

        when logout begin
            local idx = pc.get_map_index()
            local setting = devilcatacomb_zone.setting()
            if idx == setting.map_idx or idx >= (setting.map_idx * 10000) and idx < ((setting.map_idx + 1) * 10000) then
                pc.setf("devilcatacomb_zone","last_exit_time", get_global_time())
            end
        end

        when devilcatacomb_ban_timer.timer begin
            pc.warp((5914)*100, (992)*100, 65)
        end

        when warp_timer.timer begin
            local level = d.getf("level")
            local level_switch = {
                [3] = gameforge.devilcatacomb_zone._60_say,
                [4] = gameforge.devilcatacomb_zone._70_say,
                [5] = gameforge.devilcatacomb_zone._80_say,
                [6] = gameforge.devilcatacomb_zone._90_say,
            }
            local t = 3600 -(get_global_time() - d.getf("enter_time"))
            local t_r = math.mod (t, 60)
            local t_m = (t - t_r) / 60
            d.notice ( level_switch[level] )
            d.notice(string.format(gameforge.devilcatacomb_zone._20_say, t_m))
            d.set_warp_location (0, 0, 0)
        end

        when devilcatacomb_man.chat.gameforge.devilcatacomb_zone._100_npcChat with not devilcatacomb_zone.is_closed() begin
            local setting = devilcatacomb_zone.setting()
            if pc.get_level() < 75 then
                say(gameforge.devilcatacomb_zone._110_say)
            --elseif pc.getf("deviltower_zone","9_done") == 0 then
                --say(gameforge.devilcatacomb_zone._120_say)
            elseif ((get_global_time() - pc.getf("devilcatacomb_zone","last_exit_time")) < 1800) then
                say(gameforge.devilcatacomb_zone._130_say)
            else
                say(gameforge.devilcatacomb_zone._140_say)
                local s = select(gameforge.devilcatacomb_zone._150_select, gameforge.devilcatacomb_zone._160_select)
                if s == 1 then
                    pc.warp ((setting.floor1_entry.x + setting.base.x )* 100, (setting.floor1_entry.y + setting.base.y) * 100)
                end
            end
        end
    
        -- ¸ó½ºÅÍ°¡ Á×À¸¸é ¹ß»ýÇÏ´Â À̺¥Æ®.
        when kill begin
            local setting = devilcatacomb_zone.setting()
            -- ¾Æ±Íµ¿±¼ 1ÃþÀ̸é 1% È®·ü·Î ±Ý½Ã°ÇÀ» µå¶øÇÑ´Ù.
            if pc.get_x() > setting.floor1_s.x + setting.base.x
                    and pc.get_y() > setting.floor1_s.y + setting.base.y
                    and pc.get_x() < setting.floor1_e.x + setting.base.x
                    and pc.get_y() < setting.floor1_e.y + setting.base.y then
                local j = number(1, 100)
                if j == 1 then
                    game.drop_item (setting.rag, 1)
                end
            end
        end

 

    function spawn_doors ()
        local setting = devilcatacomb_zone.setting()
        for i = 1, 4 do
            local mob_set = setting.dc2_door_set1
            local set_size = setting.dc2_door_set_size
            for j = 1, set_size do
                d.set_unique (i.."_1_"..j, d.spawn_mob_dir (mob_set[j][1], mob_set[j][2], mob_set[j][3], mob_set[j][4]))
            end
            mob_set = setting.dc2_door_set2
            for j = 1, set_size do
                d.set_unique (i.."_2_"..j, d.spawn_mob_dir (mob_set[j][1], mob_set[j][2], mob_set[j][3], mob_set[j][4]))

            end
        end
    end

Im very happy for every answer and effort

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 0

      QuickSell in SpecialInventory Problem

    2. 5
    3. 12

      Legendary items effect

    4. 0

      M2Project Research | Teamler - Beta Tester

    5. 5

      How To Directx9 Device Creation with Multiple Thread Support

    6. 25

      Increase Safebox / Warehouse

    7. 25

      Increase Safebox / Warehouse

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.