mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-02 19:42:05 -04:00
Merge branch 'develop'
# Conflicts: # FFXIVClassic Map Server/FFXIVClassic Map Server.csproj # FFXIVClassic Map Server/Server.cs # data/scripts/player.lua # scripts/zones/193/npcs/pplStd_11@0C100.lua
This commit is contained in:
commit
3d5fa45730
@ -228,6 +228,8 @@ namespace FFXIVClassic_Lobby_Server
|
|||||||
{
|
{
|
||||||
conn.Dispose();
|
conn.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.database(String.Format("CID={0} state updated to active(2).", cid));
|
Log.database(String.Format("CID={0} state updated to active(2).", cid));
|
||||||
|
@ -257,17 +257,17 @@ namespace FFXIVClassic_Lobby_Server
|
|||||||
break;
|
break;
|
||||||
case 2: //fst0Battle03 (Gridania)
|
case 2: //fst0Battle03 (Gridania)
|
||||||
info.zoneId = 166;
|
info.zoneId = 166;
|
||||||
info.x = 356.09f;
|
info.x = 369.5434f;
|
||||||
info.y = 3.74f;
|
info.y = 4.21f;
|
||||||
info.z = -701.62f;
|
info.z = -706.1074f;
|
||||||
info.rot = -1.4f;
|
info.rot = -1.26721f;
|
||||||
break;
|
break;
|
||||||
case 3: //wil0Battle01 (Ul'dah)
|
case 3: //wil0Battle01 (Ul'dah)
|
||||||
info.zoneId = 184;
|
info.zoneId = 184;
|
||||||
info.x = 12.63f;
|
info.x = 5.364327f;
|
||||||
info.y = 196.05f;
|
info.y = 196.0f;
|
||||||
info.z = 131.01f;
|
info.z = 133.6561f;
|
||||||
info.rot = -1.34f;
|
info.rot = -2.849384f;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,8 +47,7 @@ namespace FFXIVClassic_Lobby_Server
|
|||||||
BasePacket packet = sendPacketQueue.Take();
|
BasePacket packet = sendPacketQueue.Take();
|
||||||
|
|
||||||
byte[] packetBytes = packet.getPacketBytes();
|
byte[] packetBytes = packet.getPacketBytes();
|
||||||
byte[] buffer = new byte[0xFFFF];
|
|
||||||
Array.Copy(packetBytes, buffer, packetBytes.Length);
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
socket.Send(packetBytes);
|
socket.Send(packetBytes);
|
||||||
|
@ -310,6 +310,56 @@ namespace FFXIVClassic_Lobby_Server
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void saveQuest(Player player, Quest quest)
|
||||||
|
{
|
||||||
|
int slot = player.getQuestSlot(quest.actorId);
|
||||||
|
if (slot == -1)
|
||||||
|
{
|
||||||
|
Log.error(String.Format("Tried saving quest player didn't have: Player: {0:x}, QuestId: {0:x}", player.actorId, quest.actorId));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
saveQuest(player, quest, slot);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void saveQuest(Player player, Quest quest, int slot)
|
||||||
|
{
|
||||||
|
string query;
|
||||||
|
MySqlCommand cmd;
|
||||||
|
|
||||||
|
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
conn.Open();
|
||||||
|
|
||||||
|
query = @"
|
||||||
|
INSERT INTO characters_quest_scenario
|
||||||
|
(characterId, slot, questId, questData, questFlags)
|
||||||
|
VALUES
|
||||||
|
(@charaId, @slot, @questId, @questData, @questFlags)
|
||||||
|
ON DUPLICATE KEY UPDATE
|
||||||
|
questData = @questData, questFlags = @questFlags
|
||||||
|
";
|
||||||
|
|
||||||
|
cmd = new MySqlCommand(query, conn);
|
||||||
|
cmd.Parameters.AddWithValue("@charaId", player.actorId);
|
||||||
|
cmd.Parameters.AddWithValue("@slot", slot);
|
||||||
|
cmd.Parameters.AddWithValue("@questId", 0xFFFFF & quest.actorId);
|
||||||
|
cmd.Parameters.AddWithValue("@questData", quest.GetSerializedQuestData());
|
||||||
|
cmd.Parameters.AddWithValue("@questFlags", quest.GetQuestFlags());
|
||||||
|
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
catch (MySqlException e)
|
||||||
|
{ Console.WriteLine(e); }
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
conn.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void loadPlayerCharacter(Player player)
|
public static void loadPlayerCharacter(Player player)
|
||||||
{
|
{
|
||||||
string query;
|
string query;
|
||||||
@ -627,7 +677,9 @@ namespace FFXIVClassic_Lobby_Server
|
|||||||
query = @"
|
query = @"
|
||||||
SELECT
|
SELECT
|
||||||
slot,
|
slot,
|
||||||
questId
|
questId,
|
||||||
|
questData,
|
||||||
|
questFlags
|
||||||
FROM characters_quest_scenario WHERE characterId = @charId";
|
FROM characters_quest_scenario WHERE characterId = @charId";
|
||||||
|
|
||||||
cmd = new MySqlCommand(query, conn);
|
cmd = new MySqlCommand(query, conn);
|
||||||
@ -638,9 +690,21 @@ namespace FFXIVClassic_Lobby_Server
|
|||||||
{
|
{
|
||||||
int index = reader.GetUInt16(0);
|
int index = reader.GetUInt16(0);
|
||||||
player.playerWork.questScenario[index] = 0xA0F00000 | reader.GetUInt32(1);
|
player.playerWork.questScenario[index] = 0xA0F00000 | reader.GetUInt32(1);
|
||||||
|
string questData = null;
|
||||||
|
uint questFlags = 0;
|
||||||
|
|
||||||
|
if (!reader.IsDBNull(2))
|
||||||
|
questData = reader.GetString(2);
|
||||||
|
else
|
||||||
|
questData = "{}";
|
||||||
|
|
||||||
|
if (!reader.IsDBNull(3))
|
||||||
|
questFlags = reader.GetUInt32(3);
|
||||||
|
else
|
||||||
|
questFlags = 0;
|
||||||
|
|
||||||
string questName = Server.getStaticActors(player.playerWork.questScenario[index]).actorName;
|
string questName = Server.getStaticActors(player.playerWork.questScenario[index]).actorName;
|
||||||
player.questScenario[index] = new Quest(player.playerWork.questScenario[index], questName);
|
player.questScenario[index] = new Quest(player, player.playerWork.questScenario[index], questName, questData, questFlags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,6 +72,9 @@
|
|||||||
<Compile Include="actors\debug\Debug.cs" />
|
<Compile Include="actors\debug\Debug.cs" />
|
||||||
<Compile Include="actors\director\Director.cs" />
|
<Compile Include="actors\director\Director.cs" />
|
||||||
<Compile Include="actors\director\OpeningDirector.cs" />
|
<Compile Include="actors\director\OpeningDirector.cs" />
|
||||||
|
<Compile Include="actors\director\quest\QuestDirectorMan0g001.cs" />
|
||||||
|
<Compile Include="actors\director\quest\QuestDirectorMan0l001.cs" />
|
||||||
|
<Compile Include="actors\director\quest\QuestDirectorMan0u001.cs" />
|
||||||
<Compile Include="actors\director\WeatherDirector.cs" />
|
<Compile Include="actors\director\WeatherDirector.cs" />
|
||||||
<Compile Include="actors\EventList.cs" />
|
<Compile Include="actors\EventList.cs" />
|
||||||
<Compile Include="actors\judge\Judge.cs" />
|
<Compile Include="actors\judge\Judge.cs" />
|
||||||
@ -135,6 +138,7 @@
|
|||||||
<Compile Include="packets\receive\_0x07Packet.cs" />
|
<Compile Include="packets\receive\_0x07Packet.cs" />
|
||||||
<Compile Include="packets\send\actor\ActorDoEmotePacket.cs" />
|
<Compile Include="packets\send\actor\ActorDoEmotePacket.cs" />
|
||||||
<Compile Include="packets\send\actor\ActorInstantiatePacket.cs" />
|
<Compile Include="packets\send\actor\ActorInstantiatePacket.cs" />
|
||||||
|
<Compile Include="packets\send\actor\ActorSpecialGraphicPacket.cs" />
|
||||||
<Compile Include="packets\send\actor\BattleAction1Packet.cs" />
|
<Compile Include="packets\send\actor\BattleAction1Packet.cs" />
|
||||||
<Compile Include="packets\send\actor\battle\BattleAction.cs" />
|
<Compile Include="packets\send\actor\battle\BattleAction.cs" />
|
||||||
<Compile Include="packets\send\actor\battle\BattleActionX00Packet.cs" />
|
<Compile Include="packets\send\actor\battle\BattleActionX00Packet.cs" />
|
||||||
@ -244,6 +248,7 @@
|
|||||||
<Compile Include="packets\send\supportdesk\GMTicketPacket.cs" />
|
<Compile Include="packets\send\supportdesk\GMTicketPacket.cs" />
|
||||||
<Compile Include="packets\send\supportdesk\GMTicketSentResponsePacket.cs" />
|
<Compile Include="packets\send\supportdesk\GMTicketSentResponsePacket.cs" />
|
||||||
<Compile Include="packets\send\_0x02Packet.cs" />
|
<Compile Include="packets\send\_0x02Packet.cs" />
|
||||||
|
<Compile Include="packets\send\_0x10Packet.cs" />
|
||||||
<Compile Include="packets\send\_0xE2Packet.cs" />
|
<Compile Include="packets\send\_0xE2Packet.cs" />
|
||||||
<Compile Include="packets\SubPacket.cs" />
|
<Compile Include="packets\SubPacket.cs" />
|
||||||
<Compile Include="packets\receive\PingPacket.cs" />
|
<Compile Include="packets\receive\PingPacket.cs" />
|
||||||
|
@ -259,19 +259,27 @@ namespace FFXIVClassic_Lobby_Server
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
player.getActor().eventCurrentOwner = eventStart.scriptOwnerActorID;
|
|
||||||
player.getActor().eventCurrentStarter = eventStart.triggerName;
|
|
||||||
|
|
||||||
//Is it a static actor? If not look in the player's instance
|
Actor ownerActor = Server.getStaticActors(eventStart.scriptOwnerActorID);
|
||||||
Actor ownerActor = Server.getStaticActors(player.getActor().eventCurrentOwner);
|
if (ownerActor != null && ownerActor is Command)
|
||||||
|
{
|
||||||
|
player.getActor().currentCommand = eventStart.scriptOwnerActorID;
|
||||||
|
player.getActor().currentCommandName = eventStart.triggerName;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player.getActor().currentEventOwner = eventStart.scriptOwnerActorID;
|
||||||
|
player.getActor().currentEventName = eventStart.triggerName;
|
||||||
|
}
|
||||||
|
|
||||||
if (ownerActor == null)
|
if (ownerActor == null)
|
||||||
{
|
{
|
||||||
//Is it a instance actor?
|
//Is it a instance actor?
|
||||||
ownerActor = Server.GetWorldManager().GetActorInWorld(player.getActor().eventCurrentOwner);
|
ownerActor = Server.GetWorldManager().GetActorInWorld(player.getActor().currentEventOwner);
|
||||||
if (ownerActor == null)
|
if (ownerActor == null)
|
||||||
{
|
{
|
||||||
//Is it a Director?
|
//Is it a Director?
|
||||||
if (player.getActor().currentDirector != null && player.getActor().eventCurrentOwner == player.getActor().currentDirector.actorId)
|
if (player.getActor().currentDirector != null && player.getActor().currentEventOwner == player.getActor().currentDirector.actorId)
|
||||||
ownerActor = player.getActor().currentDirector;
|
ownerActor = player.getActor().currentDirector;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -295,12 +303,12 @@ namespace FFXIVClassic_Lobby_Server
|
|||||||
Log.debug(String.Format("\n===Event UPDATE===\nSource Actor: 0x{0:X}\nCaller Actor: 0x{1:X}\nVal1: 0x{2:X}\nVal2: 0x{3:X}\nStep: 0x{4:X}\nParams: {5}", eventUpdate.actorID, eventUpdate.scriptOwnerActorID, eventUpdate.val1, eventUpdate.val2, eventUpdate.step, LuaUtils.dumpParams(eventUpdate.luaParams)));
|
Log.debug(String.Format("\n===Event UPDATE===\nSource Actor: 0x{0:X}\nCaller Actor: 0x{1:X}\nVal1: 0x{2:X}\nVal2: 0x{3:X}\nStep: 0x{4:X}\nParams: {5}", eventUpdate.actorID, eventUpdate.scriptOwnerActorID, eventUpdate.val1, eventUpdate.val2, eventUpdate.step, LuaUtils.dumpParams(eventUpdate.luaParams)));
|
||||||
|
|
||||||
//Is it a static actor? If not look in the player's instance
|
//Is it a static actor? If not look in the player's instance
|
||||||
Actor updateOwnerActor = Server.getStaticActors(player.getActor().eventCurrentOwner);
|
Actor updateOwnerActor = Server.getStaticActors(player.getActor().currentEventOwner);
|
||||||
if (updateOwnerActor == null)
|
if (updateOwnerActor == null)
|
||||||
{
|
{
|
||||||
updateOwnerActor = Server.GetWorldManager().GetActorInWorld(player.getActor().eventCurrentOwner);
|
updateOwnerActor = Server.GetWorldManager().GetActorInWorld(player.getActor().currentEventOwner);
|
||||||
|
|
||||||
if (player.getActor().currentDirector != null && player.getActor().eventCurrentOwner == player.getActor().currentDirector.actorId)
|
if (player.getActor().currentDirector != null && player.getActor().currentEventOwner == player.getActor().currentDirector.actorId)
|
||||||
updateOwnerActor = player.getActor().currentDirector;
|
updateOwnerActor = player.getActor().currentDirector;
|
||||||
|
|
||||||
if (updateOwnerActor == null)
|
if (updateOwnerActor == null)
|
||||||
|
@ -330,6 +330,7 @@ namespace FFXIVClassic_Lobby_Server
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
public static WorldManager GetWorldManager()
|
public static WorldManager GetWorldManager()
|
||||||
{
|
{
|
||||||
return mWorldManager;
|
return mWorldManager;
|
||||||
@ -344,5 +345,6 @@ namespace FFXIVClassic_Lobby_Server
|
|||||||
{
|
{
|
||||||
return gamedataItems;
|
return gamedataItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -347,7 +347,7 @@ namespace FFXIVClassic_Map_Server
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Moves actor to new zone, and sends packets to spawn at the given zone entrance
|
//Moves actor to new zone, and sends packets to spawn at the given zone entrance
|
||||||
public void DoZoneChange(Player player, uint destinationZoneId, uint zoneEntrance)
|
public void DoZoneChange(Player player, uint zoneEntrance)
|
||||||
{
|
{
|
||||||
if (!zoneEntranceList.ContainsKey(zoneEntrance))
|
if (!zoneEntranceList.ContainsKey(zoneEntrance))
|
||||||
{
|
{
|
||||||
@ -356,7 +356,7 @@ namespace FFXIVClassic_Map_Server
|
|||||||
}
|
}
|
||||||
|
|
||||||
ZoneEntrance ze = zoneEntranceList[zoneEntrance];
|
ZoneEntrance ze = zoneEntranceList[zoneEntrance];
|
||||||
DoZoneChange(player, destinationZoneId, ze.privateAreaName, ze.spawnType, ze.spawnX, ze.spawnY, ze.spawnZ, ze.spawnRotation);
|
DoZoneChange(player, ze.zoneId, ze.privateAreaName, ze.spawnType, ze.spawnX, ze.spawnY, ze.spawnZ, ze.spawnRotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Moves actor to new zone, and sends packets to spawn at the given coords.
|
//Moves actor to new zone, and sends packets to spawn at the given coords.
|
||||||
@ -416,11 +416,11 @@ namespace FFXIVClassic_Map_Server
|
|||||||
if (ze.zoneId != player.zoneId)
|
if (ze.zoneId != player.zoneId)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DoPlayerMoveInZone(player, ze.spawnType, ze.spawnX, ze.spawnY, ze.spawnZ, ze.spawnRotation);
|
DoPlayerMoveInZone(player, ze.spawnX, ze.spawnY, ze.spawnZ, ze.spawnRotation, ze.spawnType);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Moves actor within the zone
|
//Moves actor within the zone
|
||||||
public void DoPlayerMoveInZone(Player player, byte spawnType, float spawnX, float spawnY, float spawnZ, float spawnRotation)
|
public void DoPlayerMoveInZone(Player player, float spawnX, float spawnY, float spawnZ, float spawnRotation, byte spawnType = 0xF)
|
||||||
{
|
{
|
||||||
//Remove player from currentZone if transfer else it's login
|
//Remove player from currentZone if transfer else it's login
|
||||||
if (player.zone != null)
|
if (player.zone != null)
|
||||||
@ -436,7 +436,7 @@ namespace FFXIVClassic_Map_Server
|
|||||||
|
|
||||||
//Send packets
|
//Send packets
|
||||||
player.playerSession.queuePacket(_0xE2Packet.buildPacket(player.actorId, 0x0), true, false);
|
player.playerSession.queuePacket(_0xE2Packet.buildPacket(player.actorId, 0x0), true, false);
|
||||||
player.playerSession.queuePacket(player.createSpawnTeleportPacket(player.actorId, 0x0f), true, false);
|
player.playerSession.queuePacket(player.createSpawnTeleportPacket(player.actorId, spawnType), true, false);
|
||||||
player.sendInstanceUpdate();
|
player.sendInstanceUpdate();
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -454,6 +454,9 @@ namespace FFXIVClassic_Map_Server
|
|||||||
|
|
||||||
//Set the current zone and add player
|
//Set the current zone and add player
|
||||||
player.zone = zone;
|
player.zone = zone;
|
||||||
|
|
||||||
|
LuaEngine.onBeginLogin(player);
|
||||||
|
|
||||||
zone.addActorToZone(player);
|
zone.addActorToZone(player);
|
||||||
|
|
||||||
//Send packets
|
//Send packets
|
||||||
|
@ -35,7 +35,14 @@ namespace FFXIVClassic_Map_Server.actors.area
|
|||||||
public override SubPacket createScriptBindPacket(uint playerActorId)
|
public override SubPacket createScriptBindPacket(uint playerActorId)
|
||||||
{
|
{
|
||||||
List<LuaParam> lParams;
|
List<LuaParam> lParams;
|
||||||
lParams = LuaUtils.createLuaParamList("/Area/PrivateArea/" + className, false, true, zoneName, privateAreaName, 0x9E, canRideChocobo ? (byte)1 : (byte)0, canStealth, isInn, false, false, false, false, false, false);
|
|
||||||
|
string path = className;
|
||||||
|
|
||||||
|
if (className.ToLower().Contains("content"))
|
||||||
|
path = "Content/" + className;
|
||||||
|
|
||||||
|
lParams = LuaUtils.createLuaParamList("/Area/PrivateArea/" + path, false, true, zoneName, privateAreaName, 0x9E, canRideChocobo ? (byte)1 : (byte)0, canStealth, isInn, false, false, false, false, false, false);
|
||||||
|
ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams).debugPrintSubPacket();
|
||||||
return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams);
|
return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,6 +81,11 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
return SetActorIdleAnimationPacket.buildPacket(actorId, playerActorId, animationId);
|
return SetActorIdleAnimationPacket.buildPacket(actorId, playerActorId, animationId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setQuestGraphic(Player player, int graphicNum)
|
||||||
|
{
|
||||||
|
player.queuePacket(SetActorQuestGraphicPacket.buildPacket(player.actorId, actorId, graphicNum));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
using FFXIVClassic_Lobby_Server.common;
|
using FFXIVClassic_Lobby_Server.common;
|
||||||
using FFXIVClassic_Lobby_Server.packets;
|
using FFXIVClassic_Lobby_Server.packets;
|
||||||
using FFXIVClassic_Map_Server.actors;
|
using FFXIVClassic_Map_Server.actors;
|
||||||
|
using FFXIVClassic_Map_Server.Actors.Chara;
|
||||||
using FFXIVClassic_Map_Server.dataobjects;
|
using FFXIVClassic_Map_Server.dataobjects;
|
||||||
using FFXIVClassic_Map_Server.lua;
|
using FFXIVClassic_Map_Server.lua;
|
||||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||||
@ -20,6 +21,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
{
|
{
|
||||||
private uint actorClassId;
|
private uint actorClassId;
|
||||||
|
|
||||||
|
public NpcWork npcWork = new NpcWork();
|
||||||
|
|
||||||
public Npc(uint id, string actorName, uint zoneId, float posX, float posY, float posZ, float rot, ushort actorState, uint animationId, uint displayNameId, string customDisplayName, string className)
|
public Npc(uint id, string actorName, uint zoneId, float posX, float posY, float posZ, float rot, ushort actorState, uint animationId, uint displayNameId, string customDisplayName, string className)
|
||||||
: base(id)
|
: base(id)
|
||||||
{
|
{
|
||||||
@ -38,6 +41,26 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
this.zoneId = zoneId;
|
this.zoneId = zoneId;
|
||||||
|
|
||||||
loadNpcTemplate(id);
|
loadNpcTemplate(id);
|
||||||
|
|
||||||
|
charaWork.battleSave.potencial = 1.0f;
|
||||||
|
|
||||||
|
charaWork.parameterSave.state_mainSkill[0] = 3;
|
||||||
|
charaWork.parameterSave.state_mainSkill[2] = 3;
|
||||||
|
charaWork.parameterSave.state_mainSkillLevel = 2;
|
||||||
|
|
||||||
|
charaWork.parameterSave.hp[0] = 500;
|
||||||
|
charaWork.parameterSave.hpMax[0] = 500;
|
||||||
|
charaWork.property[0] = 1;
|
||||||
|
charaWork.property[1] = 1;
|
||||||
|
|
||||||
|
if (className.Equals("JellyfishScenarioLimsaLv00"))
|
||||||
|
{
|
||||||
|
charaWork.property[2] = 1;
|
||||||
|
npcWork.hateType = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
charaWork.property[3] = 1;
|
||||||
|
charaWork.property[4] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SubPacket createAddActorPacket(uint playerActorId)
|
public SubPacket createAddActorPacket(uint playerActorId)
|
||||||
@ -50,7 +73,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
List<LuaParam> lParams;
|
List<LuaParam> lParams;
|
||||||
|
|
||||||
Player player = Server.GetWorldManager().GetPCInWorld(playerActorId);
|
Player player = Server.GetWorldManager().GetPCInWorld(playerActorId);
|
||||||
lParams = LuaEngine.doActorOnInstantiate(player, this);
|
lParams = LuaEngine.doActorInstantiate(player, this);
|
||||||
|
|
||||||
if (lParams == null)
|
if (lParams == null)
|
||||||
{
|
{
|
||||||
@ -80,6 +103,54 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
return BasePacket.createPacket(subpackets, true, false);
|
return BasePacket.createPacket(subpackets, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override BasePacket getInitPackets(uint playerActorId)
|
||||||
|
{
|
||||||
|
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("/_init", this, playerActorId);
|
||||||
|
|
||||||
|
//Properties
|
||||||
|
for (int i = 0; i < charaWork.property.Length; i++)
|
||||||
|
{
|
||||||
|
if (charaWork.property[i] != 0)
|
||||||
|
propPacketUtil.addProperty(String.Format("charaWork.property[{0}]", i));
|
||||||
|
}
|
||||||
|
|
||||||
|
//Parameters
|
||||||
|
propPacketUtil.addProperty("charaWork.parameterSave.hp[0]");
|
||||||
|
propPacketUtil.addProperty("charaWork.parameterSave.hpMax[0]");
|
||||||
|
propPacketUtil.addProperty("charaWork.parameterSave.mp");
|
||||||
|
propPacketUtil.addProperty("charaWork.parameterSave.mpMax");
|
||||||
|
propPacketUtil.addProperty("charaWork.parameterTemp.tp");
|
||||||
|
|
||||||
|
if (charaWork.parameterSave.state_mainSkill[0] != 0)
|
||||||
|
propPacketUtil.addProperty("charaWork.parameterSave.state_mainSkill[0]");
|
||||||
|
if (charaWork.parameterSave.state_mainSkill[1] != 0)
|
||||||
|
propPacketUtil.addProperty("charaWork.parameterSave.state_mainSkill[1]");
|
||||||
|
if (charaWork.parameterSave.state_mainSkill[2] != 0)
|
||||||
|
propPacketUtil.addProperty("charaWork.parameterSave.state_mainSkill[2]");
|
||||||
|
if (charaWork.parameterSave.state_mainSkill[3] != 0)
|
||||||
|
propPacketUtil.addProperty("charaWork.parameterSave.state_mainSkill[3]");
|
||||||
|
|
||||||
|
propPacketUtil.addProperty("charaWork.parameterSave.state_mainSkillLevel");
|
||||||
|
|
||||||
|
//Status Times
|
||||||
|
for (int i = 0; i < charaWork.statusShownTime.Length; i++)
|
||||||
|
{
|
||||||
|
if (charaWork.statusShownTime[i] != 0xFFFFFFFF)
|
||||||
|
propPacketUtil.addProperty(String.Format("charaWork.statusShownTime[{0}]", i));
|
||||||
|
}
|
||||||
|
|
||||||
|
//General Parameters
|
||||||
|
for (int i = 3; i < charaWork.battleTemp.generalParameter.Length; i++)
|
||||||
|
{
|
||||||
|
if (charaWork.battleTemp.generalParameter[i] != 0)
|
||||||
|
propPacketUtil.addProperty(String.Format("charaWork.battleTemp.generalParameter[{0}]", i));
|
||||||
|
}
|
||||||
|
|
||||||
|
propPacketUtil.addProperty("npcWork.hateType");
|
||||||
|
|
||||||
|
return BasePacket.createPacket(propPacketUtil.done(), true, false);
|
||||||
|
}
|
||||||
|
|
||||||
public uint getActorClassId()
|
public uint getActorClassId()
|
||||||
{
|
{
|
||||||
return actorClassId;
|
return actorClassId;
|
||||||
|
@ -84,6 +84,15 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
45000, 47000, 50000, 53000, 56000, 59000, 62000, 65000, 68000, 71000, //Level <= 40
|
45000, 47000, 50000, 53000, 56000, 59000, 62000, 65000, 68000, 71000, //Level <= 40
|
||||||
74000, 78000, 81000, 85000, 89000, 92000, 96000, 100000, 100000, 110000}; //Level <= 50
|
74000, 78000, 81000, 85000, 89000, 92000, 96000, 100000, 100000, 110000}; //Level <= 50
|
||||||
|
|
||||||
|
//Event Related
|
||||||
|
public uint currentEventOwner = 0;
|
||||||
|
public string currentEventName = "";
|
||||||
|
|
||||||
|
public uint currentCommand = 0;
|
||||||
|
public string currentCommandName = "";
|
||||||
|
|
||||||
|
public uint eventMenuId = 0;
|
||||||
|
|
||||||
//Player Info
|
//Player Info
|
||||||
public uint[] timers = new uint[20];
|
public uint[] timers = new uint[20];
|
||||||
public ushort currentJob;
|
public ushort currentJob;
|
||||||
@ -110,11 +119,6 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
public string chocoboName;
|
public string chocoboName;
|
||||||
public byte mountState = 0;
|
public byte mountState = 0;
|
||||||
|
|
||||||
//Event Related
|
|
||||||
public uint eventCurrentOwner = 0;
|
|
||||||
public string eventCurrentStarter = "";
|
|
||||||
public uint eventMenuId = 0;
|
|
||||||
|
|
||||||
public uint achievementPoints;
|
public uint achievementPoints;
|
||||||
|
|
||||||
//Property Array Request Stuff
|
//Property Array Request Stuff
|
||||||
@ -125,7 +129,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
public Quest[] questScenario = new Quest[16];
|
public Quest[] questScenario = new Quest[16];
|
||||||
public Quest[] questGuildleve = new Quest[8];
|
public Quest[] questGuildleve = new Quest[8];
|
||||||
|
|
||||||
public Director currentDirector;// = new OpeningDirector(0x46080012);
|
public Director currentDirector;
|
||||||
|
|
||||||
public PlayerWork playerWork = new PlayerWork();
|
public PlayerWork playerWork = new PlayerWork();
|
||||||
|
|
||||||
@ -256,7 +260,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
if (isMyPlayer(playerActorId))
|
if (isMyPlayer(playerActorId))
|
||||||
{
|
{
|
||||||
if (currentDirector != null)
|
if (currentDirector != null)
|
||||||
lParams = LuaUtils.createLuaParamList("/Chara/Player/Player_work", false, false, true, currentDirector, 0, false, timers, true);
|
lParams = LuaUtils.createLuaParamList("/Chara/Player/Player_work", false, false, true, currentDirector, true, 0, false, timers, true);
|
||||||
else
|
else
|
||||||
lParams = LuaUtils.createLuaParamList("/Chara/Player/Player_work", false, false, false, true, 0, false, timers, true);
|
lParams = LuaUtils.createLuaParamList("/Chara/Player/Player_work", false, false, false, true, 0, false, timers, true);
|
||||||
}
|
}
|
||||||
@ -472,12 +476,15 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
|
|
||||||
public void sendZoneInPackets(WorldManager world, ushort spawnType)
|
public void sendZoneInPackets(WorldManager world, ushort spawnType)
|
||||||
{
|
{
|
||||||
queuePacket(SetMapPacket.buildPacket(actorId, zone.regionId, zone.actorId));
|
queuePacket(SetActorIsZoningPacket.buildPacket(actorId, actorId, false));
|
||||||
|
queuePacket(_0x10Packet.buildPacket(actorId, 0xFF));
|
||||||
queuePacket(SetMusicPacket.buildPacket(actorId, zone.bgmDay, 0x01));
|
queuePacket(SetMusicPacket.buildPacket(actorId, zone.bgmDay, 0x01));
|
||||||
queuePacket(SetWeatherPacket.buildPacket(actorId, SetWeatherPacket.WEATHER_CLEAR));
|
queuePacket(SetWeatherPacket.buildPacket(actorId, SetWeatherPacket.WEATHER_CLEAR));
|
||||||
|
|
||||||
|
queuePacket(SetMapPacket.buildPacket(actorId, zone.regionId, zone.actorId));
|
||||||
|
|
||||||
queuePacket(getSpawnPackets(actorId, spawnType));
|
queuePacket(getSpawnPackets(actorId, spawnType));
|
||||||
//getSpawnPackets(actorId, spawnType).debugPrintPacket();
|
getSpawnPackets(actorId, spawnType).debugPrintPacket();
|
||||||
|
|
||||||
#region grouptest
|
#region grouptest
|
||||||
//Retainers
|
//Retainers
|
||||||
@ -511,6 +518,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
|
|
||||||
playerSession.queuePacket(getInitPackets(actorId));
|
playerSession.queuePacket(getInitPackets(actorId));
|
||||||
|
|
||||||
|
|
||||||
BasePacket areaMasterSpawn = zone.getSpawnPackets(actorId);
|
BasePacket areaMasterSpawn = zone.getSpawnPackets(actorId);
|
||||||
BasePacket debugSpawn = world.GetDebugActor().getSpawnPackets(actorId);
|
BasePacket debugSpawn = world.GetDebugActor().getSpawnPackets(actorId);
|
||||||
BasePacket worldMasterSpawn = world.GetActor().getSpawnPackets(actorId);
|
BasePacket worldMasterSpawn = world.GetActor().getSpawnPackets(actorId);
|
||||||
@ -523,8 +531,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
playerSession.queuePacket(debugSpawn);
|
playerSession.queuePacket(debugSpawn);
|
||||||
if (directorSpawn != null)
|
if (directorSpawn != null)
|
||||||
{
|
{
|
||||||
directorSpawn.debugPrintPacket();
|
//directorSpawn.debugPrintPacket();
|
||||||
currentDirector.getInitPackets(actorId).debugPrintPacket();
|
// currentDirector.getInitPackets(actorId).debugPrintPacket();
|
||||||
queuePacket(directorSpawn);
|
queuePacket(directorSpawn);
|
||||||
queuePacket(currentDirector.getInitPackets(actorId));
|
queuePacket(currentDirector.getInitPackets(actorId));
|
||||||
//queuePacket(currentDirector.getSetEventStatusPackets(actorId));
|
//queuePacket(currentDirector.getSetEventStatusPackets(actorId));
|
||||||
@ -591,6 +599,12 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
playerSession.queuePacket(packet, true, false);
|
playerSession.queuePacket(packet, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void queuePackets(List<SubPacket> packets)
|
||||||
|
{
|
||||||
|
foreach (SubPacket subpacket in packets)
|
||||||
|
playerSession.queuePacket(subpacket, true, false);
|
||||||
|
}
|
||||||
|
|
||||||
public void broadcastPacket(SubPacket packet, bool sendToSelf)
|
public void broadcastPacket(SubPacket packet, bool sendToSelf)
|
||||||
{
|
{
|
||||||
if (sendToSelf)
|
if (sendToSelf)
|
||||||
@ -955,6 +969,47 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
return equipment;
|
return equipment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public byte getInitialTown()
|
||||||
|
{
|
||||||
|
return playerWork.initialTown;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getFreeQuestSlot()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < questScenario.Length; i++)
|
||||||
|
{
|
||||||
|
if (questScenario[i] == null)
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addQuest(uint id)
|
||||||
|
{
|
||||||
|
Actor actor = Server.getStaticActors((0xA0F00000 | id));
|
||||||
|
addQuest(actor.actorName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addQuest(string name)
|
||||||
|
{
|
||||||
|
Actor actor = Server.getStaticActors(name);
|
||||||
|
|
||||||
|
if (actor == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
uint id = actor.actorId;
|
||||||
|
|
||||||
|
int freeSlot = getFreeQuestSlot();
|
||||||
|
|
||||||
|
if (freeSlot == -1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
playerWork.questScenario[freeSlot] = id;
|
||||||
|
questScenario[freeSlot] = new Quest(this, playerWork.questScenario[freeSlot], name, null, 0);
|
||||||
|
Database.saveQuest(this, questScenario[freeSlot]);
|
||||||
|
}
|
||||||
|
|
||||||
public Quest getQuest(uint id)
|
public Quest getQuest(uint id)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < questScenario.Length; i++)
|
for (int i = 0; i < questScenario.Length; i++)
|
||||||
@ -966,6 +1021,28 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Quest getQuest(string name)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < questScenario.Length; i++)
|
||||||
|
{
|
||||||
|
if (questScenario[i] != null && questScenario[i].actorName.ToLower().Equals(name.ToLower()))
|
||||||
|
return questScenario[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool hasQuest(string name)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < questScenario.Length; i++)
|
||||||
|
{
|
||||||
|
if (questScenario[i] != null && questScenario[i].actorName.ToLower().Equals(name.ToLower()))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public bool hasQuest(uint id)
|
public bool hasQuest(uint id)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < questScenario.Length; i++)
|
for (int i = 0; i < questScenario.Length; i++)
|
||||||
@ -977,13 +1054,38 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDirector(string directorType)
|
public int getQuestSlot(uint id)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < questScenario.Length; i++)
|
||||||
|
{
|
||||||
|
if (questScenario[i] != null && questScenario[i].actorId == (0xA0F00000 | id))
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDirector(string directorType, bool sendPackets)
|
||||||
{
|
{
|
||||||
if (directorType.Equals("openingDirector"))
|
if (directorType.Equals("openingDirector"))
|
||||||
{
|
{
|
||||||
currentDirector = new OpeningDirector(0x46080012);
|
currentDirector = new OpeningDirector(this, 0x46080012);
|
||||||
|
}
|
||||||
|
else if (directorType.Equals("QuestDirectorMan0l001"))
|
||||||
|
{
|
||||||
|
currentDirector = new QuestDirectorMan0l001(this, 0x46080012);
|
||||||
|
}
|
||||||
|
else if (directorType.Equals("QuestDirectorMan0g001"))
|
||||||
|
{
|
||||||
|
currentDirector = new QuestDirectorMan0g001(this, 0x46080012);
|
||||||
|
}
|
||||||
|
else if (directorType.Equals("QuestDirectorMan0u001"))
|
||||||
|
{
|
||||||
|
currentDirector = new QuestDirectorMan0u001(this, 0x46080012);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sendPackets)
|
||||||
|
{
|
||||||
queuePacket(RemoveActorPacket.buildPacket(actorId, 0x46080012));
|
queuePacket(RemoveActorPacket.buildPacket(actorId, 0x46080012));
|
||||||
queuePacket(currentDirector.getSpawnPackets(actorId));
|
queuePacket(currentDirector.getSpawnPackets(actorId));
|
||||||
queuePacket(currentDirector.getInitPackets(actorId));
|
queuePacket(currentDirector.getInitPackets(actorId));
|
||||||
@ -992,6 +1094,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
//currentDirector.getInitPackets(actorId).debugPrintPacket();
|
//currentDirector.getInitPackets(actorId).debugPrintPacket();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public Director getDirector()
|
public Director getDirector()
|
||||||
{
|
{
|
||||||
return currentDirector;
|
return currentDirector;
|
||||||
@ -1037,22 +1141,32 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
public void runEventFunction(string functionName, params object[] parameters)
|
public void runEventFunction(string functionName, params object[] parameters)
|
||||||
{
|
{
|
||||||
List<LuaParam> lParams = LuaUtils.createLuaParamList(parameters);
|
List<LuaParam> lParams = LuaUtils.createLuaParamList(parameters);
|
||||||
SubPacket spacket = RunEventFunctionPacket.buildPacket(actorId, eventCurrentOwner, eventCurrentStarter, functionName, lParams);
|
SubPacket spacket = RunEventFunctionPacket.buildPacket(actorId, currentEventOwner, currentEventName, functionName, lParams);
|
||||||
spacket.debugPrintSubPacket();
|
spacket.debugPrintSubPacket();
|
||||||
queuePacket(spacket);
|
queuePacket(spacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void endEvent()
|
public void endEvent()
|
||||||
{
|
{
|
||||||
SubPacket p = EndEventPacket.buildPacket(actorId, eventCurrentOwner, eventCurrentStarter);
|
SubPacket p = EndEventPacket.buildPacket(actorId, currentEventOwner, currentEventName);
|
||||||
p.debugPrintSubPacket();
|
p.debugPrintSubPacket();
|
||||||
queuePacket(p);
|
queuePacket(p);
|
||||||
|
|
||||||
eventCurrentOwner = 0;
|
currentEventOwner = 0;
|
||||||
eventCurrentStarter = "";
|
currentEventName = "";
|
||||||
eventMenuId = 0;
|
eventMenuId = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void endCommand()
|
||||||
|
{
|
||||||
|
SubPacket p = EndEventPacket.buildPacket(actorId, currentCommand, currentCommandName);
|
||||||
|
p.debugPrintSubPacket();
|
||||||
|
queuePacket(p);
|
||||||
|
|
||||||
|
currentCommand = 0;
|
||||||
|
currentCommandName = "";
|
||||||
|
}
|
||||||
|
|
||||||
public void setCurrentMenuId(uint id)
|
public void setCurrentMenuId(uint id)
|
||||||
{
|
{
|
||||||
eventMenuId = id;
|
eventMenuId = id;
|
||||||
@ -1067,12 +1181,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
{
|
{
|
||||||
|
|
||||||
//Update Instance
|
//Update Instance
|
||||||
List<BasePacket> instanceUpdatePackets = playerSession.updateInstance(zone.getActorsAroundActor(this, 50));
|
playerSession.updateInstance(zone.getActorsAroundActor(this, 50));
|
||||||
foreach (BasePacket bp in instanceUpdatePackets)
|
|
||||||
{
|
|
||||||
// bp.debugPrintPacket();
|
|
||||||
queuePacket(bp);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using FFXIVClassic_Lobby_Server.packets;
|
using FFXIVClassic_Lobby_Server.packets;
|
||||||
using FFXIVClassic_Map_Server.Actors;
|
using FFXIVClassic_Map_Server.Actors;
|
||||||
|
using FFXIVClassic_Map_Server.lua;
|
||||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@ -11,9 +12,11 @@ namespace FFXIVClassic_Map_Server.actors.director
|
|||||||
{
|
{
|
||||||
class Director : Actor
|
class Director : Actor
|
||||||
{
|
{
|
||||||
public Director(uint id) : base(id)
|
Player owner;
|
||||||
{
|
|
||||||
|
|
||||||
|
public Director(Player owner, uint id) : base(id)
|
||||||
|
{
|
||||||
|
this.owner = owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual BasePacket getSpawnPackets(uint playerActorId, uint spawnType)
|
public virtual BasePacket getSpawnPackets(uint playerActorId, uint spawnType)
|
||||||
@ -37,5 +40,15 @@ namespace FFXIVClassic_Map_Server.actors.director
|
|||||||
return BasePacket.createPacket(initProperties.buildPacket(playerActorId, actorId), true, false);
|
return BasePacket.createPacket(initProperties.buildPacket(playerActorId, actorId), true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onTalked(Npc npc)
|
||||||
|
{
|
||||||
|
LuaEngine.doDirectorOnTalked(this, owner, npc);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onCommand(Command command)
|
||||||
|
{
|
||||||
|
LuaEngine.doDirectorOnCommand(this, owner, command);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using FFXIVClassic_Lobby_Server.packets;
|
using FFXIVClassic_Lobby_Server.packets;
|
||||||
|
using FFXIVClassic_Map_Server.Actors;
|
||||||
using FFXIVClassic_Map_Server.lua;
|
using FFXIVClassic_Map_Server.lua;
|
||||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||||
using System;
|
using System;
|
||||||
@ -11,12 +12,15 @@ namespace FFXIVClassic_Map_Server.actors.director
|
|||||||
{
|
{
|
||||||
class OpeningDirector : Director
|
class OpeningDirector : Director
|
||||||
{
|
{
|
||||||
public OpeningDirector(uint id) : base(id)
|
public OpeningDirector(Player player, uint id) : base(player, id)
|
||||||
{
|
{
|
||||||
this.displayNameId = 0;
|
this.displayNameId = 0;
|
||||||
this.customDisplayName = "openingDire";
|
this.customDisplayName = String.Format("openingDire_{0}_{1}", player.zone.zoneName, "04");
|
||||||
|
|
||||||
|
this.actorName = String.Format("openingDire_{0}_{1}@{2:x3}{3:x2}", player.zone.zoneName, "04", player.zoneId, 0);
|
||||||
|
|
||||||
|
this.actorName = this.actorName.Replace("Battle", "Btl");
|
||||||
|
|
||||||
this.actorName = "openingDire";
|
|
||||||
this.className = "OpeningDirector";
|
this.className = "OpeningDirector";
|
||||||
|
|
||||||
this.eventConditions = new EventList();
|
this.eventConditions = new EventList();
|
||||||
|
@ -15,8 +15,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
{
|
{
|
||||||
private uint weatherId;
|
private uint weatherId;
|
||||||
|
|
||||||
public WeatherDirector(uint weatherId)
|
public WeatherDirector(Player player, uint weatherId)
|
||||||
: base(0x5FF80003)
|
: base(player, 0x5FF80003)
|
||||||
{
|
{
|
||||||
this.weatherId = weatherId;
|
this.weatherId = weatherId;
|
||||||
|
|
||||||
|
@ -0,0 +1,41 @@
|
|||||||
|
using FFXIVClassic_Lobby_Server.packets;
|
||||||
|
using FFXIVClassic_Map_Server.Actors;
|
||||||
|
using FFXIVClassic_Map_Server.lua;
|
||||||
|
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace FFXIVClassic_Map_Server.actors.director
|
||||||
|
{
|
||||||
|
class QuestDirectorMan0g001 : Director
|
||||||
|
{
|
||||||
|
public QuestDirectorMan0g001(Player player, uint id)
|
||||||
|
: base(player, id)
|
||||||
|
{
|
||||||
|
this.displayNameId = 0;
|
||||||
|
this.customDisplayName = "questDirect_fst0Btl03_01";
|
||||||
|
|
||||||
|
this.actorName = "questDirect_fst0Btl03_01@0A615";
|
||||||
|
this.className = "QuestDirectorMan0g001";
|
||||||
|
|
||||||
|
this.eventConditions = new EventList();
|
||||||
|
|
||||||
|
List<EventList.NoticeEventCondition> noticeEventList = new List<EventList.NoticeEventCondition>();
|
||||||
|
|
||||||
|
noticeEventList.Add(new EventList.NoticeEventCondition("noticeEvent", 0xE, 0x0));
|
||||||
|
noticeEventList.Add(new EventList.NoticeEventCondition("noticeRequest", 0x0, 0x1));
|
||||||
|
|
||||||
|
this.eventConditions.noticeEventConditions = noticeEventList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override SubPacket createScriptBindPacket(uint playerActorId)
|
||||||
|
{
|
||||||
|
List<LuaParam> lParams;
|
||||||
|
lParams = LuaUtils.createLuaParamList("/Director/Quest/QuestDirectorMan0g001", false, false, false, false, false, 0x753A);
|
||||||
|
return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
using FFXIVClassic_Lobby_Server.packets;
|
||||||
|
using FFXIVClassic_Map_Server.Actors;
|
||||||
|
using FFXIVClassic_Map_Server.lua;
|
||||||
|
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace FFXIVClassic_Map_Server.actors.director
|
||||||
|
{
|
||||||
|
class QuestDirectorMan0l001 : Director
|
||||||
|
{
|
||||||
|
public QuestDirectorMan0l001(Player player, uint id)
|
||||||
|
: base(player, id)
|
||||||
|
{
|
||||||
|
this.displayNameId = 0;
|
||||||
|
this.customDisplayName = "questDirect_ocn0Btl02_01";
|
||||||
|
|
||||||
|
this.actorName = "questDirect_ocn0Btl02_01@0C196";
|
||||||
|
this.className = "QuestDirectorMan0l001";
|
||||||
|
|
||||||
|
this.eventConditions = new EventList();
|
||||||
|
|
||||||
|
List<EventList.NoticeEventCondition> noticeEventList = new List<EventList.NoticeEventCondition>();
|
||||||
|
|
||||||
|
noticeEventList.Add(new EventList.NoticeEventCondition("noticeEvent", 0xE, 0x0));
|
||||||
|
noticeEventList.Add(new EventList.NoticeEventCondition("noticeRequest", 0x0, 0x1));
|
||||||
|
|
||||||
|
this.eventConditions.noticeEventConditions = noticeEventList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override SubPacket createScriptBindPacket(uint playerActorId)
|
||||||
|
{
|
||||||
|
List<LuaParam> lParams;
|
||||||
|
lParams = LuaUtils.createLuaParamList("/Director/Quest/QuestDirectorMan0l001", false, false, false, false, false, 0x7532);
|
||||||
|
return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
using FFXIVClassic_Lobby_Server.packets;
|
||||||
|
using FFXIVClassic_Map_Server.Actors;
|
||||||
|
using FFXIVClassic_Map_Server.lua;
|
||||||
|
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace FFXIVClassic_Map_Server.actors.director
|
||||||
|
{
|
||||||
|
class QuestDirectorMan0u001 : Director
|
||||||
|
{
|
||||||
|
public QuestDirectorMan0u001(Player player, uint id)
|
||||||
|
: base(player, id)
|
||||||
|
{
|
||||||
|
this.displayNameId = 0;
|
||||||
|
this.customDisplayName = "questDirect_wil0Btl01_01";
|
||||||
|
|
||||||
|
this.actorName = "questDirect_wil0Btl01_01@0A615";
|
||||||
|
this.className = "QuestDirectorMan0u001";
|
||||||
|
|
||||||
|
this.eventConditions = new EventList();
|
||||||
|
|
||||||
|
List<EventList.NoticeEventCondition> noticeEventList = new List<EventList.NoticeEventCondition>();
|
||||||
|
|
||||||
|
noticeEventList.Add(new EventList.NoticeEventCondition("noticeEvent", 0xE, 0x0));
|
||||||
|
noticeEventList.Add(new EventList.NoticeEventCondition("noticeRequest", 0x0, 0x1));
|
||||||
|
|
||||||
|
this.eventConditions.noticeEventConditions = noticeEventList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override SubPacket createScriptBindPacket(uint playerActorId)
|
||||||
|
{
|
||||||
|
List<LuaParam> lParams;
|
||||||
|
lParams = LuaUtils.createLuaParamList("/Director/Quest/QuestDirectorMan0u001", false, false, false, false, false, 0x757F);
|
||||||
|
return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,6 @@
|
|||||||
using FFXIVClassic_Lobby_Server.common;
|
using FFXIVClassic_Lobby_Server;
|
||||||
|
using FFXIVClassic_Lobby_Server.common;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
@ -6,6 +8,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
{
|
{
|
||||||
class Quest : Actor
|
class Quest : Actor
|
||||||
{
|
{
|
||||||
|
private Player owner;
|
||||||
private int currentPhase = 0;
|
private int currentPhase = 0;
|
||||||
private uint questFlags = 0;
|
private uint questFlags = 0;
|
||||||
private Dictionary<string, Object> questData = new Dictionary<string, object>();
|
private Dictionary<string, Object> questData = new Dictionary<string, object>();
|
||||||
@ -16,14 +19,24 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
actorName = name;
|
actorName = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InitQuestData(string dataName, object initialValue)
|
public Quest(Player owner, uint actorID, string name, string questDataJson, uint questFlags)
|
||||||
|
: base(actorID)
|
||||||
{
|
{
|
||||||
questData[dataName] = initialValue;
|
this.owner = owner;
|
||||||
|
actorName = name;
|
||||||
|
this.questFlags = questFlags;
|
||||||
|
|
||||||
|
if (questDataJson != null)
|
||||||
|
this.questData = JsonConvert.DeserializeObject<Dictionary<string, Object>>(questDataJson);
|
||||||
|
else
|
||||||
|
questData = null;
|
||||||
|
|
||||||
|
if (questData == null)
|
||||||
|
questData = new Dictionary<string, object>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateQuestData(string dataName, object data)
|
public void SetQuestData(string dataName, object data)
|
||||||
{
|
{
|
||||||
if (questData.ContainsKey(dataName))
|
|
||||||
questData[dataName] = data;
|
questData[dataName] = data;
|
||||||
|
|
||||||
//Inform update
|
//Inform update
|
||||||
@ -37,11 +50,21 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ClearQuestData()
|
||||||
|
{
|
||||||
|
questData.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
public uint GetQuestId()
|
public uint GetQuestId()
|
||||||
{
|
{
|
||||||
return actorId;
|
return actorId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ClearQuestFlags()
|
||||||
|
{
|
||||||
|
questFlags = 0;
|
||||||
|
}
|
||||||
|
|
||||||
public void SetQuestFlag(int bitIndex, bool value)
|
public void SetQuestFlag(int bitIndex, bool value)
|
||||||
{
|
{
|
||||||
if (bitIndex >= 32)
|
if (bitIndex >= 32)
|
||||||
@ -68,7 +91,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return (questFlags & (1 << bitIndex)) == 1;
|
return (questFlags & (1 << bitIndex)) == (1 << bitIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetPhase()
|
public int GetPhase()
|
||||||
@ -81,5 +104,20 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
currentPhase++;
|
currentPhase++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public uint GetQuestFlags()
|
||||||
|
{
|
||||||
|
return questFlags;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetSerializedQuestData()
|
||||||
|
{
|
||||||
|
return JsonConvert.SerializeObject(questData, Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SaveData()
|
||||||
|
{
|
||||||
|
Database.saveQuest(owner, this);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
using FFXIVClassic_Lobby_Server.common;
|
using FFXIVClassic_Lobby_Server.common;
|
||||||
using FFXIVClassic_Lobby_Server.packets;
|
using FFXIVClassic_Lobby_Server.packets;
|
||||||
using FFXIVClassic_Map_Server.Actors;
|
using FFXIVClassic_Map_Server.Actors;
|
||||||
|
using FFXIVClassic_Map_Server.lua;
|
||||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@ -112,7 +113,7 @@ namespace FFXIVClassic_Map_Server.dataobjects
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<BasePacket> updateInstance(List<Actor> list)
|
public void updateInstance(List<Actor> list)
|
||||||
{
|
{
|
||||||
List<BasePacket> basePackets = new List<BasePacket>();
|
List<BasePacket> basePackets = new List<BasePacket>();
|
||||||
List<SubPacket> removeActorSubpackets = new List<SubPacket>();
|
List<SubPacket> removeActorSubpackets = new List<SubPacket>();
|
||||||
@ -123,14 +124,11 @@ namespace FFXIVClassic_Map_Server.dataobjects
|
|||||||
{
|
{
|
||||||
if (!list.Contains(actorInstanceList[i]))
|
if (!list.Contains(actorInstanceList[i]))
|
||||||
{
|
{
|
||||||
removeActorSubpackets.Add(RemoveActorPacket.buildPacket(playerActor.actorId, actorInstanceList[i].actorId));
|
getActor().queuePacket(RemoveActorPacket.buildPacket(playerActor.actorId, actorInstanceList[i].actorId));
|
||||||
actorInstanceList.RemoveAt(i);
|
actorInstanceList.RemoveAt(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (removeActorSubpackets.Count != 0)
|
|
||||||
basePackets.Add(BasePacket.createPacket(removeActorSubpackets, true, false));
|
|
||||||
|
|
||||||
//Add new actors or move
|
//Add new actors or move
|
||||||
for (int i = 0; i < list.Count; i++)
|
for (int i = 0; i < list.Count; i++)
|
||||||
{
|
{
|
||||||
@ -141,21 +139,22 @@ namespace FFXIVClassic_Map_Server.dataobjects
|
|||||||
|
|
||||||
if (actorInstanceList.Contains(actor))
|
if (actorInstanceList.Contains(actor))
|
||||||
{
|
{
|
||||||
posUpdateSubpackets.Add(actor.createPositionUpdatePacket(playerActor.actorId));
|
getActor().queuePacket(actor.createPositionUpdatePacket(playerActor.actorId));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
basePackets.Add(actor.getSpawnPackets(playerActor.actorId, 1));
|
getActor().queuePacket(actor.getSpawnPackets(playerActor.actorId, 1));
|
||||||
basePackets.Add(actor.getInitPackets(playerActor.actorId));
|
getActor().queuePacket(actor.getInitPackets(playerActor.actorId));
|
||||||
basePackets.Add(actor.getSetEventStatusPackets(playerActor.actorId));
|
getActor().queuePacket(actor.getSetEventStatusPackets(playerActor.actorId));
|
||||||
actorInstanceList.Add(actor);
|
actorInstanceList.Add(actor);
|
||||||
|
|
||||||
|
if (actor is Npc)
|
||||||
|
{
|
||||||
|
LuaEngine.doActorOnSpawn(getActor(), (Npc)actor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (posUpdateSubpackets.Count > 0)
|
|
||||||
basePackets.Add(BasePacket.createPacket(posUpdateSubpackets, true, false));
|
|
||||||
|
|
||||||
return basePackets;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using FFXIVClassic_Lobby_Server;
|
using FFXIVClassic_Lobby_Server;
|
||||||
|
using FFXIVClassic_Lobby_Server.common;
|
||||||
using FFXIVClassic_Lobby_Server.packets;
|
using FFXIVClassic_Lobby_Server.packets;
|
||||||
using FFXIVClassic_Map_Server.actors.director;
|
using FFXIVClassic_Map_Server.actors.director;
|
||||||
using FFXIVClassic_Map_Server.Actors;
|
using FFXIVClassic_Map_Server.Actors;
|
||||||
@ -31,7 +32,7 @@ namespace FFXIVClassic_Map_Server.lua
|
|||||||
UserData.RegistrationPolicy = InteropRegistrationPolicy.Automatic;
|
UserData.RegistrationPolicy = InteropRegistrationPolicy.Automatic;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<LuaParam> doActorOnInstantiate(Player player, Actor target)
|
public static List<LuaParam> doActorInstantiate(Player player, Actor target)
|
||||||
{
|
{
|
||||||
string luaPath;
|
string luaPath;
|
||||||
|
|
||||||
@ -40,22 +41,18 @@ namespace FFXIVClassic_Map_Server.lua
|
|||||||
luaPath = String.Format(FILEPATH_NPCS, target.zoneId, target.getName());
|
luaPath = String.Format(FILEPATH_NPCS, target.zoneId, target.getName());
|
||||||
if (File.Exists(luaPath))
|
if (File.Exists(luaPath))
|
||||||
{
|
{
|
||||||
Script script = new Script();
|
Script script = loadScript(luaPath);
|
||||||
((ScriptLoaderBase)script.Options.ScriptLoader).ModulePaths = new string[] { "./scripts/?", "./scripts/?.lua" };
|
|
||||||
script.Globals["getStaticActor"] = (Func<string, Actor>)Server.getStaticActors;
|
if (script == null)
|
||||||
script.Globals["getWorldMaster"] = (Func<Actor>)Server.GetWorldManager().GetActor;
|
return null;
|
||||||
script.Globals["getItemGamedata"] = (Func<uint, Item>)Server.getItemGamedata;
|
|
||||||
script.DoFile(luaPath);
|
DynValue result = script.Call(script.Globals["init"], target);
|
||||||
DynValue result = script.Call(script.Globals["onInstantiate"], target);
|
|
||||||
List<LuaParam> lparams = LuaUtils.createLuaParamList(result);
|
List<LuaParam> lparams = LuaUtils.createLuaParamList(result);
|
||||||
return lparams;
|
return lparams;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
List<SubPacket> sendError = new List<SubPacket>();
|
SendError(player, String.Format("ERROR: Could not find script for actor {0}.", target.getName()));
|
||||||
sendError.Add(EndEventPacket.buildPacket(player.actorId, player.eventCurrentOwner, player.eventCurrentStarter));
|
|
||||||
player.sendMessage(SendMessagePacket.MESSAGE_TYPE_SYSTEM_ERROR, "", String.Format("ERROR: Could not find script for actor {0}.", target.getName()));
|
|
||||||
player.playerSession.queuePacket(BasePacket.createPacket(sendError, true, false));
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -80,13 +77,10 @@ namespace FFXIVClassic_Map_Server.lua
|
|||||||
|
|
||||||
if (File.Exists(luaPath))
|
if (File.Exists(luaPath))
|
||||||
{
|
{
|
||||||
Script script = new Script();
|
Script script = loadScript(luaPath);
|
||||||
((ScriptLoaderBase)script.Options.ScriptLoader).ModulePaths = new string[] { "./scripts/?", "./scripts/?.lua" };
|
|
||||||
script.Globals["getWorldManager"] = (Func<WorldManager>)Server.GetWorldManager;
|
if (script == null)
|
||||||
script.Globals["getStaticActor"] = (Func<string, Actor>)Server.getStaticActors;
|
return;
|
||||||
script.Globals["getWorldMaster"] = (Func<Actor>)Server.GetWorldManager().GetActor;
|
|
||||||
script.Globals["getItemGamedata"] = (Func<uint, Item>)Server.getItemGamedata;
|
|
||||||
script.DoFile(luaPath);
|
|
||||||
|
|
||||||
//Have to do this to combine LuaParams
|
//Have to do this to combine LuaParams
|
||||||
List<Object> objects = new List<Object>();
|
List<Object> objects = new List<Object>();
|
||||||
@ -98,14 +92,34 @@ namespace FFXIVClassic_Map_Server.lua
|
|||||||
objects.AddRange(LuaUtils.createLuaParamObjectList(eventStart.luaParams));
|
objects.AddRange(LuaUtils.createLuaParamObjectList(eventStart.luaParams));
|
||||||
|
|
||||||
//Run Script
|
//Run Script
|
||||||
DynValue result = script.Call(script.Globals["onEventStarted"], objects.ToArray());
|
if (!script.Globals.Get("onEventStarted").IsNil())
|
||||||
|
script.Call(script.Globals["onEventStarted"], objects.ToArray());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
List<SubPacket> sendError = new List<SubPacket>();
|
SendError(player, String.Format("ERROR: Could not find script for actor {0}.", target.getName()));
|
||||||
sendError.Add(EndEventPacket.buildPacket(player.actorId, player.eventCurrentOwner, player.eventCurrentStarter));
|
}
|
||||||
player.sendMessage(SendMessagePacket.MESSAGE_TYPE_SYSTEM_ERROR, "", String.Format("ERROR: Could not find script for actor {0}.", target.getName()));
|
|
||||||
player.playerSession.queuePacket(BasePacket.createPacket(sendError, true, false));
|
}
|
||||||
|
|
||||||
|
public static void doActorOnSpawn(Player player, Npc target)
|
||||||
|
{
|
||||||
|
string luaPath = String.Format(FILEPATH_NPCS, target.zoneId, target.getName());
|
||||||
|
|
||||||
|
if (File.Exists(luaPath))
|
||||||
|
{
|
||||||
|
Script script = loadScript(luaPath);
|
||||||
|
|
||||||
|
if (script == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
//Run Script
|
||||||
|
if (!script.Globals.Get("onSpawn").IsNil())
|
||||||
|
script.Call(script.Globals["onSpawn"], player, target);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendError(player, String.Format("ERROR: Could not find script for actor {0}.", target.getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -123,30 +137,25 @@ namespace FFXIVClassic_Map_Server.lua
|
|||||||
|
|
||||||
if (File.Exists(luaPath))
|
if (File.Exists(luaPath))
|
||||||
{
|
{
|
||||||
Script script = new Script();
|
Script script = loadScript(luaPath);
|
||||||
((ScriptLoaderBase)script.Options.ScriptLoader).ModulePaths = new string[] { "./scripts/?", "./scripts/?.lua" };
|
|
||||||
script.Globals["getWorldManager"] = (Func<WorldManager>)Server.GetWorldManager;
|
if (script == null)
|
||||||
script.Globals["getStaticActor"] = (Func<string, Actor>)Server.getStaticActors;
|
return;
|
||||||
script.Globals["getWorldMaster"] = (Func<Actor>)Server.GetWorldManager().GetActor;
|
|
||||||
script.Globals["getItemGamedata"] = (Func<uint, Item>)Server.getItemGamedata;
|
|
||||||
script.DoFile(luaPath);
|
|
||||||
|
|
||||||
//Have to do this to combine LuaParams
|
//Have to do this to combine LuaParams
|
||||||
List<Object> objects = new List<Object>();
|
List<Object> objects = new List<Object>();
|
||||||
objects.Add(player);
|
objects.Add(player);
|
||||||
objects.Add(target);
|
objects.Add(target);
|
||||||
objects.Add(eventUpdate.step);
|
objects.Add(eventUpdate.val2);
|
||||||
objects.AddRange(LuaUtils.createLuaParamObjectList(eventUpdate.luaParams));
|
objects.AddRange(LuaUtils.createLuaParamObjectList(eventUpdate.luaParams));
|
||||||
|
|
||||||
//Run Script
|
//Run Script
|
||||||
DynValue result = script.Call(script.Globals["onEventUpdate"], objects.ToArray());
|
if (!script.Globals.Get("onEventUpdate").IsNil())
|
||||||
|
script.Call(script.Globals["onEventUpdate"], objects.ToArray());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
List<SubPacket> sendError = new List<SubPacket>();
|
SendError(player, String.Format("ERROR: Could not find script for actor {0}.", target.getName()));
|
||||||
sendError.Add(EndEventPacket.buildPacket(player.actorId, player.eventCurrentOwner, player.eventCurrentStarter));
|
|
||||||
player.sendMessage(SendMessagePacket.MESSAGE_TYPE_SYSTEM_ERROR, "", String.Format("ERROR: Could not find script for actor {0}.", target.getName()));
|
|
||||||
player.playerSession.queuePacket(BasePacket.createPacket(sendError, true, false));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,35 +165,117 @@ namespace FFXIVClassic_Map_Server.lua
|
|||||||
|
|
||||||
if (File.Exists(luaPath))
|
if (File.Exists(luaPath))
|
||||||
{
|
{
|
||||||
Script script = new Script();
|
Script script = loadScript(luaPath);
|
||||||
((ScriptLoaderBase)script.Options.ScriptLoader).ModulePaths = new string[] { "./scripts/?", "./scripts/?.lua" };
|
|
||||||
script.Globals["getWorldManager"] = (Func<WorldManager>)Server.GetWorldManager;
|
if (script == null)
|
||||||
script.Globals["getStaticActor"] = (Func<string, Actor>)Server.getStaticActors;
|
return;
|
||||||
script.Globals["getWorldMaster"] = (Func<Actor>)Server.GetWorldManager().GetActor;
|
|
||||||
script.Globals["getItemGamedata"] = (Func<uint, Item>)Server.getItemGamedata;
|
|
||||||
script.DoFile(luaPath);
|
|
||||||
|
|
||||||
//Run Script
|
//Run Script
|
||||||
DynValue result = script.Call(script.Globals["onZoneIn"], player);
|
if (!script.Globals.Get("onZoneIn").IsNil())
|
||||||
|
script.Call(script.Globals["onZoneIn"], player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void onBeginLogin(Player player)
|
||||||
|
{
|
||||||
|
if (File.Exists(FILEPATH_PLAYER))
|
||||||
|
{
|
||||||
|
Script script = loadScript(FILEPATH_PLAYER);
|
||||||
|
|
||||||
|
if (script == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
//Run Script
|
||||||
|
if (!script.Globals.Get("onBeginLogin").IsNil())
|
||||||
|
script.Call(script.Globals["onBeginLogin"], player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void onLogin(Player player)
|
public static void onLogin(Player player)
|
||||||
{
|
{
|
||||||
if (File.Exists(FILEPATH_PLAYER))
|
if (File.Exists(FILEPATH_PLAYER))
|
||||||
|
{
|
||||||
|
Script script = loadScript(FILEPATH_PLAYER);
|
||||||
|
|
||||||
|
if (script == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
//Run Script
|
||||||
|
if (!script.Globals.Get("onLogin").IsNil())
|
||||||
|
script.Call(script.Globals["onLogin"], player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Script loadScript(string filename)
|
||||||
{
|
{
|
||||||
Script script = new Script();
|
Script script = new Script();
|
||||||
((ScriptLoaderBase)script.Options.ScriptLoader).ModulePaths = new string[] { "./scripts/?", "./scripts/?.lua" };
|
((FileSystemScriptLoader)script.Options.ScriptLoader).ModulePaths = FileSystemScriptLoader.UnpackStringPaths("./scripts/?;./scripts/?.lua");
|
||||||
script.Globals["getWorldManager"] = (Func<WorldManager>)Server.GetWorldManager;
|
script.Globals["getWorldManager"] = (Func<WorldManager>)Server.GetWorldManager;
|
||||||
script.Globals["getStaticActor"] = (Func<string, Actor>)Server.getStaticActors;
|
script.Globals["getStaticActor"] = (Func<string, Actor>)Server.getStaticActors;
|
||||||
script.Globals["getWorldMaster"] = (Func<Actor>)Server.GetWorldManager().GetActor;
|
script.Globals["getWorldMaster"] = (Func<Actor>)Server.GetWorldManager().GetActor;
|
||||||
script.Globals["getItemGamedata"] = (Func<uint, Item>)Server.getItemGamedata;
|
script.Globals["getItemGamedata"] = (Func<uint, Item>)Server.getItemGamedata;
|
||||||
script.DoFile(FILEPATH_PLAYER);
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
script.DoFile(filename);
|
||||||
|
}
|
||||||
|
catch(SyntaxErrorException e)
|
||||||
|
{
|
||||||
|
Log.error(String.Format("LUAERROR: {0}.", e.DecoratedMessage));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return script;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void SendError(Player player, string message)
|
||||||
|
{
|
||||||
|
List<SubPacket> sendError = new List<SubPacket>();
|
||||||
|
sendError.Add(EndEventPacket.buildPacket(player.actorId, player.currentEventOwner, player.currentEventName));
|
||||||
|
player.sendMessage(SendMessagePacket.MESSAGE_TYPE_SYSTEM_ERROR, "", message);
|
||||||
|
player.playerSession.queuePacket(BasePacket.createPacket(sendError, true, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
internal static void doDirectorOnTalked(Director director, Player player, Npc npc)
|
||||||
|
{
|
||||||
|
string luaPath = String.Format(FILEPATH_DIRECTORS, director.getName());
|
||||||
|
|
||||||
|
if (File.Exists(luaPath))
|
||||||
|
{
|
||||||
|
Script script = loadScript(luaPath);
|
||||||
|
|
||||||
|
if (script == null)
|
||||||
|
return;
|
||||||
|
|
||||||
//Run Script
|
//Run Script
|
||||||
DynValue result = script.Call(script.Globals["onLogin"], player);
|
if (!script.Globals.Get("onTalked").IsNil())
|
||||||
|
script.Call(script.Globals["onTalked"], player, npc);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendError(player, String.Format("ERROR: Could not find script for director {0}.", director.getName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static void doDirectorOnCommand(Director director, Player player, Command command)
|
||||||
|
{
|
||||||
|
string luaPath = String.Format(FILEPATH_DIRECTORS, director.getName());
|
||||||
|
|
||||||
|
if (File.Exists(luaPath))
|
||||||
|
{
|
||||||
|
Script script = loadScript(luaPath);
|
||||||
|
|
||||||
|
if (script == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
//Run Script
|
||||||
|
if (!script.Globals.Get("onCommand").IsNil())
|
||||||
|
script.Call(script.Globals["onCommand"], player, command);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendError(player, String.Format("ERROR: Could not find script for director {0}.", director.getName()));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,11 @@ namespace FFXIVClassic_Map_Server
|
|||||||
{
|
{
|
||||||
foreach (LuaParam l in luaParams)
|
foreach (LuaParam l in luaParams)
|
||||||
{
|
{
|
||||||
|
if (l.typeID == 0x1)
|
||||||
|
writer.Write((Byte)0);
|
||||||
|
else
|
||||||
writer.Write((Byte)l.typeID);
|
writer.Write((Byte)l.typeID);
|
||||||
|
|
||||||
switch (l.typeID)
|
switch (l.typeID)
|
||||||
{
|
{
|
||||||
case 0x0: //Int32
|
case 0x0: //Int32
|
||||||
|
@ -0,0 +1,36 @@
|
|||||||
|
using FFXIVClassic_Lobby_Server.packets;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||||
|
{
|
||||||
|
class SetActorQuestGraphicPacket
|
||||||
|
{
|
||||||
|
public const int NONE = 0x0;
|
||||||
|
public const int QUEST = 0x2;
|
||||||
|
public const int NOGRAPHIC = 0x3;
|
||||||
|
public const int QUEST_IMPORTANT = 0x4;
|
||||||
|
|
||||||
|
public const ushort OPCODE = 0x00E3;
|
||||||
|
public const uint PACKET_SIZE = 0x28;
|
||||||
|
|
||||||
|
public static SubPacket buildPacket(uint playerActorID, uint targetActorID, int iconCode)
|
||||||
|
{
|
||||||
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
|
using (MemoryStream mem = new MemoryStream(data))
|
||||||
|
{
|
||||||
|
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||||
|
{
|
||||||
|
binWriter.Write((Int32)iconCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new SubPacket(OPCODE, targetActorID, playerActorID, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
31
FFXIVClassic Map Server/packets/send/_0x10Packet.cs
Normal file
31
FFXIVClassic Map Server/packets/send/_0x10Packet.cs
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
using FFXIVClassic_Lobby_Server.packets;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace FFXIVClassic_Map_Server.packets.send
|
||||||
|
{
|
||||||
|
class _0x10Packet
|
||||||
|
{
|
||||||
|
public const ushort OPCODE = 0x0010;
|
||||||
|
public const uint PACKET_SIZE = 0x28;
|
||||||
|
|
||||||
|
public static SubPacket buildPacket(uint playerActorId, int val)
|
||||||
|
{
|
||||||
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
|
using (MemoryStream mem = new MemoryStream(data))
|
||||||
|
{
|
||||||
|
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||||
|
{
|
||||||
|
binWriter.Write((UInt32)val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new SubPacket(OPCODE, playerActorId, playerActorId, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -6,7 +6,7 @@ Switches between active and passive mode states
|
|||||||
|
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
function onEventStarted(player, actor, triggerName)
|
function onEventStarted(player, command, triggerName)
|
||||||
|
|
||||||
if (player:getState() == 0) then
|
if (player:getState() == 0) then
|
||||||
player:changeState(2);
|
player:changeState(2);
|
||||||
@ -14,7 +14,12 @@ function onEventStarted(player, actor, triggerName)
|
|||||||
player:changeState(0);
|
player:changeState(0);
|
||||||
end
|
end
|
||||||
|
|
||||||
player:endEvent();
|
player:endCommand();
|
||||||
|
|
||||||
|
--For Opening Tutorial
|
||||||
|
if (player:hasQuest("Man0l0") or player:hasQuest("Man0g0") or player:hasQuest("Man0u0")) then
|
||||||
|
player:getDirector():onCommand(command);
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ function onEventStarted(player, actor, triggerName)
|
|||||||
player:sendGameMessage(worldMaster, 32503, 0x20);
|
player:sendGameMessage(worldMaster, 32503, 0x20);
|
||||||
end
|
end
|
||||||
|
|
||||||
player:endEvent();
|
player:endCommand();
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -18,6 +18,6 @@ function onEventUpdate(player, actor, step, arg1)
|
|||||||
|
|
||||||
--Submit
|
--Submit
|
||||||
|
|
||||||
player:endEvent();
|
player:endCommand();
|
||||||
|
|
||||||
end
|
end
|
@ -14,6 +14,6 @@ function onEventStarted(player, commandactor, triggerName, arg1, arg2, arg3, arg
|
|||||||
player:examinePlayer(actor);
|
player:examinePlayer(actor);
|
||||||
end
|
end
|
||||||
|
|
||||||
player:endEvent();
|
player:endCommand();
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -42,9 +42,6 @@ function onEventStarted(player, actor, triggerName, isGoobbue)
|
|||||||
player:changeState(0);
|
player:changeState(0);
|
||||||
end
|
end
|
||||||
|
|
||||||
player:endEvent();
|
player:endCommand();
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function onEventUpdate(player, npc)
|
|
||||||
end
|
|
@ -15,7 +15,7 @@ function onEventStarted(player, actor, triggerName, maxNumber)
|
|||||||
worldMaster = getWorldMaster();
|
worldMaster = getWorldMaster();
|
||||||
player:sendGameMessage(player, worldMaster, 25342, 0x20, result, maxNumber);
|
player:sendGameMessage(player, worldMaster, 25342, 0x20, result, maxNumber);
|
||||||
|
|
||||||
player:endEvent();
|
player:endCommand();
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ function onEventStarted(player, actor, triggerName, emoteId)
|
|||||||
player:changeState(0);
|
player:changeState(0);
|
||||||
end
|
end
|
||||||
|
|
||||||
player:endEvent();
|
player:endCommand();
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ function onEventStarted(player, actor, triggerName, emoteId)
|
|||||||
player:doEmote(emoteId);
|
player:doEmote(emoteId);
|
||||||
end
|
end
|
||||||
|
|
||||||
player:endEvent();
|
player:endCommand();
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ function onEventStarted(player, actor, triggerName, invActionInfo, param1, param
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
player:endEvent();
|
player:endCommand();
|
||||||
end
|
end
|
||||||
|
|
||||||
function loadGearset(player, classId)
|
function loadGearset(player, classId)
|
||||||
|
@ -11,5 +11,5 @@ The param "itemDBIds" has the vars: item1 and item2.
|
|||||||
|
|
||||||
function onEventStarted(player, actor, triggerName, invActionInfo, param1, param2, param3, param4, param5, param6, param7, param8, itemDBIds)
|
function onEventStarted(player, actor, triggerName, invActionInfo, param1, param2, param3, param4, param5, param6, param7, param8, itemDBIds)
|
||||||
player:getInventory(0x00):removeItem(invActionInfo.slot);
|
player:getInventory(0x00):removeItem(invActionInfo.slot);
|
||||||
player:endEvent();
|
player:endCommand();
|
||||||
end
|
end
|
||||||
|
@ -16,8 +16,9 @@ Countdown: 1
|
|||||||
--]]
|
--]]
|
||||||
|
|
||||||
function onEventStarted(player, command)
|
function onEventStarted(player, command)
|
||||||
player:setCurrentMenuId(0);
|
--player:setCurrentMenuId(0);
|
||||||
player:runEventFunction("delegateCommand", command, "eventConfirm");
|
--player:runEventFunction("delegateCommand", command, "eventConfirm");
|
||||||
|
player:logout();
|
||||||
end
|
end
|
||||||
|
|
||||||
function onEventUpdate(player, command, triggerName, step, arg1, arg2)
|
function onEventUpdate(player, command, triggerName, step, arg1, arg2)
|
||||||
@ -28,23 +29,23 @@ function onEventUpdate(player, command, triggerName, step, arg1, arg2)
|
|||||||
if (currentMenuId == 0) then
|
if (currentMenuId == 0) then
|
||||||
if (arg1 == 1) then --Exit
|
if (arg1 == 1) then --Exit
|
||||||
player:quitGame();
|
player:quitGame();
|
||||||
player:endEvent();
|
player:endCommand();
|
||||||
elseif (arg1 == 2) then --Character Screen
|
elseif (arg1 == 2) then --Character Screen
|
||||||
player:logout();
|
player:logout();
|
||||||
player:endEvent();
|
player:endCommand();
|
||||||
--player:setCurrentMenuId(1);
|
--player:setCurrentMenuId(1);
|
||||||
--player:runEventFunction("delegateCommand", command, "eventCountDown");
|
--player:runEventFunction("delegateCommand", command, "eventCountDown");
|
||||||
elseif (arg1 == 3) then --Cancel
|
elseif (arg1 == 3) then --Cancel
|
||||||
player:endEvent();
|
player:endCommand();
|
||||||
end
|
end
|
||||||
--Countdown Dialog
|
--Countdown Dialog
|
||||||
elseif (currentMenuId == 1) then
|
elseif (currentMenuId == 1) then
|
||||||
|
|
||||||
if (arg2 == 1) then --Logout Complete
|
if (arg2 == 1) then --Logout Complete
|
||||||
player:logout();
|
player:logout();
|
||||||
player:endEvent();
|
player:endCommand();
|
||||||
elseif (arg2 == 2) then --Cancel Pressed
|
elseif (arg2 == 2) then --Cancel Pressed
|
||||||
player:endEvent();
|
player:endCommand();
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -7,7 +7,3 @@ function onEventStarted(player, actor, questId)
|
|||||||
player:sendRequestedInfo("requestedData", "activegl", 7, nil, nil, nil, nil, nil, nil, nil);
|
player:sendRequestedInfo("requestedData", "activegl", 7, nil, nil, nil, nil, nil, nil, nil);
|
||||||
-- player:sendRequestedInfo("requestedData", "glHist", 10, 0x1D4F2, 1009, 12464, 11727, 12485, 12526);
|
-- player:sendRequestedInfo("requestedData", "glHist", 10, 0x1D4F2, 1009, 12464, 11727, 12485, 12526);
|
||||||
end
|
end
|
||||||
|
|
||||||
function onEventUpdate(player, actor, triggerName, step, arg1)
|
|
||||||
|
|
||||||
end
|
|
@ -6,7 +6,3 @@
|
|||||||
function onEventStarted(player, actor, questId)
|
function onEventStarted(player, actor, questId)
|
||||||
player:sendRequestedInfo("requestedData", "qtdata", 0x1D4F2);
|
player:sendRequestedInfo("requestedData", "qtdata", 0x1D4F2);
|
||||||
end
|
end
|
||||||
|
|
||||||
function onEventUpdate(player, actor, triggerName, step, arg1)
|
|
||||||
|
|
||||||
end
|
|
@ -35,17 +35,17 @@ function onEventUpdate(player, actor, step, arg1)
|
|||||||
player:setCurrentMenuId(1);
|
player:setCurrentMenuId(1);
|
||||||
player:runEventFunction("delegateCommand", actor, "eventAetheryte", arg1, 2, 2, 2, 4, 4, 4);
|
player:runEventFunction("delegateCommand", actor, "eventAetheryte", arg1, 2, 2, 2, 4, 4, 4);
|
||||||
else
|
else
|
||||||
player:endEvent();
|
player:endCommand();
|
||||||
end
|
end
|
||||||
elseif (menuId == 1) then --Aetheryte
|
elseif (menuId == 1) then --Aetheryte
|
||||||
if (arg1 == nil) then
|
if (arg1 == nil) then
|
||||||
player:endEvent();
|
player:endCommand();
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
player:setCurrentMenuId(2);
|
player:setCurrentMenuId(2);
|
||||||
player:runEventFunction("delegateCommand", actor, "eventConfirm", false, false, 1, 138824, false);
|
player:runEventFunction("delegateCommand", actor, "eventConfirm", false, false, 1, 138824, false);
|
||||||
elseif (menuId == 2) then --Confirm
|
elseif (menuId == 2) then --Confirm
|
||||||
player:endEvent();
|
player:endCommand();
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
@ -1,5 +1,38 @@
|
|||||||
local initClassItems, initRaceItems;
|
local initClassItems, initRaceItems;
|
||||||
|
|
||||||
|
function onBeginLogin(player)
|
||||||
|
|
||||||
|
--For Opening. Set Director and reset position incase d/c
|
||||||
|
if (player:hasQuest(110001) == true) then
|
||||||
|
--player:setDirector("openingDirector", false);
|
||||||
|
player.positionX = 0.016;
|
||||||
|
player.positionY = 10.35;
|
||||||
|
--player.positionZ = -36.91;
|
||||||
|
player.positionZ = -20.91;
|
||||||
|
player.rotation = 0.025;
|
||||||
|
player:getQuest(110001):ClearQuestData();
|
||||||
|
player:getQuest(110001):ClearQuestFlags();
|
||||||
|
elseif (player:hasQuest(110005) == true) then
|
||||||
|
player:setDirector("openingDirector", false);
|
||||||
|
player.positionX = 369.5434;
|
||||||
|
player.positionY = 4.21;
|
||||||
|
player.positionZ = -706.1074;
|
||||||
|
player.rotation = -1.26721;
|
||||||
|
player:getQuest(110005):ClearQuestData();
|
||||||
|
player:getQuest(110005):ClearQuestFlags();
|
||||||
|
elseif (player:hasQuest(110009) == true) then
|
||||||
|
player:setDirector("openingDirector", false);
|
||||||
|
player.positionX = 5.364327;
|
||||||
|
player.positionY = 196.0;
|
||||||
|
player.positionZ = 133.6561;
|
||||||
|
player.rotation = -2.849384;
|
||||||
|
player:getQuest(110009):ClearQuestData();
|
||||||
|
player:getQuest(110009):ClearQuestFlags();
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
function onLogin(player)
|
function onLogin(player)
|
||||||
player:sendMessage(0x1D,"",">Callback \"onLogin\" for player script running.");
|
player:sendMessage(0x1D,"",">Callback \"onLogin\" for player script running.");
|
||||||
|
|
||||||
@ -8,11 +41,6 @@ function onLogin(player)
|
|||||||
|
|
||||||
initClassItems(player);
|
initClassItems(player);
|
||||||
initRaceItems(player);
|
initRaceItems(player);
|
||||||
end
|
|
||||||
|
|
||||||
if (player:hasQuest(110001) == true or player:hasQuest(110005) == true or player:hasQuest(110009) == true) then
|
|
||||||
--player:setDirector("openingDirector");
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Monster/Lemming/NuteaterStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 10, 1, 4, false, false, false, false, false, false, false, false, 2;
|
return "/Chara/Npc/Monster/Lemming/NuteaterStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 10, 1, 4, false, false, false, false, false, false, false, false, 2;
|
||||||
end
|
end
|
@ -20,7 +20,7 @@ Menu Ids:
|
|||||||
|
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Object/Aetheryte/AetheryteParent", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Object/Aetheryte/AetheryteParent", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ Menu Ids:
|
|||||||
|
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/PopulaceGuildlevePublisher", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/PopulaceGuildlevePublisher", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/PopulaceLinkshellManager", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/PopulaceLinkshellManager", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ Menu Ids:
|
|||||||
|
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/PopulacePassiveGLPublisher", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/PopulacePassiveGLPublisher", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ Menu Ids:
|
|||||||
|
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/Shop/PopulaceShopSalesman", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Object/TaskBoard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Object/TaskBoard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Object/OpeningStoperF0B1", false, false, false, false, false, 0x10A350, false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Object/OpeningStoperF0B1", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
function onEventStarted(player, npc, triggerName)
|
function onEventStarted(player, npc, triggerName)
|
||||||
|
@ -3,7 +3,17 @@
|
|||||||
function onZoneInit(zone)
|
function onZoneInit(zone)
|
||||||
end
|
end
|
||||||
|
|
||||||
function onZoneIn(zone, player)
|
function onZoneIn(player)
|
||||||
|
|
||||||
|
openingQuest = player:getQuest(110001);
|
||||||
|
|
||||||
|
--Opening Quest
|
||||||
|
if (openingQuest ~= nil) then
|
||||||
|
if (openingQuest:GetQuestFlag(0) == false) then
|
||||||
|
player:kickEvent(player:getDirector(), "noticeEvent");
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function onZoneOut(zone, player)
|
function onZoneOut(zone, player)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Object/ObjectBed", false, false, false, false, false, 0x1250FB, false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Object/ObjectBed", false, false, false, false, false, 0x1250FB, false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Object/ObjectInnDoor", false, false, false, false, false, 0x1250F8, false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Object/ObjectInnDoor", false, false, false, false, false, 0x1250F8, false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Object/ObjectItemStorage", false, false, false, false, false, 0x1250F8, false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Object/ObjectItemStorage", false, false, false, false, false, 0x1250F8, false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/PopulaceCutScenePlayer", false, false, false, false, false, 0x107B38, false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/PopulaceCutScenePlayer", false, false, false, false, false, 0x107B38, false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function onInstantiate(npc)
|
function init(npc)
|
||||||
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
return "/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, npc.getActorClassId(), false, false, 0, 1, "TEST";
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -3,7 +3,17 @@
|
|||||||
function onZoneInit(zone)
|
function onZoneInit(zone)
|
||||||
end
|
end
|
||||||
|
|
||||||
function onZoneIn(zone, player)
|
function onZoneIn(player)
|
||||||
|
|
||||||
|
openingQuest = player:getQuest(110005);
|
||||||
|
|
||||||
|
--Opening Quest
|
||||||
|
if (openingQuest ~= nil) then
|
||||||
|
if (openingQuest:GetQuestFlag(0) == false) then
|
||||||
|
player:kickEvent(player:getDirector(), "noticeEvent");
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function onZoneOut(zone, player)
|
function onZoneOut(zone, player)
|
||||||
|
20
scripts/directors/openingDire - Copy.lua
Normal file
20
scripts/directors/openingDire - Copy.lua
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
require("/quests/man/man0l0")
|
||||||
|
|
||||||
|
function onEventStarted(player, actor, triggerName)
|
||||||
|
|
||||||
|
man0l0Quest = getStaticActor("Man0l0");
|
||||||
|
player:runEventFunction("delegateEvent", player, man0l0Quest, "processTtrNomal001withHQ", nil, nil, nil, nil);
|
||||||
|
--player:runEventFunction("delegateEvent", player, man0l0Quest, "processEvent000_1", nil, nil, nil, nil);
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function onEventUpdate(player, npc, resultId)
|
||||||
|
man0l0Quest = getStaticActor("Man0l0");
|
||||||
|
|
||||||
|
if (resultId == RESULT_Event000_1) then
|
||||||
|
player:runEventFunction("delegateEvent", player, man0l0Quest, "processTtrNomal001", nil, nil, nil, nil);
|
||||||
|
elseif (resultId == RESULT_TtrNomal001) then
|
||||||
|
player:endEvent();
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
31
scripts/directors/openingDire.lua
Normal file
31
scripts/directors/openingDire.lua
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
require("/quests/man/man0l0")
|
||||||
|
|
||||||
|
function onEventStarted(player, actor, triggerName)
|
||||||
|
|
||||||
|
man0l0Quest = getStaticActor("Man0l0");
|
||||||
|
player:runEventFunction("delegateEvent", player, man0l0Quest, "processTtrNomal001withHQ", nil, nil, nil, nil);
|
||||||
|
--player:runEventFunction("delegateEvent", player, man0l0Quest, "processEvent000_1", nil, nil, nil, nil);
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function onEventUpdate(player, npc, resultId)
|
||||||
|
|
||||||
|
player:endEvent();
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function onTalked(player, npc)
|
||||||
|
|
||||||
|
man0l0Quest = player:getQuest("Man0l0");
|
||||||
|
|
||||||
|
if (man0l0Quest ~= nil) then
|
||||||
|
if (man0l0Quest ~= nil and man0l0Quest:GetQuestFlag(MAN0L0_FLAG_MINITUT_DONE1) == true and man0l0Quest:GetQuestFlag(MAN0L0_FLAG_MINITUT_DONE2) == true and man0l0Quest:GetQuestFlag(MAN0L0_FLAG_MINITUT_DONE3) == true) then
|
||||||
|
|
||||||
|
doorNpc = getWorldManager():GetActorInWorld(1090025);
|
||||||
|
player:setEventStatus(doorNpc, "pushDefault", true, 0x2);
|
||||||
|
doorNpc:setQuestGraphic(player, 0x3);
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
37
scripts/directors/openingDire_fst0Btl03_04@0A600.lua
Normal file
37
scripts/directors/openingDire_fst0Btl03_04@0A600.lua
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
require("/quests/man/man0g0")
|
||||||
|
|
||||||
|
function onEventStarted(player, actor, triggerName)
|
||||||
|
|
||||||
|
man0g0Quest = getStaticActor("Man0g0");
|
||||||
|
player:runEventFunction("delegateEvent", player, man0g0Quest, "processTtrNomal001withHQ", nil, nil, nil, nil);
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function onEventUpdate(player, npc, resultId)
|
||||||
|
|
||||||
|
player:endEvent();
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function onTalked(player, npc)
|
||||||
|
|
||||||
|
man0g0Quest = player:getQuest("Man0g0");
|
||||||
|
|
||||||
|
if (man0g0Quest ~= nil) then
|
||||||
|
|
||||||
|
yda = getWorldManager():GetActorInWorld(1000009);
|
||||||
|
papalymo = getWorldManager():GetActorInWorld(1000010);
|
||||||
|
|
||||||
|
if (man0g0Quest:GetQuestFlag(MAN0G0_FLAG_TUTORIAL1_DONE) == false) then
|
||||||
|
yda:setQuestGraphic(player, 0x0);
|
||||||
|
papalymo:setQuestGraphic(player, 0x2);
|
||||||
|
else
|
||||||
|
if (man0g0Quest:GetQuestFlag(MAN0G0_FLAG_MINITUT_DONE1) == true) then
|
||||||
|
yda:setQuestGraphic(player, 0x2);
|
||||||
|
papalymo:setQuestGraphic(player, 0x0);
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
26
scripts/directors/openingDire_wil0Btl01_04@0B800.lua
Normal file
26
scripts/directors/openingDire_wil0Btl01_04@0B800.lua
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
require("/quests/man/man0u0")
|
||||||
|
|
||||||
|
function onEventStarted(player, actor, triggerName)
|
||||||
|
|
||||||
|
man0u0Quest = getStaticActor("Man0u0");
|
||||||
|
player:runEventFunction("delegateEvent", player, man0u0Quest, "processTtrNomal001withHQ", nil, nil, nil, nil);
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function onEventUpdate(player, npc, resultId)
|
||||||
|
|
||||||
|
player:endEvent();
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function onTalked(player, npc)
|
||||||
|
|
||||||
|
man0u0Quest = player:getQuest("Man0u0");
|
||||||
|
|
||||||
|
if (man0u0Quest ~= nil) then
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
21
scripts/directors/questDirect_fst0Btl03_01@0A615.lua
Normal file
21
scripts/directors/questDirect_fst0Btl03_01@0A615.lua
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
function onEventStarted(player, actor, triggerName)
|
||||||
|
|
||||||
|
man0g0Quest = getStaticActor("Man0g0");
|
||||||
|
--player:runEventFunction("delegateEvent", player, man0g0Quest, "processTtrBtl001");
|
||||||
|
player:runEventFunction("delegateEvent", player, man0g0Quest, "processTtrBtl002");
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function onEventUpdate(player, npc, resultId)
|
||||||
|
--man0g0Quest = getStaticActor("Man0g0");
|
||||||
|
--player:runEventFunction("delegateEvent", player, man0g0Quest, "processTtrBtl002");
|
||||||
|
player:endEvent();
|
||||||
|
end
|
||||||
|
|
||||||
|
function onCommand(player, command)
|
||||||
|
--Check command if ActivateCommand
|
||||||
|
player:endCommand();
|
||||||
|
player:endEvent();
|
||||||
|
player:kickEvent(player:getDirector(), "noticeEvent", true);
|
||||||
|
end
|
21
scripts/directors/questDirect_ocn0Btl02_01@0C196.lua
Normal file
21
scripts/directors/questDirect_ocn0Btl02_01@0C196.lua
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
function onEventStarted(player, actor, triggerName)
|
||||||
|
|
||||||
|
man0l0Quest = getStaticActor("Man0l0");
|
||||||
|
--player:runEventFunction("delegateEvent", player, man0l0Quest, "processTtrBtl001");
|
||||||
|
player:runEventFunction("delegateEvent", player, man0l0Quest, "processTtrBtl002");
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function onEventUpdate(player, npc, resultId)
|
||||||
|
--man0l0Quest = getStaticActor("Man0l0");
|
||||||
|
--player:runEventFunction("delegateEvent", player, man0l0Quest, "processTtrBtl002");
|
||||||
|
player:endEvent();
|
||||||
|
end
|
||||||
|
|
||||||
|
function onCommand(player, command)
|
||||||
|
--Check command if ActivateCommand
|
||||||
|
player:endCommand();
|
||||||
|
player:endEvent();
|
||||||
|
player:kickEvent(player:getDirector(), "noticeEvent", true);
|
||||||
|
end
|
7
scripts/quests/man/man0g0.lua
Normal file
7
scripts/quests/man/man0g0.lua
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
--Quest Flags
|
||||||
|
MAN0G0_FLAG_TUTORIAL1_DONE = 0;
|
||||||
|
MAN0G0_FLAG_TUTORIAL2_DONE = 1;
|
||||||
|
|
||||||
|
MAN0G0_FLAG_MINITUT_DONE1 = 4;
|
||||||
|
MAN0G0_FLAG_MINITUT_DONE2 = 8;
|
||||||
|
MAN0G0_FLAG_MINITUT_DONE3 = 16;
|
13
scripts/quests/man/man0l0.lua
Normal file
13
scripts/quests/man/man0l0.lua
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
--Quest Flags
|
||||||
|
MAN0L0_FLAG_TUTORIAL1_DONE = 0;
|
||||||
|
MAN0L0_FLAG_TUTORIAL2_DONE = 1;
|
||||||
|
MAN0L0_FLAG_TUTORIAL3_DONE = 2;
|
||||||
|
|
||||||
|
MAN0L0_FLAG_MINITUT_DONE1 = 4;
|
||||||
|
MAN0L0_FLAG_MINITUT_DONE2 = 8;
|
||||||
|
MAN0L0_FLAG_MINITUT_DONE3 = 16;
|
||||||
|
|
||||||
|
--Result Unique Ids
|
||||||
|
RESULT_Event000_1 = 0x2B9EBC42;
|
||||||
|
RESULT_TtrNomal001 = 0x8649D125;
|
7
scripts/quests/man/man0u0.lua
Normal file
7
scripts/quests/man/man0u0.lua
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
--Quest Flags
|
||||||
|
MAN0U0_FLAG_TUTORIAL1_DONE = 0;
|
||||||
|
MAN0U0_FLAG_TUTORIAL2_DONE = 1;
|
||||||
|
|
||||||
|
MAN0U0_FLAG_MINITUT_DONE1 = 4;
|
||||||
|
MAN0U0_FLAG_MINITUT_DONE2 = 8;
|
||||||
|
MAN0U0_FLAG_MINITUT_DONE3 = 16;
|
7
scripts/zones/155/npcs/doorStd_fst0Twn01a_31@0CE00.lua
Normal file
7
scripts/zones/155/npcs/doorStd_fst0Twn01a_31@0CE00.lua
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
function init(npc)
|
||||||
|
return "/Chara/Npc/MapObj/DoorStandard", false, false, false, false, false, 5900001 , false, false, 0, 0, 0x141, 0xB7d;
|
||||||
|
end
|
||||||
|
|
||||||
|
function onEventStarted(player, npc, triggerName)
|
||||||
|
|
||||||
|
end
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user