mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-08 21:44:35 +02:00
Repositioned LaNoscea and Shroud Aetherytes. Linked them up too. Teleporting to one now causes you to appear *near* it, and facing it.
This commit is contained in:
parent
844f21d9a4
commit
9505cd71be
7 changed files with 98 additions and 110 deletions
|
@ -109,5 +109,22 @@ aetheryteChildLinks = {
|
|||
}
|
||||
|
||||
aetheryteTeleportPositions = {
|
||||
[1280002] = {128, 29.97, 45.83, -35.47}
|
||||
[1280001] = {230, -407, 42.5, 337},
|
||||
[1280002] = {128, 29.97, 45.83, -35.47},
|
||||
[1280003] = {129, -991.88, 61.71, -1120.79},
|
||||
[1280004] = {129, -1883.47, 53.77, -1372.68},
|
||||
[1280005] = {130, 1123.29, 45.7, -928.69},
|
||||
[1280006] = {135, -278.181, 77.63, -2260.79},
|
||||
[1280007] = {128, 582.47, 54.52, -1.2},
|
||||
[1280020] = {132, 1343.5, -54.38, -870.84},
|
||||
|
||||
[1280031] = {175, -235, 185, -3.9},
|
||||
[1280033] = {171, 1250.9, 264, -544.2},
|
||||
|
||||
[1280061] = {206, -120, 16, -1332},
|
||||
[1280062] = {150, 288, 4, -543.928},
|
||||
[1280063] = {151, 1702, 20, -862},
|
||||
[1280064] = {152, -1052, 20, -1760},
|
||||
[1280065] = {153, -1566.035, -11.89, -550.51},
|
||||
[1280066] = {154, 734, -12, 1126}
|
||||
}
|
|
@ -21,6 +21,7 @@ eventGLJoin () - Ask to join party leader's leve
|
|||
|
||||
require ("global")
|
||||
require ("aetheryte")
|
||||
require ("utils")
|
||||
|
||||
function init(npc)
|
||||
return false, false, 0, 0;
|
||||
|
@ -29,12 +30,19 @@ end
|
|||
function onEventStarted(player, aetheryte, triggerName)
|
||||
|
||||
aetheryteId = aetheryte:GetActorClassId();
|
||||
parentNode = aetheryteParentLinks[aetheryteId];
|
||||
menuChoice = callClientFunction(player, "eventAetheryteChildSelect", true, aetheryteChildLinks[aetheryteId], 100, 1);
|
||||
parentNode = aetheryteChildLinks[aetheryteId];
|
||||
menuChoice = callClientFunction(player, "eventAetheryteChildSelect", true, parentNode, 100, 1);
|
||||
|
||||
--Teleport
|
||||
if (menuChoice == 2) then
|
||||
printf("%ud", parentNode);
|
||||
destination = aetheryteTeleportPositions[parentNode];
|
||||
|
||||
if (destination ~= nil) then
|
||||
randoPos = getRandomPointInBand(destination[2], destination[4], 3, 5);
|
||||
rotation = getAngleFacing(randoPos.x, randoPos.y, destination[2], destination[4]);
|
||||
GetWorldManager():DoZoneChange(player, destination[1], nil, 0, 2, randoPos.x, destination[3], randoPos.y, rotation);
|
||||
end
|
||||
--Init Levequest
|
||||
elseif (menuChoice == -1) then
|
||||
doLevequestInit(player, aetheryte);
|
||||
|
|
|
@ -25,6 +25,7 @@ eventGLJoin () - Ask to join party leader's leve
|
|||
|
||||
require ("global")
|
||||
require ("aetheryte")
|
||||
require ("utils")
|
||||
|
||||
function init(npc)
|
||||
return false, false, 0, 0;
|
||||
|
@ -38,25 +39,27 @@ function onEventStarted(player, aetheryte, triggerName)
|
|||
local listPosition = 1;
|
||||
local activeChildNodes = {0, 0, 0, 0, 0};
|
||||
|
||||
if (player:HasAetheryteNodeUnlocked(childNodes[1])) then
|
||||
activeChildNodes[listPosition] = childNodes[1];
|
||||
listPosition = listPosition+1;
|
||||
end
|
||||
if (player:HasAetheryteNodeUnlocked(childNodes[2])) then
|
||||
activeChildNodes[listPosition] = childNodes[2];
|
||||
listPosition = listPosition+1;
|
||||
end
|
||||
if (player:HasAetheryteNodeUnlocked(childNodes[3])) then
|
||||
activeChildNodes[listPosition] = childNodes[3];
|
||||
listPosition = listPosition+1;
|
||||
end
|
||||
if (player:HasAetheryteNodeUnlocked(childNodes[4])) then
|
||||
activeChildNodes[listPosition] = childNodes[4];
|
||||
listPosition = listPosition+1;
|
||||
end
|
||||
if (player:HasAetheryteNodeUnlocked(childNodes[5])) then
|
||||
activeChildNodes[listPosition] = childNodes[5];
|
||||
listPosition = listPosition+1;
|
||||
if (childNodes ~= nil) then
|
||||
if (player:HasAetheryteNodeUnlocked(childNodes[1])) then
|
||||
activeChildNodes[listPosition] = childNodes[1];
|
||||
listPosition = listPosition+1;
|
||||
end
|
||||
if (player:HasAetheryteNodeUnlocked(childNodes[2])) then
|
||||
activeChildNodes[listPosition] = childNodes[2];
|
||||
listPosition = listPosition+1;
|
||||
end
|
||||
if (player:HasAetheryteNodeUnlocked(childNodes[3])) then
|
||||
activeChildNodes[listPosition] = childNodes[3];
|
||||
listPosition = listPosition+1;
|
||||
end
|
||||
if (player:HasAetheryteNodeUnlocked(childNodes[4])) then
|
||||
activeChildNodes[listPosition] = childNodes[4];
|
||||
listPosition = listPosition+1;
|
||||
end
|
||||
if (player:HasAetheryteNodeUnlocked(childNodes[5])) then
|
||||
activeChildNodes[listPosition] = childNodes[5];
|
||||
listPosition = listPosition+1;
|
||||
end
|
||||
end
|
||||
|
||||
local showTeleportOptions = true;
|
||||
|
@ -82,6 +85,12 @@ function onEventStarted(player, aetheryte, triggerName)
|
|||
player:SendGameMessage(player, aetheryte, 127, 0x20, 3, 5);
|
||||
--Teleport to Gate
|
||||
elseif (choice > 0) then
|
||||
destination = aetheryteTeleportPositions[activeChildNodes[choice]];
|
||||
if (destination ~= nil) then
|
||||
randoPos = getRandomPointInBand(destination[2], destination[4], 3, 5);
|
||||
rotation = getAngleFacing(randoPos.x, randoPos.y, destination[2], destination[4]);
|
||||
GetWorldManager():DoZoneChange(player, destination[1], nil, 0, 2, randoPos.x, destination[3], randoPos.y, rotation);
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,68 +0,0 @@
|
|||
--[[
|
||||
|
||||
Globals referenced in all of the lua scripts
|
||||
|
||||
--]]
|
||||
|
||||
-- ACTOR STATES
|
||||
|
||||
ACTORSTATE_PASSIVE = 0;
|
||||
ACTORSTATE_DEAD1 = 1;
|
||||
ACTORSTATE_ACTIVE = 2;
|
||||
ACTORSTATE_DEAD2 = 3;
|
||||
ACTORSTATE_SITTING_ONOBJ = 11;
|
||||
ACTORSTATE_SITTING_ONFLOOR = 13;
|
||||
ACTORSTATE_MOUNTED = 15;
|
||||
|
||||
|
||||
-- MESSAGE
|
||||
MESSAGE_TYPE_NONE = 0;
|
||||
MESSAGE_TYPE_SAY = 1;
|
||||
MESSAGE_TYPE_SHOUT = 2;
|
||||
MESSAGE_TYPE_TELL = 3;
|
||||
MESSAGE_TYPE_PARTY = 4;
|
||||
MESSAGE_TYPE_LINKSHELL1 = 5;
|
||||
MESSAGE_TYPE_LINKSHELL2 = 6;
|
||||
MESSAGE_TYPE_LINKSHELL3 = 7;
|
||||
MESSAGE_TYPE_LINKSHELL4 = 8;
|
||||
MESSAGE_TYPE_LINKSHELL5 = 9;
|
||||
MESSAGE_TYPE_LINKSHELL6 = 10;
|
||||
MESSAGE_TYPE_LINKSHELL7 = 11;
|
||||
MESSAGE_TYPE_LINKSHELL8 = 12;
|
||||
|
||||
MESSAGE_TYPE_SAY_SPAM = 22;
|
||||
MESSAGE_TYPE_SHOUT_SPAM = 23;
|
||||
MESSAGE_TYPE_TELL_SPAM = 24;
|
||||
MESSAGE_TYPE_CUSTOM_EMOTE = 25;
|
||||
MESSAGE_TYPE_EMOTE_SPAM = 26;
|
||||
MESSAGE_TYPE_STANDARD_EMOTE = 27;
|
||||
MESSAGE_TYPE_URGENT_MESSAGE = 28;
|
||||
MESSAGE_TYPE_GENERAL_INFO = 29;
|
||||
MESSAGE_TYPE_SYSTEM = 32;
|
||||
MESSAGE_TYPE_SYSTEM_ERROR = 33;
|
||||
|
||||
-- INVENTORY
|
||||
INVENTORY_NORMAL = 0x0000; --Max 0xC8
|
||||
INVENTORY_LOOT = 0x0004; --Max 0xA
|
||||
INVENTORY_MELDREQUEST = 0x0005; --Max 0x04
|
||||
INVENTORY_BAZAAR = 0x0007; --Max 0x0A
|
||||
INVENTORY_CURRENCY = 0x0063; --Max 0x140
|
||||
INVENTORY_KEYITEMS = 0x0064; --Max 0x500
|
||||
INVENTORY_EQUIPMENT = 0x00FE; --Max 0x23
|
||||
INVENTORY_EQUIPMENT_OTHERPLAYER = 0x00F9; --Max 0x23
|
||||
|
||||
--UTILS
|
||||
|
||||
function callClientFunction(player, functionName, ...)
|
||||
player:RunEventFunction(functionName, ...);
|
||||
result = coroutine.yield();
|
||||
return result;
|
||||
end
|
||||
|
||||
function printf(s, ...)
|
||||
if ... then
|
||||
print(s:format(...));
|
||||
else
|
||||
print(s);
|
||||
end;
|
||||
end;
|
|
@ -12,6 +12,7 @@ eventConfirm(isReturn, isInBattle, cityReturnNum, 138821, forceAskReturnOnly)
|
|||
|
||||
require ("global")
|
||||
require ("aetheryte")
|
||||
require ("utils")
|
||||
|
||||
teleportMenuToAetheryte = {
|
||||
[1] = {
|
||||
|
@ -74,8 +75,10 @@ function onEventStarted(player, actor, triggerName, isTeleport)
|
|||
player:SendGameMessage(worldMaster, 34105, 0x20);
|
||||
--Do teleport
|
||||
destination = aetheryteTeleportPositions[teleportMenuToAetheryte[regionChoice][aetheryteChoice]];
|
||||
if (destination ~= nil) then
|
||||
GetWorldManager():DoZoneChange(player, destination[1], nil, 0, 2, destination[2], destination[3], destination[4], 0.0);
|
||||
if (destination ~= nil) then
|
||||
randoPos = getRandomPointInBand(destination[2], destination[4], 3, 5);
|
||||
rotation = getAngleFacing(randoPos.x, randoPos.y, destination[2], destination[4]);
|
||||
GetWorldManager():DoZoneChange(player, destination[1], nil, 0, 2, randoPos.x, destination[3], randoPos.y, rotation);
|
||||
end
|
||||
end
|
||||
player:endEvent();
|
||||
|
@ -93,7 +96,7 @@ function onEventStarted(player, actor, triggerName, isTeleport)
|
|||
--Return to Inn
|
||||
if (player:GetHomePointInn() == 1) then
|
||||
GetWorldManager():DoZoneChange(player, 12);
|
||||
elseif (player:GetHomePointInn() == 3) then
|
||||
elseif (player:GetHomePointInn() == 2) then
|
||||
GetWorldManager():DoZoneChange(player, 13);
|
||||
elseif (player:GetHomePointInn() == 3) then
|
||||
GetWorldManager():DoZoneChange(player, 11);
|
||||
|
@ -102,7 +105,9 @@ function onEventStarted(player, actor, triggerName, isTeleport)
|
|||
--Return to Homepoint
|
||||
destination = aetheryteTeleportPositions[player:GetHomePoint()];
|
||||
if (destination ~= nil) then
|
||||
GetWorldManager():DoZoneChange(player, destination[1], nil, 0, 2, destination[2], destination[3], destination[4], 0.0);
|
||||
randoPos = getRandomPointInBand(destination[2], destination[4], 3, 5);
|
||||
rotation = getAngleFacing(randoPos.x, randoPos.y, destination[2], destination[4]);
|
||||
GetWorldManager():DoZoneChange(player, destination[1], nil, 0, 2, randoPos.x, destination[3], randoPos.y, rotation);
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
18
data/scripts/utils.lua
Normal file
18
data/scripts/utils.lua
Normal file
|
@ -0,0 +1,18 @@
|
|||
--[[
|
||||
|
||||
Helper Utils
|
||||
|
||||
--]]
|
||||
|
||||
function getRandomPointInBand(originX, originY, minRadius, maxRadius)
|
||||
angle = math.random() * math.pi * 2;
|
||||
radius =(math.sqrt(math.random()) * (maxRadius-minRadius)) + minRadius;
|
||||
x = radius * math.cos(angle);
|
||||
y = radius * math.sin(angle);
|
||||
return {x=x+originX,y=y+originY};
|
||||
end
|
||||
|
||||
function getAngleFacing(x, y, targetX, targetY)
|
||||
angle = math.atan2(targetX - x, targetY - y);
|
||||
return angle;
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue