mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-02 19:42:05 -04:00
Fixed work values being totally wrong for guildleves. Added Add/Remove GL command.
This commit is contained in:
parent
b5db036d71
commit
fc96dac7c7
@ -1092,9 +1092,9 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
|
||||
public int GetFreeGuildleveSlot()
|
||||
{
|
||||
for (int i = 0; i < questGuildleve.Length; i++)
|
||||
for (int i = 0; i < work.guildleveId.Length; i++)
|
||||
{
|
||||
if (questGuildleve[i] == 0)
|
||||
if (work.guildleveId[i] == 0)
|
||||
return i;
|
||||
}
|
||||
|
||||
@ -1135,8 +1135,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
if (freeSlot == -1)
|
||||
return;
|
||||
|
||||
playerWork.questScenario[freeSlot] = id;
|
||||
questGuildleve[freeSlot] = id;
|
||||
work.guildleveId[freeSlot] = (ushort)id;
|
||||
Database.SaveGuildleve(this, id, freeSlot);
|
||||
SendGuildleveClientUpdate(freeSlot);
|
||||
}
|
||||
@ -1145,14 +1144,14 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
{
|
||||
if (HasGuildleve(id))
|
||||
{
|
||||
for (int i = 0; i < questGuildleve.Length; i++)
|
||||
for (int i = 0; i < work.guildleveId.Length; i++)
|
||||
{
|
||||
if (questGuildleve[i] != null && questGuildleve[i] == id)
|
||||
if (work.guildleveId[i] == id)
|
||||
{
|
||||
work.guildleveChecked[i] = abandoned;
|
||||
work.guildleveDone[i] = completed;
|
||||
work.guildleveChecked[i] = completed;
|
||||
work.guildleveDone[i] = abandoned;
|
||||
Database.MarkGuildleve(this, id, abandoned, completed);
|
||||
SendGuildleveClientUpdate(i);
|
||||
SendGuildleveMarkClientUpdate(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1162,13 +1161,12 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
{
|
||||
if (HasGuildleve(id))
|
||||
{
|
||||
for (int i = 0; i < questGuildleve.Length; i++)
|
||||
for (int i = 0; i < work.guildleveId.Length; i++)
|
||||
{
|
||||
if (questGuildleve[i] != null && questGuildleve[i] == id)
|
||||
if (work.guildleveId[i] == id)
|
||||
{
|
||||
Database.RemoveGuildleve(this, id);
|
||||
questGuildleve[i] = 0;
|
||||
playerWork.questGuildleve[i] = 0;
|
||||
work.guildleveId[i] = 0;
|
||||
SendGuildleveClientUpdate(i);
|
||||
break;
|
||||
}
|
||||
@ -1351,9 +1349,9 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
|
||||
public bool HasGuildleve(uint id)
|
||||
{
|
||||
for (int i = 0; i < questGuildleve.Length; i++)
|
||||
for (int i = 0; i < work.guildleveId.Length; i++)
|
||||
{
|
||||
if (questGuildleve[i] != null && questGuildleve[i] == id)
|
||||
if (work.guildleveId[i] == id)
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1421,8 +1419,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
|
||||
private void SendGuildleveClientUpdate(int slot)
|
||||
{
|
||||
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("playerWork/journal", this, actorId);
|
||||
propPacketUtil.AddProperty(String.Format("playerWork.questGuildleve[{0}]", slot));
|
||||
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("work/guildleve", this, actorId);
|
||||
propPacketUtil.AddProperty(String.Format("work.guildleveId[{0}]", slot));
|
||||
QueuePackets(propPacketUtil.Done());
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,7 @@ namespace FFXIVClassic_Map_Server.actors.director
|
||||
public GuildleveWork guildleveWork = new GuildleveWork();
|
||||
|
||||
public bool isEnded = false;
|
||||
public uint completionTime = 0;
|
||||
|
||||
public GuildleveDirector(uint id, Area zone, string directorPath, uint guildleveId, byte selectedDifficulty, Player guildleveOwner, params object[] args)
|
||||
: base(id, zone, directorPath, args)
|
||||
@ -89,12 +90,14 @@ namespace FFXIVClassic_Map_Server.actors.director
|
||||
return;
|
||||
isEnded = true;
|
||||
|
||||
completionTime = Utils.UnixTimeStampUTC() - guildleveWork.startTime;
|
||||
|
||||
if (wasCompleted)
|
||||
{
|
||||
foreach (Actor a in GetPlayerMembers())
|
||||
{
|
||||
Player player = (Player)a;
|
||||
player.MarkGuildleve(guildleveId, false, true);
|
||||
player.MarkGuildleve(guildleveId, true, true);
|
||||
player.PlayAnimation(0x02000002);
|
||||
player.ChangeMusic(81);
|
||||
player.SendGameMessage(Server.GetWorldManager().GetActor(), 50023, 0x20, (object)(int)guildleveId);
|
||||
|
@ -20,7 +20,7 @@ function onEventStarted(player, npc, triggerName)
|
||||
local currentGLDirector = player:GetGuildleveDirector();
|
||||
local glData = currentGLDirector.guildleveData;
|
||||
|
||||
callClientFunction(player, "eventGuildleveReward", currentGLDirector.guildleveId, 0x26, 24, 24, 0, 0, 0, 0, 0, 0, 0, 4);
|
||||
callClientFunction(player, "eventGuildleveReward", currentGLDirector.guildleveId, currentGLDirector.completionTime, 24, 24, 0, 0, 0, 0, 0, 0, 0, 4);
|
||||
|
||||
local choice = callClientFunction(player, "eventTalkGuildleveWarp", glData.aetheryte, 0);
|
||||
|
||||
|
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;
|
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;
|
Loading…
Reference in New Issue
Block a user