mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-08 21:44:35 +02:00
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.
This commit is contained in:
parent
8ae4fbc045
commit
324ebab2d2
20 changed files with 1516 additions and 344 deletions
|
@ -6,8 +6,8 @@ DiceCommand Script
|
|||
|
||||
function onEventStarted(player, actor, triggerName, maxNumber)
|
||||
|
||||
if (maxNumber == nil) then
|
||||
maxNumber = 999;
|
||||
if (maxNumber == nil or maxNumber > 1000 or maxNumber < 1) then
|
||||
maxNumber = 100;
|
||||
end
|
||||
|
||||
result = math.random(0, maxNumber);
|
||||
|
|
|
@ -69,7 +69,7 @@ function onEventStarted(player, actor, triggerName, emoteId, unknownArg1, arg2,
|
|||
targetId = 0;
|
||||
end
|
||||
|
||||
if (player:GetState() == 0) then
|
||||
if (player:GetState() == 0 or player:GetState() == 11 or player:GetState() == 13) then
|
||||
emote = emoteTable[emoteId];
|
||||
if (emote ~= nil) then
|
||||
player:doEmote(targetId, emote.animId, emote.descId);
|
||||
|
|
|
@ -6,14 +6,100 @@ properties = {
|
|||
description =
|
||||
[[
|
||||
Adds currency <qty> to player or <targetname>
|
||||
!addcurrency <item> <qty> |
|
||||
!addcurrency <item> <qty> <targetname> |
|
||||
Defaults to gil if no item entered
|
||||
!givecurrency <item> <qty> |
|
||||
!givecurrency <item> <qty> <targetname> |
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, currency, qty, name, lastName)
|
||||
currencyItems = {
|
||||
["GIL"] = 1000001,
|
||||
["FIRE_SHARD"] = 1000003,
|
||||
["ICE_SHARD"] = 1000004,
|
||||
["WIND_SHARD"] = 1000005,
|
||||
["EARTH_SHARD"] = 1000006,
|
||||
["LIGHTNING_SHARD"] = 1000007,
|
||||
["WATER_SHARD"] = 1000008,
|
||||
["FIRE_CRYSTAL"] = 1000009,
|
||||
["ICE_CRYSTAL"] = 1000010,
|
||||
["WIND_CRYSTAL"] = 1000011,
|
||||
["EARTH_CRYSTAL"] = 1000012,
|
||||
["LIGHTNING_CRYSTAL"] = 1000013,
|
||||
["WATER_CRYSTAL"] = 1000014,
|
||||
["FIRE_CLUSTER"] = 1000015,
|
||||
["ICE_CLUSTER"] = 1000016,
|
||||
["WIND_CLUSTER"] = 1000017,
|
||||
["EARTH_CLUSTER"] = 1000018,
|
||||
["LIGHTNING_CLUSTER"] = 1000019,
|
||||
["WATER_CLUSTER"] = 1000020,
|
||||
["PUGILISTS_GUILD_MARK"] = 1000101,
|
||||
["GLADIATORS_GUILD_MARK"] = 1000102,
|
||||
["MARAUDERS_GUILD_MARK"] = 1000103,
|
||||
["ARCHERS_GUILD_MARK"] = 1000106,
|
||||
["LANCERS_GUILD_MARK"] = 1000107,
|
||||
["THAUMATURGES_GUILD_MARK"] = 1000110,
|
||||
["CONJURERS_GUILD_MARK"] = 1000111,
|
||||
["CARPENTERS_GUILD_MARK"] = 1000113,
|
||||
["BLACKSMITHS_GUILD_MARK"] = 1000114,
|
||||
["ARMORERS_GUILD_MARK"] = 1000115,
|
||||
["GOLDSMITHS_GUILD_MARK"] = 1000116,
|
||||
["LEATHERWORKERS_GUILD_MARK"] = 1000117,
|
||||
["WEAVERS_GUILD_MARK"] = 1000118,
|
||||
["ALCHEMISTS_GUILD_MARK"] = 1000119,
|
||||
["CULINARIANS_GUILD_MARK"] = 1000120,
|
||||
["MINERS_GUILD_MARK"] = 1000121,
|
||||
["BOTANISTS_GUILD_MARK"] = 1000122,
|
||||
["FISHERMENS_GUILD_MARK"] = 1000123,
|
||||
["STORM_SEAL"] = 1000201,
|
||||
["SERPENT_SEAL"] = 1000202,
|
||||
["FLAME_SEAL"] = 1000203,
|
||||
|
||||
["FIRESHARD"] = 1000003,
|
||||
["ICESHARD"] = 1000004,
|
||||
["WINDSHARD"] = 1000005,
|
||||
["EARTHSHARD"] = 1000006,
|
||||
["LIGHTNINGSHARD"] = 1000007,
|
||||
["WATERSHARD"] = 1000008,
|
||||
["FIRECRYSTAL"] = 1000009,
|
||||
["ICECRYSTAL"] = 1000010,
|
||||
["WINDCRYSTAL"] = 1000011,
|
||||
["EARTHCRYSTAL"] = 1000012,
|
||||
["LIGHTNINGCRYSTAL"] = 1000013,
|
||||
["WATERCRYSTAL"] = 1000014,
|
||||
["FIRECLUSTER"] = 1000015,
|
||||
["ICECLUSTER"] = 1000016,
|
||||
["WINDCLUSTER"] = 1000017,
|
||||
["EARTHCLUSTER"] = 1000018,
|
||||
["LIGHTNINGCLUSTER"] = 1000019,
|
||||
["WATERCLUSTER"] = 1000020,
|
||||
["PUGILISTSGUILDMARK"] = 1000101,
|
||||
["GLADIATORSGUILDMARK"] = 1000102,
|
||||
["MARAUDERSGUILDMARK"] = 1000103,
|
||||
["ARCHERSGUILDMARK"] = 1000106,
|
||||
["LANCERSGUILDMARK"] = 1000107,
|
||||
["THAUMATURGESGUILDMARK"] = 1000110,
|
||||
["CONJURERSGUILDMARK"] = 1000111,
|
||||
["CARPENTERSGUILDMARK"] = 1000113,
|
||||
["BLACKSMITHSGUILDMARK"] = 1000114,
|
||||
["ARMORERSGUILDMARK"] = 1000115,
|
||||
["GOLDSMITHSGUILDMARK"] = 1000116,
|
||||
["LEATHERWORKERSGUILDMARK"] = 1000117,
|
||||
["WEAVERSGUILDMARK"] = 1000118,
|
||||
["ALCHEMISTSGUILDMARK"] = 1000119,
|
||||
["CULINARIANSGUILDMARK"] = 1000120,
|
||||
["MINERSGUILDMARK"] = 1000121,
|
||||
["BOTANISTSGUILDMARK"] = 1000122,
|
||||
["FISHERMENSGUILDMARK"] = 1000123,
|
||||
["STORMSEAL"] = 1000201,
|
||||
["SERPENTSEAL"] = 1000202,
|
||||
["FLAMESEAL"] = 1000203,
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, item, qty, name, lastName)
|
||||
local sender = "[givecurrency] ";
|
||||
|
||||
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local worldMaster = GetWorldMaster();
|
||||
|
||||
if name then
|
||||
if lastName then
|
||||
player = GetWorldManager():GetPCInWorld(name.." "..lastName) or nil;
|
||||
|
@ -23,20 +109,30 @@ function onTrigger(player, argc, currency, qty, name, lastName)
|
|||
end;
|
||||
|
||||
if player then
|
||||
currency = tonumber(currency) or nil;
|
||||
if not currencyItems[string.upper(item)] then
|
||||
player:SendMessage(messageID, sender, "Invalid parameter for item.");
|
||||
return;
|
||||
else
|
||||
item = currencyItems[string.upper(item)];
|
||||
end
|
||||
|
||||
qty = tonumber(qty) or 1;
|
||||
location = INVENTORY_CURRENCY;
|
||||
|
||||
local invCheck = player:getInventory(location):AddItem(item, qty, 1);
|
||||
|
||||
local added = player:GetInventory(location):AddItem(currency, qty, 1);
|
||||
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local message = "unable to add currency";
|
||||
|
||||
if currency and added then
|
||||
message = string.format("added currency %u to %s", currency, player:GetName());
|
||||
if (invCheck == INV_ERROR_FULL) then
|
||||
-- Your inventory is full.
|
||||
player:SendGameMessage(player, worldMaster, 60022, messageID);
|
||||
elseif (invCheck == INV_ERROR_ALREADY_HAS_UNIQUE) then
|
||||
-- You cannot have more than one <itemId> <quality> in your possession at any given time.
|
||||
player:SendGameMessage(player, worldMaster, 40279, messageID, item, 1);
|
||||
elseif (invCheck == INV_ERROR_SYSTEM_ERROR) then
|
||||
player:SendMessage(MESSAGE_TYPE_SYSTEM, "", "[DEBUG] Server Error on adding item.");
|
||||
elseif (invCheck == INV_ERROR_SUCCESS) then
|
||||
message = string.format("Added item %s to location %s to %s", item, location, player:GetName());
|
||||
player:SendMessage(MESSAGE_TYPE_SYSTEM, "", message);
|
||||
player:SendGameMessage(player, worldMaster, 25246, messageID, item, qty);
|
||||
end
|
||||
player:SendMessage(messageID, sender, message);
|
||||
print(message);
|
||||
else
|
||||
print(sender.."unable to add currency, ensure player name is valid.");
|
||||
end;
|
||||
end
|
||||
end;
|
|
@ -15,7 +15,7 @@ Adds <item> <qty> to <location> for player or <targetname>.
|
|||
function onTrigger(player, argc, item, qty, location, name, lastName)
|
||||
local sender = "[giveitem] ";
|
||||
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local message = string.format("Unable to add item %u", item);
|
||||
local worldMaster = GetWorldMaster();
|
||||
|
||||
if name then
|
||||
if lastName then
|
||||
|
@ -27,10 +27,16 @@ function onTrigger(player, argc, item, qty, location, name, lastName)
|
|||
|
||||
if player then
|
||||
item = tonumber(item) or nil;
|
||||
|
||||
if not item then
|
||||
player:SendMessage(messageID, sender, "Invalid parameter for item.");
|
||||
return;
|
||||
end
|
||||
|
||||
qty = tonumber(qty) or 1;
|
||||
|
||||
if location then
|
||||
location = tonumber(location) or _G[string.upper(location)];
|
||||
location = _G[string.upper(location)];
|
||||
|
||||
if not location then
|
||||
player:SendMessage(messageID, sender, "Unknown item location.");
|
||||
|
@ -40,16 +46,22 @@ function onTrigger(player, argc, item, qty, location, name, lastName)
|
|||
location = INVENTORY_NORMAL;
|
||||
end;
|
||||
|
||||
local added = player:getInventory(location):addItem(item, qty, 1);
|
||||
|
||||
if added then
|
||||
message = string.format("Added item %u of kind %u to %s", item, location, player:GetName());
|
||||
end;
|
||||
else
|
||||
print(sender.."[giveitem] Unable to add item, ensure player name is valid.");
|
||||
return;
|
||||
end;
|
||||
|
||||
player:SendMessage(messageID, sender, message);
|
||||
print(message);
|
||||
local invCheck = player:getInventory(location):AddItem(item, qty, 1);
|
||||
|
||||
if (invCheck == INV_ERROR_FULL) then
|
||||
-- Your inventory is full.
|
||||
player:SendGameMessage(player, worldMaster, 60022, messageID);
|
||||
elseif (invCheck == INV_ERROR_ALREADY_HAS_UNIQUE) then
|
||||
-- You cannot have more than one <itemId> <quality> in your possession at any given time.
|
||||
player:SendGameMessage(player, worldMaster, 40279, messageID, item, 1);
|
||||
elseif (invCheck == INV_ERROR_SYSTEM_ERROR) then
|
||||
player:SendMessage(MESSAGE_TYPE_SYSTEM, "", "[DEBUG] Server Error on adding item.");
|
||||
elseif (invCheck == INV_ERROR_SUCCESS) then
|
||||
message = string.format("Added item %s to location %s to %s", item, location, player:GetName());
|
||||
player:SendMessage(MESSAGE_TYPE_SYSTEM, "", message);
|
||||
player:SendGameMessage(player, worldMaster, 25246, messageID, item, qty);
|
||||
end
|
||||
end
|
||||
|
||||
end;
|
|
@ -13,7 +13,18 @@ Positions your character forward a set <distance>, defaults to 5 yalms.
|
|||
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, distance, vertical)
|
||||
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];
|
||||
|
@ -21,37 +32,69 @@ function onTrigger(player, argc, distance, vertical)
|
|||
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] ";
|
||||
|
||||
if distance == nil then
|
||||
distance = 5
|
||||
end;
|
||||
|
||||
local px = x - distance * math.cos(angle);
|
||||
local pz = z + distance * math.sin(angle);
|
||||
local message = string.format("Positioning forward %u yalms.", distance);
|
||||
local worldManager = GetWorldManager();
|
||||
local distance = 5;
|
||||
local direction = 0;
|
||||
|
||||
local checkArg1 = tonumber(arg1);
|
||||
local checkArg2 = tonumber(arg2);
|
||||
|
||||
if argc == 1 then
|
||||
worldManager:DoPlayerMoveInZone(player, px, y, pz, rot, 0x0);
|
||||
player:SendMessage(messageID, sender, message);
|
||||
elseif argc == 2 then
|
||||
if vertical == "up" or vertical == "u" or vertical == "+" then
|
||||
y = y + distance;
|
||||
message = string.format("Positioning up %u yalms.", distance);
|
||||
worldManager:DoPlayerMoveInZone(player, x, y, z, rot, 0x0);
|
||||
player:SendMessage(messageID, sender, message);
|
||||
elseif vertical == "down" or vertical == "d" or vertical == "-" then
|
||||
y = y - distance;
|
||||
message = string.format("Positioning down %u yalms.", distance);
|
||||
worldManager:DoPlayerMoveInZone(player, x, y, z, rot, 0x0);
|
||||
player:SendMessage(messageID, sender, message);
|
||||
else
|
||||
player:SendMessage(messageID, sender, "Unknown parameters! Usage: \n"..properties.description);
|
||||
end;
|
||||
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
|
||||
worldManager:DoPlayerMoveInZone(player, px, y, pz, rot, 0x0);
|
||||
player:SendMessage(messageID, sender, message);
|
||||
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;
|
||||
|
|
124
data/scripts/commands/gm/quest.lua
Normal file
124
data/scripts/commands/gm/quest.lua
Normal file
|
@ -0,0 +1,124 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "ssss",
|
||||
description =
|
||||
[[
|
||||
Add/Remove Quests, modify <phase> and <flag 0-32>.
|
||||
!quest add/remove <quest> |
|
||||
!quest phase <quest> <phase> |
|
||||
!quest flag <quest> <flag> true/false |
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, command, var1, var2, var3)
|
||||
|
||||
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local sender = "[quest] ";
|
||||
local message = "Error";
|
||||
|
||||
if player then
|
||||
if argc == 2 then
|
||||
if command == "add" or command == "give" or command == "+" then
|
||||
if tonumber(var1) then
|
||||
if player:HasQuest(tonumber(var1)) == false then
|
||||
player:AddQuest(tonumber(var1));
|
||||
message = ("adding quest "..var1);
|
||||
else
|
||||
message = ("already have quest "..var1);
|
||||
end
|
||||
else
|
||||
if player:HasQuest(var1) == false then
|
||||
player:AddQuest(var1);
|
||||
message = ("adding quest "..var1);
|
||||
else
|
||||
message = ("already have quest "..var1);
|
||||
end
|
||||
end
|
||||
|
||||
elseif command == "remove" or command == "delete" or command == "-" then
|
||||
if tonumber(var1) and player:HasQuest(tonumber(var1)) == true then
|
||||
player:RemoveQuestByQuestId(tonumber(var1));
|
||||
message = ("removing quest "..var1);
|
||||
else
|
||||
if player:HasQuest(var1) == true then
|
||||
q2 = GetStaticActor(var1);
|
||||
|
||||
if q2 ~= nil then
|
||||
q3 = q2.actorId;
|
||||
message = ("removing quest "..var1);
|
||||
printf(q3);
|
||||
q4 = bit32.band(q3, 0xA0F00000);
|
||||
printf(q4);
|
||||
|
||||
--player:RemoveQuest(quest.actorName);
|
||||
end
|
||||
else
|
||||
message = ("remove error: either incorrect ID or quest "..var1.." isn't active on character");
|
||||
end
|
||||
end
|
||||
else
|
||||
message = ("error: command "..command.." not recognized");
|
||||
end
|
||||
|
||||
elseif argc == 3 then
|
||||
if command == "phase" or command == "step" then
|
||||
if (tonumber(var1) and tonumber(var2)) ~= nil then
|
||||
if player:HasQuest(tonumber(var1)) == true then
|
||||
player:GetQuest(tonumber(var1)):NextPhase(tonumber(var2));
|
||||
message = ("changing phase of quest "..var1.." to "..var2);
|
||||
else
|
||||
message = ("phase error: either incorrect ID or quest "..var1.." isn't active on character");
|
||||
end
|
||||
else
|
||||
message = ("error: invalid parameters used");
|
||||
end
|
||||
else
|
||||
message = ("error: command "..command.." not recognized");
|
||||
end;
|
||||
|
||||
elseif argc == 4 then
|
||||
if command == "flag" then
|
||||
if tonumber(var1) and (tonumber(var2) >= 0 and tonumber(var2) <= 32) then
|
||||
questvar = tonumber(var1);
|
||||
flagvar = (tonumber(var2));
|
||||
boolvar = 0;
|
||||
|
||||
if var3 == "true" or var3 == "1" or var3 == "on" then
|
||||
boolvar = true;
|
||||
elseif var3 == "false" or var3 == "0" or var3 == "off" then
|
||||
boolvar = false;
|
||||
elseif var3 == "flip" or var3 == "toggle" then
|
||||
if player:HasQuest(questvar) == true then
|
||||
boolvar = not player:GetQuest(questvar):GetQuestFlag(flagvar);
|
||||
end
|
||||
else
|
||||
message = ("error: flag: boolean not recognized");
|
||||
print(sender..message);
|
||||
return;
|
||||
end
|
||||
|
||||
var4 = player:GetQuest(questvar):GetQuestFlag(flagvar);
|
||||
|
||||
if var4 ~= boolvar then
|
||||
player:GetQuest(questvar):SetQuestFlag(flagvar, boolvar);
|
||||
player:GetQuest(questvar):SaveData();
|
||||
if boolvar == true then
|
||||
message = ("changing flag "..tonumber(var2).." to true on quest "..questvar);
|
||||
else
|
||||
message = ("changing flag "..tonumber(var2).." to false on quest "..questvar);
|
||||
end
|
||||
else
|
||||
message = ("error: flag "..flagvar.." is already set to that state on quest "..questvar);
|
||||
end
|
||||
else
|
||||
message = ("error: command "..command.." not recognized");
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
player:SendMessage(messageID, sender, message);
|
||||
print(sender..message);
|
||||
end
|
|
@ -13,24 +13,20 @@ Set movement speed for player. Enter no value to reset to default.
|
|||
}
|
||||
|
||||
function onTrigger(player, argc, stop, walk, run)
|
||||
|
||||
if argc == 1 then
|
||||
s = 0;
|
||||
w = (tonumber(stop) / 2);
|
||||
r = tonumber(stop);
|
||||
player:ChangeSpeed(s, w, r);
|
||||
player:SendMessage(MESSAGE_TYPE_SYSTEM_ERROR, "[speed]", string.format("Speed set to 0/%u/%u", w,r));
|
||||
elseif argc == 3 then
|
||||
stop = tonumber(stop) or 0;
|
||||
walk = tonumber(walk) or 2;
|
||||
run = tonumber(run) or 5;
|
||||
if argc == 3 then
|
||||
player:ChangeSpeed(stop, walk, run, run);
|
||||
elseif argc == 1 then
|
||||
player:ChangeSpeed(0, stop/2, stop, stop);
|
||||
else
|
||||
player:ChangeSpeed(0,2,5,5);
|
||||
end
|
||||
end
|
||||
|
||||
local s = tonumber(stop) or 0;
|
||||
local w = tonumber(walk) or 2;
|
||||
local r = tonumber(run) or 5;
|
||||
|
||||
if argc == 1 and tonumber(stop) then
|
||||
w = (tonumber(stop) / 2);
|
||||
player:ChangeSpeed(0, w, s, s);
|
||||
player:SendMessage(MESSAGE_TYPE_SYSTEM_ERROR, "", string.format("[speed] Speed set to 0/%s/%s", w,s));
|
||||
elseif argc == 3 then
|
||||
player:ChangeSpeed(s, w, r, r);
|
||||
player:SendMessage(MESSAGE_TYPE_SYSTEM_ERROR, "", string.format("[speed] Speed set to %s/%s/%s", s,w,r));
|
||||
else
|
||||
player:ChangeSpeed(0, 2, 5, 5);
|
||||
player:SendMessage(MESSAGE_TYPE_SYSTEM_ERROR, "", "[speed] Speed values set to default");
|
||||
end
|
||||
|
||||
end
|
39
data/scripts/commands/gm/warpid.lua
Normal file
39
data/scripts/commands/gm/warpid.lua
Normal file
|
@ -0,0 +1,39 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "s",
|
||||
description = "Teleports to Actor uniqueId's position",
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, uID)
|
||||
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local sender = "[warpid] ";
|
||||
local message = "unable to find actor";
|
||||
local worldManager = GetWorldManager();
|
||||
|
||||
if not player then
|
||||
printf("[Command] [warpid] Player not found!");
|
||||
return;
|
||||
end;
|
||||
|
||||
actor = GetWorldManager():GetActorInWorldByUniqueId(uID);
|
||||
|
||||
if (actor ~= nil) then
|
||||
local actorPos = actor:GetPos();
|
||||
local playerPos = player:GetPos();
|
||||
|
||||
if actorPos[4] == playerPos[4] then
|
||||
worldManager:DoPlayerMoveInZone(player, actorPos[0], actorPos[1], actorPos[2], actorPos[3], 0x00);
|
||||
else
|
||||
worldManager:DoZoneChange(player, actorPos[4], nil, 0, 0x02, actorPos[0], actorPos[1], actorPos[2], actorPos[3]);
|
||||
end
|
||||
|
||||
message = string.format("Moving to %s 's coordinates @ zone %s, %.3f %.3f %.3f ", uID, actorPos[4], actorPos[0], actorPos[1], actorPos[2]);
|
||||
end ;
|
||||
|
||||
player:SendMessage(messageID, sender, message);
|
||||
|
||||
end
|
||||
|
||||
|
63
data/scripts/commands/gm/warpplayer.lua
Normal file
63
data/scripts/commands/gm/warpplayer.lua
Normal file
|
@ -0,0 +1,63 @@
|
|||
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;
|
Loading…
Add table
Add a link
Reference in a new issue