mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-21 04:07:48 +00:00

- AddItem functions to cast INV_ERROR to INT for LUA - Fixed unique item check. It was checking for Rare flag, not EX Scripts : Base - shop.lua : Functions for buying/selling from a variety of shop scripts Commands - EmoteStandardCommand.lua fixed not being able to use emotes when sitting - DiceCommand.lua fixed. No arguments sets default value of 100 as per the ingame description. Max value raised from 999 to 1000. GM Commands - speed.lua fixed when using single argument - nudge.lua fixed sanitizing. Made arguments reversible to allow !nudge up 10 & !nudge 10 up - giveitem.lua added inv_error handling. Need to do to rest of item commands at some point - givecurrency.lua changed to have you enter a regex'd name of item rather than item ID. Eg. "!givecurrency fire_crystal 10". Added inv_error handling to it. - warpplayer.lua added. Moves yourself to name of player, or moves first player to second player - warpid.lua added. For warping to the first instance of an actor's uniqueId the server comes across. - quest.lua added. For adding/adjusting quests for debugging them. Class Scripts - PopulaceBlackMarketeer.lua updated to utilize shop.lua - PopulaceShopSalesman.lua updated to utilize shop.lua - PopulaceCompanyShop.lua updated to utilize shop.lua - PopulaceCompanyBuffer.lua added and documented along with menu layout. Needs working status effect to finish. - PopulaceCompanyGLPublisher.lua added. Mostly documented, barely functional. - PopulaceCompanyGuide.lua added. Documented, fully functional. - PopulaceCompanyOfficer.lua added. Documented. Menus work. Needs GC rank table at some point for documenting GC ranks/seal caps. - PopulaceCompanySupply.lua added and mostly documented. Read-only basic menu flow, static LUA tables used to set it up, will need SQL tables at some point to replace them with. Some guesswork on what menus show since no video reference could be found. - PopulaceGuildShop.lua updated. Mostly documented. Read-only shop menus.
100 lines
3.2 KiB
Lua
100 lines
3.2 KiB
Lua
require("global");
|
|
|
|
properties = {
|
|
permissions = 0,
|
|
parameters = "ss",
|
|
description =
|
|
[[
|
|
Positions your character forward a set <distance>, defaults to 5 yalms.
|
|
!nudge |
|
|
!nudge <distance> |
|
|
!nudge <distance> <up/down> |
|
|
]],
|
|
|
|
}
|
|
|
|
vertical = {
|
|
["UP"] = 1,
|
|
["U"] = 1,
|
|
["+"] = 1,
|
|
["ASCEND"] = 1,
|
|
["DOWN"] = -1,
|
|
["D"] = -1,
|
|
["-"] = -1,
|
|
["DESCEND"] = -1,
|
|
}
|
|
|
|
function onTrigger(player, argc, arg1, arg2)
|
|
local pos = player:GetPos();
|
|
local x = pos[0];
|
|
local y = pos[1];
|
|
local z = pos[2];
|
|
local rot = pos[3];
|
|
local zone = pos[4];
|
|
local angle = rot + (math.pi/2);
|
|
|
|
local worldManager = GetWorldManager();
|
|
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
|
local sender = "[nudge] ";
|
|
local distance = 5;
|
|
local direction = 0;
|
|
|
|
local checkArg1 = tonumber(arg1);
|
|
local checkArg2 = tonumber(arg2);
|
|
|
|
if argc == 1 then
|
|
if checkArg1 then
|
|
distance = checkArg1;
|
|
else
|
|
player:SendMessage(messageID, sender, "Unknown parameters! Usage: \n"..properties.description);
|
|
return;
|
|
end
|
|
elseif argc == 2 then
|
|
if checkArg1 and checkArg2 then -- If both are numbers, just ignore second argument
|
|
distance = checkArg1;
|
|
elseif checkArg1 and not checkArg2 then -- If first is number and second is string
|
|
distance = checkArg1;
|
|
if vertical[string.upper(arg2)] then -- Check vertical direction on string, otherwise throw param error
|
|
direction = vertical[string.upper(arg2)];
|
|
else
|
|
player:SendMessage(messageID, sender, "Unknown parameters! Usage: \n"..properties.description);
|
|
return;
|
|
end
|
|
elseif (not checkArg1) and checkArg2 then -- If first is string and second is number
|
|
distance = checkArg2;
|
|
if vertical[string.upper(arg1)] then -- Check vertical direction on string, otherwise throw param error
|
|
direction = vertical[string.upper(arg1)];
|
|
else
|
|
player:SendMessage(messageID, sender, "Unknown parameters! Usage: \n"..properties.description);
|
|
return;
|
|
end
|
|
else
|
|
player:SendMessage(messageID, sender, "Unknown parameters! Usage: \n"..properties.description);
|
|
return;
|
|
end
|
|
end
|
|
|
|
|
|
|
|
local message = string.format("Positioning forward %s yalms.", distance);
|
|
|
|
if direction == 1 then
|
|
y = y + distance;
|
|
message = string.format("Positioning up %s yalms.", distance);
|
|
worldManager:DoPlayerMoveInZone(player, x, y, z, rot, 0x0);
|
|
elseif direction == -1 then
|
|
y = y - distance;
|
|
message = string.format("Positioning down %s yalms.", distance);
|
|
worldManager:DoPlayerMoveInZone(player, x, y, z, rot, 0x0);
|
|
else
|
|
local px = x - distance * math.cos(angle);
|
|
local pz = z + distance * math.sin(angle);
|
|
if distance < 1 then
|
|
message = string.format("Positioning back %s yalms.", distance);
|
|
end
|
|
worldManager:DoPlayerMoveInZone(player, px, y, pz, rot, 0x0);
|
|
end;
|
|
|
|
player:SendMessage(messageID, sender, message);
|
|
|
|
end;
|