mirror of
https://git.muiegratis.online/suikoakari/Campofinale
synced 2025-12-12 17:44:37 +01:00
real enemy drops, improved code etc, i dont remember everything i made LOL
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
|
using System.Threading;
|
||||||
using static Campofinale.Resource.ResourceManager;
|
using static Campofinale.Resource.ResourceManager;
|
||||||
using static Campofinale.Resource.ResourceManager.LevelScene.LevelData;
|
using static Campofinale.Resource.ResourceManager.LevelScene.LevelData;
|
||||||
|
|
||||||
@@ -41,6 +42,10 @@ namespace Campofinale.Game.Entities
|
|||||||
public virtual void Heal(double heal)
|
public virtual void Heal(double heal)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public virtual void OnDie()
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
public virtual bool Interact(string eventName, Google.Protobuf.Collections.MapField<string, DynamicParameter> properties)
|
public virtual bool Interact(string eventName, Google.Protobuf.Collections.MapField<string, DynamicParameter> properties)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
|
using Campofinale.Resource.Table;
|
||||||
|
using System.Threading;
|
||||||
using static Campofinale.Resource.ResourceManager;
|
using static Campofinale.Resource.ResourceManager;
|
||||||
|
|
||||||
namespace Campofinale.Game.Entities
|
namespace Campofinale.Game.Entities
|
||||||
@@ -97,6 +99,23 @@ namespace Campofinale.Game.Entities
|
|||||||
};
|
};
|
||||||
return proto;
|
return proto;
|
||||||
}
|
}
|
||||||
|
public override void OnDie()
|
||||||
|
{
|
||||||
|
if (!wikiEnemyDropTable.ContainsKey(templateId)) return;
|
||||||
|
WikiEnemyDropTable table = wikiEnemyDropTable[templateId];
|
||||||
|
if (table!=null)
|
||||||
|
{
|
||||||
|
table.dropItemIds.ForEach(id =>
|
||||||
|
{
|
||||||
|
GetOwner().sceneManager.CreateDrop(Position, new RewardTable.ItemBundle()
|
||||||
|
{
|
||||||
|
id = id,
|
||||||
|
count = 1
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
public override void Damage(double dmg)
|
public override void Damage(double dmg)
|
||||||
{
|
{
|
||||||
curHp -= dmg;
|
curHp -= dmg;
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ using static Campofinale.Resource.ResourceManager;
|
|||||||
using Google.Protobuf.Collections;
|
using Google.Protobuf.Collections;
|
||||||
using Campofinale.Packets.Sc;
|
using Campofinale.Packets.Sc;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
|
using CsvHelper.Configuration.Attributes;
|
||||||
|
|
||||||
namespace Campofinale.Game.Inventory
|
namespace Campofinale.Game.Inventory
|
||||||
{
|
{
|
||||||
|
|||||||
25
Campofinale/Game/MissionSys/GameMission.cs
Normal file
25
Campofinale/Game/MissionSys/GameMission.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
using Campofinale.Resource;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Campofinale.Game.MissionSys
|
||||||
|
{
|
||||||
|
public class GameMission
|
||||||
|
{
|
||||||
|
public string missionId;
|
||||||
|
public MissionState state;
|
||||||
|
|
||||||
|
public GameMission()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public GameMission(string id, MissionState state = MissionState.Available)
|
||||||
|
{
|
||||||
|
missionId = id;
|
||||||
|
this.state = state;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
24
Campofinale/Game/MissionSys/GameQuest.cs
Normal file
24
Campofinale/Game/MissionSys/GameQuest.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
using Campofinale.Resource;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Campofinale.Game.MissionSys
|
||||||
|
{
|
||||||
|
public class GameQuest
|
||||||
|
{
|
||||||
|
public string questId;
|
||||||
|
public QuestState state;
|
||||||
|
public GameQuest()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public GameQuest(string id, QuestState state = QuestState.Available)
|
||||||
|
{
|
||||||
|
questId = id;
|
||||||
|
this.state = state;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -266,33 +266,6 @@ namespace Campofinale.Game.MissionSys
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public class GameQuest
|
|
||||||
{
|
|
||||||
public string questId;
|
|
||||||
public QuestState state;
|
|
||||||
public GameQuest()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
public GameQuest(string id, QuestState state = QuestState.Available)
|
|
||||||
{
|
|
||||||
questId = id;
|
|
||||||
this.state = state;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public class GameMission
|
|
||||||
{
|
|
||||||
public string missionId;
|
|
||||||
public MissionState state;
|
|
||||||
|
|
||||||
public GameMission()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
public GameMission(string id, MissionState state = MissionState.Available)
|
|
||||||
{
|
|
||||||
missionId = id;
|
|
||||||
this.state = state;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,42 +90,39 @@ namespace Campofinale.Game
|
|||||||
|
|
||||||
if (scene != null)
|
if (scene != null)
|
||||||
{
|
{
|
||||||
if(GetEntity(guid) is EntityMonster)
|
Entity entity = GetEntity(guid);
|
||||||
|
if (entity != null)
|
||||||
{
|
{
|
||||||
EntityMonster monster = (EntityMonster)GetEntity(guid);
|
entity.OnDie();
|
||||||
CreateDrop(monster.Position, new RewardTable.ItemBundle()
|
if (killClient)
|
||||||
{
|
{
|
||||||
id = "item_gem_rarity_3",
|
ScSceneDestroyEntity destroy = new()
|
||||||
count=1
|
|
||||||
});
|
|
||||||
LevelScene lv_scene = ResourceManager.GetLevelData(GetEntity(guid).sceneNumId);
|
|
||||||
LevelEnemyData d = lv_scene.levelData.enemies.Find(l => l.levelLogicId == monster.guid);
|
|
||||||
if (d != null)
|
|
||||||
{
|
|
||||||
if (!d.respawnable)
|
|
||||||
{
|
{
|
||||||
player.noSpawnAnymore.Add(monster.guid);
|
Id = guid,
|
||||||
|
Reason = reason,
|
||||||
|
SceneNumId = GetEntity(guid).sceneNumId,
|
||||||
|
};
|
||||||
|
player.Send(Protocol.ScMsgId.ScSceneDestroyEntity, destroy);
|
||||||
|
|
||||||
|
}
|
||||||
|
if (entity is EntityMonster monster)
|
||||||
|
{
|
||||||
|
LevelScene lv_scene = ResourceManager.GetLevelData(entity.sceneNumId);
|
||||||
|
LevelEnemyData d = lv_scene.levelData.enemies.Find(l => l.levelLogicId == monster.guid);
|
||||||
|
if (d != null)
|
||||||
|
{
|
||||||
|
if (!d.respawnable)
|
||||||
|
{
|
||||||
|
player.noSpawnAnymore.Add(monster.guid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if (scenes.Find(s => s.sceneNumId == entity.sceneNumId) != null)
|
||||||
if (killClient)
|
|
||||||
{
|
|
||||||
ScSceneDestroyEntity destroy = new()
|
|
||||||
{
|
{
|
||||||
Id = guid,
|
scenes.Find(s => s.sceneNumId == entity.sceneNumId).entities.Remove(entity);
|
||||||
Reason = reason,
|
|
||||||
SceneNumId = GetEntity(guid).sceneNumId,
|
|
||||||
};
|
|
||||||
player.Send(Protocol.ScMsgId.ScSceneDestroyEntity, destroy);
|
|
||||||
}
|
|
||||||
if (GetEntity(guid) != null)
|
|
||||||
{
|
|
||||||
if(scenes.Find(s => s.sceneNumId == GetEntity(guid).sceneNumId) != null)
|
|
||||||
{
|
|
||||||
scenes.Find(s => s.sceneNumId == GetEntity(guid).sceneNumId).entities.Remove(GetEntity(guid));
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -400,8 +397,11 @@ namespace Campofinale.Game
|
|||||||
{
|
{
|
||||||
|
|
||||||
List<Entity> toSpawn = new();
|
List<Entity> toSpawn = new();
|
||||||
foreach(Entity e in GetEntityExcludingChar().FindAll(e=>e.spawned==false))
|
List<Entity> toCheck = GetEntityExcludingChar().FindAll(e => e.spawned == false);
|
||||||
|
toCheck.Sort((a, b) => a.Position.Distance(GetOwner().position).CompareTo(b.Position.Distance(GetOwner().position)));
|
||||||
|
foreach (Entity e in toCheck)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(e.spawned==false && (GetActiveScript(e.belongLevelScriptId) || e.belongLevelScriptId==0))
|
if(e.spawned==false && (GetActiveScript(e.belongLevelScriptId) || e.belongLevelScriptId==0))
|
||||||
{
|
{
|
||||||
if (!e.defaultHide)
|
if (!e.defaultHide)
|
||||||
|
|||||||
@@ -122,7 +122,19 @@ namespace Campofinale.Http
|
|||||||
|
|
||||||
await ctx.Response.SendAsync(resp);
|
await ctx.Response.SendAsync(resp);
|
||||||
}
|
}
|
||||||
|
[StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/1003/prod-cbt/default/Windows/res_version")]
|
||||||
|
public static async Task os_windows_res_version(HttpContext ctx)
|
||||||
|
{
|
||||||
|
|
||||||
|
string resp = "{\"version\": \"2089329-32\", \"kickFlag\": true}";
|
||||||
|
|
||||||
|
|
||||||
|
ctx.Response.StatusCode = 200;
|
||||||
|
//ctx.Response.ContentLength = resp.Length;
|
||||||
|
ctx.Response.ContentType = "application/json";
|
||||||
|
|
||||||
|
await ctx.Response.SendAsync(resp);
|
||||||
|
}
|
||||||
[StaticRoute(HttpServerLite.HttpMethod.GET, "/api/gameBulletin/version")]
|
[StaticRoute(HttpServerLite.HttpMethod.GET, "/api/gameBulletin/version")]
|
||||||
public static async Task Version(HttpContext ctx)
|
public static async Task Version(HttpContext ctx)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ namespace Campofinale.Packets.Cs
|
|||||||
{
|
{
|
||||||
CsSceneSetLastSafeZone req = packet.DecodeBody<CsSceneSetLastSafeZone>();
|
CsSceneSetLastSafeZone req = packet.DecodeBody<CsSceneSetLastSafeZone>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,20 +44,21 @@ namespace Campofinale.Packets.Cs
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* ScSceneLevelScriptStateNotify rsp = new ScSceneLevelScriptStateNotify()
|
var sceneScript = session.sceneManager.GetCurScene().scripts.Find(s => s.scriptId == req.ScriptId);
|
||||||
|
if (sceneScript != null)
|
||||||
{
|
{
|
||||||
SceneNumId = req.SceneNumId,
|
sceneScript.state = 2;
|
||||||
ScriptId = req.ScriptId,
|
ScSceneLevelScriptStateNotify rsp = new ScSceneLevelScriptStateNotify()
|
||||||
|
{
|
||||||
|
SceneNumId = req.SceneNumId,
|
||||||
|
ScriptId = req.ScriptId,
|
||||||
|
|
||||||
State = 3
|
State = sceneScript.state
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!session.sceneManager.GetCurScene().activeScripts.Contains(req.ScriptId))
|
|
||||||
{
|
|
||||||
session.sceneManager.GetCurScene().activeScripts.Add(req.ScriptId);
|
|
||||||
session.sceneManager.GetCurScene().UpdateShowEntities();
|
session.sceneManager.GetCurScene().UpdateShowEntities();
|
||||||
|
session.Send(ScMsgId.ScSceneLevelScriptStateNotify, rsp);
|
||||||
}
|
}
|
||||||
session.Send(ScMsgId.ScSceneLevelScriptStateNotify, rsp);*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -86,6 +87,23 @@ namespace Campofinale.Packets.Cs
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var sceneScript = session.sceneManager.GetCurScene().scripts.Find(s => s.scriptId == req.ScriptId);
|
||||||
|
if (sceneScript != null)
|
||||||
|
{
|
||||||
|
sceneScript.state = 3;
|
||||||
|
ScSceneLevelScriptStateNotify rsp = new ScSceneLevelScriptStateNotify()
|
||||||
|
{
|
||||||
|
SceneNumId = req.SceneNumId,
|
||||||
|
ScriptId = req.ScriptId,
|
||||||
|
|
||||||
|
State = sceneScript.state
|
||||||
|
};
|
||||||
|
|
||||||
|
session.Send(ScMsgId.ScSceneLevelScriptStateNotify, rsp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -81,8 +81,8 @@ namespace Campofinale
|
|||||||
//Data
|
//Data
|
||||||
public string accountId = "";
|
public string accountId = "";
|
||||||
public string nickname = "Endministrator";
|
public string nickname = "Endministrator";
|
||||||
public ulong roleId= 1;
|
public ulong roleId = 1;
|
||||||
public Gender gender=Gender.GenFemale;
|
public Gender gender = Gender.GenFemale;
|
||||||
public uint level = 20;
|
public uint level = 20;
|
||||||
public uint xp = 0;
|
public uint xp = 0;
|
||||||
//
|
//
|
||||||
@@ -99,7 +99,7 @@ namespace Campofinale
|
|||||||
public FactoryManager factoryManager;
|
public FactoryManager factoryManager;
|
||||||
public MissionSystem missionSystem;
|
public MissionSystem missionSystem;
|
||||||
public int teamIndex = 0;
|
public int teamIndex = 0;
|
||||||
public List<Team> teams= new List<Team>();
|
public List<Team> teams = new List<Team>();
|
||||||
public List<Mail> mails = new List<Mail>();
|
public List<Mail> mails = new List<Mail>();
|
||||||
public List<int> unlockedSystems = new();
|
public List<int> unlockedSystems = new();
|
||||||
public List<ulong> noSpawnAnymore = new();
|
public List<ulong> noSpawnAnymore = new();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Campofinale.Resource
|
namespace Campofinale.Resource
|
||||||
{
|
{
|
||||||
public enum MissionState : int// TypeDefIndex: 33630
|
public enum MissionState
|
||||||
{
|
{
|
||||||
None = 0,
|
None = 0,
|
||||||
Available = 1,
|
Available = 1,
|
||||||
@@ -17,6 +17,14 @@
|
|||||||
Completed = 3,
|
Completed = 3,
|
||||||
Failed = 4,
|
Failed = 4,
|
||||||
}
|
}
|
||||||
|
public enum LevelScriptState
|
||||||
|
{
|
||||||
|
None = 0,
|
||||||
|
Disabled = 1,
|
||||||
|
Enabled = 2,
|
||||||
|
Active = 3,
|
||||||
|
Running = 4
|
||||||
|
}
|
||||||
public enum InteractiveComponentType
|
public enum InteractiveComponentType
|
||||||
{
|
{
|
||||||
TriggerObserver = 0,
|
TriggerObserver = 0,
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ namespace Campofinale.Resource
|
|||||||
public static Dictionary<string, GachaWeaponPoolTable> gachaWeaponPoolTable = new();
|
public static Dictionary<string, GachaWeaponPoolTable> gachaWeaponPoolTable = new();
|
||||||
//
|
//
|
||||||
public static Dictionary<string, EnemyTable> enemyTable = new();
|
public static Dictionary<string, EnemyTable> enemyTable = new();
|
||||||
|
public static Dictionary<string, WikiEnemyDropTable> wikiEnemyDropTable = new();
|
||||||
public static Dictionary<string, EquipTable> equipTable = new();
|
public static Dictionary<string, EquipTable> equipTable = new();
|
||||||
public static Dictionary<string, EquipSuitTable> equipSuitTable = new();
|
public static Dictionary<string, EquipSuitTable> equipSuitTable = new();
|
||||||
public static Dictionary<string, SpaceShipCharBehaviourTable> spaceShipCharBehaviourTable = new();
|
public static Dictionary<string, SpaceShipCharBehaviourTable> spaceShipCharBehaviourTable = new();
|
||||||
@@ -107,7 +108,6 @@ namespace Campofinale.Resource
|
|||||||
// TODO: move all tables to the folder
|
// TODO: move all tables to the folder
|
||||||
sceneAreaTable=JsonConvert.DeserializeObject<Dictionary<string, SceneAreaTable>>(ReadJsonFile("TableCfg/SceneAreaTable.json"));
|
sceneAreaTable=JsonConvert.DeserializeObject<Dictionary<string, SceneAreaTable>>(ReadJsonFile("TableCfg/SceneAreaTable.json"));
|
||||||
strIdNumTable = JsonConvert.DeserializeObject<StrIdNumTable>(ReadJsonFile("TableCfg/StrIdNumTable.json"));
|
strIdNumTable = JsonConvert.DeserializeObject<StrIdNumTable>(ReadJsonFile("TableCfg/StrIdNumTable.json"));
|
||||||
characterTable = JsonConvert.DeserializeObject<Dictionary<string, CharacterTable>>(ReadJsonFile("TableCfg/CharacterTable.json"));
|
|
||||||
systemJumpTable = JsonConvert.DeserializeObject<Dictionary<string, SystemJumpTable>>(ReadJsonFile("TableCfg/SystemJumpTable.json"));
|
systemJumpTable = JsonConvert.DeserializeObject<Dictionary<string, SystemJumpTable>>(ReadJsonFile("TableCfg/SystemJumpTable.json"));
|
||||||
settlementBasicDataTable = JsonConvert.DeserializeObject<Dictionary<string, SettlementBasicDataTable>>(ReadJsonFile("TableCfg/SettlementBasicDataTable.json"));
|
settlementBasicDataTable = JsonConvert.DeserializeObject<Dictionary<string, SettlementBasicDataTable>>(ReadJsonFile("TableCfg/SettlementBasicDataTable.json"));
|
||||||
blocMissionTable = JsonConvert.DeserializeObject<Dictionary<string, BlocMissionTable>>(ReadJsonFile("TableCfg/BlocMissionTable.json"));
|
blocMissionTable = JsonConvert.DeserializeObject<Dictionary<string, BlocMissionTable>>(ReadJsonFile("TableCfg/BlocMissionTable.json"));
|
||||||
@@ -138,15 +138,12 @@ namespace Campofinale.Resource
|
|||||||
spaceshipRoomInsTable = JsonConvert.DeserializeObject<Dictionary<string, SpaceshipRoomInsTable>>(ReadJsonFile("TableCfg/SpaceshipRoomInsTable.json"));
|
spaceshipRoomInsTable = JsonConvert.DeserializeObject<Dictionary<string, SpaceshipRoomInsTable>>(ReadJsonFile("TableCfg/SpaceshipRoomInsTable.json"));
|
||||||
dungeonTable = JsonConvert.DeserializeObject<Dictionary<string, DungeonTable>>(ReadJsonFile("TableCfg/DungeonTable.json"));
|
dungeonTable = JsonConvert.DeserializeObject<Dictionary<string, DungeonTable>>(ReadJsonFile("TableCfg/DungeonTable.json"));
|
||||||
equipSuitTable = JsonConvert.DeserializeObject<Dictionary<string, EquipSuitTable>>(ReadJsonFile("TableCfg/EquipSuitTable.json"));
|
equipSuitTable = JsonConvert.DeserializeObject<Dictionary<string, EquipSuitTable>>(ReadJsonFile("TableCfg/EquipSuitTable.json"));
|
||||||
levelGradeTable = JsonConvert.DeserializeObject<Dictionary<string, LevelGradeTable>>(ReadJsonFile("TableCfg/LevelGradeTable.json"));
|
|
||||||
levelShortIdTable = JsonConvert.DeserializeObject<Dictionary<string, LevelShortIdTable>>(ReadJsonFile("DynamicAssets/gamedata/gameplayconfig/jsoncfg/LevelShortIdTable.json"));
|
levelShortIdTable = JsonConvert.DeserializeObject<Dictionary<string, LevelShortIdTable>>(ReadJsonFile("DynamicAssets/gamedata/gameplayconfig/jsoncfg/LevelShortIdTable.json"));
|
||||||
rewardTable = JsonConvert.DeserializeObject<Dictionary<string, RewardTable>>(ReadJsonFile("TableCfg/RewardTable.json"));
|
rewardTable = JsonConvert.DeserializeObject<Dictionary<string, RewardTable>>(ReadJsonFile("TableCfg/RewardTable.json"));
|
||||||
adventureTaskTable = JsonConvert.DeserializeObject<Dictionary<string, AdventureTaskTable>>(ReadJsonFile("TableCfg/AdventureTaskTable.json"));
|
adventureTaskTable = JsonConvert.DeserializeObject<Dictionary<string, AdventureTaskTable>>(ReadJsonFile("TableCfg/AdventureTaskTable.json"));
|
||||||
factoryBuildingTable = JsonConvert.DeserializeObject<Dictionary<string, FactoryBuildingTable>>(ReadJsonFile("TableCfg/FactoryBuildingTable.json"));
|
factoryBuildingTable = JsonConvert.DeserializeObject<Dictionary<string, FactoryBuildingTable>>(ReadJsonFile("TableCfg/FactoryBuildingTable.json"));
|
||||||
facSTTNodeTable = JsonConvert.DeserializeObject<Dictionary<string, FacSTTNodeTable>>(ReadJsonFile("TableCfg/FacSTTNodeTable.json"));
|
facSTTNodeTable = JsonConvert.DeserializeObject<Dictionary<string, FacSTTNodeTable>>(ReadJsonFile("TableCfg/FacSTTNodeTable.json"));
|
||||||
facSTTLayerTable = JsonConvert.DeserializeObject<Dictionary<string, FacSTTLayerTable>>(ReadJsonFile("TableCfg/FacSTTLayerTable.json"));
|
facSTTLayerTable = JsonConvert.DeserializeObject<Dictionary<string, FacSTTLayerTable>>(ReadJsonFile("TableCfg/FacSTTLayerTable.json"));
|
||||||
itemTypeTable = JsonConvert.DeserializeObject<Dictionary<int, ItemTypeTable>>(ReadJsonFile("TableCfg/ItemTypeTable.json"));
|
|
||||||
interactiveTable = JsonConvert.DeserializeObject<InteractiveTable>(ReadJsonFile("Json/Interactive/InteractiveTable.json"));
|
|
||||||
LoadInteractiveData();
|
LoadInteractiveData();
|
||||||
LoadLevelDatas();
|
LoadLevelDatas();
|
||||||
LoadScriptsEvent();
|
LoadScriptsEvent();
|
||||||
@@ -155,7 +152,7 @@ namespace Campofinale.Resource
|
|||||||
|
|
||||||
if (missingResources)
|
if (missingResources)
|
||||||
{
|
{
|
||||||
Logger.PrintWarn("Missing some resources. The gameserver will probably crash.");
|
Logger.PrintWarn("Some Resources are Missing. The Game server may not work properly.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static List<int> GetAllShortIds()
|
public static List<int> GetAllShortIds()
|
||||||
@@ -242,38 +239,55 @@ namespace Campofinale.Resource
|
|||||||
{
|
{
|
||||||
Logger.Print("Loading ScriptsEvents");
|
Logger.Print("Loading ScriptsEvents");
|
||||||
string directoryPath = @"Json/ScriptEvents";
|
string directoryPath = @"Json/ScriptEvents";
|
||||||
string[] jsonFiles = Directory.GetFiles(directoryPath, "*.json", SearchOption.AllDirectories);
|
try
|
||||||
foreach (string json in jsonFiles)
|
|
||||||
{
|
{
|
||||||
Dictionary<string,LevelScriptEvent> events = JsonConvert.DeserializeObject<Dictionary<string, LevelScriptEvent>>(ReadJsonFile(json));
|
string[] jsonFiles = Directory.GetFiles(directoryPath, "*.json", SearchOption.AllDirectories);
|
||||||
foreach(KeyValuePair<string,LevelScriptEvent> e in events)
|
foreach (string json in jsonFiles)
|
||||||
{
|
{
|
||||||
if (levelScriptsEvents.ContainsKey(e.Key))
|
Dictionary<string, LevelScriptEvent> events = JsonConvert.DeserializeObject<Dictionary<string, LevelScriptEvent>>(ReadJsonFile(json));
|
||||||
|
foreach (KeyValuePair<string, LevelScriptEvent> e in events)
|
||||||
{
|
{
|
||||||
Logger.PrintWarn($"{e.Key} already added, skipping the one in {json}");
|
if (levelScriptsEvents.ContainsKey(e.Key))
|
||||||
}
|
{
|
||||||
else
|
Logger.PrintWarn($"{e.Key} already added, skipping the one in {json}");
|
||||||
{
|
}
|
||||||
levelScriptsEvents.Add(e.Key,e.Value);
|
else
|
||||||
|
{
|
||||||
|
levelScriptsEvents.Add(e.Key, e.Value);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Logger.Print($"Loaded {levelScriptsEvents.Count} ScriptsEvents");
|
||||||
}
|
}
|
||||||
Logger.Print($"Loaded {levelScriptsEvents.Count} ScriptsEvents");
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Logger.PrintWarn($"No ScriptsEvents folder found in Json.");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
public static void LoadSpawners()
|
public static void LoadSpawners()
|
||||||
{
|
{
|
||||||
Logger.Print("Loading Spawners");
|
Logger.Print("Loading Spawners");
|
||||||
string directoryPath = @"DynamicAssets\gamedata\spawnerconfig";
|
string directoryPath = @"DynamicAssets\gamedata\spawnerconfig";
|
||||||
string[] jsonFiles = Directory.GetFiles(directoryPath, "*.json", SearchOption.AllDirectories);
|
try
|
||||||
foreach (string json in jsonFiles)
|
|
||||||
{
|
{
|
||||||
SpawnerConfig spawner = JsonConvert.DeserializeObject<SpawnerConfig>(ReadJsonFile(json));
|
string[] jsonFiles = Directory.GetFiles(directoryPath, "*.json", SearchOption.AllDirectories);
|
||||||
spawnerConfigs.Add(spawner);
|
foreach (string json in jsonFiles)
|
||||||
|
{
|
||||||
|
SpawnerConfig spawner = JsonConvert.DeserializeObject<SpawnerConfig>(ReadJsonFile(json));
|
||||||
|
spawnerConfigs.Add(spawner);
|
||||||
|
|
||||||
|
}
|
||||||
|
Logger.Print($"Loaded {spawnerConfigs.Count} Spawners");
|
||||||
}
|
}
|
||||||
Logger.Print($"Loaded {spawnerConfigs.Count} Spawners");
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Logger.PrintError($"Error occured when loading SpawnerConfigs: " + e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
public static void LoadLevelDatas()
|
public static void LoadLevelDatas()
|
||||||
{
|
{
|
||||||
@@ -302,7 +316,7 @@ namespace Campofinale.Resource
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
//Logger.PrintError(ex.Message);
|
//Logger.PrintError(ex.Message);
|
||||||
Logger.PrintWarn("Missing levelData natural spawns file for scene " + data.mapIdStr + " path: " + path);
|
Logger.PrintWarn("Missing LevelData natural spawns file for scene " + data.mapIdStr + " path: " + path);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
8
Campofinale/Resource/Table/WikiEnemyDropTable.cs
Normal file
8
Campofinale/Resource/Table/WikiEnemyDropTable.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
namespace Campofinale.Resource.Table
|
||||||
|
{
|
||||||
|
[TableCfgType("TableCfg/WikiEnemyDropTable.json", LoadPriority.LOW)]
|
||||||
|
public class WikiEnemyDropTable
|
||||||
|
{
|
||||||
|
public List<string> dropItemIds = new();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user