mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-08-23 09:30:56 +02:00
Finished the crafting start window system. Added PassiveGuildleveQuests and refactors the Quest object. Cleaned up how zone music is handled.
This commit is contained in:
parent
f4e2280de8
commit
605b4918e2
34 changed files with 7121 additions and 4533 deletions
|
@ -152,7 +152,7 @@ namespace Meteor.Map.Actors
|
|||
public uint extraUint;
|
||||
public float extraFloat;
|
||||
|
||||
protected Dictionary<string, UInt64> tempVars = new Dictionary<string, UInt64>();
|
||||
protected Dictionary<string, ulong> tempVars = new Dictionary<string, ulong>();
|
||||
|
||||
//Inventory
|
||||
protected Dictionary<ushort, ItemPackage> itemPackages = new Dictionary<ushort, ItemPackage>();
|
||||
|
@ -227,8 +227,8 @@ namespace Meteor.Map.Actors
|
|||
{
|
||||
if (!effect.GetHidden())
|
||||
{
|
||||
propPacketUtil.AddProperty(String.Format("charaWork.statusShownTime[{0}]", i));
|
||||
propPacketUtil.AddProperty(String.Format("charaWork.statusShownTime[{0}]", i));
|
||||
propPacketUtil.AddProperty(string.Format("charaWork.statusShownTime[{0}]", i));
|
||||
propPacketUtil.AddProperty(string.Format("charaWork.statusShownTime[{0}]", i));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
@ -908,9 +908,9 @@ namespace Meteor.Map.Actors
|
|||
AddTP((int)Math.Ceiling(tpModifier * action.amount));
|
||||
}
|
||||
|
||||
public UInt64 GetTempVar(string name)
|
||||
public ulong GetTempVar(string name)
|
||||
{
|
||||
UInt64 retVal = 0;
|
||||
ulong retVal = 0;
|
||||
if (tempVars.TryGetValue(name, out retVal))
|
||||
return retVal;
|
||||
return 0;
|
||||
|
@ -923,7 +923,7 @@ namespace Meteor.Map.Actors
|
|||
tempVars[name] = val;
|
||||
}
|
||||
|
||||
public void SetTempVar(string name, UInt64 val)
|
||||
public void SetTempVar(string name, ulong val)
|
||||
{
|
||||
if (tempVars.ContainsKey(name))
|
||||
tempVars[name] = val;
|
||||
|
@ -994,7 +994,7 @@ namespace Meteor.Map.Actors
|
|||
{
|
||||
shouldSend = true;
|
||||
charaWork.battleTemp.timingCommandFlag[i] = false;
|
||||
propPacketUtil.AddProperty(String.Format("charaWork.battleTemp.timingCommandFlag[{0}]", i));
|
||||
propPacketUtil.AddProperty(string.Format("charaWork.battleTemp.timingCommandFlag[{0}]", i));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1025,7 +1025,7 @@ namespace Meteor.Map.Actors
|
|||
if (this is Player)
|
||||
{
|
||||
var propPacketUtil = new ActorPropertyPacketUtil("charaWork/timingCommand", this);
|
||||
propPacketUtil.AddProperty(String.Format("charaWork.battleTemp.timingCommandFlag[{0}]", procId));
|
||||
propPacketUtil.AddProperty(string.Format("charaWork.battleTemp.timingCommandFlag[{0}]", procId));
|
||||
((Player)this).QueuePackets(propPacketUtil.Done());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace Meteor.Map.actors.chara
|
|||
//These will need to be redone at some point. remember to update tables in db.
|
||||
//Consider using text_paramname sheet. that matches up with the stats on armor, but some things will need special handling
|
||||
//Also, 0-35 should probably match with up BattleTemp
|
||||
enum Modifier : UInt32
|
||||
enum Modifier : uint
|
||||
{
|
||||
//These line up with ParamNames starting at 15001 and appear on gear
|
||||
//Health
|
||||
|
|
|
@ -27,9 +27,9 @@ namespace Meteor.Map.actors.chara
|
|||
class ModifierListEntry
|
||||
{
|
||||
public uint id;
|
||||
public Int64 value;
|
||||
public long value;
|
||||
|
||||
public ModifierListEntry(uint id, Int64 value)
|
||||
public ModifierListEntry(uint id, long value)
|
||||
{
|
||||
this.id = id;
|
||||
this.value = value;
|
||||
|
@ -47,13 +47,13 @@ namespace Meteor.Map.actors.chara
|
|||
mobModList = new Dictionary<uint, ModifierListEntry>();
|
||||
}
|
||||
|
||||
public void AddModifier(uint id, Int64 val, bool isMobMod)
|
||||
public void AddModifier(uint id, long val, bool isMobMod)
|
||||
{
|
||||
var list = isMobMod ? mobModList : modList;
|
||||
list.Add(id, new ModifierListEntry(id, val));
|
||||
}
|
||||
|
||||
public void SetModifier(uint id, Int64 val, bool isMobMod)
|
||||
public void SetModifier(uint id, long val, bool isMobMod)
|
||||
{
|
||||
var list = isMobMod ? mobModList : modList;
|
||||
if (list.ContainsKey(id))
|
||||
|
@ -62,7 +62,7 @@ namespace Meteor.Map.actors.chara
|
|||
list.Add(id, new ModifierListEntry(id, val));
|
||||
}
|
||||
|
||||
public Int64 GetModifier(uint id, bool isMobMod)
|
||||
public long GetModifier(uint id, bool isMobMod)
|
||||
{
|
||||
ModifierListEntry retVal;
|
||||
var list = isMobMod ? mobModList : modList;
|
||||
|
|
|
@ -83,7 +83,7 @@ namespace Meteor.Map.Actors
|
|||
public ModifierList genusMods;
|
||||
public ModifierList spawnMods;
|
||||
|
||||
protected Dictionary<MobModifier, Int64> mobModifiers = new Dictionary<MobModifier, Int64>();
|
||||
protected Dictionary<MobModifier, long> mobModifiers = new Dictionary<MobModifier, long>();
|
||||
|
||||
public BattleNpc(int actorNumber, ActorClass actorClass, string uniqueId, Area spawnedArea, float posX, float posY, float posZ, float rot,
|
||||
ushort actorState, uint animationId, string customDisplayName)
|
||||
|
@ -320,7 +320,7 @@ namespace Meteor.Map.Actors
|
|||
}
|
||||
else
|
||||
{
|
||||
var err = String.Format("[{0}][{1}] {2} {3} {4} {5} tried to die ded", actorId, GetUniqueId(), positionX, positionY, positionZ, GetZone().GetName());
|
||||
var err = string.Format("[{0}][{1}] {2} {3} {4} {5} tried to die ded", actorId, GetUniqueId(), positionX, positionY, positionZ, GetZone().GetName());
|
||||
Program.Log.Error(err);
|
||||
//throw new Exception(err);
|
||||
}
|
||||
|
@ -434,20 +434,20 @@ namespace Meteor.Map.Actors
|
|||
this.bnpcId = id;
|
||||
}
|
||||
|
||||
public Int64 GetMobMod(MobModifier mobMod)
|
||||
public long GetMobMod(MobModifier mobMod)
|
||||
{
|
||||
return GetMobMod((uint)mobMod);
|
||||
}
|
||||
|
||||
public Int64 GetMobMod(uint mobModId)
|
||||
public long GetMobMod(uint mobModId)
|
||||
{
|
||||
Int64 res;
|
||||
long res;
|
||||
if (mobModifiers.TryGetValue((MobModifier)mobModId, out res))
|
||||
return res;
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void SetMobMod(uint mobModId, Int64 val)
|
||||
public void SetMobMod(uint mobModId, long val)
|
||||
{
|
||||
if (mobModifiers.ContainsKey((MobModifier)mobModId))
|
||||
mobModifiers[(MobModifier)mobModId] = val;
|
||||
|
|
|
@ -81,7 +81,7 @@ namespace Meteor.Map.Actors
|
|||
LoadNpcAppearance(actorClass.actorClassId);
|
||||
|
||||
className = actorClass.classPath.Substring(actorClass.classPath.LastIndexOf("/") + 1);
|
||||
this.classPath = String.Format("{0}/{1}", actorClass.classPath.Substring(0, actorClass.classPath.LastIndexOf('/')).ToLower(), className);
|
||||
this.classPath = string.Format("{0}/{1}", actorClass.classPath.Substring(0, actorClass.classPath.LastIndexOf('/')).ToLower(), className);
|
||||
|
||||
charaWork.battleSave.potencial = 1.0f;
|
||||
|
||||
|
@ -109,8 +109,8 @@ namespace Meteor.Map.Actors
|
|||
isMapObj = false;
|
||||
else
|
||||
{
|
||||
layout = (uint)(Int32)lParams[4].value;
|
||||
instance = (uint)(Int32)lParams[5].value;
|
||||
layout = (uint)(int)lParams[4].value;
|
||||
instance = (uint)(int)lParams[5].value;
|
||||
isStatic = true;
|
||||
}
|
||||
}
|
||||
|
@ -236,7 +236,7 @@ namespace Meteor.Map.Actors
|
|||
for (int i = 0; i < charaWork.property.Length; i++)
|
||||
{
|
||||
if (charaWork.property[i] != 0)
|
||||
propPacketUtil.AddProperty(String.Format("charaWork.property[{0}]", i));
|
||||
propPacketUtil.AddProperty(string.Format("charaWork.property[{0}]", i));
|
||||
}
|
||||
|
||||
//Parameters
|
||||
|
@ -261,14 +261,14 @@ namespace Meteor.Map.Actors
|
|||
for (int i = 0; i < charaWork.statusShownTime.Length; i++)
|
||||
{
|
||||
if (charaWork.statusShownTime[i] != 0)
|
||||
propPacketUtil.AddProperty(String.Format("charaWork.statusShownTime[{0}]", i));
|
||||
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(string.Format("charaWork.battleTemp.generalParameter[{0}]", i));
|
||||
}
|
||||
|
||||
propPacketUtil.AddProperty("npcWork.hateType");
|
||||
|
@ -302,7 +302,7 @@ namespace Meteor.Map.Actors
|
|||
|
||||
public void LoadNpcAppearance(uint id)
|
||||
{
|
||||
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)))
|
||||
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
|
||||
{
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace Meteor.Map.actors.chara.npc
|
|||
{
|
||||
this.retainerId = retainerId;
|
||||
this.ownerPlayer = player;
|
||||
this.actorName = String.Format("_rtnre{0:x7}", actorId);
|
||||
this.actorName = string.Format("_rtnre{0:x7}", actorId);
|
||||
|
||||
itemPackages[ItemPackage.NORMAL] = new ItemPackage(this, MAXSIZE_INVENTORY_NORMAL, ItemPackage.NORMAL);
|
||||
itemPackages[ItemPackage.CURRENCY_CRYSTALS] = new ItemPackage(this, MAXSIZE_INVENTORY_CURRANCY, ItemPackage.CURRENCY_CRYSTALS);
|
||||
|
|
|
@ -46,6 +46,7 @@ using Meteor.Map.packets.send.actor.battle;
|
|||
using Meteor.Map.packets.receive.events;
|
||||
using static Meteor.Map.LuaUtils;
|
||||
using Meteor.Map.packets.send.actor.events;
|
||||
using Meteor.Map.DataObjects;
|
||||
|
||||
namespace Meteor.Map.Actors
|
||||
{
|
||||
|
@ -146,7 +147,7 @@ namespace Meteor.Map.Actors
|
|||
|
||||
//Quest Actors (MUST MATCH playerWork.questScenario/questGuildleve)
|
||||
public Quest[] questScenario = new Quest[16];
|
||||
public uint[] questGuildleve = new uint[8];
|
||||
public Quest[] questGuildleve = new Quest[8];
|
||||
|
||||
//Aetheryte
|
||||
public uint homepoint = 0;
|
||||
|
@ -161,6 +162,10 @@ namespace Meteor.Map.Actors
|
|||
public Retainer currentSpawnedRetainer = null;
|
||||
public bool sentRetainerSpawn = false;
|
||||
|
||||
//Crafting
|
||||
public List<Recipe> recentRecipes = new List<Recipe>();
|
||||
public List<Recipe> awardedRecipes = new List<Recipe>();
|
||||
|
||||
private List<Director> ownedDirectors = new List<Director>();
|
||||
private Director loginInitDirector = null;
|
||||
|
||||
|
@ -173,7 +178,7 @@ namespace Meteor.Map.Actors
|
|||
public Player(Session cp, uint actorID) : base(actorID)
|
||||
{
|
||||
playerSession = cp;
|
||||
actorName = String.Format("_pc{0:00000000}", actorID);
|
||||
actorName = string.Format("_pc{0:00000000}", actorID);
|
||||
className = "Player";
|
||||
|
||||
moveSpeeds[0] = SetActorSpeedPacket.DEFAULT_STOP;
|
||||
|
@ -274,6 +279,17 @@ namespace Meteor.Map.Actors
|
|||
this.aiContainer = new AIContainer(this, new PlayerController(this), null, new TargetFind(this));
|
||||
allegiance = CharacterTargetingAllegiance.Player;
|
||||
CalculateBaseStats();
|
||||
|
||||
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(36));
|
||||
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(37));
|
||||
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(38));
|
||||
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(39));
|
||||
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(40));
|
||||
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(41));
|
||||
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(42));
|
||||
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(43));
|
||||
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(2));
|
||||
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(3));
|
||||
}
|
||||
|
||||
public List<SubPacket> Create0x132Packets()
|
||||
|
@ -402,7 +418,7 @@ namespace Meteor.Map.Actors
|
|||
for (int i = 0; i < charaWork.property.Length; i++)
|
||||
{
|
||||
if (charaWork.property[i] != 0)
|
||||
propPacketUtil.AddProperty(String.Format("charaWork.property[{0}]", i));
|
||||
propPacketUtil.AddProperty(string.Format("charaWork.property[{0}]", i));
|
||||
}
|
||||
|
||||
//Parameters
|
||||
|
@ -418,21 +434,21 @@ namespace Meteor.Map.Actors
|
|||
for (int i = 0; i < charaWork.statusShownTime.Length; i++)
|
||||
{
|
||||
if (charaWork.statusShownTime[i] != 0)
|
||||
propPacketUtil.AddProperty(String.Format("charaWork.statusShownTime[{0}]", i));
|
||||
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(string.Format("charaWork.battleTemp.generalParameter[{0}]", i));
|
||||
}
|
||||
|
||||
propPacketUtil.AddProperty("charaWork.battleTemp.castGauge_speed[0]");
|
||||
propPacketUtil.AddProperty("charaWork.battleTemp.castGauge_speed[1]");
|
||||
|
||||
//Battle Save Skillpoint
|
||||
propPacketUtil.AddProperty(String.Format("charaWork.battleSave.skillPoint[{0}]", charaWork.parameterSave.state_mainSkill[0] - 1));
|
||||
propPacketUtil.AddProperty(string.Format("charaWork.battleSave.skillPoint[{0}]", charaWork.parameterSave.state_mainSkill[0] - 1));
|
||||
|
||||
//Commands
|
||||
propPacketUtil.AddProperty("charaWork.commandBorder");
|
||||
|
@ -443,12 +459,12 @@ namespace Meteor.Map.Actors
|
|||
{
|
||||
if (charaWork.command[i] != 0)
|
||||
{
|
||||
propPacketUtil.AddProperty(String.Format("charaWork.command[{0}]", i));
|
||||
propPacketUtil.AddProperty(string.Format("charaWork.command[{0}]", i));
|
||||
//Recast Timers
|
||||
if (i >= charaWork.commandBorder)
|
||||
{
|
||||
propPacketUtil.AddProperty(String.Format("charaWork.parameterTemp.maxCommandRecastTime[{0}]", i - charaWork.commandBorder));
|
||||
propPacketUtil.AddProperty(String.Format("charaWork.parameterSave.commandSlot_recastTime[{0}]", i - charaWork.commandBorder));
|
||||
propPacketUtil.AddProperty(string.Format("charaWork.parameterTemp.maxCommandRecastTime[{0}]", i - charaWork.commandBorder));
|
||||
propPacketUtil.AddProperty(string.Format("charaWork.parameterSave.commandSlot_recastTime[{0}]", i - charaWork.commandBorder));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -457,32 +473,32 @@ namespace Meteor.Map.Actors
|
|||
{
|
||||
charaWork.commandCategory[i] = 1;
|
||||
if (charaWork.commandCategory[i] != 0)
|
||||
propPacketUtil.AddProperty(String.Format("charaWork.commandCategory[{0}]", i));
|
||||
propPacketUtil.AddProperty(string.Format("charaWork.commandCategory[{0}]", i));
|
||||
}
|
||||
|
||||
for (int i = 0; i < charaWork.commandAcquired.Length; i++)
|
||||
{
|
||||
if (charaWork.commandAcquired[i] != false)
|
||||
propPacketUtil.AddProperty(String.Format("charaWork.commandAcquired[{0}]", i));
|
||||
propPacketUtil.AddProperty(string.Format("charaWork.commandAcquired[{0}]", i));
|
||||
}
|
||||
|
||||
for (int i = 0; i < charaWork.additionalCommandAcquired.Length; i++)
|
||||
{
|
||||
if (charaWork.additionalCommandAcquired[i] != false)
|
||||
propPacketUtil.AddProperty(String.Format("charaWork.additionalCommandAcquired[{0}]", i));
|
||||
propPacketUtil.AddProperty(string.Format("charaWork.additionalCommandAcquired[{0}]", i));
|
||||
}
|
||||
|
||||
for (int i = 0; i < charaWork.parameterSave.commandSlot_compatibility.Length; i++)
|
||||
{
|
||||
charaWork.parameterSave.commandSlot_compatibility[i] = true;
|
||||
if (charaWork.parameterSave.commandSlot_compatibility[i])
|
||||
propPacketUtil.AddProperty(String.Format("charaWork.parameterSave.commandSlot_compatibility[{0}]", i));
|
||||
propPacketUtil.AddProperty(string.Format("charaWork.parameterSave.commandSlot_compatibility[{0}]", i));
|
||||
}
|
||||
|
||||
for (int i = 0; i < charaWork.parameterSave.commandSlot_recastTime.Length; i++)
|
||||
{
|
||||
if (charaWork.parameterSave.commandSlot_recastTime[i] != 0)
|
||||
propPacketUtil.AddProperty(String.Format("charaWork.parameterSave.commandSlot_recastTime[{0}]", i));
|
||||
propPacketUtil.AddProperty(string.Format("charaWork.parameterSave.commandSlot_recastTime[{0}]", i));
|
||||
}
|
||||
|
||||
//System
|
||||
|
@ -505,25 +521,25 @@ namespace Meteor.Map.Actors
|
|||
for (int i = 0; i < playerWork.questScenario.Length; i++)
|
||||
{
|
||||
if (playerWork.questScenario[i] != 0)
|
||||
propPacketUtil.AddProperty(String.Format("playerWork.questScenario[{0}]", i));
|
||||
propPacketUtil.AddProperty(string.Format("playerWork.questScenario[{0}]", i));
|
||||
}
|
||||
|
||||
//Guildleve - Local
|
||||
for (int i = 0; i < playerWork.questGuildleve.Length; i++)
|
||||
{
|
||||
if (playerWork.questGuildleve[i] != 0)
|
||||
propPacketUtil.AddProperty(String.Format("playerWork.questGuildleve[{0}]", i));
|
||||
propPacketUtil.AddProperty(string.Format("playerWork.questGuildleve[{0}]", i));
|
||||
}
|
||||
|
||||
//Guildleve - Regional
|
||||
for (int i = 0; i < work.guildleveId.Length; i++)
|
||||
{
|
||||
if (work.guildleveId[i] != 0)
|
||||
propPacketUtil.AddProperty(String.Format("work.guildleveId[{0}]", i));
|
||||
propPacketUtil.AddProperty(string.Format("work.guildleveId[{0}]", i));
|
||||
if (work.guildleveDone[i] != false)
|
||||
propPacketUtil.AddProperty(String.Format("work.guildleveDone[{0}]", i));
|
||||
propPacketUtil.AddProperty(string.Format("work.guildleveDone[{0}]", i));
|
||||
if (work.guildleveChecked[i] != false)
|
||||
propPacketUtil.AddProperty(String.Format("work.guildleveChecked[{0}]", i));
|
||||
propPacketUtil.AddProperty(string.Format("work.guildleveChecked[{0}]", i));
|
||||
}
|
||||
|
||||
//Bazaar
|
||||
|
@ -541,9 +557,9 @@ namespace Meteor.Map.Actors
|
|||
for (int i = 0; i < playerWork.npcLinkshellChatCalling.Length; i++)
|
||||
{
|
||||
if (playerWork.npcLinkshellChatCalling[i] != false)
|
||||
propPacketUtil.AddProperty(String.Format("playerWork.npcLinkshellChatCalling[{0}]", i));
|
||||
propPacketUtil.AddProperty(string.Format("playerWork.npcLinkshellChatCalling[{0}]", i));
|
||||
if (playerWork.npcLinkshellChatExtra[i] != false)
|
||||
propPacketUtil.AddProperty(String.Format("playerWork.npcLinkshellChatExtra[{0}]", i));
|
||||
propPacketUtil.AddProperty(string.Format("playerWork.npcLinkshellChatExtra[{0}]", i));
|
||||
}
|
||||
|
||||
propPacketUtil.AddProperty("playerWork.restBonusExpRate");
|
||||
|
@ -560,7 +576,7 @@ namespace Meteor.Map.Actors
|
|||
|
||||
public void SendSeamlessZoneInPackets()
|
||||
{
|
||||
QueuePacket(SetMusicPacket.BuildPacket(actorId, zone.bgmDay, SetMusicPacket.EFFECT_FADEIN));
|
||||
QueuePacket(SetMusicPacket.BuildPacket(actorId, zone.GetCurrentMusic(), SetMusicPacket.EFFECT_FADEIN));
|
||||
QueuePacket(SetWeatherPacket.BuildPacket(actorId, SetWeatherPacket.WEATHER_CLEAR, 1));
|
||||
}
|
||||
|
||||
|
@ -583,7 +599,7 @@ namespace Meteor.Map.Actors
|
|||
}
|
||||
}
|
||||
else
|
||||
QueuePacket(SetMusicPacket.BuildPacket(actorId, zone.bgmDay, 0x01)); //Zone
|
||||
QueuePacket(SetMusicPacket.BuildPacket(actorId, zone.GetCurrentMusic(), 0x01)); //Zone
|
||||
|
||||
QueuePacket(SetWeatherPacket.BuildPacket(actorId, SetWeatherPacket.WEATHER_CLEAR, 1));
|
||||
|
||||
|
@ -806,11 +822,6 @@ namespace Meteor.Map.Actors
|
|||
Database.SavePlayerStatusEffects(this);
|
||||
}
|
||||
|
||||
public Area GetZone()
|
||||
{
|
||||
return zone;
|
||||
}
|
||||
|
||||
public void SendMessage(uint logType, string sender, string message)
|
||||
{
|
||||
QueuePacket(SendMessagePacket.BuildPacket(actorId, logType, sender, message));
|
||||
|
@ -895,6 +906,12 @@ namespace Meteor.Map.Actors
|
|||
QueuePacket(SetMusicPacket.BuildPacket(actorId, musicId, 1));
|
||||
}
|
||||
|
||||
public void ResetMusic()
|
||||
{
|
||||
if (zone != null)
|
||||
QueuePacket(SetMusicPacket.BuildPacket(actorId, zone.GetCurrentMusic(), 1));
|
||||
}
|
||||
|
||||
public void SendMountAppearance()
|
||||
{
|
||||
if (mountState == 1)
|
||||
|
@ -1193,7 +1210,7 @@ namespace Meteor.Map.Actors
|
|||
propertyBuilder.NewTarget("playerWork/expBonus");
|
||||
propertyBuilder.AddProperty("playerWork.restBonusExpRate");
|
||||
propertyBuilder.NewTarget("charaWork/battleStateForSelf");
|
||||
propertyBuilder.AddProperty(String.Format("charaWork.battleSave.skillPoint[{0}]", classId - 1));
|
||||
propertyBuilder.AddProperty(string.Format("charaWork.battleSave.skillPoint[{0}]", classId - 1));
|
||||
Database.LoadHotbar(this);
|
||||
|
||||
var time = Utils.UnixTimeStampUTC();
|
||||
|
@ -1221,7 +1238,7 @@ namespace Meteor.Map.Actors
|
|||
Database.PlayerCharacterUpdateClassLevel(this, classId, level);
|
||||
charaWork.battleSave.skillLevel[classId - 1] = level;
|
||||
ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("charaWork/stateForAll", this);
|
||||
propertyBuilder.AddProperty(String.Format("charaWork.battleSave.skillLevel[{0}]", classId-1));
|
||||
propertyBuilder.AddProperty(string.Format("charaWork.battleSave.skillLevel[{0}]", classId-1));
|
||||
List<SubPacket> packets = propertyBuilder.Done();
|
||||
QueuePackets(packets);
|
||||
}
|
||||
|
@ -1363,6 +1380,16 @@ namespace Meteor.Map.Actors
|
|||
|
||||
return -1;
|
||||
}
|
||||
public int GetFreeQuestGuildleveSlot()
|
||||
{
|
||||
for (int i = 0; i < questGuildleve.Length; i++)
|
||||
{
|
||||
if (questGuildleve[i] == null)
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
public int GetFreeGuildleveSlot()
|
||||
{
|
||||
|
@ -1447,37 +1474,61 @@ namespace Meteor.Map.Actors
|
|||
}
|
||||
}
|
||||
}
|
||||
public void AddQuest(string name, bool isSilent = false)
|
||||
{
|
||||
Actor actor = Server.GetStaticActors(name);
|
||||
AddQuestInternal(actor as Quest, isSilent);
|
||||
}
|
||||
|
||||
public void AddQuest(uint id, bool isSilent = false)
|
||||
{
|
||||
Actor actor = Server.GetStaticActors((0xA0F00000 | id));
|
||||
AddQuest(actor.actorName, isSilent);
|
||||
AddQuestInternal(actor as Quest, isSilent);
|
||||
}
|
||||
|
||||
public void AddQuest(string name, bool isSilent = false)
|
||||
public void AddQuestGuildleve(uint id, byte difficulty)
|
||||
{
|
||||
Actor actor = Server.GetStaticActors(name);
|
||||
|
||||
if (actor == null)
|
||||
Quest staticQuest = (Quest) Server.GetStaticActors((0xA0F00000 | id));
|
||||
if (staticQuest == null)
|
||||
return;
|
||||
|
||||
uint id = actor.actorId;
|
||||
PassiveGuildleve newQuest = new PassiveGuildleve(staticQuest, this, difficulty);
|
||||
|
||||
int freeSlot = GetFreeQuestGuildleveSlot();
|
||||
|
||||
if (freeSlot == -1)
|
||||
return;
|
||||
|
||||
playerWork.questGuildleve[freeSlot] = newQuest.actorId;
|
||||
questGuildleve[freeSlot] = newQuest;
|
||||
|
||||
Database.SaveQuest(this, newQuest);
|
||||
SendQuestGuildleveClientUpdate(freeSlot);
|
||||
}
|
||||
|
||||
private void AddQuestInternal(Quest staticQuest, bool isSilent = false)
|
||||
{
|
||||
if (staticQuest == null)
|
||||
return;
|
||||
|
||||
Scenario newQuest = new Scenario(staticQuest, this, null, 0, 0);
|
||||
|
||||
int freeSlot = GetFreeQuestSlot();
|
||||
|
||||
if (freeSlot == -1)
|
||||
return;
|
||||
|
||||
playerWork.questScenario[freeSlot] = id;
|
||||
questScenario[freeSlot] = new Quest(this, playerWork.questScenario[freeSlot], name, null, 0, 0);
|
||||
Database.SaveQuest(this, questScenario[freeSlot]);
|
||||
playerWork.questScenario[freeSlot] = newQuest.actorId;
|
||||
questScenario[freeSlot] = newQuest;
|
||||
|
||||
Database.SaveQuest(this, newQuest);
|
||||
SendQuestClientUpdate(freeSlot);
|
||||
|
||||
if (!isSilent)
|
||||
{
|
||||
SendGameMessage(Server.GetWorldManager().GetActor(), 25224, 0x20, (object)questScenario[freeSlot].GetQuestId());
|
||||
questScenario[freeSlot].NextPhase(0);
|
||||
}
|
||||
(questScenario[freeSlot] as Scenario).NextPhase(0);
|
||||
}
|
||||
}
|
||||
|
||||
public void CompleteQuest(uint id)
|
||||
|
@ -1541,9 +1592,9 @@ namespace Meteor.Map.Actors
|
|||
{
|
||||
if (questScenario[i] != null && questScenario[i].GetQuestId() == oldId)
|
||||
{
|
||||
Actor actor = Server.GetStaticActors((0xA0F00000 | newId));
|
||||
Quest quest = Server.GetStaticActors((0xA0F00000 | newId)) as Quest;
|
||||
playerWork.questScenario[i] = (0xA0F00000 | newId);
|
||||
questScenario[i] = new Quest(this, playerWork.questScenario[i], actor.actorName, null, 0, 0);
|
||||
questScenario[i] = new Scenario(quest, this, null, 0, 0);
|
||||
Database.SaveQuest(this, questScenario[i]);
|
||||
SendQuestClientUpdate(i);
|
||||
break;
|
||||
|
@ -1598,6 +1649,16 @@ namespace Meteor.Map.Actors
|
|||
|
||||
return null;
|
||||
}
|
||||
public Quest GetQuestGuildleve(uint id)
|
||||
{
|
||||
for (int i = 0; i < questGuildleve.Length; i++)
|
||||
{
|
||||
if (questGuildleve[i] != null && questGuildleve[i].actorId == (0xA0F00000 | id))
|
||||
return questGuildleve[i];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public bool HasQuest(string name)
|
||||
{
|
||||
|
@ -1621,6 +1682,17 @@ namespace Meteor.Map.Actors
|
|||
return false;
|
||||
}
|
||||
|
||||
public bool HasQuestGuildleve(uint id)
|
||||
{
|
||||
for (int i = 0; i < questGuildleve.Length; i++)
|
||||
{
|
||||
if (questGuildleve[i] != null && questGuildleve[i].actorId == (0xA0F00000 | id))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool HasGuildleve(uint id)
|
||||
{
|
||||
for (int i = 0; i < work.guildleveId.Length; i++)
|
||||
|
@ -1643,6 +1715,17 @@ namespace Meteor.Map.Actors
|
|||
return -1;
|
||||
}
|
||||
|
||||
public int GetQuestGuildleveSlot(uint id)
|
||||
{
|
||||
for (int i = 0; i < questGuildleve.Length; i++)
|
||||
{
|
||||
if (questGuildleve[i] != null && questGuildleve[i].actorId == (0xA0F00000 | id))
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
public void SetNpcLS(uint npcLSId, uint state)
|
||||
{
|
||||
bool isCalling, isExtra;
|
||||
|
@ -1679,30 +1762,36 @@ namespace Meteor.Map.Actors
|
|||
Database.SaveNpcLS(this, npcLSId, isCalling, isExtra);
|
||||
|
||||
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("playerWork/npcLinkshellChat", this);
|
||||
propPacketUtil.AddProperty(String.Format("playerWork.npcLinkshellChatExtra[{0}]", npcLSId));
|
||||
propPacketUtil.AddProperty(String.Format("playerWork.npcLinkshellChatCalling[{0}]", npcLSId));
|
||||
propPacketUtil.AddProperty(string.Format("playerWork.npcLinkshellChatExtra[{0}]", npcLSId));
|
||||
propPacketUtil.AddProperty(string.Format("playerWork.npcLinkshellChatCalling[{0}]", npcLSId));
|
||||
QueuePackets(propPacketUtil.Done());
|
||||
}
|
||||
|
||||
private void SendQuestClientUpdate(int slot)
|
||||
{
|
||||
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("playerWork/journal", this);
|
||||
propPacketUtil.AddProperty(String.Format("playerWork.questScenario[{0}]", slot));
|
||||
propPacketUtil.AddProperty(string.Format("playerWork.questScenario[{0}]", slot));
|
||||
QueuePackets(propPacketUtil.Done());
|
||||
}
|
||||
private void SendQuestGuildleveClientUpdate(int slot)
|
||||
{
|
||||
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("playerWork/journal", this);
|
||||
propPacketUtil.AddProperty(string.Format("playerWork.questGuildleve[{0}]", slot));
|
||||
QueuePackets(propPacketUtil.Done());
|
||||
}
|
||||
|
||||
private void SendGuildleveClientUpdate(int slot)
|
||||
{
|
||||
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("work/guildleve", this);
|
||||
propPacketUtil.AddProperty(String.Format("work.guildleveId[{0}]", slot));
|
||||
propPacketUtil.AddProperty(string.Format("work.guildleveId[{0}]", slot));
|
||||
QueuePackets(propPacketUtil.Done());
|
||||
}
|
||||
|
||||
private void SendGuildleveMarkClientUpdate(int slot)
|
||||
{
|
||||
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("work/guildleve", this);
|
||||
propPacketUtil.AddProperty(String.Format("work.guildleveDone[{0}]", slot));
|
||||
propPacketUtil.AddProperty(String.Format("work.guildleveChecked[{0}]", slot));
|
||||
propPacketUtil.AddProperty(string.Format("work.guildleveDone[{0}]", slot));
|
||||
propPacketUtil.AddProperty(string.Format("work.guildleveChecked[{0}]", slot));
|
||||
QueuePackets(propPacketUtil.Done());
|
||||
}
|
||||
|
||||
|
@ -2034,10 +2123,35 @@ namespace Meteor.Map.Actors
|
|||
retainerMeetingGroup = null;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Update(DateTime tick)
|
||||
|
||||
public void AddRecentRecipe(Recipe recipe)
|
||||
{
|
||||
|
||||
recentRecipes.Remove(recipe);
|
||||
if (recentRecipes.Count > 8)
|
||||
recentRecipes.RemoveAt(7);
|
||||
recentRecipes.Add(recipe);
|
||||
}
|
||||
|
||||
public List<Recipe> GetRecentRecipes()
|
||||
{
|
||||
return recentRecipes;
|
||||
}
|
||||
|
||||
public void AddAwardedRecipe(Recipe recipe)
|
||||
{
|
||||
awardedRecipes.Remove(recipe);
|
||||
if (awardedRecipes.Count > 8)
|
||||
awardedRecipes.RemoveAt(7);
|
||||
awardedRecipes.Add(recipe);
|
||||
}
|
||||
|
||||
public List<Recipe> GetAwardedRecipes()
|
||||
{
|
||||
return awardedRecipes;
|
||||
}
|
||||
|
||||
public override void Update(DateTime tick)
|
||||
{
|
||||
// Chocobo Rental Expirey
|
||||
if (rentalExpireTime != 0)
|
||||
{
|
||||
|
@ -2048,7 +2162,7 @@ namespace Meteor.Map.Actors
|
|||
{
|
||||
rentalExpireTime = 0;
|
||||
rentalMinLeft = 0;
|
||||
ChangeMusic(GetZone().bgmDay);
|
||||
ResetMusic();
|
||||
SetMountState(0);
|
||||
ChangeSpeed(0.0f, 2.0f, 5.0f, 5.0f);
|
||||
ChangeState(0);
|
||||
|
@ -2102,7 +2216,7 @@ namespace Meteor.Map.Actors
|
|||
if (GetMod(i) != charaWork.battleTemp.generalParameter[i])
|
||||
{
|
||||
charaWork.battleTemp.generalParameter[i] = (short)GetMod(i);
|
||||
propPacketUtil.AddProperty(String.Format("charaWork.battleTemp.generalParameter[{0}]", i));
|
||||
propPacketUtil.AddProperty(string.Format("charaWork.battleTemp.generalParameter[{0}]", i));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2149,8 +2263,8 @@ namespace Meteor.Map.Actors
|
|||
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("charaWork/command", this);
|
||||
foreach (ushort slot in slotsToUpdate)
|
||||
{
|
||||
propPacketUtil.AddProperty(String.Format("charaWork.command[{0}]", slot));
|
||||
propPacketUtil.AddProperty(String.Format("charaWork.commandCategory[{0}]", slot));
|
||||
propPacketUtil.AddProperty(string.Format("charaWork.command[{0}]", slot));
|
||||
propPacketUtil.AddProperty(string.Format("charaWork.commandCategory[{0}]", slot));
|
||||
}
|
||||
|
||||
propPacketUtil.NewTarget("charaWork/commandDetailForSelf");
|
||||
|
@ -2158,7 +2272,7 @@ namespace Meteor.Map.Actors
|
|||
foreach (ushort slot in slotsToUpdate)
|
||||
{
|
||||
charaWork.parameterSave.commandSlot_compatibility[slot - charaWork.commandBorder] = charaWork.command[slot] != 0;
|
||||
propPacketUtil.AddProperty(String.Format("charaWork.parameterSave.commandSlot_compatibility[{0}]", slot - charaWork.commandBorder));
|
||||
propPacketUtil.AddProperty(string.Format("charaWork.parameterSave.commandSlot_compatibility[{0}]", slot - charaWork.commandBorder));
|
||||
}
|
||||
|
||||
QueuePackets(propPacketUtil.Done());
|
||||
|
@ -2172,8 +2286,8 @@ namespace Meteor.Map.Actors
|
|||
|
||||
foreach (ushort slot in slotsToUpdate)
|
||||
{
|
||||
recastPacketUtil.AddProperty(String.Format("charaWork.parameterTemp.maxCommandRecastTime[{0}]", slot - charaWork.commandBorder));
|
||||
recastPacketUtil.AddProperty(String.Format("charaWork.parameterSave.commandSlot_recastTime[{0}]", slot - charaWork.commandBorder));
|
||||
recastPacketUtil.AddProperty(string.Format("charaWork.parameterTemp.maxCommandRecastTime[{0}]", slot - charaWork.commandBorder));
|
||||
recastPacketUtil.AddProperty(string.Format("charaWork.parameterSave.commandSlot_recastTime[{0}]", slot - charaWork.commandBorder));
|
||||
}
|
||||
|
||||
QueuePackets(recastPacketUtil.Done());
|
||||
|
@ -2595,7 +2709,7 @@ namespace Meteor.Map.Actors
|
|||
charaWork.battleSave.skillPoint[classId - 1] = 0;
|
||||
//send new level
|
||||
ActorPropertyPacketUtil levelPropertyPacket = new ActorPropertyPacketUtil("charaWork/stateForAll", this);
|
||||
levelPropertyPacket.AddProperty(String.Format("charaWork.battleSave.skillLevel[{0}]", classId - 1));
|
||||
levelPropertyPacket.AddProperty(string.Format("charaWork.battleSave.skillLevel[{0}]", classId - 1));
|
||||
levelPropertyPacket.AddProperty("charaWork.parameterSave.state_mainSkillLevel");
|
||||
QueuePackets(levelPropertyPacket.Done());
|
||||
|
||||
|
@ -2606,7 +2720,7 @@ namespace Meteor.Map.Actors
|
|||
charaWork.battleSave.skillPoint[classId - 1] = Math.Min(charaWork.battleSave.skillPoint[classId - 1] + exp, MAXEXP[GetLevel() - 1]);
|
||||
|
||||
ActorPropertyPacketUtil expPropertyPacket = new ActorPropertyPacketUtil("charaWork/battleStateForSelf", this);
|
||||
expPropertyPacket.AddProperty(String.Format("charaWork.battleSave.skillPoint[{0}]", classId - 1));
|
||||
expPropertyPacket.AddProperty(string.Format("charaWork.battleSave.skillPoint[{0}]", classId - 1));
|
||||
|
||||
QueuePackets(expPropertyPacket.Done());
|
||||
Database.SetExp(this, classId, charaWork.battleSave.skillPoint[classId - 1]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue