project-meteor-server/data/scripts/commands/gm/warpplayer.lua
CuriousJorge 324ebab2d2 Inventory.cs - GetItemQuantity() added
- 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.
2017-10-09 23:40:38 -04:00

64 lines
2.2 KiB
Lua

require("global");
properties = {
permissions = 0,
parameters = "ssss",
description =
[[
Warps to name of player, or warps first player to second player
<target name> |
<1st target name> <2nd target name>
]],
}
function onTrigger(player, argc, name, lastName, name2, lastName2)
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
local sender = "[warpplayer] ";
if name and lastName then
p1 = GetWorldManager():GetPCInWorld(name.." "..lastName) or nil;
end;
if name2 and lastName2 then
p2 = GetWorldManager():GetPCInWorld(name2.." "..lastName2) or nil;
end;
if not player then
printf("[Command] [warpplayer] Error! No target or player specified!");
return;
end;
local worldManager = GetWorldManager();
if argc == 2 then
if not p1 then
printf("[Command] [warpplayer] Error! Invalid player specified!");
player:SendMessage(messageID, sender, "Error! Invalid player specified!");
return;
else
local pos = p1:GetPos();
worldManager:DoZoneChange(player, pos[4], nil, 0, 0x02, pos[0], pos[1], pos[2], pos[3]);
player:SendMessage(messageID, sender, string.format("Moving to %s %s 's coordinates.", name, lastName));
end;
elseif argc == 4 then;
if not p1 or not p2 then
printf("[Command] [warpplayer] Error! Invalid player specified!");
player:SendMessage(messageID, sender, "Error! Invalid player specified!");
return;
else
local pos = p1:GetPos();
local pos2 = p2:GetPos();
worldManager:DoZoneChange(p1, pos2[4], nil, 0, 0x02, pos2[0], pos2[1], pos2[2], pos2[3]);
player:SendMessage(messageID, sender, string.format("Moving %s %s to %s %s 's coordinates.", name, lastName, name2, lastName2));
p1:SendMessage(messageID, sender, string.format("You are being moved to %s %s 's coordinates.", name2, lastName2));
end;
else
if player then
player:SendMessage(messageID, sender, "Unknown parameters! Usage: "..properties.description);
end;
return;
end;
end;