468 lines
18 KiB
Lua
468 lines
18 KiB
Lua
-- DevilDom module
|
||
|
||
-- Old Man Nuz (Devildom init)
|
||
function NPC_lost_island_rooze_contact()
|
||
local minimumDevildomLevel = tonumber(get_env("game.devildom_minimum_level_req")) or 175
|
||
local npc_name = "@"..get_npc_type().."|@"..get_npc_name()
|
||
|
||
dlg_title( npc_name)
|
||
dlg_text( "@91000447" )
|
||
|
||
if get_quest_progress(4033) == 255 and get_value( 'level' ) >= 175 or tonumber(get_env("game.devildom_no_quest_req")) == 1 then
|
||
if minimumDevildomLevel <= gv("lv") then
|
||
dlg_menu("@90610375", "NPC_lost_island_rooze_warp()")
|
||
end
|
||
end
|
||
|
||
dlg_menu( "@90010002", '' )
|
||
dlg_show()
|
||
end
|
||
|
||
function NPC_lost_island_rooze_warp()
|
||
local npc_name = "@"..get_npc_type().."|@"..get_npc_name()
|
||
local levelRequirement = tonumber(get_env("game.devildom_minimum_level_req")) or 175
|
||
|
||
|
||
dlg_title( npc_name)
|
||
dlg_text( "@90610403" )
|
||
|
||
if ( get_quest_progress(4033) == 255 or tonumber(get_env("game.devildom_no_quest_req")) == 1 ) and get_value( 'level' ) >= levelRequirement then
|
||
dlg_menu("@90610404", "warp_to_instance_dungeon(80000,0)")
|
||
end
|
||
if get_quest_progress(4036) == 255 or tonumber(get_env("game.devildom_no_quest_req")) == 1 then -- 11
|
||
dlg_menu("@90610405", "warp_to_instance_dungeon(80000, 1, 22626, 54881)")
|
||
end
|
||
if get_quest_progress(4037) == 255 or tonumber(get_env("game.devildom_no_quest_req")) == 1 then -- 21
|
||
dlg_menu("@90610406", "warp_to_instance_dungeon(80000, 2, 19129, 58384)")
|
||
end
|
||
if get_quest_progress(4040) == 255 or tonumber(get_env("game.devildom_no_quest_req")) == 1 then -- 31
|
||
dlg_menu("@90610852", "warp_to_instance_dungeon(80000, 3, 25028, 61184)")
|
||
end
|
||
if get_quest_progress(4041) == 255 or tonumber(get_env("game.devildom_no_quest_req")) == 1 then -- 41
|
||
dlg_menu("@90610853", "warp_to_instance_dungeon(80000, 4, 28028, 56184)")
|
||
end
|
||
if get_quest_progress(4042) == 255 or tonumber(get_env("game.devildom_no_quest_req")) == 1 then -- 51
|
||
dlg_menu("@90610854", "warp_to_instance_dungeon(80000, 5, 25028, 51184)")
|
||
end
|
||
|
||
dlg_menu( "@90010002", '' )
|
||
dlg_show()
|
||
|
||
end
|
||
|
||
|
||
|
||
function devildom_count( monster_id, quest1, param1, quest2, param2 )
|
||
|
||
-- 22000371 Antiker Hispo
|
||
-- 22000194 Gargam der verfluchte Ent
|
||
-- 22000205 Mephisto der Blutbesudelte (Rayash, the Bloody)
|
||
-- 22000347 Rayashs Leibwächter
|
||
-- 22000373 Antiker Rayash
|
||
-- 22000216 Kraken der Unendlichkeit
|
||
-- 22000369 Antiker Ältester
|
||
-- 22000382 Antiker Magmagolem
|
||
-- 22000383 Reviac-Gladiator
|
||
-- 22000379 Antiker Holzdämon
|
||
|
||
-- 22000407 Yushiva, Mutter der Natur
|
||
-- 22000411 Yushiva, das zeitlose Weib
|
||
|
||
-- 22000192 Teuflischer Seelenstein (blau)
|
||
-- 22000203 Teuflischer Seelenstein (blau)
|
||
-- 22000214 Teuflischer Seelenstein (blau)
|
||
|
||
-- 22000193 Teuflischer Seelenstein (rot)
|
||
-- 22000204 Teuflischer Seelenstein (rot)
|
||
-- 22000215 Teuflischer Seelenstein (rot)
|
||
|
||
local layer = get_value('layer')
|
||
|
||
local bossesList =
|
||
{
|
||
[22000195] = function() do_each_player_in_instance_dungeon(80000, layer, 'set_quest_status(4035, 1, 1)', gv('x'), gv('y')) do_each_player_in_instance_dungeon(80000, layer, 'set_quest_status(4044, 2, 1)', gv('x'), gv('y') ) end, -- Hispo der Abartige [ Call_Script_tula_Death() ]
|
||
[22000217] = function() do_each_player_in_instance_dungeon(80000, layer, 'set_quest_status(4039, 1, 1)', gv('x'), gv('y')) do_each_player_in_instance_dungeon(80000, layer, 'set_quest_status(4044, 1, 1)', gv('x'), gv('y') ) end, -- Yushiva – Die Eisjungfrau [ Call_Script_Kainen_Death() ]
|
||
[22000206] = function() do_each_player_in_instance_dungeon(80000, layer, 'set_quest_status(4037, 1, 1)', gv('x'), gv('y')) do_each_player_in_instance_dungeon(80000, layer, 'set_quest_status(4046, 1, 1)', gv('x'), gv('y') ) end, -- Kleinkacmo, König der Marduka [ Call_Script_Barga_Death() ]
|
||
[22000370] = function() do_each_player_in_instance_dungeon(80000, layer, 'set_quest_status(4041, 1, 1)', gv('x'), gv('y')) do_each_player_in_instance_dungeon(80000, layer, 'set_quest_status(4046, 1, 1)', gv('x'), gv('y') ) end, -- Dämonenwald [ Call_Script_DevilWood_Death() ]
|
||
[22000372] = function() do_each_player_in_instance_dungeon(80000, layer, 'set_quest_status(4041, 2, 1)', gv('x'), gv('y')) do_each_player_in_instance_dungeon(80000, layer, 'set_quest_status(4045, 2, 1)', gv('x'), gv('y') ) end, -- Nargash Gorg [ Call_Script_Slaughterer_Death() ]
|
||
[22000374] = function() do_each_player_in_instance_dungeon(80000, layer, 'set_quest_status(4042, 1, 1)', gv('x'), gv('y')) do_each_player_in_instance_dungeon(80000, layer, 'set_quest_status(4045, 1, 1)', gv('x'), gv('y') ) end, -- Antiker Wasserspeier Blargon [ Call_Script_StoneGargoyle_Death() ]
|
||
[22000376] = function() do_each_player_in_instance_dungeon(80000, layer, 'set_quest_status(4042, 2, 1)', gv('x'), gv('y')) do_each_player_in_instance_dungeon(80000, layer, 'set_quest_status(4040, 1, 1)', gv('x'), gv('y') ) end, -- Magmagolem [ Call_Script_MagmaGolem_Death() ]
|
||
[22000378] = function() do_each_player_in_instance_dungeon(80000, layer, 'set_quest_status(4043, 1, 1)', gv('x'), gv('y')) do_each_player_in_instance_dungeon(80000, layer, 'set_quest_status(4038, 1, 1)', gv('x'), gv('y') ) end, -- Reviac-Golem [ Call_Script_CrazyHagen_Death() ]
|
||
[22000384] = function() do_each_player_in_instance_dungeon(80000, layer, 'set_quest_status(4043, 2, 1)', gv('x'), gv('y')) do_each_player_in_instance_dungeon(80000, layer, 'set_quest_status(4036, 1, 1)', gv('x'), gv('y') ) end, -- Reviac, Herr von Devildom [ Call_Script_DevilReviac_Death() ]
|
||
}
|
||
|
||
local Boss = bossesList[monster_id]
|
||
|
||
if Boss then
|
||
Boss()
|
||
else
|
||
|
||
end
|
||
|
||
local monster_count = get_instance_dungeon_flag( 80000, layer, 'monster_count' )
|
||
set_instance_dungeon_flag( 80000, layer, 'monster_count', monster_count+1 )
|
||
|
||
local current = get_instance_dungeon_flag( 80000, layer, 'current' )
|
||
current = current + 1;
|
||
|
||
set_instance_dungeon_flag( 80000, layer , 'current', current )
|
||
broadcast_mission_objective_progress( 1, 0, current, 80000,layer )
|
||
|
||
if get_instance_dungeon_flag( 80000, layer, 'final_count' ) == monster_count then
|
||
add_field_prop( 10361, 0, 26748, 54183, gv('layer'), 250, 0, 0, 1.58, 1, 1, 1 )
|
||
end
|
||
|
||
|
||
end
|
||
|
||
|
||
|
||
function NPC_DevildomDungeon()
|
||
local npc_name = "@"..get_npc_type().."|@"..get_npc_name()
|
||
local stage = get_instance_dungeon_flag( 80000, gv('layer'), 'stage' )
|
||
|
||
dlg_title(npc_name)
|
||
dlg_text( "@90610399" )
|
||
|
||
if stage >= 11 then
|
||
dlg_menu( "@90610400", "warp( 22626, 54881, gv('layer'))" )
|
||
end
|
||
if stage >= 21 then
|
||
dlg_menu( "@90610401", "warp( 19129, 58384, gv('layer') )" )
|
||
end
|
||
if stage >= 31 then
|
||
dlg_menu( "@90610855", "warp( 25028, 61184, gv('layer') )" )
|
||
end
|
||
if stage >= 41 then
|
||
dlg_menu( "@90610856", "warp( 28028, 56184, gv('layer') )" )
|
||
end
|
||
if stage >= 51 then
|
||
dlg_menu( "@90610857", "warp( 25028, 51184, gv('layer') )" )
|
||
end
|
||
|
||
dlg_menu( "@90610402", "exit_indun( 0 )" )
|
||
dlg_menu( "@90010002", " " )
|
||
dlg_show()
|
||
end
|
||
|
||
|
||
|
||
function MMT_open_door(stage)
|
||
|
||
|
||
|
||
local layer = gv('layer')
|
||
|
||
--LOG
|
||
--notice(get_instance_dungeon_flag( 80000, layer, 'monster_count' ))
|
||
--
|
||
|
||
MMT_action(layer,stage+1)
|
||
set_instance_dungeon_flag( 80000, layer, 'stage', stage+1 )
|
||
|
||
end
|
||
|
||
--- stage:2 는 2번방 몬스터 생성
|
||
function MMT_action(layer,stage)
|
||
local state_code = get_local_info()
|
||
|
||
if layer == -1 then
|
||
layer = gv('layer')
|
||
end
|
||
|
||
local type, monster
|
||
if math.mod(stage, 5) ~= 0 and math.mod(stage, 5) ~= 1 then -- 중보, 보스, 시작방 빼고
|
||
type = math.random(1, 8)
|
||
if stage <= 30 then
|
||
monster = math.random(22000185, 22000191) + math.floor( stage / 10 )*11
|
||
else
|
||
local Marray =
|
||
{ 0, 22000315, 22000318, 22000321, 0, 0, 22000324, 22000327, 22000330, 0, -- 31층
|
||
0, 22000333, 22000336, 22000339, 0, 0, 22000342, 22000345, 22000348, 0, -- 41층
|
||
0, 22000351, 22000354, 22000357, 0, 0, 22000360, 22000363, 22000366, 0, -- 51층
|
||
}
|
||
local regen_monster = Marray[stage-30]
|
||
monster = math.random(regen_monster, regen_monster+2) -- 31층 이상 일반몹...
|
||
end
|
||
MMT_regen(layer,stage, type, monster)
|
||
elseif math.mod(stage+5, 10) == 0 then -- 중보
|
||
if stage <= 30 then
|
||
type = math.random(21, 22)
|
||
else
|
||
if state_code == 8192 then
|
||
type = 23
|
||
else
|
||
type = math.random( 47, 48 )
|
||
end
|
||
end
|
||
MMT_regen(layer,stage, type, 0)
|
||
elseif math.mod(stage, 10) == 0 and stage ~= 60 then --보스 // 마지막 방은 포함 안되도록
|
||
if stage <= 30 then
|
||
type = math.random(31, 32)
|
||
else
|
||
if state_code == 8192 then
|
||
type = 23
|
||
else
|
||
type = math.random( 47, 48 )
|
||
end
|
||
end
|
||
MMT_regen(layer,stage, type, 0)
|
||
elseif stage == 60 then
|
||
type = math.random(41, 45)
|
||
if state_code == 4 or state_code == 8 or state_code == 128 or state_code == 16384 or state_code == 32768 or state_code == 65536 then
|
||
local awBelt = find_item( 3100048 )
|
||
if awBelt >= 1 then
|
||
MMT_regen(layer,stage, 46, 0)
|
||
set_instance_dungeon_flag( 80000, layer, 'final_count' ,459 )
|
||
else
|
||
MMT_regen(layer,stage, type, 0)
|
||
set_instance_dungeon_flag( 80000, layer, 'final_count' ,457 )
|
||
end
|
||
else
|
||
MMT_regen(layer,stage, type, 0)
|
||
set_instance_dungeon_flag( 80000, layer, 'final_count' ,457 )
|
||
end
|
||
elseif math.mod(stage, 5) == 1 then
|
||
--cprint("쉬어가셈")
|
||
end
|
||
end
|
||
|
||
|
||
function MMT_regen(layer, stage, generate_type, monster_id)
|
||
local parray =
|
||
{ 19128,51384,2, 19128,52084,2, 19128,52784,2, 19128,53484,2, 19128,54184,2,
|
||
19828,54184,1, 20528,54184,1, 21228,54184,1, 21928,54184,1, 22628,54184,1,
|
||
|
||
22628,54884,2, 22628,55584,2, 22628,56284,2, 22628,56984,2, 22628,57684,2,
|
||
21928,57684,3, 21228,57684,3, 20528,57684,3, 19828,57684,3, 19128,57684,3,
|
||
|
||
19128,58384,2, 19128,59084,2, 19128,59784,2, 19128,60484,2, 19128,61184,2,
|
||
20028,61184,1, 21028,61184,1, 22028,61184,1, 23028,61184,1, 24028,61184,1,
|
||
|
||
25028,61184,1, 26028,61184,1, 27028,61184,1, 28028,61184,1, 29028,61184,1,
|
||
29028,60184,0, 29028,59184,0, 29028,58184,0, 29028,57184,0, 29028,56184,0,
|
||
|
||
28028,56184,3, 27028,56184,3, 26028,56184,3, 25028,56184,3, 24028,56184,3,
|
||
24028,55184,0, 24028,54184,0, 24028,53184,0, 24028,52184,0, 24028,51184,0,
|
||
|
||
25028,51184,1, 26028,51184,1, 27028,51184,1, 28028,51184,1, 29028,51184,1,
|
||
29028,52184,2, 29028,53184,2, 29028,54184,2, 28028,54184,3, 27028,54184,3,
|
||
}
|
||
local count = 2
|
||
|
||
if stage >= 31 then
|
||
count = 1
|
||
end
|
||
|
||
local dur = 0
|
||
local base_idx = 1+(stage-1) * 3
|
||
local base_x = parray[base_idx+0]
|
||
local base_y = parray[base_idx+1]
|
||
local tdir = parray[base_idx+2]
|
||
|
||
local ppattern1 = { -18,-2, -10,3, -15,14, -4,18, 4,18, 15,14, 10,3, 18,-2 }
|
||
local ppattern2 = { -14,-8, -14,-3, -14,3, -14,8, 14,8, 14,3, 14,-3, 14,-8 }
|
||
local ppattern3 = { -11,15, -6,11, -7,18, -2,18, 2,18, 7,18, 11,15, 6,11 }
|
||
local ppattern4 = { 0,-6, -5,-3, -5,3, 0,6, 5,3, 5,-3, -10,16, 10,16 }
|
||
local ppattern5 = { -16,-10, -16,-4, -7,10, -4,17, 4,17, 7,10, 16,-4, 16,-10 }
|
||
local ppattern6 = { -9,12, -9,18, -4,18, -4,12, 4,18, 4,12, 9,18, 9,12 }
|
||
local ppattern7 = { 0,-4, -6,-2, 6,-2, 0,2, -8,16, -3,16, 3,16, 8,16 }
|
||
local ppattern8 = { -4,-1, 4,-1, 0,9, -11,17, -7,9, 0,18, 7,9, 11,17 }
|
||
|
||
local ppattern21 = { 0,8,22000194, -10, 0, 22000192} -- Intermediate Treasure, Blue
|
||
local ppattern22 = { 0,8,22000194, 10, 0, 22000193} -- Intermediate Treasure, Red
|
||
local ppattern23 = { 0,0,22000370, 0, 2, 22000369} -- Intermediate and low-tier enemies above floor 31
|
||
|
||
local ppattern31 = { 0,0,22000195, 0,12,22000193, -10,0,22000192} -- 보스, 붉은, 푸른
|
||
local ppattern32 = { 0,0,22000195, 0,12,22000192, 10,0,22000193} -- 보스, 푸른, 붉
|
||
|
||
local ppattern41 = { 0,0,22000384, -2,0,22000379, 2,0,22000380, 0,-2,22000381} -- 보스, 보스쫄 3마리
|
||
local ppattern42 = { 0,0,22000384, -2,0,22000380, 2,0,22000381, 0,-2,22000382} -- 보스, 보스쫄 3마리
|
||
local ppattern43 = { 0,0,22000384, -2,0,22000381, 2,0,22000382, 0,-2,22000383} -- 보스, 보스쫄 3마리
|
||
local ppattern44 = { 0,0,22000384, -2,0,22000379, 2,0,22000382, 0,-2,22000383} -- 보스, 보스쫄 3마리
|
||
local ppattern45 = { 0,0,22000384, -2,0,22000379, 2,0,22000380, 0,-2,22000383} -- 보스, 보스쫄 3마리
|
||
local ppattern46 = { 0,0,22000384, -2,0,22000379, 2,0,22000380, 0,-2,22000381, -2,-2,22000382, 2,2,22000383} -- If user has another world belt. Will spawn all monsters. (Webzen)
|
||
|
||
local ppattern47 = { 0,0,22000370, 0,2,22000369 } -- Room 31 onwards (Webzen)
|
||
local ppattern48 = { 0,0,22000370, 0,2,22000403 } -- Room 31 onwards with Yushiva (Webzen)
|
||
|
||
local xv, yv
|
||
|
||
if stage <= 25 then
|
||
xv = 10
|
||
yv = 10
|
||
else
|
||
xv = 10
|
||
yv = 10
|
||
end
|
||
|
||
--cprint("패턴"..generate_type)
|
||
|
||
if generate_type==1 then
|
||
MMT_add_npc( base_x,base_y,monster_id,ppattern1,xv,yv,tdir,count,dur,layer,stage)
|
||
elseif generate_type==2 then
|
||
MMT_add_npc( base_x,base_y,monster_id,ppattern2,xv,yv,tdir,count,dur,layer,stage)
|
||
elseif generate_type==3 then
|
||
MMT_add_npc( base_x,base_y,monster_id,ppattern3,xv,yv,tdir,count,dur,layer,stage)
|
||
elseif generate_type==4 then
|
||
MMT_add_npc( base_x,base_y,monster_id,ppattern4,xv,yv,tdir,count,dur,layer,stage)
|
||
elseif generate_type==5 then
|
||
MMT_add_npc( base_x,base_y,monster_id,ppattern5,xv,yv,tdir,count,dur,layer,stage)
|
||
elseif generate_type==6 then
|
||
MMT_add_npc( base_x,base_y,monster_id,ppattern6,xv,yv,tdir,count,dur,layer,stage)
|
||
elseif generate_type==7 then
|
||
MMT_add_npc( base_x,base_y,monster_id,ppattern7,xv,yv,tdir,count,dur,layer,stage)
|
||
elseif generate_type==8 then
|
||
MMT_add_npc( base_x,base_y,monster_id,ppattern8,xv,yv,tdir,count,dur,layer,stage)
|
||
|
||
elseif generate_type==21 then
|
||
MMT_add_npc_boss( base_x,base_y,ppattern21,xv,yv,tdir,dur,layer,stage)
|
||
elseif generate_type==22 then
|
||
MMT_add_npc_boss( base_x,base_y,ppattern22,xv,yv,tdir,dur,layer,stage)
|
||
elseif generate_type==23 then
|
||
MMT_add_npc_boss( base_x,base_y,ppattern23,xv,yv,tdir,dur,layer,stage)
|
||
elseif generate_type==31 then
|
||
MMT_add_npc_boss( base_x,base_y,ppattern31,xv,yv,tdir,dur,layer,stage)
|
||
elseif generate_type==32 then
|
||
MMT_add_npc_boss( base_x,base_y,ppattern32,xv,yv,tdir,dur,layer,stage)
|
||
elseif generate_type==41 then
|
||
MMT_add_npc_boss( base_x,base_y,ppattern41,xv,yv,tdir,dur,layer,stage)
|
||
elseif generate_type==42 then
|
||
MMT_add_npc_boss( base_x,base_y,ppattern42,xv,yv,tdir,dur,layer,stage)
|
||
elseif generate_type==43 then
|
||
MMT_add_npc_boss( base_x,base_y,ppattern44,xv,yv,tdir,dur,layer,stage)
|
||
elseif generate_type==44 then
|
||
MMT_add_npc_boss( base_x,base_y,ppattern44,xv,yv,tdir,dur,layer,stage)
|
||
elseif generate_type==45 then
|
||
MMT_add_npc_boss( base_x,base_y,ppattern45,xv,yv,tdir,dur,layer,stage)
|
||
elseif generate_type==46 then
|
||
MMT_add_npc_boss( base_x,base_y,ppattern46,xv,yv,tdir,dur,layer,stage)
|
||
elseif generate_type==47 then -- Webzen only
|
||
MMT_add_npc_boss( base_x,base_y,ppattern47,xv,yv,tdir,dur,layer,stage)
|
||
elseif generate_type==48 then -- Webzen only
|
||
MMT_add_npc_boss( base_x,base_y,ppattern48,xv,yv,tdir,dur,layer,stage)
|
||
end
|
||
end
|
||
|
||
function MMT_broadcast_mission( layer,total )
|
||
|
||
broadcast_mission_title( 1, '@1224', 80000,layer )
|
||
broadcast_mission_reward( 1, '@90610864',80000,layer )
|
||
broadcast_mission_objective( 1, 0, total, '@1224',80000,layer) -- 미션 목표도 항상 '모든 몬스터를 섬멸하라'에 최대 몬스터 수는 6(4층인 경우만 1이 됨)
|
||
set_instance_dungeon_flag( 80000, layer, 'total' ,total )
|
||
set_instance_dungeon_flag( 80000, layer, 'current' ,0 )
|
||
|
||
end
|
||
|
||
function MMT_add_npc( base_x,base_y,monster_id,ppattern,xv,yv,tdir,count,dur,layer,stage)
|
||
|
||
local total = 0
|
||
local cnt = table.getn(ppattern)/2
|
||
for i = 1, cnt do
|
||
local idx
|
||
idx = (i-1)*2+1
|
||
local xx = (ppattern[idx]*xv)
|
||
idx = (i-1)*2+2
|
||
local yy = (ppattern[idx]*yv)
|
||
local temp_xx = xx
|
||
local temp_yy = yy
|
||
if tdir == 0 then -- ahead west
|
||
temp_xx = -xx
|
||
temp_yy = -yy
|
||
elseif tdir == 1 then -- ahead west
|
||
temp_xx = yy
|
||
temp_yy = -xx
|
||
elseif tdir == 2 then -- ahead south
|
||
temp_xx = xx
|
||
temp_yy = yy
|
||
elseif tdir == 3 then -- ahead eash
|
||
temp_xx = -yy
|
||
temp_yy = xx
|
||
end
|
||
|
||
if stage <= 30 then
|
||
monster = math.random(22000185, 22000191) + math.floor( stage / 10 )*11
|
||
else
|
||
local Marray =
|
||
{ 0, 22000315, 22000318, 22000321, 0, 0, 22000324, 22000327, 22000330, 0, -- 31층
|
||
0, 22000333, 22000336, 22000339, 0, 0, 22000342, 22000345, 22000348, 0, -- 41층
|
||
0, 22000351, 22000354, 22000357, 0, 0, 22000360, 22000363, 22000366, 0, -- 51층
|
||
}
|
||
|
||
local regen_monster = Marray[stage-30]
|
||
monster = math.random(regen_monster, regen_monster+2) -- 31층 이상 일반몹...
|
||
end
|
||
|
||
xx = base_x + temp_xx
|
||
yy = base_y + temp_yy
|
||
add_npc( xx,yy,monster,count,dur,layer)
|
||
total = total + count
|
||
--cprint(xx.." "..yy.." "..monster_id.." "..count.." "..dur.." "..layer)
|
||
end
|
||
|
||
MMT_broadcast_mission(layer,total)
|
||
end
|
||
|
||
function MMT_add_npc_boss( base_x,base_y,ppattern,xv,yv,tdir,dur,layer,stage)
|
||
|
||
local total = 0
|
||
local cnt = table.getn(ppattern)/3
|
||
for i = 1, cnt do
|
||
local idx
|
||
idx = (i-1)*3+1
|
||
local xx = (ppattern[idx]*xv)
|
||
idx = (i-1)*3+2
|
||
local yy = (ppattern[idx]*yv)
|
||
|
||
local temp_xx = xx
|
||
local temp_yy = yy
|
||
if tdir == 0 then -- ahead west
|
||
temp_xx = -xx
|
||
temp_yy = -yy
|
||
elseif tdir == 1 then -- ahead west
|
||
temp_xx = yy
|
||
temp_yy = -xx
|
||
elseif tdir == 2 then -- ahead south
|
||
temp_xx = xx
|
||
temp_yy = yy
|
||
elseif tdir == 3 then -- ahead eash
|
||
temp_xx = -yy
|
||
temp_yy = xx
|
||
end
|
||
|
||
local monster_id
|
||
if stage <= 30 then
|
||
monster_id = ppattern[(i-1)*3+3] + (math.floor( (stage / 10)-0.5 ))*11
|
||
elseif stage == 60 then
|
||
monster_id = ppattern[(i-1)*3+3]
|
||
else
|
||
monster_id = ppattern[(i-1)*3+3] + ((stage-35)/5)*2 -- 31층 이상 중보 보스...
|
||
end
|
||
|
||
xx = base_x + temp_xx
|
||
yy = base_y + temp_yy
|
||
add_npc( xx,yy,monster_id,1,dur,layer)
|
||
total = total + 1
|
||
end
|
||
MMT_broadcast_mission(layer,total)
|
||
|
||
end
|
||
|
||
------------------------------------------------------------------------------------------------------------
|
||
function MMT_on_leave( layer ) -- 이탈시호출
|
||
------------------------------------------------------------------------------------------------------------
|
||
send_mission_title( '' )
|
||
end
|
||
|
||
------------------------------------------------------------------------------------------------------------
|
||
function MMT_on_join( layer ) -- 각 방마다 호출
|
||
------------------------------------------------------------------------------------------------------------
|
||
local total = get_instance_dungeon_flag( 80000, layer, 'total' )
|
||
local current = get_instance_dungeon_flag( 80000, layer, 'current' )
|
||
if total ~= nil and total ~= "" then
|
||
send_mission_title( '@1224' ) -- 미션 제목은 항상 '모든 몬스터를 섬멸하라'
|
||
send_mission_reward( '@90610864')
|
||
send_mission_objective( 0, total, '@1224' ) -- 미션 목표도 항상 '모든 몬스터를 섬멸하라'에 최대 몬스터 수는 6(4층인 경우만 1이 됨)
|
||
send_mission_objective_progress( 0, current )
|
||
end
|
||
end |