mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-07-27 12:56:07 +02:00
Updated Map Server namespace. Moved all other data folders (www and sql) to data folder. Renamed boot name to Project Meteor.
This commit is contained in:
parent
18ef69f3d1
commit
91549bff7a
1823 changed files with 102704 additions and 901 deletions
15
Data/scripts/commands/gm/addguildleve.lua
Normal file
15
Data/scripts/commands/gm/addguildleve.lua
Normal file
|
@ -0,0 +1,15 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "s",
|
||||
description = "Adds a guildleve by <id>.",
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, glId)
|
||||
if player then
|
||||
player:AddGuildleve(tonumber(glId));
|
||||
else
|
||||
print(sender.."unable to add guildleve, ensure player name is valid.");
|
||||
end;
|
||||
end;
|
29
Data/scripts/commands/gm/addtoparty.lua
Normal file
29
Data/scripts/commands/gm/addtoparty.lua
Normal file
|
@ -0,0 +1,29 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sss",
|
||||
description =
|
||||
[[
|
||||
Adds target to party
|
||||
]]
|
||||
}
|
||||
|
||||
function onTrigger(player, argc)
|
||||
local sender = "[addtoparty] ";
|
||||
|
||||
if player then
|
||||
if player.target then
|
||||
print("hi")
|
||||
local id = player.target.actorId
|
||||
print("hi")
|
||||
player.currentParty:AddMember(id);
|
||||
player.target.currentParty = player.currentParty;
|
||||
print("hi")
|
||||
else
|
||||
print(sender.." no target")
|
||||
end
|
||||
else
|
||||
print(sender.." no player");
|
||||
end;
|
||||
end;
|
30
Data/scripts/commands/gm/ba.lua
Normal file
30
Data/scripts/commands/gm/ba.lua
Normal file
|
@ -0,0 +1,30 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sss",
|
||||
description =
|
||||
[[
|
||||
Adds experience <qty> to player or <targetname>.
|
||||
!giveexp <qty> |
|
||||
!giveexp <qty> <targetname> |
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, animType, modelAnim, effectId)
|
||||
local sender = "[battleaction] ";
|
||||
|
||||
local actor = GetWorldManager():GetActorInWorld(player.currentTarget) or nil;
|
||||
if player and actor then
|
||||
aid = tonumber(animType) or 0
|
||||
mid = tonumber(modelAnim) or 0
|
||||
eid = tonumber(effectId) or 0
|
||||
local id = bit32.lshift(aid, 24);
|
||||
id = bit32.bor(id, bit32.lshift(mid, 12));
|
||||
id = bit32.bor(id, eid)
|
||||
print((tonumber(id)))
|
||||
player:DoBattleAction(30301, id);
|
||||
else
|
||||
print(sender.."unable to add experience, ensure player name is valid.");
|
||||
end;
|
||||
end;
|
41
Data/scripts/commands/gm/delcurrency.lua
Normal file
41
Data/scripts/commands/gm/delcurrency.lua
Normal file
|
@ -0,0 +1,41 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "ssss",
|
||||
description =
|
||||
[[
|
||||
Removes currency <qty> from player or <targetname>
|
||||
!delcurrency <item> <qty> |
|
||||
!delcurrency <item> <qty> <targetname> |
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, currency, qty, name, lastName)
|
||||
local sender = "[delcurrency] ";
|
||||
|
||||
if name then
|
||||
if lastName then
|
||||
player = GetWorldManager():GetPCInWorld(name.." "..lastName) or nil;
|
||||
else
|
||||
player = GetWorldManager():GetPCInWorld(name) or nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
if player then
|
||||
currency = tonumber(currency) or nil;
|
||||
qty = tonumber(qty) or 1;
|
||||
|
||||
local removed = player:GetItemPackage(INVENTORY_CURRENCY):RemoveItem(currency, qty);
|
||||
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local message = "Attempting to remove currency" -- "unable to remove currency";
|
||||
|
||||
if currency and removed then
|
||||
message = string.format("removed currency %u from %s", currency, player:GetName());
|
||||
end
|
||||
player:SendMessage(messageID, sender, message);
|
||||
print(message);
|
||||
else
|
||||
print(sender.."unable to remove currency, ensure player name is valid.");
|
||||
end;
|
||||
end;
|
55
Data/scripts/commands/gm/delitem.lua
Normal file
55
Data/scripts/commands/gm/delitem.lua
Normal file
|
@ -0,0 +1,55 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sssss",
|
||||
description =
|
||||
[[
|
||||
Removes <item> <qty> from <location> for player or <targetname>.
|
||||
!delitem <item> <qty> |
|
||||
!delitem <item> <qty> <location> |
|
||||
!delitem <item> <qty> <location> <targetname> |
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, item, qty, location, name, lastName)
|
||||
local sender = "[delitem] ";
|
||||
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
|
||||
if name then
|
||||
if lastName then
|
||||
player = GetWorldManager():GetPCInWorld(name.." "..lastName) or nil;
|
||||
else
|
||||
player = GetWorldManager():GetPCInWorld(name) or nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
if player then
|
||||
item = tonumber(item) or nil;
|
||||
qty = tonumber(qty) or 1;
|
||||
|
||||
if location then
|
||||
location = tonumber(location) or _G[string.upper(location)];
|
||||
|
||||
if location == nil then
|
||||
player:SendMessage(messageID, sender, "Unknown item location.");
|
||||
return;
|
||||
end;
|
||||
else
|
||||
location = INVENTORY_NORMAL;
|
||||
end;
|
||||
|
||||
local removed = player:GetItemPackage(location):RemoveItem(item, qty);
|
||||
|
||||
if removed then -- RemoveItem() currently returns nothing for verification, this statement can't work
|
||||
message = string.format("Removed item %u of kind %u to %s", item, location, player:GetName());
|
||||
end;
|
||||
else
|
||||
print(sender.."[giveitem] Unable to remove item, ensure player name is valid.");
|
||||
return;
|
||||
end;
|
||||
|
||||
local message = string.format("Attempting to remove item %u of kind %u from %s", item, location, player:GetName());
|
||||
player:SendMessage(messageID, sender, message);
|
||||
print(message);
|
||||
end;
|
42
Data/scripts/commands/gm/delkeyitem.lua
Normal file
42
Data/scripts/commands/gm/delkeyitem.lua
Normal file
|
@ -0,0 +1,42 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "ssss",
|
||||
description =
|
||||
[[
|
||||
Removes <keyitem> from player or <targetname>.
|
||||
!delkeyitem <keyitem> |
|
||||
!delkeyitem <keyitem> <target name> |
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, keyitem, qty, name, lastName)
|
||||
local sender = "[delkeyitem] ";
|
||||
|
||||
if name then
|
||||
if lastName then
|
||||
player = GetWorldManager():GetPCInWorld(name.." "..lastName) or nil;
|
||||
else
|
||||
player = GetWorldManager():GetPCInWorld(name) or nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
if player then
|
||||
keyitem = tonumber(keyitem) or nil;
|
||||
qty = tonumber(qty) or 1;
|
||||
local location = INVENTORY_KEYITEMS;
|
||||
|
||||
local removed = player:GetItemPackage(location):RemoveItem(keyitem, qty);
|
||||
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local message = "Attempting to remove keyitem" -- "unable to remove keyitem";
|
||||
|
||||
if removed then
|
||||
message = string.format("removed keyitem %u from %s", keyitem, player:GetName());
|
||||
end;
|
||||
player:SendMessage(messageID, sender, message);
|
||||
print(message);
|
||||
else
|
||||
print(sender.."unable to remove keyitem, ensure player name is valid.");
|
||||
end;
|
||||
end;
|
16
Data/scripts/commands/gm/despawn.lua
Normal file
16
Data/scripts/commands/gm/despawn.lua
Normal file
|
@ -0,0 +1,16 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "d",
|
||||
description = "Spawns a actor",
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, actorName)
|
||||
|
||||
if (actorName ~= nil) then
|
||||
zone = player:GetZone();
|
||||
actor = zone:DespawnActor(actorName);
|
||||
end
|
||||
|
||||
end;
|
34
Data/scripts/commands/gm/eaction.lua
Normal file
34
Data/scripts/commands/gm/eaction.lua
Normal file
|
@ -0,0 +1,34 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "s",
|
||||
description =
|
||||
[[
|
||||
Equips <commandid> in the first open slot without checking if you can.
|
||||
!eaction <commandid>
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, commandid)
|
||||
local sender = "[eaction] ";
|
||||
|
||||
print(commandid);
|
||||
if name then
|
||||
if lastName then
|
||||
player = GetWorldManager():GetPCInWorld(name.." "..lastName) or nil;
|
||||
else
|
||||
player = GetWorldManager():GetPCInWorld(name) or nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
if player then
|
||||
classid = player:GetCurrentClassOrJob();
|
||||
commandid = tonumber(commandid) or 0;
|
||||
|
||||
local added = player:EquipAbilityInFirstOpenSlot(classid, commandid);
|
||||
|
||||
else
|
||||
print(sender.."unable to add command, ensure player name is valid.");
|
||||
end;
|
||||
end;
|
31
Data/scripts/commands/gm/effect.lua
Normal file
31
Data/scripts/commands/gm/effect.lua
Normal file
|
@ -0,0 +1,31 @@
|
|||
require("global");
|
||||
require("bit32");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "iiii",
|
||||
description =
|
||||
[[
|
||||
effect
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, effectId, magnitude, tick, duration)
|
||||
local messageId = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local sender = "effect";
|
||||
|
||||
if player then
|
||||
player.AddHP(100000);
|
||||
player.DelHP(500);
|
||||
|
||||
effectId = tonumber(effectId) or 223180;
|
||||
magnitude = tonumber(magnitude) or 700;
|
||||
tick = tonumber(tick) or 3;
|
||||
duration = tonumber(duration) or 360;
|
||||
|
||||
while player.statusEffects.HasStatusEffect(effectId) do
|
||||
player.statusEffects.RemoveStatusEffect(effectId);
|
||||
end;
|
||||
player.statusEffects.AddStatusEffect(effectId, magnitude, tick, duration);
|
||||
end;
|
||||
end;
|
35
Data/scripts/commands/gm/endevent.lua
Normal file
35
Data/scripts/commands/gm/endevent.lua
Normal file
|
@ -0,0 +1,35 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "ss",
|
||||
description =
|
||||
[[
|
||||
Passes endEvent() to player or <targetname> to close a script.
|
||||
!endevent |
|
||||
!endevent <targetname> |
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, name, lastName)
|
||||
local sender = "[endevent] ";
|
||||
|
||||
if name then
|
||||
if lastName then
|
||||
player = GetWorldManager():GetPCInWorld(name.." "..lastName) or nil;
|
||||
else
|
||||
player = GetWorldManager():GetPCInWorld(name) or nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local message = "Sending endEvent()";
|
||||
|
||||
if player then
|
||||
player:endEvent();
|
||||
player:SendMessage(messageID, sender, message);
|
||||
print(message);
|
||||
else
|
||||
print(sender.."Sending Event.");
|
||||
end;
|
||||
end;
|
42
Data/scripts/commands/gm/equipactions.lua
Normal file
42
Data/scripts/commands/gm/equipactions.lua
Normal file
|
@ -0,0 +1,42 @@
|
|||
require("global");
|
||||
require("modifiers");
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "s",
|
||||
description =
|
||||
[[
|
||||
equips all your class and job actions
|
||||
]],
|
||||
}
|
||||
|
||||
classToActions = {
|
||||
[2] = { Start = 27100, End = 27119},
|
||||
[3] = { Start = 27140, End = 27159},
|
||||
[4] = { Start = 27180, End = 27199},
|
||||
[7] = { Start = 27220, End = 27239},
|
||||
[8] = { Start = 27260, End = 27279},
|
||||
[22] = { Start = 27300, End = 27319},
|
||||
[23] = { Start = 27340, End = 27359}
|
||||
}
|
||||
|
||||
function onTrigger(player, argc)
|
||||
local messageId = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local sender = "equipactions";
|
||||
|
||||
classId = player.GetClass()
|
||||
|
||||
if classToActions[classId] then
|
||||
s = classToActions[classId].Start
|
||||
e = classToActions[classId].End
|
||||
print('h')
|
||||
for i = 0, 30 do
|
||||
player.UnequipAbility(i, false)
|
||||
end
|
||||
|
||||
for commandid = s, e do
|
||||
if GetWorldManager():GetBattleCommand(commandid) then
|
||||
player:EquipAbilityInFirstOpenSlot(player:GetCurrentClassOrJob(), commandid);
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
138
Data/scripts/commands/gm/givecurrency.lua
Normal file
138
Data/scripts/commands/gm/givecurrency.lua
Normal file
|
@ -0,0 +1,138 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "ssss",
|
||||
description =
|
||||
[[
|
||||
Adds currency <qty> to player or <targetname>
|
||||
Defaults to gil if no item entered
|
||||
!givecurrency <item> <qty> |
|
||||
!givecurrency <item> <qty> <targetname> |
|
||||
]],
|
||||
}
|
||||
|
||||
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;
|
||||
else
|
||||
player = GetWorldManager():GetPCInWorld(name) or nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
if player then
|
||||
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);
|
||||
|
||||
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;
|
35
Data/scripts/commands/gm/giveexp.lua
Normal file
35
Data/scripts/commands/gm/giveexp.lua
Normal file
|
@ -0,0 +1,35 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sss",
|
||||
description =
|
||||
[[
|
||||
Adds experience <qty> to player or <targetname>.
|
||||
!giveexp <qty> |
|
||||
!giveexp <qty> <targetname> |
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, qty, name, lastName)
|
||||
local sender = "[giveexp] ";
|
||||
|
||||
if name then
|
||||
if lastName then
|
||||
player = GetWorldManager():GetPCInWorld(name.." "..lastName) or nil;
|
||||
else
|
||||
player = GetWorldManager():GetPCInWorld(name) or nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
if player then
|
||||
currency = 1000001;
|
||||
qty = tonumber(qty) or 1;
|
||||
location = INVENTORY_CURRENCY;
|
||||
|
||||
actionList = player:AddExp(qty, player.charaWork.parameterSave.state_mainSkill[0], 0);
|
||||
player:DoBattleAction(0, 0, actionList);
|
||||
else
|
||||
print(sender.."unable to add experience, ensure player name is valid.");
|
||||
end;
|
||||
end;
|
42
Data/scripts/commands/gm/givegil.lua
Normal file
42
Data/scripts/commands/gm/givegil.lua
Normal file
|
@ -0,0 +1,42 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sss",
|
||||
description =
|
||||
[[
|
||||
Adds gil <qty> to player or <targetname>.
|
||||
!givegil <qty> |
|
||||
!givegil <qty> <targetname> |
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, qty, name, lastName)
|
||||
local sender = "[givegil] ";
|
||||
|
||||
if name then
|
||||
if lastName then
|
||||
player = GetWorldManager():GetPCInWorld(name.." "..lastName) or nil;
|
||||
else
|
||||
player = GetWorldManager():GetPCInWorld(name) or nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
if player then
|
||||
currency = 1000001;
|
||||
qty = tonumber(qty) or 1;
|
||||
location = INVENTORY_CURRENCY;
|
||||
|
||||
local added = player:GetItemPackage(location):AddItem(currency, qty, 1);
|
||||
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local message = "unable to add gil";
|
||||
|
||||
if currency and added then
|
||||
message = string.format("added %u gil to %s", qty, player:GetName());
|
||||
end
|
||||
player:SendMessage(messageID, sender, message);
|
||||
print(message);
|
||||
else
|
||||
print(sender.."unable to add gil, ensure player name is valid.");
|
||||
end;
|
||||
end;
|
66
Data/scripts/commands/gm/giveitem.lua
Normal file
66
Data/scripts/commands/gm/giveitem.lua
Normal file
|
@ -0,0 +1,66 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sssss",
|
||||
description =
|
||||
[[
|
||||
Adds <item> <qty> to <location> for player or <targetname>.
|
||||
!giveitem <item> <qty> |
|
||||
!giveitem <item> <qty> <location> |
|
||||
!giveitem <item> <qty> <location> <targetname> |
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, item, qty, location, name, lastName)
|
||||
local sender = "[giveitem] ";
|
||||
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local worldMaster = GetWorldMaster();
|
||||
|
||||
if name then
|
||||
if lastName then
|
||||
player = GetWorldManager():GetPCInWorld(name.." "..lastName) or nil;
|
||||
else
|
||||
player = GetWorldManager():GetPCInWorld(name) or nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
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 = _G[string.upper(location)];
|
||||
|
||||
if not location then
|
||||
player:SendMessage(messageID, sender, "Unknown item location.");
|
||||
return;
|
||||
end;
|
||||
else
|
||||
location = INVENTORY_NORMAL;
|
||||
end;
|
||||
|
||||
local invCheck = player:getItemPackage(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;
|
42
Data/scripts/commands/gm/givekeyitem.lua
Normal file
42
Data/scripts/commands/gm/givekeyitem.lua
Normal file
|
@ -0,0 +1,42 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sss",
|
||||
description =
|
||||
[[
|
||||
Adds <keyitem> to player or <targetname>.
|
||||
!giveitem <keyitem> |
|
||||
!giveitem <keyitem> <target name> |
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, keyitem, name, lastName)
|
||||
local sender = "[givekeyitem] ";
|
||||
|
||||
if name then
|
||||
if lastName then
|
||||
player = GetWorldManager():GetPCInWorld(name.." "..lastName) or nil;
|
||||
else
|
||||
player = GetWorldManager():GetPCInWorld(name) or nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
if player then
|
||||
keyitem = tonumber(keyitem) or nil;
|
||||
qty = 1;
|
||||
location = INVENTORY_KEYITEMS;
|
||||
|
||||
local added = player:GetItemPackage(location):AddItem(keyitem, qty, 1);
|
||||
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local message = "unable to add keyitem";
|
||||
|
||||
if keyitem and added then
|
||||
message = string.format("added keyitem %u to %s", keyitem, player:GetName());
|
||||
end
|
||||
player:SendMessage(messageID, sender, message);
|
||||
print(message);
|
||||
else
|
||||
print(sender.."unable to add keyitem, ensure player name is valid.");
|
||||
end;
|
||||
end;
|
41
Data/scripts/commands/gm/graphic.lua
Normal file
41
Data/scripts/commands/gm/graphic.lua
Normal file
|
@ -0,0 +1,41 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sssss",
|
||||
description =
|
||||
[[
|
||||
Changes appearance for equipment with given parameters.
|
||||
!graphic <slot> <wID> <eID> <vID> <vID>
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, slot, wId, eId, vId, cId)
|
||||
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local sender = "[graphic] ";
|
||||
|
||||
slot = tonumber(slot) or 0;
|
||||
wId = tonumber(wId) or 0;
|
||||
eId = tonumber(eId) or 0;
|
||||
vId = tonumber(vId) or 0;
|
||||
cId = tonumber(cId) or 0;
|
||||
|
||||
local actor = GetWorldManager():GetActorInWorld(player.currentTarget) or nil;
|
||||
if player and actor then
|
||||
if player and argc > 0 then
|
||||
|
||||
-- player.appearanceIds[5] = player.achievementPoints;
|
||||
if argc > 2 then
|
||||
actor:GraphicChange(slot, wId, eId, vId, cId);
|
||||
--player.achievementPoints = player.achievementPoints + 1;
|
||||
actor:SendMessage(messageID, sender, string.format("Changing appearance on slot %u", slot));
|
||||
actor:SendMessage(messageID, sender, string.format("points %u", player.appearanceIds[5]));
|
||||
else
|
||||
actor.appearanceIds[slot] = wId;
|
||||
end
|
||||
actor:SendAppearance();
|
||||
else
|
||||
player:SendMessage(messageID, sender, "No parameters sent! Usage: "..properties.description);
|
||||
end;
|
||||
end;
|
||||
end;
|
14
Data/scripts/commands/gm/music.lua
Normal file
14
Data/scripts/commands/gm/music.lua
Normal file
|
@ -0,0 +1,14 @@
|
|||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "s",
|
||||
description =
|
||||
[[
|
||||
Plays music <id> to player.
|
||||
!music <id>
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, music)
|
||||
music = tonumber(music) or 0;
|
||||
player:ChangeMusic(music);
|
||||
end;
|
22
Data/scripts/commands/gm/mypos.lua
Normal file
22
Data/scripts/commands/gm/mypos.lua
Normal file
|
@ -0,0 +1,22 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "",
|
||||
description = "prints your current in-game position (different to map coords)",
|
||||
}
|
||||
|
||||
function onTrigger(player)
|
||||
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 messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local sender = "[mypos] ";
|
||||
local message = string.format("X:%.3f Y:%.3f Z:%.3f (Rotation: %.3f) Zone:%d", x, y, z, rot, zone);
|
||||
|
||||
player:SendMessage(messageID, sender, message);
|
||||
end;
|
100
Data/scripts/commands/gm/nudge.lua
Normal file
100
Data/scripts/commands/gm/nudge.lua
Normal file
|
@ -0,0 +1,100 @@
|
|||
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;
|
28
Data/scripts/commands/gm/playanimation.lua
Normal file
28
Data/scripts/commands/gm/playanimation.lua
Normal file
|
@ -0,0 +1,28 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sss",
|
||||
description =
|
||||
[[
|
||||
Plays animation on target.
|
||||
!playanimation <animType> <modelAnim> <effectId>
|
||||
]],
|
||||
}
|
||||
|
||||
|
||||
function onTrigger(player, argc, animType, modelAnim, effectId)
|
||||
local sender = "[battleaction] ";
|
||||
local actor = GetWorldManager():GetActorInWorld(player.currentTarget) or nil;
|
||||
if player and actor then
|
||||
aid = tonumber(animType) or 0
|
||||
mid = tonumber(modelAnim) or 0
|
||||
eid = tonumber(effectId) or 0
|
||||
local id = bit32.lshift(aid, 24);
|
||||
id = bit32.bor(id, bit32.lshift(mid, 12));
|
||||
id = bit32.bor(id, eid)
|
||||
actor:PlayAnimation(id)
|
||||
else
|
||||
print(sender.."unable to add experience, ensure player name is valid.");
|
||||
end;
|
||||
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
|
32
Data/scripts/commands/gm/reloadzone.lua
Normal file
32
Data/scripts/commands/gm/reloadzone.lua
Normal file
|
@ -0,0 +1,32 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "s",
|
||||
description = "reloads <zone>",
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, zone)
|
||||
if not player and not zone or tonumber(zone) == 0 then
|
||||
printf("No valid zone specified!");
|
||||
return;
|
||||
end;
|
||||
|
||||
local sender = "[reloadzones] ";
|
||||
|
||||
zone = tonumber(zone);
|
||||
|
||||
if player then
|
||||
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
zone = zone or player:GetZoneID();
|
||||
player:SendMessage(messageID, "[reloadzones] ", string.format("Reloading zone: %u", zone));
|
||||
--[[ todo: get this working legit
|
||||
player:GetZone():Clear();
|
||||
player:GetZone():AddActorToZone(player);
|
||||
player:SendInstanceUpdate();
|
||||
]]
|
||||
end;
|
||||
|
||||
GetWorldManager():ReloadZone(zone);
|
||||
printf("%s reloaded zone %u", sender, zone);
|
||||
end;
|
15
Data/scripts/commands/gm/removeguildleve.lua
Normal file
15
Data/scripts/commands/gm/removeguildleve.lua
Normal file
|
@ -0,0 +1,15 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "s",
|
||||
description = "Adds a guildleve by <id>.",
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, glId)
|
||||
if player then
|
||||
player:RemoveGuildleve(tonumber(glId));
|
||||
else
|
||||
print(sender.."unable to add guildleve, ensure player name is valid.");
|
||||
end;
|
||||
end;
|
29
Data/scripts/commands/gm/sendpacket.lua
Normal file
29
Data/scripts/commands/gm/sendpacket.lua
Normal file
|
@ -0,0 +1,29 @@
|
|||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "ssss",
|
||||
description =
|
||||
[[
|
||||
Sends a custom <packet> to player or <targetname>
|
||||
!sendpacket <packet> |
|
||||
!sendpacket <packet> <targetname> |
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, path, name, lastName)
|
||||
local sender = "[sendpacket ]";
|
||||
lastName = lastName or "";
|
||||
path = "./packets/"..path;
|
||||
|
||||
if name then
|
||||
if lastName then
|
||||
player = GetWorldManager():GetPCInWorld(name.." "..lastName) or nil;
|
||||
else
|
||||
player = GetWorldManager():GetPCInWorld(name) or nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
value = tonumber(value) or 0;
|
||||
if player and argc > 0 then
|
||||
player:SendPacket(path)
|
||||
end;
|
||||
end;
|
25
Data/scripts/commands/gm/setappearance.lua
Normal file
25
Data/scripts/commands/gm/setappearance.lua
Normal file
|
@ -0,0 +1,25 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "s",
|
||||
description =
|
||||
[[
|
||||
Changes appearance for equipment with given parameters.
|
||||
!graphic <slot> <wID> <eID> <vID> <vID>
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, appearanceId)
|
||||
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local sender = "[setappearance] ";
|
||||
|
||||
app = tonumber(appearanceId) or 0;
|
||||
player:SendMessage(messageID, sender, string.format("appearance %u", app));
|
||||
|
||||
if player and player.target then
|
||||
player.target.ChangeNpcAppearance(app);
|
||||
player:SendMessage(messageID, sender, string.format("appearance %u", app));
|
||||
end;
|
||||
|
||||
end;
|
21
Data/scripts/commands/gm/setjob.lua
Normal file
21
Data/scripts/commands/gm/setjob.lua
Normal file
|
@ -0,0 +1,21 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sss",
|
||||
description =
|
||||
[[
|
||||
Adds experience <qty> to player or <targetname>.
|
||||
!giveexp <qty> |
|
||||
!giveexp <qty> <targetname> |
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, jobId)
|
||||
local sender = "[setjob] ";
|
||||
|
||||
jobId = tonumber(jobId)
|
||||
if player then
|
||||
player:SetCurrentJob(jobId);
|
||||
end;
|
||||
end;
|
33
Data/scripts/commands/gm/setmaxhp.lua
Normal file
33
Data/scripts/commands/gm/setmaxhp.lua
Normal file
|
@ -0,0 +1,33 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sss",
|
||||
description =
|
||||
[[
|
||||
Sets player or <targetname>'s maximum hp to <hp> and heals them to full.
|
||||
!setmaxhp <hp> |
|
||||
!setmaxhp <hp> <targetname>
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, hp, name, lastName)
|
||||
local sender = "[setmaxhp] ";
|
||||
|
||||
if name then
|
||||
if lastName then
|
||||
player = GetWorldManager():GetPCInWorld(name.." "..lastName) or nil;
|
||||
else
|
||||
player = GetWorldManager():GetPCInWorld(name) or nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
if player then
|
||||
hp = tonumber(hp) or 1;
|
||||
location = INVENTORY_CURRENCY;
|
||||
|
||||
player:hpstuff(hp);
|
||||
else
|
||||
print(sender.."unable to add experience, ensure player name is valid.");
|
||||
end;
|
||||
end;
|
33
Data/scripts/commands/gm/setmaxmp.lua
Normal file
33
Data/scripts/commands/gm/setmaxmp.lua
Normal file
|
@ -0,0 +1,33 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sss",
|
||||
description =
|
||||
[[
|
||||
Sets player or <targetname>'s maximum hp to <hp> and heals them to full.
|
||||
!setmaxhp <hp> |
|
||||
!setmaxhp <hp> <targetname>
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, hp, name, lastName)
|
||||
local sender = "[setmaxhp] ";
|
||||
|
||||
if name then
|
||||
if lastName then
|
||||
player = GetWorldManager():GetPCInWorld(name.." "..lastName) or nil;
|
||||
else
|
||||
player = GetWorldManager():GetPCInWorld(name) or nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
if player then
|
||||
hp = tonumber(hp) or 1;
|
||||
location = INVENTORY_CURRENCY;
|
||||
|
||||
player:hpstuff(hp);
|
||||
else
|
||||
print(sender.."unable to add experience, ensure player name is valid.");
|
||||
end;
|
||||
end;
|
18
Data/scripts/commands/gm/setmod.lua
Normal file
18
Data/scripts/commands/gm/setmod.lua
Normal file
|
@ -0,0 +1,18 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "ss",
|
||||
description =
|
||||
[[
|
||||
Sets a modifier of player
|
||||
!setmod <modId> <modVal> |
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, modId, modVal)
|
||||
local sender = "[setmod] ";
|
||||
local mod = tonumber(modId)
|
||||
local val = tonumber(modVal)
|
||||
player:SetMod(mod, val);
|
||||
end;
|
27
Data/scripts/commands/gm/setnpcls.lua
Normal file
27
Data/scripts/commands/gm/setnpcls.lua
Normal file
|
@ -0,0 +1,27 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "is",
|
||||
description = "Sets a NPC LS' state. Args: npcLSId, <gone|inactive|active|alert>",
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, lsId, state)
|
||||
local id = tonumber(lsId) or 0;
|
||||
|
||||
if (state == "alert") then
|
||||
player:SetNpcLS(id, NPCLS_ALERT);
|
||||
elseif (state == "active") then
|
||||
player:SetNpcLS(id, NPCLS_ACTIVE);
|
||||
elseif (state == "inactive") then
|
||||
player:SetNpcLS(id, NPCLS_INACTIVE);
|
||||
elseif (state == "gone") then
|
||||
player:SetNpcLS(id, NPCLS_GONE);
|
||||
else
|
||||
player:SendMessage(0x20, "", "Invalid state argument");
|
||||
return;
|
||||
end
|
||||
|
||||
player:SendMessage(0x20, "", string.format("NPC LS %d set to %s", id, state));
|
||||
|
||||
end
|
18
Data/scripts/commands/gm/setproc.lua
Normal file
18
Data/scripts/commands/gm/setproc.lua
Normal file
|
@ -0,0 +1,18 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sss",
|
||||
description =
|
||||
[[
|
||||
Adds experience <qty> to player or <targetname>.
|
||||
!giveexp <qty> |
|
||||
!giveexp <qty> <targetname> |
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, procid)
|
||||
local sender = "[giveexp] ";
|
||||
local pid = tonumber(procid)
|
||||
player:SetProc(pid, true);
|
||||
end;
|
24
Data/scripts/commands/gm/setsize.lua
Normal file
24
Data/scripts/commands/gm/setsize.lua
Normal file
|
@ -0,0 +1,24 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "s",
|
||||
description =
|
||||
[[
|
||||
Changes appearance for equipment with given parameters.
|
||||
!graphic <slot> <wID> <eID> <vID> <vID>
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, size)
|
||||
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local sender = "[setappearance] ";
|
||||
|
||||
s = tonumber(size) or 0;
|
||||
|
||||
if player and player.target then
|
||||
player.target.appearanceIds[0] = s;
|
||||
player.target.zone.BroadcastPacketAroundActor(player.target, player.target.CreateAppearancePacket());
|
||||
end;
|
||||
|
||||
end;
|
24
Data/scripts/commands/gm/setstate.lua
Normal file
24
Data/scripts/commands/gm/setstate.lua
Normal file
|
@ -0,0 +1,24 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "s",
|
||||
description =
|
||||
[[
|
||||
Changes appearance for equipment with given parameters.
|
||||
!graphic <slot> <wID> <eID> <vID> <vID>
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, state)
|
||||
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local sender = "[setstate] ";
|
||||
|
||||
local s = tonumber(state);
|
||||
local actor = GetWorldManager():GetActorInWorld(player.currentTarget) or nil;
|
||||
if player and actor then
|
||||
actor:ChangeState(s);
|
||||
wait(0.8);
|
||||
player:SendMessage(0x20, "", "state: "..s);
|
||||
end;
|
||||
end;
|
27
Data/scripts/commands/gm/settp.lua
Normal file
27
Data/scripts/commands/gm/settp.lua
Normal file
|
@ -0,0 +1,27 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sss",
|
||||
description =
|
||||
[[
|
||||
Sets player or <targetname>'s maximum tp to <tp> and heals them to full.
|
||||
!setmaxtp <tp> |
|
||||
!setmaxtp <tp> <targetname>
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, tp)
|
||||
local sender = "[setmaxtp] ";
|
||||
|
||||
|
||||
|
||||
if player then
|
||||
tp = tonumber(tp) or 0;
|
||||
location = INVENTORY_CURRENCY;
|
||||
|
||||
player:SetTP(tp);
|
||||
else
|
||||
print(sender.."unable to add experience, ensure player name is valid.");
|
||||
end;
|
||||
end;
|
43
Data/scripts/commands/gm/spawn.lua
Normal file
43
Data/scripts/commands/gm/spawn.lua
Normal file
|
@ -0,0 +1,43 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "d",
|
||||
description = "Spawns a actor",
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, actorClassId, width, height)
|
||||
|
||||
if (actorClassId == nil) then
|
||||
player:SendMessage(0x20, "", "No actor class id provided.");
|
||||
return;
|
||||
end
|
||||
|
||||
local pos = player:GetPos();
|
||||
local x = pos[0];
|
||||
local y = pos[1];
|
||||
local z = pos[2];
|
||||
local rot = pos[3];
|
||||
local zone = pos[4];
|
||||
|
||||
actorClassId = tonumber(actorClassId);
|
||||
|
||||
if (actorClassId ~= nil) then
|
||||
zone = player:GetZone();
|
||||
local w = tonumber(width) or 0;
|
||||
local h = tonumber(height) or 0;
|
||||
printf("%f %f %f", x, y, z);
|
||||
--local x, y, z = player.GetPos();
|
||||
for i = 0, w do
|
||||
for j = 0, h do
|
||||
actor = zone:SpawnActor(actorClassId, "test", pos[0] + (i - (w / 2) * 3), pos[1], pos[2] + (j - (h / 2) * 3), pos[3]);
|
||||
actor.SetAppearance(1001149)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (actor == nil) then
|
||||
player:SendMessage(0x20, "", "This actor class id cannot be spawned.");
|
||||
end
|
||||
|
||||
end;
|
135
Data/scripts/commands/gm/spawnnpc.lua
Normal file
135
Data/scripts/commands/gm/spawnnpc.lua
Normal file
|
@ -0,0 +1,135 @@
|
|||
require("global");
|
||||
require("modifiers");
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sss",
|
||||
description =
|
||||
[[
|
||||
yolo
|
||||
]],
|
||||
}
|
||||
|
||||
local modelIds =
|
||||
{
|
||||
["titan"] = 2107401,
|
||||
["ifrit"] = 2207302,
|
||||
["ifrithotair"] = 2207310,
|
||||
["nail"] = 2207307,
|
||||
["garuda"] = 2209501,
|
||||
["garudahelper"] = 2209516,
|
||||
["plume"] = 2209502,
|
||||
["monolith"] = 2209506,
|
||||
["mog"] = 2210408,
|
||||
["nael"] = 2210902,
|
||||
["meteor"] = 2210903,
|
||||
["cactuar"] = 2200905,
|
||||
["morbol"] = 2201002,
|
||||
["drake"] = 2202209,
|
||||
["ogre"] = 2202502,
|
||||
["treant"] = 2202801,
|
||||
["couerl"] = 2203203,
|
||||
["wyvern"] = 2203801,
|
||||
["clouddragon"] = 2208101,
|
||||
["golem"] = 2208901,
|
||||
["atomos"] = 2111002,
|
||||
["chimera"] = 2308701,
|
||||
["salamander"] = 2201302,
|
||||
["ahriman"] = 2201704,
|
||||
["rat"] = 9111275,
|
||||
["bat"] = 2104113,
|
||||
["chigoe"] = 2105613,
|
||||
["hedgemole"] = 2105709,
|
||||
["gnat"] = 2200604,
|
||||
["bird"] = 2201208,
|
||||
["puk"] = 2200112,
|
||||
["angler"] = 2204507,
|
||||
["snurble"] = 2204403,
|
||||
["lemur"] = 2200505,
|
||||
["doe"] = 2200303,
|
||||
["hippogryph"] = 2200405,
|
||||
["trap"] = 2202710,
|
||||
["goat"] = 2102312,
|
||||
["dodo"] = 9111263,
|
||||
["imp"] = 2202607,
|
||||
["spriggan"] = 2290036,
|
||||
["cyclops"] = 2210701,
|
||||
["raptor"] = 2200205,
|
||||
["wolf"] = 2201429,
|
||||
["fungus"] = 2205907,
|
||||
["basilisk"] = 2200708,
|
||||
["bomb"] = 2201611,
|
||||
["jellyfish"] = 2105415,
|
||||
["slug"] = 2104205,
|
||||
["coblyn"] = 2202103,
|
||||
["ghost"] = 2204317,
|
||||
["crab"] = 2107613,
|
||||
["yarzon"] = 2205520,
|
||||
["elemental"] = 2105104,
|
||||
["boar"] = 2201505,
|
||||
["kobold"] = 2206629,
|
||||
["sylph"] = 2206702,
|
||||
["ixal"] = 2206434,
|
||||
["amaljaa"] = 2206502,
|
||||
["qiqirn"] = 2206304,
|
||||
["apkallu"] = 2202902,
|
||||
["goobbue"] = 2103301,
|
||||
["garlean"] = 2207005,
|
||||
["flan"] = 2103404,
|
||||
["swarm"] = 2105304,
|
||||
["goblin"] = 2210301,
|
||||
["buffalo"] = 2200802,
|
||||
["skeleton"] = 2201902,
|
||||
["zombie"] = 2201807,
|
||||
["toad"] = 2203107,
|
||||
["wisp"] = 2209903,
|
||||
["juggernaut"] = 6000243,
|
||||
["mammet"] = 6000246,
|
||||
["lantern"] = 1200329,
|
||||
["helper"] = 2310605,
|
||||
["diremite"] = 2101108,
|
||||
["gong"] = 1200050,
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, name, width, height, blockCount)
|
||||
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local sender = "spawnnpc";
|
||||
|
||||
if player and (modelIds[name] != nil) then
|
||||
local pos = player:GetPos();
|
||||
local x = tonumber(pos[0]);
|
||||
local y = tonumber(pos[1]);
|
||||
local z = tonumber(pos[2]);
|
||||
local rot = tonumber(pos[3]);
|
||||
local zone = pos[4];
|
||||
local w = tonumber(width) or 0;
|
||||
|
||||
local h = tonumber(height) or 0;
|
||||
local blocks = tonumber(blockCount) or 0;
|
||||
for b = 0, blocks do
|
||||
for i = 0, w do
|
||||
for j = 0, h do
|
||||
local actor = player.GetZone().SpawnActor(2104001, 'ass', x + (i * 1), y, z + (j * 1), rot, 0, 0, true);
|
||||
actor.ChangeNpcAppearance(modelIds[name]);
|
||||
actor.SetMaxHP(5000);
|
||||
actor.SetHP(5000);
|
||||
actor.SetMod(modifiersGlobal.CanBlock, 1);
|
||||
actor.SetMod(modifiersGlobal.AttackRange, 3);
|
||||
actor.SetMod(modifiersGlobal.MovementSpeed, 5);
|
||||
actor.SetMobMod(mobModifiersGlobal.Roams, 1);
|
||||
actor.SetMobMod(mobModifiersGlobal.RoamDelay, 10);
|
||||
actor.charaWork.parameterSave.state_mainSkillLevel = 52;
|
||||
actor.moveState = 3;
|
||||
end;
|
||||
end;
|
||||
|
||||
x = x + 500
|
||||
end;
|
||||
return;
|
||||
elseif player and (modelIds[name] == nil) then
|
||||
player:SendMessage(messageID, sender, "That name isn't valid");
|
||||
else
|
||||
print("I don't even know how you managed this")
|
||||
end
|
||||
|
||||
return;
|
||||
end;
|
32
Data/scripts/commands/gm/speed.lua
Normal file
32
Data/scripts/commands/gm/speed.lua
Normal file
|
@ -0,0 +1,32 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sss",
|
||||
description =
|
||||
[[
|
||||
Set movement speed for player. Enter no value to reset to default.
|
||||
!speed <run> |
|
||||
!speed <stop> <walk> <run> |
|
||||
]]
|
||||
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, stop, walk, run)
|
||||
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
|
28
Data/scripts/commands/gm/test.lua
Normal file
28
Data/scripts/commands/gm/test.lua
Normal file
|
@ -0,0 +1,28 @@
|
|||
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> |
|
||||
]],
|
||||
|
||||
}
|
||||
|
||||
function onTrigger(player, argc)
|
||||
worldMaster = GetWorldMaster();
|
||||
player:SendGameMessage(player, worldMaster, 34108, 0x20);
|
||||
player:SendGameMessage(player, worldMaster, 50011, 0x20);
|
||||
|
||||
director = player:GetZone():CreateDirector("Quest/QuestDirectorMan0l001");
|
||||
player:AddDirector(director);
|
||||
player:SetLoginDirector(director);
|
||||
|
||||
player:KickEvent(director, "noticeEvent", true);
|
||||
|
||||
GetWorldManager():DoZoneChange(player, 9);
|
||||
end;
|
54
Data/scripts/commands/gm/testmapobj.lua
Normal file
54
Data/scripts/commands/gm/testmapobj.lua
Normal file
|
@ -0,0 +1,54 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sssss",
|
||||
description = ""
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, animation, regionId, layoutId, maxLayoutId)
|
||||
layoutId = tonumber(layoutId);
|
||||
|
||||
if (maxLayoutId ~= nil) then
|
||||
maxLayoutId = tonumber(maxLayoutId);
|
||||
else
|
||||
maxLayoutId = layoutId;
|
||||
end
|
||||
|
||||
actorClassId = 5900001;
|
||||
while (layoutId <= maxLayoutId) do
|
||||
if (actorClassId == nil) then
|
||||
player:SendMessage(0x20, "", "No actor class id provided.");
|
||||
return;
|
||||
end
|
||||
|
||||
local pos = player:GetPos();
|
||||
local x = pos[0];
|
||||
local y = pos[1];
|
||||
local z = pos[2];
|
||||
local zone = pos[4];
|
||||
|
||||
actorClassId = tonumber(actorClassId);
|
||||
|
||||
if (actorClassId ~= nil) then
|
||||
zone = player:GetZone();
|
||||
actor = zone:SpawnActor(actorClassId, "mapobj", pos[0], pos[1], pos[2], tonumber(regionId), tonumber(layoutId));
|
||||
wait(0.8);
|
||||
actor:PlayMapObjAnimation(player, animation);
|
||||
zone:DespawnActor("mapobj");
|
||||
wait(0.5);
|
||||
player:SendMessage(0x20, "", "Layout ID: "..layoutId);
|
||||
end
|
||||
layoutId=layoutId+1;
|
||||
end
|
||||
end;
|
||||
--!testmapobj 5900001 421 2810 2820
|
||||
|
||||
--dun4 (0x19e) - Copperbell Mines
|
||||
--dun1 - Mun Tuy
|
||||
--dun2 - Tam Tara
|
||||
--debug:_getAllCharacter("MapObjStandard")[1]
|
||||
|
||||
|
||||
--Ferry (Thanalan, Z=-130): 5145, 252
|
||||
--Ferry (La Noscea, Z=+130): 5144, 201
|
24
Data/scripts/commands/gm/vdragon.lua
Normal file
24
Data/scripts/commands/gm/vdragon.lua
Normal file
|
@ -0,0 +1,24 @@
|
|||
require("global");
|
||||
require("utils");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sssss",
|
||||
description =
|
||||
[[
|
||||
Angle stuff!
|
||||
!anglestuff
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc)
|
||||
local sender = "[battleaction] ";
|
||||
|
||||
if player and player.currentTarget then
|
||||
local actor = GetWorldManager():GetActorInWorld(player.currentTarget) or nil;
|
||||
actor.Ability(23459, actor.actorId);
|
||||
|
||||
else
|
||||
print(sender.."unable to add experience, ensure player name is valid.");
|
||||
end;
|
||||
end;
|
76
Data/scripts/commands/gm/warp.lua
Normal file
76
Data/scripts/commands/gm/warp.lua
Normal file
|
@ -0,0 +1,76 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sssssss",
|
||||
description =
|
||||
[[
|
||||
Warp player or <targetname> to a location from a list, or enter a zoneID with coordinates.
|
||||
!warp <spawn list> |
|
||||
!warp <zone> <x> <y> <z> |
|
||||
!warp <zone> <x> <y> <z> <privateArea> <targetname> |
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, p1, p2, p3, p4, privateArea, name, lastName)
|
||||
|
||||
if name then
|
||||
if lastName then
|
||||
player = GetWorldManager():GetPCInWorld(name.." "..lastName) or nil;
|
||||
else
|
||||
player = GetWorldManager():GetPCInWorld(name) or nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
if not player then
|
||||
printf("[Command] [warp] error! No target or player specified!");
|
||||
return;
|
||||
end;
|
||||
|
||||
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local sender = "[warp] ";
|
||||
|
||||
-- we're getting a list/array from c# so 0 index
|
||||
local pos = player:GetPos();
|
||||
local player_x = pos[0];
|
||||
local player_y = pos[1];
|
||||
local player_z = pos[2];
|
||||
local player_rot = pos[3];
|
||||
local player_zone = pos[4];
|
||||
|
||||
local worldManager = GetWorldManager();
|
||||
|
||||
if argc >= 3 then
|
||||
|
||||
if argc == 3 then
|
||||
local x = tonumber(applyPositionOffset(p1, player_x)) or player_x;
|
||||
local y = tonumber(applyPositionOffset(p2, player_y)) or player_y;
|
||||
local z = tonumber(applyPositionOffset(p3, player_z)) or player_z;
|
||||
|
||||
player:SendMessage(messageID, sender, string.format("setting coordinates X:%d Y:%d Z:%d within current zone (%d)", x, y, z, player_zone));
|
||||
|
||||
worldManager:DoPlayerMoveInZone(player, x, y, z, player_rot, 0x00);
|
||||
else
|
||||
local zone = tonumber(applyPositionOffset(p1, player_zone)) or player_zone;
|
||||
local x = tonumber(applyPositionOffset(p2, player_x)) or player_x;
|
||||
local y = tonumber(applyPositionOffset(p3, player_y)) or player_y;
|
||||
local z = tonumber(applyPositionOffset(p4, player_z)) or player_z;
|
||||
if privateArea == "" then privateArea = nil end;
|
||||
player:SendMessage(messageID, sender, string.format("setting coordinates X:%d Y:%d Z:%d to new zone (%d) private area:%s", x, y, z, zone, privateArea or "unspecified"));
|
||||
worldManager:DoZoneChange(player, zone, privateArea, 0, 0x02, x, y, z, 0.00);
|
||||
end
|
||||
|
||||
else
|
||||
player:SendMessage(messageID, sender, "Unknown parameters! Usage: "..properties.description);
|
||||
end;
|
||||
end;
|
||||
|
||||
function applyPositionOffset(str, offset)
|
||||
local s = str;
|
||||
if s:find("@") then
|
||||
s = tonumber(s:sub(s:find("@") + 1, s:len()));
|
||||
if s then s = s + offset end;
|
||||
end
|
||||
print(s);
|
||||
return s;
|
||||
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;
|
37
Data/scripts/commands/gm/weather.lua
Normal file
37
Data/scripts/commands/gm/weather.lua
Normal file
|
@ -0,0 +1,37 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "ssss",
|
||||
description =
|
||||
[[
|
||||
Change the weather visual to <id> and optional <transition> for player.
|
||||
!weather <id> |
|
||||
!weather <id> <transition> |
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, weather, updateTime, zonewide)
|
||||
-- todo: change weather
|
||||
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local sender = "[weather] ";
|
||||
local message = "unable to change weather";
|
||||
|
||||
if player then
|
||||
weather = tonumber(weather) or 0;
|
||||
updateTime = tonumber(updateTime) or 0;
|
||||
zonewide = tonumber(zonewide) or 0;
|
||||
message = string.format("changed weather to %u ", weather);
|
||||
|
||||
if zonewide ~= 0 then
|
||||
message = string.format(message.."for zone %u", player:GetZoneID());
|
||||
else
|
||||
message = message..player:GetName();
|
||||
end;
|
||||
|
||||
-- weatherid, updateTime
|
||||
player:GetZone():ChangeWeather(weather, updateTime, player, zonewide ~= 0);
|
||||
player:SendMessage(messageID, sender, message);
|
||||
end;
|
||||
print(sender..message);
|
||||
end;
|
49
Data/scripts/commands/gm/workvalue.lua
Normal file
49
Data/scripts/commands/gm/workvalue.lua
Normal file
|
@ -0,0 +1,49 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "ssss",
|
||||
description =
|
||||
[[
|
||||
<actorName> <workName> <uiFunc> <value>
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, target, workName, uiFunc, value)
|
||||
|
||||
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local sender = "[workvalue] ";
|
||||
|
||||
if (argc != 4) then
|
||||
player:SendMessage(messageID, sender, "Invalid args");
|
||||
return;
|
||||
end
|
||||
|
||||
if (target == "@t") then
|
||||
targetActor = GetWorldManager():GetActorInWorld(player.currentTarget) or nil;
|
||||
else
|
||||
targetActor = GetWorldManager():GetActorInWorld(target) or nil;
|
||||
end
|
||||
|
||||
if not targetActor then
|
||||
player:SendMessage(messageID, sender, "Error finding target...");
|
||||
return
|
||||
end
|
||||
|
||||
if (tonumber(value) ~= nil) then
|
||||
result = targetActor:SetWorkValue(player, workName, uiFunc, tonumber(value));
|
||||
elseif (value == "true") then
|
||||
result = targetActor:SetWorkValue(player, workName, uiFunc, true);
|
||||
elseif (value == "false") then
|
||||
result = targetActor:SetWorkValue(player, workName, uiFunc, false);
|
||||
else
|
||||
result = targetActor:SetWorkValue(player, workName, uiFunc, value);
|
||||
end
|
||||
|
||||
if (result) then
|
||||
player:SendMessage(messageID, sender, workName .. " changed to " .. value);
|
||||
else
|
||||
player:SendMessage(messageID, sender, "Could not changed workvalue. Is the name and datatype correct?");
|
||||
end
|
||||
|
||||
end
|
193
Data/scripts/commands/gm/yolo.lua
Normal file
193
Data/scripts/commands/gm/yolo.lua
Normal file
|
@ -0,0 +1,193 @@
|
|||
require("global");
|
||||
require("modifiers");
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "ssss",
|
||||
description =
|
||||
[[
|
||||
yolo
|
||||
]],
|
||||
}
|
||||
|
||||
local quests =
|
||||
{
|
||||
[111807] = { level = 25, weight = 4, rewardexp = 1080 },
|
||||
[110868] = { level = 50, weight = 4, rewardexp = 4400 },
|
||||
[111603] = { level = 22, weight = 5, rewardexp = 1100 },
|
||||
[111602] = { level = 22, weight = 5, rewardexp = 1100 },
|
||||
[111420] = { level = 45, weight = 5, rewardexp = 4450 },
|
||||
[110811] = { level = 18, weight = 6, rewardexp = 780 },
|
||||
[110814] = { level = 18, weight = 6, rewardexp = 780 },
|
||||
[110707] = { level = 25, weight = 6, rewardexp = 1620 },
|
||||
[110682] = { level = 34, weight = 6, rewardexp = 3180 },
|
||||
[111202] = { level = 35, weight = 6, rewardexp = 3360 },
|
||||
[111222] = { level = 35, weight = 6, rewardexp = 3360 },
|
||||
[111302] = { level = 35, weight = 6, rewardexp = 3360 },
|
||||
[111223] = { level = 40, weight = 6, rewardexp = 4260 },
|
||||
[110819] = { level = 45, weight = 6, rewardexp = 5340 },
|
||||
[111224] = { level = 45, weight = 6, rewardexp = 5340 },
|
||||
[111225] = { level = 45, weight = 6, rewardexp = 5340 },
|
||||
[110867] = { level = 45, weight = 6, rewardexp = 5340 },
|
||||
[110869] = { level = 45, weight = 6, rewardexp = 5340 },
|
||||
[110708] = { level = 45, weight = 6, rewardexp = 5340 },
|
||||
[110627] = { level = 45, weight = 6, rewardexp = 5340 },
|
||||
[111434] = { level = 50, weight = 6, rewardexp = 6600 },
|
||||
[110850] = { level = 1, weight = 7, rewardexp = 40 },
|
||||
[110851] = { level = 1, weight = 7, rewardexp = 40 },
|
||||
[110841] = { level = 20, weight = 7, rewardexp = 1120 },
|
||||
[110642] = { level = 20, weight = 7, rewardexp = 1120 },
|
||||
[110840] = { level = 20, weight = 7, rewardexp = 1120 },
|
||||
[110727] = { level = 21, weight = 7, rewardexp = 1401 },
|
||||
[111221] = { level = 30, weight = 7, rewardexp = 2661 },
|
||||
[111241] = { level = 30, weight = 7, rewardexp = 2661 },
|
||||
[110687] = { level = 28, weight = 9, rewardexp = 2970 },
|
||||
[110016] = { level = 34, weight = 50, rewardexp = 26500 },
|
||||
[110017] = { level = 38, weight = 50, rewardexp = 32500 },
|
||||
[110019] = { level = 46, weight = 50, rewardexp = 46000 }
|
||||
};
|
||||
|
||||
local expTable = {
|
||||
570, -- 1
|
||||
700,
|
||||
880,
|
||||
1100,
|
||||
1500,
|
||||
1800,
|
||||
2300,
|
||||
3200,
|
||||
4300,
|
||||
5000, -- 10
|
||||
5900,
|
||||
6800,
|
||||
7700,
|
||||
8700,
|
||||
9700,
|
||||
11000,
|
||||
12000,
|
||||
13000,
|
||||
15000,
|
||||
16000, -- 20
|
||||
20000,
|
||||
22000,
|
||||
23000,
|
||||
25000,
|
||||
27000,
|
||||
29000,
|
||||
31000,
|
||||
33000,
|
||||
35000,
|
||||
38000, -- 30
|
||||
45000,
|
||||
47000,
|
||||
50000,
|
||||
53000,
|
||||
56000,
|
||||
59000,
|
||||
62000,
|
||||
65000,
|
||||
68000,
|
||||
71000, -- 40
|
||||
74000,
|
||||
78000,
|
||||
81000,
|
||||
85000,
|
||||
89000,
|
||||
92000,
|
||||
96000,
|
||||
100000,
|
||||
100000,
|
||||
110000 -- 50
|
||||
};
|
||||
|
||||
local commandCost = {
|
||||
["raise"] = 150,
|
||||
["cure"] = 40,
|
||||
["cura"] = 100,
|
||||
["curaga"] = 150,
|
||||
};
|
||||
-- stone: (1, 9) (5, 12) (10, )
|
||||
-- cure: (1, 5) (5, 6) (10, )
|
||||
-- aero: (1, 9) (5, 12) (10, )
|
||||
-- protect: (1, 9) (5, 12) (10, )
|
||||
--[[
|
||||
function onTrigger(player, argc, id, level, weight)
|
||||
id = tonumber(id) or 111807;
|
||||
level = tonumber(level) or quests[id].level;
|
||||
weight = tonumber(weight) or quests[id].weight;
|
||||
local messageId = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local sender = "yolo";
|
||||
|
||||
if id == 1 then
|
||||
return
|
||||
end
|
||||
local message = calcSkillPoint(player, level, weight);
|
||||
if player then
|
||||
player.SendMessage(messageId, sender, string.format("calculated %s | expected %s", message, quests[id].rewardexp));
|
||||
end;
|
||||
printf("calculated %s | expected %s", message, quests[id].rewardexp);
|
||||
end;
|
||||
]]
|
||||
|
||||
|
||||
|
||||
function onTrigger(player, argc, width, height, blockCount)
|
||||
local messageId = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local sender = "yolo";
|
||||
|
||||
if player then
|
||||
if false then
|
||||
local effectId = 223004;
|
||||
|
||||
player.statusEffects.RemoveStatusEffect(effectId);
|
||||
player.statusEffects.AddStatusEffect(effectId, 1, 0, 5);
|
||||
return;
|
||||
end;
|
||||
|
||||
local pos = player:GetPos();
|
||||
local x = tonumber(pos[0]);
|
||||
local y = tonumber(pos[1]);
|
||||
local z = tonumber(pos[2]);
|
||||
local rot = tonumber(pos[3]);
|
||||
local zone = pos[4];
|
||||
local w = tonumber(width) or 0;
|
||||
|
||||
local h = tonumber(height) or 0;
|
||||
local blocks = tonumber(blockCount) or 0;
|
||||
|
||||
printf("%f %f %f", x, y, z);
|
||||
--local x, y, z = player.GetPos();
|
||||
for b = 0, blocks do
|
||||
for i = 0, w do
|
||||
for j = 0, h do
|
||||
local actor = player.GetZone().SpawnActor(2104001, 'ass', x + (i * 1), y, z + (j * 1), rot, 0, 0, true);
|
||||
actor.ChangeNpcAppearance(2200905);
|
||||
actor.SetMaxHP(5000);
|
||||
actor.SetHP(5000);
|
||||
actor.SetMod(modifiersGlobal.CanBlock, 1);
|
||||
actor.SetMod(modifiersGlobal.AttackRange, 3);
|
||||
actor.SetMod(modifiersGlobal.MovementSpeed, 5);
|
||||
actor.SetMobMod(mobModifiersGlobal.Roams, 1);
|
||||
actor.SetMobMod(mobModifiersGlobal.RoamDelay, 10);
|
||||
actor.charaWork.parameterSave.state_mainSkillLevel = 52;
|
||||
actor.moveState = 3;
|
||||
end
|
||||
end
|
||||
|
||||
x = x + 500
|
||||
end
|
||||
return;
|
||||
end
|
||||
end;
|
||||
|
||||
function calculateCommandCost(player, skillName, level)
|
||||
if skillName and level and commandCost[skillName] then
|
||||
return math.ceil((8000 + (level - 70) * 500) * (commandCost[skillName] * 0.001));
|
||||
end;
|
||||
return 1;
|
||||
end
|
||||
|
||||
function calcSkillPoint(player, lvl, weight)
|
||||
weight = weight / 100
|
||||
|
||||
return math.ceil(expTable[lvl] * weight)
|
||||
end
|
19
Data/scripts/commands/gm/zonecount.lua
Normal file
19
Data/scripts/commands/gm/zonecount.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "",
|
||||
description =
|
||||
[[
|
||||
Get the amount of actors in this zone.
|
||||
!zonecount
|
||||
]]
|
||||
|
||||
}
|
||||
|
||||
function onTrigger(player, argc)
|
||||
|
||||
local message = tostring(player.zone.GetAllActors().Count);
|
||||
|
||||
player.SendMessage(0x20, "", message);
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue