255 lines
7.1 KiB
Lua
255 lines
7.1 KiB
Lua
-- Lua 스크립트 암호화
|
|
function get_module_name()
|
|
return "on_player_level_up"
|
|
end
|
|
|
|
function on_player_level_up()
|
|
|
|
--local tx, ty, current_x, island_number
|
|
local lv = get_value( "level" )
|
|
local max_reached_level = gv( "max_reached_level" )
|
|
local state_code = get_local_info()
|
|
|
|
--=========================================================================================150 레벨 이하 레벨 달성 보상
|
|
local i --function
|
|
for i = max_reached_level + 1 , lv do
|
|
if i == 20 then
|
|
-- Carte Pet Commun (orc etc)
|
|
give_on_level_up_pet( 0 , 1 , 5 )
|
|
|
|
|
|
--add_item( 900010, 5 ) -- 900010 Economiseur d'Energie (non-Aⓒchangeable)
|
|
--add_item( 900018, 5 ) -- Potion Mira
|
|
add_item(2010454, 5 ) -- EB
|
|
private_notice( sconv( "@690000140" , "#@index_lv@#", i ) )
|
|
|
|
elseif i == 50 then
|
|
give_on_level_up_pet( 0 , 1 , 5 )
|
|
add_item(2010454, 5 ) -- EB
|
|
add_item(2902160, 5 ) -- 2902160 Fiole de Bonheur<not tradable>
|
|
private_notice( sconv( "@690000140" , "#@index_lv@#", i ) )
|
|
|
|
|
|
elseif i == 100 then
|
|
|
|
give_on_level_up_pet( 0 , 1 , 10 )
|
|
private_notice( sconv( "@690000140" , "#@index_lv@#", i ) )
|
|
|
|
|
|
elseif i == 150 then
|
|
|
|
|
|
give_on_level_up_pet( 0 , 2 , 5 )
|
|
|
|
give_on_level_up_pet( 1 , 3 , 1 )
|
|
give_on_level_up_pet( 1 , 3 , 1 )
|
|
give_on_level_up_pet( 1 , 3 , 1 )
|
|
give_on_level_up_pet( 1 , 3 , 1 )
|
|
give_on_level_up_pet( 1 , 3 , 1 )
|
|
|
|
add_item( 900010, 5 ) -- 900010 Economiseur d'Energie (non-Aⓒchangeable)
|
|
add_item( 900018, 5 ) -- Potion Mira
|
|
add_item(2010454, 5 ) -- EB
|
|
add_item(2902160, 5 ) -- 2902160 Fiole de Bonheur<not tradable>
|
|
|
|
add_item(800000000 , 2 ) -- box conso
|
|
add_item(800000001 , 2 ) -- box enchant
|
|
|
|
private_notice( sconv( "@690000140" , "#@index_lv@#", i ) )
|
|
|
|
end
|
|
end
|
|
|
|
if lv == 5 then
|
|
-- 각 1번 섬의 텔레포트 좌표
|
|
-- tx = 30315
|
|
-- ty = 5480
|
|
|
|
if (gv('rx') == nil or gv('rx') == "") and (gv('ry') == nil or gv('ry') == "") then -- 해외
|
|
current_x = get_flag( "rx" )
|
|
else -- 국내
|
|
current_x = gv( "rx" )
|
|
end
|
|
|
|
if (gv('rx') == nil or gv('rx') == "") and (gv('ry') == nil or gv('ry') == "") then -- 해외
|
|
set_flag( "rx", 172543 + math.random(0,100))
|
|
set_flag( "ry", 51847 + math.random(0,100))
|
|
else -- 국내
|
|
sv( "rx", 172543 + math.random(0,100))
|
|
sv( "ry", 51847 + math.random(0,100))
|
|
end
|
|
|
|
end
|
|
|
|
-- 국가 코드 읽어오기
|
|
-- get_local_info()의 반환값들
|
|
--LOCAL_INFO_KOREA = 1
|
|
--LOCAL_INFO_HONGKONG = 2
|
|
--LOCAL_INFO_AMERICA = 4
|
|
--LOCAL_INFO_GERMANY = 8
|
|
--LOCAL_INFO_JAPAN = 16
|
|
--LOCAL_INFO_TAIWAN = 32
|
|
--LOCAL_INFO_CHINA = 64
|
|
--LOCAL_INFO_FRANCE = 128
|
|
--LOCAL_INFO_RUSSIA = 256
|
|
|
|
|
|
local state_code = get_local_info()
|
|
|
|
-- 18레벨 이상이나 수련자의 섬 내에 있는 경우 종족 마을로 귀환 지점 설정
|
|
local current_x = gv("x")
|
|
local current_y = gv("y")
|
|
local race = get_value( "race" )
|
|
|
|
-- 미국이면 무조건 안보냄 (전 국가 적용 안함으로 변경 08.07.29)
|
|
if state_code == 511 then
|
|
-- 아무짓도 안해요
|
|
elseif lv >= 180 then
|
|
-- 수련자의 섬에 있는지 여부 체크
|
|
if current_x >= 161280 and current_x <= 177408 then
|
|
if current_y >= 48384 and current_y <= 64512 then
|
|
|
|
local return_x
|
|
local return_y
|
|
|
|
-- 현재귀환 위치를 가져옴.
|
|
if (gv('rx') == nil or gv('rx') == "") and (gv('ry') == nil or gv('ry') == "") then -- 해외
|
|
return_x = get_flag( "rx" )
|
|
return_y = get_flag( "ry" )
|
|
else -- 국내
|
|
return_x = gv( "rx" )
|
|
return_y = gv( "ry" )
|
|
end
|
|
|
|
-- 수련자의 섬이 귀환인지 체크
|
|
if return_x == 173183 and return_y == 52299 then
|
|
|
|
-- 귀환지역을 해당 종족 마을로 설정
|
|
|
|
-- 데바일 경우
|
|
if race == 4 then
|
|
if (gv('rx') == nil or gv('rx') == "") and (gv('ry') == nil or gv('ry') == "") then -- 해외
|
|
set_flag( "rx", 6625 + math.random(0,100))
|
|
set_flag( "ry", 6980 + math.random(0,100))
|
|
else -- 국내
|
|
sv( "rx", 6625 + math.random(0,100))
|
|
sv( "ry", 6980 + math.random(0,100))
|
|
end
|
|
|
|
|
|
-- 아수라일 경우
|
|
elseif race == 5 then
|
|
if (gv('rx') == nil or gv('rx') == "") and (gv('ry') == nil or gv('ry') == "") then -- 해외
|
|
set_flag( "rx", 116799 + math.random(0,100))
|
|
set_flag( "ry", 58205 + math.random(0,100))
|
|
else -- 국내
|
|
sv( "rx", 116799 + math.random(0,100))
|
|
sv( "ry", 58205 + math.random(0,100))
|
|
end
|
|
|
|
|
|
-- 가이아일 경우
|
|
else
|
|
if (gv('rx') == nil or gv('rx') == "") and (gv('ry') == nil or gv('ry') == "") then -- 해외
|
|
set_flag( "rx", 153513 + math.random(0,100))
|
|
set_flag( "ry", 77203 + math.random(0,100))
|
|
else -- 국내
|
|
set_flag( "rx", 153513 + math.random(0,100))
|
|
set_flag( "ry", 77203 + math.random(0,100))
|
|
end
|
|
end -- if race == 4 then
|
|
|
|
-- 수련자의 섬에 있고 18레벨 이상이기 때문에 해당 종족 마을로 강제 귀환 설정 됐다는 메시지 날림.
|
|
message( "@235")
|
|
|
|
end -- if return_x == 173183 and return_y == 52299
|
|
end -- if current_y >= 48384 and current_y <= 64512 then
|
|
end -- if current_x >= 161280 and current_x <= 177408 then
|
|
end -- if lv >= 18 then
|
|
|
|
kick_auto_to_another_world()
|
|
|
|
local current_x = gv("x")
|
|
local current_y = gv("y")
|
|
local race = get_value( "race" )
|
|
|
|
if current_x >= 161280 and current_x <= 177408 then
|
|
if current_y >= 48384 and current_y <= 64512 then
|
|
|
|
local is_auto, quest_count
|
|
quest_count, is_auto = anti_auto_quest_check()
|
|
|
|
if is_auto then
|
|
if race == 4 then
|
|
RunTeleport_Auto_TO_City( 6625 , 6980 )
|
|
elseif race == 5 then
|
|
RunTeleport_Auto_TO_City( 116799 , 58205 )
|
|
else
|
|
RunTeleport_Auto_TO_City( 153506 , 77175 )
|
|
end
|
|
end -- if is_auto then
|
|
end -- if current_y >= 48384 and current_y <= 64512 then
|
|
end -- if current_x >= 161280 and current_x <= 177408 then
|
|
|
|
on_player_level_joblevel_guide()
|
|
|
|
if lv > max_reached_level then
|
|
update_title_condition( 9002001, lv )
|
|
end
|
|
end
|
|
|
|
function on_player_level_joblevel_guide()
|
|
|
|
|
|
--작업중
|
|
local lv = get_value( "level" )
|
|
local job_lv = get_value( "job_level" )
|
|
local job_dp = get_value( "job_depth" )
|
|
|
|
if job_dp == 0 and lv >= 10 and job_lv >= 10 then
|
|
cprint( "@1200" )
|
|
--cprint( "@254" )
|
|
cprint( "@1201" )
|
|
elseif lv == 20 then
|
|
cprint( "@1202" )
|
|
cprint( "@1203" )
|
|
|
|
-- add_npc(172578, 51937, 600, 5)
|
|
|
|
elseif lv == 50 then
|
|
cprint( "@1204" )
|
|
cprint( "@1205" )
|
|
elseif job_dp== 1 and lv >= 50 and job_lv >= 40 then
|
|
cprint( "@1206" )
|
|
cprint( "@1207" )
|
|
cprint( "@1208" )
|
|
elseif lv == 80 then
|
|
cprint( "@1209" )
|
|
cprint( "@1210" )
|
|
elseif lv == 100 then
|
|
cprint( "@1211" )
|
|
cprint( "@1212" )
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
function give_on_level_up_pet( isrdm , rarity , count )
|
|
pet={}
|
|
pet[1]={540002 , 540005 , 540006 , 540011 , 540018 , 540053 , 540057 , 540079,540019}
|
|
pet[2]={540009 , 540012 , 540052 , 540067 , 540065}
|
|
pet[3]={540013 , 540059 , 540055 , 540010}
|
|
pet[4]={540061 , 540036 , 540063 , 540076}
|
|
pet[5]={540037 , 540069}
|
|
|
|
if isrdm == 0 then
|
|
for i = 1 , table.getn(pet[rarity]) do
|
|
add_item(pet[rarity][i] , count )
|
|
end
|
|
else
|
|
add_item(pet[rarity][math.random(1,table.getn(pet[rarity] ))] , count )
|
|
end
|
|
|
|
|
|
end |