748 lines
26 KiB
Lua
748 lines
26 KiB
Lua
-- Main
|
|
function get_module_name()
|
|
return "NPC_TeleportTown"
|
|
end
|
|
|
|
function BindingArea(text,pos_x,pos_y) -- Set the return area (X,Y)
|
|
set_flag("rx", pos_x + math.random(0,100))
|
|
set_flag("ry", pos_y + math.random(0,100))
|
|
message("@" .. text)
|
|
end
|
|
|
|
function NPC_TeleportTown_Contact_init( npc_id )
|
|
if npc_id == nil or npc_id == '' then npc_id = get_npc_id() end
|
|
local text, dlg_binding_area, text_binding_area, pos_x, pos_y, current_city
|
|
|
|
if npc_id == 1005 then -- Laksy; Gabriel
|
|
text = 90100502 -- NPC greetings
|
|
text_binding_area = 90100508 -- String; "Your set point set as %city%"
|
|
pos_x = 6625 -- X position to set as a default city
|
|
pos_y = 6980 -- Y position to set as a default city
|
|
current_city = 90200505 -- Current city as a string; Requires to detect additional teleport menus
|
|
dlg_binding_area = 90100507 -- Make Laksy as default city
|
|
|
|
elseif npc_id == 1006 then -- Laksy; Lower Laksy; Audrey
|
|
text = 90100602
|
|
text_binding_area = 0
|
|
pos_x = 0
|
|
pos_y = 0
|
|
current_city = 90100603
|
|
dlg_binding_area = 90100507
|
|
|
|
elseif npc_id == 1014 then -- Laksy; Ruriel
|
|
text = 90101402
|
|
text_binding_area = 90100508
|
|
pos_x = 6625
|
|
pos_y = 6980
|
|
current_city = 90200505
|
|
dlg_binding_area = 90100507
|
|
|
|
elseif npc_id == 2005 then -- Katan; Asmond
|
|
text = 90200502
|
|
text_binding_area = 90200508
|
|
pos_x = 116799
|
|
pos_y = 58205
|
|
current_city = 90100506
|
|
dlg_binding_area = 90200507
|
|
|
|
elseif npc_id == 2017 then -- Katan; Iriosa
|
|
text = 90996933
|
|
text_binding_area = 90200508
|
|
pos_x = 116799
|
|
pos_y = 58205
|
|
current_city = 90100506
|
|
dlg_binding_area = 90200507
|
|
|
|
elseif npc_id == 3005 then -- Trainee Island; Authier
|
|
text = 90300502
|
|
text_binding_area = 90300508
|
|
pos_x = 172185
|
|
pos_y = 52095
|
|
current_city = 90019001
|
|
dlg_binding_area = 90300510
|
|
|
|
elseif npc_id == 4005 then -- Horizon; Rivendel
|
|
text = 90400502
|
|
text_binding_area = 90400509
|
|
pos_x = 153513
|
|
pos_y = 77203
|
|
current_city = 90100510
|
|
dlg_binding_area = 90400508
|
|
|
|
elseif npc_id == 4098 then -- Horizon; Udindel
|
|
text = 90400502
|
|
text_binding_area = 90400509
|
|
pos_x = 153513
|
|
pos_y = 77203
|
|
current_city = 90100510
|
|
dlg_binding_area = 90400508
|
|
|
|
elseif npc_id == 6005 then -- Rondo; Leku
|
|
text = 90600502
|
|
text_binding_area = 90600509
|
|
pos_x = 137843
|
|
pos_y = 105078
|
|
current_city = 90100511
|
|
dlg_binding_area = 90600508
|
|
|
|
elseif npc_id == 6014 then -- Rondo; Genie
|
|
text = 90601402
|
|
text_binding_area = 90600509
|
|
pos_x = 137843
|
|
pos_y = 105078
|
|
current_city = 90100511
|
|
dlg_binding_area = 90600508
|
|
|
|
elseif npc_id == 7005 then -- Rondo; Yurie
|
|
text = 90700502
|
|
text_binding_area = 90600509
|
|
pos_x = 137843
|
|
pos_y = 105078
|
|
current_city = 90100511
|
|
dlg_binding_area = 90600508
|
|
|
|
elseif npc_id == 7033 then -- City of Ruins; Igan
|
|
text = 90703302
|
|
text_binding_area = 90703308
|
|
pos_x = 152634
|
|
pos_y = 151508
|
|
current_city = 90010151
|
|
dlg_binding_area = 90703307
|
|
|
|
end
|
|
|
|
if is_auto_user() == true then -- If player is punished, he can not use teleportation services
|
|
text = 37100001 -- You are currently in our blacklist. Consider changing your behavior
|
|
end
|
|
|
|
dlg_title(get_npc_title())
|
|
dlg_text("@"..text)
|
|
|
|
if is_auto_user() == false then -- If player is not punished
|
|
if get_npc_id() ~= 1006 then -- 1006 NPC locates in Lower Laksy
|
|
dlg_menu("@"..dlg_binding_area,'BindingArea('..text_binding_area..','..pos_x..','..pos_y..')') -- Return area set
|
|
end
|
|
if get_npc_id() == 1005 or get_npc_id() == 1014 then -- Lower Laksy init
|
|
MenuTeleportInit(90100503,122964,138048,0)
|
|
end
|
|
|
|
TeleportationMenuArea(current_city)
|
|
|
|
local currCitiesFuncTable =
|
|
{
|
|
[90200505] = function() DevaAreaMenu() end,
|
|
[90100506] = function() AsuraAreaMenu() end,
|
|
[90100510] = function() GaiaAreaMenu() end,
|
|
[90100511] = function() RondoAreaMenu() end,
|
|
[90010151] = function() CityOfRuinsAreaMenu() end,
|
|
[90019001] = function() TraineeIslandAreaMenu() end,
|
|
|
|
[90100603] = function()
|
|
DevaAreaMenu()
|
|
MenuTeleportInit(90100603, 6625, 6980, 0)
|
|
end,
|
|
}
|
|
|
|
-- To call the function for the current city:
|
|
local func = currCitiesFuncTable[current_city]
|
|
if func then func() end
|
|
|
|
MenuOwnDungeon()
|
|
end
|
|
|
|
dlg_end()
|
|
end
|
|
|
|
-- Teleport execution: Common function
|
|
function RunTeleport(cost,x_pos,y_pos)
|
|
local gold = gv("gold")
|
|
if gold < cost then
|
|
message("@90010008")
|
|
return
|
|
end
|
|
sv("gold", ( gold - cost ) )
|
|
-- These 2 are required to avoid duplicate issues
|
|
update_gold_chaos()
|
|
save()
|
|
warp(x_pos + math.random(-50,50), y_pos + math.random(-50,50))
|
|
auto_star() -- Automatic star, can be turned on/off manually by a player (only for himself)
|
|
end
|
|
|
|
function TeleportationMenuArea(current_city) -- City Teleportation Menu Core;
|
|
local tTable = { }
|
|
-- Text X_coord Y_coord Price PremiumPrice
|
|
tTable[1] = { 90019001, 172682, 52104, 0, 0 } -- Trainee Island
|
|
tTable[2] = { 90200505, 6625, 6980, 500, 0 } -- Laksy
|
|
tTable[3] = { 90100506, 116835, 58332, 500, 0 } -- Katan
|
|
tTable[4] = { 90100510, 153505, 77276, 500, 0 } -- Horizon
|
|
tTable[5] = { 90100511, 137874, 105078, 50000, 0 } -- Rondo
|
|
tTable[6] = { 90010151, 152943, 151081, 80000, 0 } -- City of Ruins
|
|
tTable[7] = { 90100516, 140101, 102600, 10000, 0 } -- Creature Farm
|
|
tTable[8] = { 90606233, 162990, 116317, 50000, 0 } -- Red Spider Circus Entrance
|
|
|
|
local tTableIndex = #tTable
|
|
MenuTeleport(tTable,tTableIndex,current_city)
|
|
end
|
|
|
|
-- Teleport menu: Add areas except skip_id from the list to the menu
|
|
function MenuTeleport(tTable,tTableIndex,skip_id)
|
|
if skip_id == nil then
|
|
skip_id = 0
|
|
end
|
|
|
|
local price_idx = 0
|
|
if is_premium() then
|
|
price_idx = 5 -- Premium Low Price
|
|
else
|
|
price_idx = 4 -- Normal Price
|
|
end
|
|
for i = 1, tTableIndex do
|
|
if tTable[i][1] ~= skip_id then
|
|
MenuTeleportInit(tTable[i][1], tTable[i][2], tTable[i][3], tTable[i][price_idx])
|
|
end
|
|
end
|
|
end
|
|
|
|
-- Teleport menu: Common function
|
|
function MenuTeleportInit(text,pos_x,pos_y,price)
|
|
local random_x = ( math.random(-50,50) + pos_x )
|
|
local random_y = ( math.random(-50,50) + pos_y )
|
|
dlg_menu(sconv("@"..text,"#@price@#",price),"RunTeleport(" .. price .. "," .. random_x .. "," .. random_y .. ")" )
|
|
end
|
|
|
|
-- Teleport to HV
|
|
function MenuTeleportSecroute()
|
|
if is_auto_user() then
|
|
dlg_text("@37100001")
|
|
elseif is_premium() or has_hv_pass() then
|
|
dlg_menu(sconv("@90101603","#@price@#",0), 'RunTeleport(0,222219,20106)')
|
|
else
|
|
dlg_menu(sconv("@90101603","#@price@#",15000000), 'RunTeleport(15000000,222219,20106)')
|
|
end
|
|
end
|
|
|
|
-- Teleport to Guild Own Dungeon
|
|
function MenuOwnDungeon()
|
|
local dungeon_id = get_own_dungeon_id()
|
|
local dungeon_relation_code = get_dungeon_relation(dungeon_id)
|
|
if get_own_dungeon_id() ~= 0 then
|
|
if ( dungeon_relation_code > 0 and dungeon_relation_code < 5 ) or dungeon_relation_code == 9 then
|
|
dlg_menu("@90010231", 'scf_teleport_to_owned_dungeon()')
|
|
dlg_menu("@90605270", 'scf_teleport_to_owned_secret_dungeon()')
|
|
end
|
|
end
|
|
end
|
|
|
|
-- Teleport to Common Guild Dungeon
|
|
function scf_teleport_to_owned_dungeon()
|
|
local dungeon_id = get_own_dungeon_id()
|
|
local tTable = { }
|
|
-- Dungeon ID X Y
|
|
tTable[1] = { 130400, 132995, 87096 } -- Relics of Arid Moonlight 1
|
|
tTable[2] = { 130700, 130842, 79586 } -- Relics of Arid Moonlight 2
|
|
tTable[3] = { 130000, 155817, 103724 } -- Lost Mines 1
|
|
tTable[4] = { 130600, 152309, 102886 } -- Lost Mines 2
|
|
tTable[5] = { 130300, 103210, 100366 } -- Crystal Valley 1
|
|
tTable[6] = { 130500, 99757, 103236 } -- Crystal Valley 2
|
|
tTable[7] = { 130800, 132969, 127961 } -- The Shrine of Palmir Plateau 1
|
|
tTable[8] = { 130900, 137566, 127813 } -- The Shrine of Palmir Plateau 2
|
|
tTable[9] = { 120700, 146188, 135579 } -- Sanctuary
|
|
tTable[10] = { 121000, 91985, 117044 } -- Temple of the Ancients
|
|
tTable[11] = { 122000, 85720, 118033 } -- Temple of the Lost Souls
|
|
tTable[12] = { 123000, 92027, 124430 } -- Temple of the Exile
|
|
|
|
local tTableIndex = #tTable
|
|
for i = 1, tTableIndex do
|
|
if tTable[tTableIndex][1] == dungeon_id then
|
|
warp( (tTable[tTableIndex][2] + math.random(-50,50)), (tTable[tTableIndex][3] + math.random(-50,50)) )
|
|
auto_star() -- Automatic star, can be turned on/off manually by a player (only for himself)
|
|
end
|
|
end
|
|
|
|
|
|
end
|
|
|
|
-- Teleport to Secret Guild Dungeon
|
|
function scf_teleport_to_owned_secret_dungeon()
|
|
local dungeon_id = get_own_dungeon_id() or 0
|
|
if dungeon_id == 0 or dungeon_id == nil or dungeon_id == '' then return end
|
|
|
|
local ownedSecretDungeonTable = {}
|
|
ownedSecretDungeonTable[130300] = 70101 -- Crystal Valley
|
|
ownedSecretDungeonTable[130500] = 70101 -- Crystal Valley
|
|
|
|
ownedSecretDungeonTable[130800] = 120201 -- Palmir Plateau
|
|
ownedSecretDungeonTable[130900] = 120201 -- Palmir Plateau
|
|
|
|
ownedSecretDungeonTable[120700] = 110101 -- Sanctuary
|
|
|
|
ownedSecretDungeonTable[121000] = 100101 -- Temple of the Ancients
|
|
ownedSecretDungeonTable[122000] = 90101 -- Temple of the Lost Souls
|
|
ownedSecretDungeonTable[123000] = 80101 -- Temple of the Exile
|
|
|
|
warp_to_secret_dungeon(ownedSecretDungeonTable[dungeon_id])
|
|
end
|
|
|
|
-- Laksy Field Teleportation menu
|
|
function DevaAreaMenu()
|
|
local tTable = { }
|
|
-- Text X_coord Y_coord Price PremiumPrice
|
|
tTable[1] = { 90100503, 122964, 138048, 0, 0 } -- Lower Laksy
|
|
tTable[1] = { 90999311, 120718, 143033, 15000, 0 } -- Laksy North Field
|
|
tTable[2] = { 90999312, 131613, 136593, 27000, 0 } -- Laksi East Field
|
|
tTable[3] = { 90100505, 132546, 139965, 35000, 0 } -- Experimental Magic Field
|
|
tTable[4] = { 90700615, 142013, 147483, 63000, 0 } -- Lizardman Habitat
|
|
tTable[5] = { 90100504, 139011, 141396, 61000, 0 } -- Templar Headquarters
|
|
tTable[6] = { 90700614, 142086, 132207, 60000, 0 } -- Siren's Island
|
|
|
|
local tTableIndex = #tTable
|
|
MenuTeleport(tTable,tTableIndex)
|
|
end
|
|
|
|
-- Horizon Field Teleportation Menu
|
|
function GaiaAreaMenu()
|
|
local tTable = { }
|
|
-- Text X_coord Y_coord Price PremiumPrice
|
|
tTable[1] = { 90700620, 139982, 85162, 58000, 0 } -- Wolha Cemetery
|
|
tTable[2] = { 90400503, 138722, 75351, 58000, 0 } -- Dead Spirit's Altar
|
|
tTable[3] = { 90700621, 155533, 85778, 37000, 0 } -- First Valmore Mine
|
|
tTable[4] = { 90999309, 146894, 77650, 31000, 0 } -- Horizon Field
|
|
tTable[5] = { 90999310, 155104, 93975, 61000, 0 } -- Bamboo Woods
|
|
|
|
local tTableIndex = #tTable
|
|
MenuTeleport(tTable,tTableIndex)
|
|
end
|
|
|
|
-- Katan Field Teleportation Menu
|
|
function AsuraAreaMenu()
|
|
local tTable = { }
|
|
-- Text X_coord Y_coord Price PremiumPrice
|
|
tTable[1] = { 90700617, 107700, 76121, 120000, 0 } -- Stag Ruins
|
|
tTable[2] = { 90700618, 124939, 71987, 100000, 0 } -- Mourning Graveyard
|
|
tTable[3] = { 90999300, 124736, 57288, 50000, 0 } -- East of Katan Field
|
|
tTable[4] = { 90999301, 123179, 65374, 180000, 0 } -- Northeast of Katan
|
|
tTable[5] = { 90999302, 109591, 58449, 40000, 0 } -- West of Katan
|
|
tTable[6] = { 90999304, 100576, 82868, 110000, 0 } -- Ceriu Kanyon
|
|
tTable[7] = { 90010263, 113371, 88368, 120000, 0 } -- Ceriu Desert
|
|
tTable[8] = { 90010262, 120236, 72040, 110000, 0 } -- Pyre Site
|
|
local tTableIndex = #tTable
|
|
MenuTeleport(tTable,tTableIndex)
|
|
end
|
|
|
|
-- Rondo Field Teleportation Menu
|
|
function RondoAreaMenu()
|
|
local tTable = { }
|
|
-- Text X_coord Y_coord Price PremiumPrice
|
|
tTable[1] = { 90010171, 128872, 108975, 5000, 0 } -- Rondo Citadel
|
|
tTable[2] = { 90700623, 108976, 103279, 175000, 0 } -- Crystal Mountain
|
|
tTable[3] = { 90700624, 134710, 120610, 75000, 0 } -- Palmir Plateau
|
|
tTable[4] = { 90700625, 150691, 117877, 150000, 0 } -- Pitch Black Woods
|
|
tTable[5] = { 90999005, 96900, 101308, 250000, 0 } -- Crystal Mountain Gate
|
|
tTable[6] = { 90999306, 129250, 94073, 100000, 0 } -- Horizon NW
|
|
tTable[7] = { 90999307, 123635, 103436, 100000, 0 } -- Red Farm
|
|
tTable[8] = { 90999308, 150508, 111503, 100000, 0 } -- Marduka Watchtower
|
|
tTable[9] = { 90999502, 159670, 124498, 100000, 0 } -- Marduka's Realm
|
|
tTable[10] = { 90999503, 125457, 121567, 100000, 0 } -- Coast (Entrance to Veiled Island)
|
|
local tTableIndex = #tTable
|
|
MenuTeleport(tTable,tTableIndex)
|
|
end
|
|
|
|
-- City of Ruins Teleportation Menu
|
|
function CityOfRuinsAreaMenu()
|
|
local tTable = { }
|
|
-- Text X_coord Y_coord Price PremiumPrice
|
|
tTable[1] = { 90610476, 162943, 131365, 90000, 0 } -- Mare Village
|
|
tTable[2] = { 90610477, 153062, 131621, 90000, 0 } -- Marduka Southern Watchtower
|
|
tTable[3] = { 90610478, 146243, 135598, 90000, 0 } -- Waterfall
|
|
tTable[4] = { 90610479, 154476, 152325, 90000, 0 } -- Vestige Island
|
|
tTable[5] = { 90610480, 159650, 124060, 90000, 0 } -- Marduka's Realm Gate
|
|
tTable[6] = { 90610481, 153506, 136821, 90000, 0 } -- Marduka Wadi
|
|
local tTableIndex = #tTable
|
|
MenuTeleport(tTable,tTableIndex)
|
|
end
|
|
|
|
-- Veiled Island Teleportation Menu
|
|
function VeiledIslandAreaMenu()
|
|
local tTable = { }
|
|
-- Text X_coord Y_coord Price PremiumPrice
|
|
tTable[1] = { 90610482, 87534, 140987, 90000, 0 } -- Frozen Coast
|
|
tTable[2] = { 90610483, 93947, 121759, 90000, 0 } -- Frozen Thorn Forest
|
|
tTable[3] = { 90610484, 108074, 117640, 90000, 0 } -- Frozen Marduka Outpost
|
|
tTable[4] = { 90610485, 106923, 122380, 90000, 0 } -- Snowstorm Valley
|
|
tTable[5] = { 90610486, 88991, 121541, 90000, 0 } -- Snowfield Basin
|
|
local tTableIndex = #tTable
|
|
MenuTeleport(tTable,tTableIndex)
|
|
end
|
|
|
|
-- Trainee Island Teleportation Menu
|
|
function TraineeIslandAreaMenu()
|
|
local tTable = { }
|
|
-- Text X_coord Y_coord Price PremiumPrice
|
|
tTable[1] = { 90610683, 168113, 51458, 1000000, 0 } -- Elementary Tutor Camp
|
|
tTable[2] = { 90999503, 175850, 56700, 1000000, 0 } -- Coast
|
|
tTable[3] = { 90610684, 170572, 60573, 3000000, 0 } -- Kenta Valley
|
|
tTable[3] = { 90610685, 175240, 60657, 3000000, 0 } -- Near Navislamia
|
|
local tTableIndex = #tTable
|
|
MenuTeleport(tTable,tTableIndex)
|
|
end
|
|
|
|
-- Info about dungeons owning
|
|
function NPC_DungeonInfo(dungeon_id)
|
|
local pdata = { 130400, 130700, 130000, 130600, 130300, 130500, 130800, 130900, 120700, 121000, 122000, 123000} -- Dungeons IDs
|
|
|
|
if dungeon_id == 0 then
|
|
dlg_text("@90408511")
|
|
else
|
|
local own_guild = get_own_guild_name( dungeon_id )
|
|
local tax_rate = get_tax_rate( dungeon_id )
|
|
local title = sconv("@90408510", "#@own_guild@#" , own_guild , "#@tax_rate@#" , tostring(tax_rate))
|
|
dlg_text("@70" .. dungeon_id .. "|<br>|" .. title)
|
|
end
|
|
|
|
for i = 1, table.getn(pdata) do
|
|
local tid = pdata[i]
|
|
local ouytputText = "#@dungName@# - <#FFFFFF> [ #@ownerName@# ]"
|
|
local ownGuildName = get_own_guild_name(tid)
|
|
local dungeonName = "@70" .. tid
|
|
local text = sconv(ouytputText, "#@dungName@#", dungeonName, "#@ownerName@#", ownGuildName)
|
|
dlg_menu(text,"NPC_DungeonInfo("..tid..")")
|
|
end
|
|
|
|
dlg_end()
|
|
end
|
|
|
|
-- NPC teleportation to dungeons
|
|
function NPC_DungeonTeleportContactInit()
|
|
local npc_id = get_npc_id()
|
|
local tTable = { }
|
|
dlg_title(get_npc_title())
|
|
if is_auto_user() then
|
|
dlg_text("@37100001")
|
|
else
|
|
dlg_text("@90606127")
|
|
dlg_menu("@9569","NPC_DungeonInfo(0)") -- Dungeon owning guild info
|
|
-- Text X_coord Y_coord Price PremiumPrice
|
|
tTable[1] = { 90606128, 132995, 87096, 10000, 0 } -- Relics of Arid Moonlight 1
|
|
tTable[2] = { 90606129, 130842, 79586, 10000, 0 } -- Relics of Arid Moonlight 2
|
|
tTable[3] = { 90606130, 155933, 103711, 50000, 0 } -- Lost Mines 1
|
|
tTable[4] = { 90606131, 152309, 102886, 50000, 0 } -- Lost Mines 2
|
|
tTable[5] = { 90606132, 103210, 100366, 50000, 0 } -- Crystal Valley 1
|
|
tTable[6] = { 90606133, 99757, 103236, 50000, 0 } -- Crystal Valley 2
|
|
tTable[7] = { 90606134, 132969, 127961, 50000, 0 } -- The Shrine of Palmir Plateau 1
|
|
tTable[8] = { 90606135, 137566, 127813, 50000, 0 } -- The Shrine of Palmir Plateau 2
|
|
tTable[9] = { 90606136, 146188, 135579, 150000, 0 } -- Sanctuary
|
|
tTable[10] = { 90606137, 91958, 117044, 150000, 0 } -- Temple of the Ancients
|
|
tTable[11] = { 90606138, 85720, 118033, 150000, 0 } -- Temple of the Lost Souls
|
|
tTable[12] = { 90606139, 92246, 124628, 150000, 0 } -- Temple of the Exile
|
|
tTable[13] = { 90606140, 98965, 129204, 200000, 0 } -- Labyrinth
|
|
tTable[14] = { 90606607, 38300, 118300, 90000, 0 } -- Red Spider Circus Entrance
|
|
tTable[15] = { 90610407, 108660, 76468, 500000, 0 } -- Remains of the Ancients
|
|
tTable[16] = { 90610408, 98529, 127391, 500000, 0 } -- Devildom
|
|
local tTableIndex = #tTable
|
|
MenuTeleport(tTable,tTableIndex)
|
|
MenuOwnDungeon()
|
|
|
|
dlg_menu("[TODO: String ID] NewDungeons", "new_dungeons_list()") -- <#B42DF3>New Locations
|
|
dlg_menu("[TODO: String ID] HiddenDungeons", "hidden_dungeons_list()") -- Hidden dungeons list
|
|
dlg_menu("[TODO: String ID] FarmZones", "farm_zones_list()") -- Farm zones
|
|
end
|
|
dlg_end()
|
|
end
|
|
|
|
function new_dungeons_list()
|
|
local npc_id = get_npc_id()
|
|
local tTable = { }
|
|
dlg_title(get_npc_title())
|
|
if is_auto_user() then
|
|
dlg_text("@37100001")
|
|
else
|
|
dlg_text("@90606127")
|
|
-- Text X_coord Y_coord Price PremiumPrice
|
|
tTable[1] = { 90606128, 132995, 87096, 10000, 0 } -- Relics of Arid Moonlight 1
|
|
end
|
|
|
|
local tTableIndex = #tTable
|
|
MenuTeleport(tTable,tTableIndex)
|
|
dlg_end()
|
|
end
|
|
|
|
function hidden_dungeons_list()
|
|
local tTable = { }
|
|
dlg_title(get_npc_title())
|
|
dlg_text("@90606127")
|
|
-- Text X_coord Y_coord Price PremiumPrice
|
|
tTable[1] = { 70070101, 121934, 24410, 20000, 10000 } -- Secret Crystal Valley
|
|
tTable[2] = { 70120201, 195147, 33220, 30000, 20000 } -- Secret Shrine of Palmir Plateau
|
|
tTable[3] = { 70110101, 189945, 20146, 2000000, 1000000 } -- Secret Sanctuary
|
|
tTable[4] = { 70100101, 169141, 22684, 8000000, 6000000 } -- Secret TOA
|
|
tTable[5] = { 70090101, 153017, 22509, 8000000, 6000000 } -- Secret TOLS
|
|
tTable[6] = { 70080101, 136888, 22494, 8000000, 6000000 } -- Secret TOE
|
|
|
|
local tTableIndex = #tTable
|
|
MenuTeleport(tTable,tTableIndex)
|
|
dlg_end()
|
|
end
|
|
|
|
-- List of all farm zones teleports
|
|
function farm_zones_list()
|
|
dlg_title(get_npc_title())
|
|
dlg_text("@90606127")
|
|
|
|
local tTable = {}
|
|
-- Text X_coord Y_coord Price PremiumPrice
|
|
tTable[1] = { 70070812, 120343, 132180, 5000, 0 } -- 35 lvl zone [ Laksy Champion Field 4 ]
|
|
tTable[2] = { 70080508, 140723, 94741, 12500, 1000 } -- 50 lvl zone [ Bloody Moon Champion Field 1 ]
|
|
tTable[2] = { 70080708, 134260, 116857, 52500, 30000 } -- 70 lvl zone [ Palmir Plateau Champion Field 2 ]
|
|
tTable[3] = { 70080805, 141249, 138315, 100000, 75000 } -- 80 lvl zone [ Templar Champion Field ]
|
|
tTable[4] = { 70100804, 167347, 133756, 300000, 150000 } -- 90 lvl zone [ Mare Champion Field ]
|
|
tTable[5] = { 70090800, 152803, 129683, 750000, 320000 } -- 100 lvl zone [ Marduka's Realm ]
|
|
tTable[6] = { 70090804, 146673, 135607, 1500000, 1000000 } -- 120 lvl zone [ The Waterfall ]
|
|
tTable[7] = { 70090902, 148969, 153399, 15000000, 2500000 } -- 140 lvl zone [ Vestige Valley ]
|
|
tTable[8] = { 70050603, 93747, 97910, 30000000, 5000000 } -- 150 lvl zone [ Crystal Mountain Summit ]
|
|
|
|
local tTableIndex = #tTable
|
|
MenuTeleport(tTable,tTableIndex)
|
|
dlg_end()
|
|
end
|
|
|
|
function NPC_TeleportTown_contact_secroute_init()
|
|
local npc_id = get_npc_id()
|
|
local text
|
|
|
|
if npc_id == 11237 then -- Teleporter Faerrah
|
|
text = 90999705
|
|
elseif npc_id == 11238 then -- Teleporter M.J.
|
|
text = 90700602
|
|
end
|
|
|
|
if is_auto_user() == true then -- If player is punished, he can not use teleportation services
|
|
text = 37100001 -- You are currently in our blacklist. Consider changing your behavior
|
|
elseif is_premium() or has_hv_pass() then
|
|
text = 90700118
|
|
end
|
|
|
|
dlg_start()
|
|
dlg_text("@" .. text)
|
|
|
|
if is_auto_user() == false then
|
|
MenuOwnDungeon()
|
|
if npc_id == 11238 then
|
|
if is_premium() or has_hv_pass() then
|
|
dlg_menu("@90700613", "sRoute_tpcore(1)") -- Deva Area
|
|
dlg_menu("@90700616", "sRoute_tpcore(2)") -- Katan Area
|
|
dlg_menu("@90700619", "sRoute_tpcore(3)") -- Horizon Area
|
|
dlg_menu("@90700622", "sRoute_tpcore(4)") -- Rondo Area
|
|
dlg_menu("@90610474", "sRoute_tpcore(5)") -- City of Ruins Area
|
|
dlg_menu("@90610475", "sRoute_tpcore(6)") -- Veiled Island
|
|
dlg_menu("@70100300", "sRoute_tpcore(7)") -- Trainee Islan
|
|
end
|
|
else
|
|
TeleportationMenuArea(0) -- Cities Teleportation Menu
|
|
end
|
|
end
|
|
dlg_end()
|
|
end
|
|
|
|
function sRoute_tpcore(id)
|
|
local areasTable = {}
|
|
areasTable[1] = DevaAreaMenu
|
|
areasTable[2] = AsuraAreaMenu
|
|
areasTable[3] = GaiaAreaMenu
|
|
areasTable[4] = RondoAreaMenu
|
|
areasTable[5] = CityOfRuinsAreaMenu
|
|
areasTable[6] = VeiledIslandAreaMenu
|
|
areasTable[7] = TraineeIslandAreaMenu
|
|
|
|
dlg_title(get_npc_title())
|
|
dlg_text("@90700602")
|
|
|
|
local fn = areasTable[id]
|
|
|
|
if fn then
|
|
fn()
|
|
else
|
|
private_notice("[Error] Unknown sRoute_tpcore ID: " .. id)
|
|
end
|
|
|
|
dlg_end()
|
|
end
|
|
|
|
-- GM Location NPC
|
|
function NPC_TeleportTown_GM_contact()
|
|
dlg_title(get_npc_title())
|
|
if gv("permission") == 100 then
|
|
dlg_text("I can teleport you everywhere")
|
|
TeleportationMenuArea(0)
|
|
dlg_menu("@90700613","sRoute_tpcore(1)") -- Deva Area
|
|
dlg_menu("@90700616","sRoute_tpcore(2)") -- Katan Area
|
|
dlg_menu("@90700619","sRoute_tpcore(3)") -- Horizon Area
|
|
dlg_menu("@90700622","sRoute_tpcore(4)") -- Rondo Area
|
|
dlg_menu("@90610474","sRoute_tpcore(5)") -- City of Ruins Area
|
|
dlg_menu("@90610475","sRoute_tpcore(6)") -- Veiled Island
|
|
dlg_menu("@70100300","sRoute_tpcore(7)") -- Trainee Island
|
|
MenuOwnDungeon()
|
|
end
|
|
dlg_end()
|
|
end
|
|
|
|
|
|
-- Hidden Village teleporter NPC
|
|
function NPC_TeleportSecroute_Town_contact()
|
|
dlg_start()
|
|
|
|
dlg_text("@90101602")
|
|
MenuTeleportSecroute()
|
|
dlg_menu("@90101611","NPC_TeleportSecroute_Town_sub(1)")
|
|
dlg_menu("@90101613","NPC_TeleportSecroute_Town_sub(2)")
|
|
|
|
dlg_end()
|
|
end
|
|
|
|
function NPC_TeleportSecroute_Town_sub( selected_option )
|
|
local secrouteText = {}
|
|
secrouteText[1] = "@90101612"
|
|
secrouteText[2] = "@90101614"
|
|
dlg_title(get_npc_title())
|
|
dlg_text(selected_option)
|
|
dlg_end()
|
|
end
|
|
|
|
function Teleport_channel( channel_id )
|
|
private_notice("function Teleport_channel( channel_id ) [report this to developers]")
|
|
end
|
|
|
|
function on_channel_set( channel_number )
|
|
private_notice("function on_channel_set( channel_number ) [report this to developers]")
|
|
end
|
|
|
|
-- Entering the Flea Market
|
|
function warp_to_market()
|
|
local gateNum = {}
|
|
gateNum[1] = { 200898 + math.random( 0, 5 ), 72983 + math.random( 0, 5 ) }
|
|
gateNum[2] = { 202322 + math.random( 0, 5 ), 72989 + math.random( 0, 5 ) }
|
|
gateNum[3] = { 201596 + math.random( 0, 5 ), 71744 + math.random( 0, 5 ) }
|
|
|
|
local Gate = math.random(1,3)
|
|
|
|
set_flag('mx', gv('x'))
|
|
set_flag('my', gv('y'))
|
|
|
|
warp(gateNum[Gate][1], gateNum[Gate][2])
|
|
end
|
|
|
|
-- Return back from Flea
|
|
function quit_market()
|
|
local mx = get_flag( 'mx' )
|
|
local my = get_flag( 'my' )
|
|
|
|
if mx == nil or my == nil or mx == 0 or my == 0 or mx == '' or my == '' then
|
|
mx = gv( 'rx' )
|
|
my = gv( 'ry' )
|
|
end
|
|
|
|
del_flag( 'mx' )
|
|
del_flag( 'my' )
|
|
warp( mx + math.random( 0, 10 ), my + math.random( 0, 10 ) )
|
|
end
|
|
|
|
-- Obelisk Contact script (Flea)
|
|
function market_obelisk_tower()
|
|
cprint("To-do later; Flea market obelisk contact script")
|
|
end
|
|
|
|
-- NPC Market owner (Flea Market)
|
|
function NPC_maricat_market_maricat_contact()
|
|
dlg_title(get_npc_title())
|
|
dlg_text("@90999374")
|
|
dlg_menu("@90999375","maricat_talkLink(1)" )
|
|
dlg_menu("@90999377","maricat_talkLink(2)" )
|
|
dlg_menu("@90999379","maricat_talkLink(3)" )
|
|
dlg_end()
|
|
end
|
|
|
|
function maricat_talkLink(id) -- Dialogue with Flea Market Owner
|
|
local responceTable = {}
|
|
responceTable[1] = "@90999376" -- Additional Information 1 Maricat - What is a market?
|
|
responceTable[2] = "@90999378" -- Additional information 2 Maricat - Return to town
|
|
responceTable[3] = "@90999380" -- Additional Information 3 Maricat - What is Maricat?
|
|
|
|
dlg_title(get_npc_title())
|
|
dlg_text_without_quest_menu(responceTable[id])
|
|
dlg_menu("@90010003","NPC_maricat_market_maricat_contact()")
|
|
dlg_end()
|
|
end
|
|
|
|
function NPC_maricat_market_guard_contact() -- Market Guard
|
|
dlg_title(get_npc_title())
|
|
dlg_text("@90999383")
|
|
dlg_menu("@90999384","maricat_guard_talkLink(1)")
|
|
dlg_menu("@90999386","maricat_guard_talkLink(2)")
|
|
dlg_end()
|
|
end
|
|
|
|
function maricat_guard_talkLink(id) -- Dialogue with Flea Market Guard
|
|
local responceTable = {}
|
|
responceTable[1] = "@90999385" -- Additional Information 1 Market Guard - What is Maricat?
|
|
responceTable[2] = "@90999387" -- Additional Information 2 Market Guard - What about Maricat Village?
|
|
|
|
dlg_title(get_npc_title())
|
|
dlg_text_without_quest_menu(responceTable[id])
|
|
dlg_menu("@90010003","NPC_maricat_market_guard_contact()")
|
|
dlg_end()
|
|
end
|
|
|
|
-- Flea Market teleportation dialogue
|
|
function NPC_maricat_market_teleport_contact()
|
|
dlg_start()
|
|
dlg_text("@90999390")
|
|
dlg_menu("@90999405","warp_to_market()") -- Warp to Flea Market function
|
|
dlg_menu("@90999391","maricat_teleport_talkLink(1)") -- What are you doing?
|
|
dlg_menu("@90999393","maricat_teleport_talkLink(2)") -- More info about Flea Market
|
|
dlg_end()
|
|
end
|
|
|
|
function maricat_teleport_talkLink(id)
|
|
local responceTable = {}
|
|
responceTable[1] = "@90999392" -- Additional information 1 Market guide - What is a market guide?
|
|
responceTable[2] = "@90999394" -- Additional Information 2 Market Guide - Free Trade Zone?
|
|
|
|
dlg_title(get_npc_title())
|
|
dlg_text_without_quest_menu(responceTable[id])
|
|
|
|
dlg_menu("@90010003","NPC_maricat_market_teleport_contact()")
|
|
dlg_end()
|
|
end
|
|
|
|
function NPC_TeleportTown_ramadan_contact() -- Ramadan event teleportator contact
|
|
dlg_title(get_npc_title())
|
|
dlg_text("@90605386" )
|
|
dlg_menu("@90605383","warp_to_ramadan()") -- Warp to Ramadan event location function
|
|
dlg_end()
|
|
end
|
|
|
|
function NPC_TeleportTown_warpback_contact() -- Ramadan exit NPC contact
|
|
dlg_title(get_npc_title())
|
|
dlg_text("@90605389")
|
|
dlg_menu("@90605390","quit_ramadan()") -- Warp back
|
|
dlg_end()
|
|
end
|
|
|
|
-- Entering the Ramadan event location
|
|
function warp_to_ramadan()
|
|
set_flag( 'ramdanx', gv('x') )
|
|
set_flag( 'ramdany', gv('y') )
|
|
warp( 24927 + math.random( 0, 50 ), 8778 + math.random( 0, 50 ), 0 )
|
|
end
|
|
|
|
-- Exit from the Ramadan event location
|
|
function quit_ramadan()
|
|
local ramdanx = get_flag('ramdanx')
|
|
local ramdany = get_flag('ramdany')
|
|
if ramdanx == nil or ramdany == nil or ramdanx == 0 or ramdany == 0 or ramdanx == '' or ramdany == '' then
|
|
ramdanx = gv('rx')
|
|
ramdany = gv('ry')
|
|
end
|
|
del_flag('ramdanx')
|
|
del_flag('ramdany')
|
|
warp( ramdanx + math.random( 0, 10 ), ramdany + math.random( 0, 10 ), 0 )
|
|
end |