-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
47,166 additions
and
26,592 deletions.
There are no files selected for viewing
Binary file modified
BIN
+0 Bytes
(100%)
l2-unity-fmod/.cache/{4127ed50-b246-44fa-b836-f66fb20fe7bb}.pdc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
l2-unity-fmod/.cache/{4d8dba7a-2f4e-48a8-8a7f-0018e8aa04f3}.pdc
Binary file not shown.
53,064 changes: 26,532 additions & 26,532 deletions
53,064
l2-unity/Assets/Resources/Scenes/Tests/TestParticles.unity
Large diffs are not rendered by default.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
l2-unity/Assets/Scripts/Datatable/Grp/Model/SkillSoundgrp.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class SkillSoundgrp | ||
{ | ||
public int SkillId { get; set; } | ||
public SkillSound[] SpellEffectSounds { get; set; } | ||
public SkillSound[] ShotEffectSounds { get; set; } | ||
public string[] CastingVoices { get; set; } | ||
public string[] CastingEndVoices { get; set; } | ||
public float CastVolume { get; set; } | ||
public float CastRadius { get; set; } | ||
|
||
public SkillSoundgrp() | ||
{ | ||
SpellEffectSounds = new SkillSound[3]; | ||
ShotEffectSounds = new SkillSound[3]; | ||
CastingVoices = new string[14]; | ||
CastingEndVoices = new string[14]; | ||
} | ||
} | ||
|
||
public class SkillSound | ||
{ | ||
public string SoundEvent { get; set; } | ||
public float SoundVolune { get; set; } | ||
public float SoundRadius { get; set; } | ||
public float SoundDelay { get; set; } | ||
} |
2 changes: 2 additions & 0 deletions
2
l2-unity/Assets/Scripts/Datatable/Grp/Model/SkillSoundgrp.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
222 changes: 222 additions & 0 deletions
222
l2-unity/Assets/Scripts/Datatable/Grp/SkillSoundgrpTable.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,222 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.IO; | ||
using UnityEngine; | ||
|
||
public class SkillSoundgrpTable | ||
{ | ||
private static SkillSoundgrpTable _instance; | ||
private Dictionary<int, SkillSoundgrp> _data; | ||
|
||
public static SkillSoundgrpTable Instance | ||
{ | ||
get | ||
{ | ||
if (_instance == null) | ||
{ | ||
_instance = new SkillSoundgrpTable(); | ||
} | ||
|
||
return _instance; | ||
} | ||
} | ||
|
||
public void Initialize() | ||
{ | ||
ReadActions(); | ||
} | ||
|
||
private void ReadActions() | ||
{ | ||
_data = new Dictionary<int, SkillSoundgrp>(); | ||
|
||
string dataPath = Path.Combine(Application.streamingAssetsPath, "Data/Meta/SkillSoundgrp_Classic.txt"); | ||
if (!File.Exists(dataPath)) | ||
{ | ||
Debug.LogWarning("File not found: " + dataPath); | ||
return; | ||
} | ||
|
||
using (StreamReader reader = new StreamReader(dataPath)) | ||
{ | ||
string line; | ||
while ((line = reader.ReadLine()) != null) | ||
{ | ||
SkillSoundgrp grp = new SkillSoundgrp(); | ||
|
||
string[] keyvals = line.Split('\t'); | ||
|
||
for (int i = 0; i < keyvals.Length; i++) | ||
{ | ||
if (!keyvals[i].Contains("=")) | ||
{ | ||
continue; | ||
} | ||
|
||
string[] keyval = keyvals[i].Split("="); | ||
string key = keyval[0]; | ||
string value = keyval[1].Replace("[", "").Replace("]", ""); | ||
|
||
switch (key) | ||
{ | ||
case "skill_id": | ||
grp.SkillId = int.Parse(value, CultureInfo.InvariantCulture); | ||
break; | ||
case "spelleffect_sound_1": | ||
case "spelleffect_sound_2": | ||
case "spelleffect_sound_3": | ||
if (value != "None") | ||
{ | ||
int index = int.Parse(key.Replace("spelleffect_sound_", ""), CultureInfo.InvariantCulture); | ||
grp.SpellEffectSounds[--index] = new SkillSound(); | ||
grp.SpellEffectSounds[index].SoundEvent = value; | ||
} | ||
break; | ||
case "spelleffect_sound_vol_1": | ||
case "spelleffect_sound_vol_2": | ||
case "spelleffect_sound_vol_3": | ||
int volIndex = int.Parse(key.Replace("spelleffect_sound_vol_", "")); | ||
if (grp.SpellEffectSounds[--volIndex] != null) | ||
{ | ||
float vol = float.Parse(value, CultureInfo.InvariantCulture); | ||
grp.SpellEffectSounds[volIndex].SoundVolune = vol; | ||
} | ||
break; | ||
case "spelleffect_sound_rad_1": | ||
case "spelleffect_sound_rad_2": | ||
case "spelleffect_sound_rad_3": | ||
int radIndex = int.Parse(key.Replace("spelleffect_sound_rad_", "")); | ||
if (grp.SpellEffectSounds[--radIndex] != null) | ||
{ | ||
float rad = float.Parse(value, CultureInfo.InvariantCulture); | ||
grp.SpellEffectSounds[radIndex].SoundRadius = rad; | ||
} | ||
break; | ||
case "spelleffect_sound_delay_1": | ||
case "spelleffect_sound_delay_2": | ||
case "spelleffect_sound_delay_3": | ||
int delayIndex = int.Parse(key.Replace("spelleffect_sound_delay_", "")); | ||
if (grp.SpellEffectSounds[--delayIndex] != null) | ||
{ | ||
float delay = float.Parse(value, CultureInfo.InvariantCulture); | ||
grp.SpellEffectSounds[delayIndex].SoundDelay = delay; | ||
} | ||
break; | ||
case "shoteffect_sound_1": | ||
case "shoteffect_sound_2": | ||
case "shoteffect_sound_3": | ||
if (value != "None") | ||
{ | ||
int index = int.Parse(key.Replace("shoteffect_sound_", ""), CultureInfo.InvariantCulture); | ||
grp.ShotEffectSounds[--index] = new SkillSound(); | ||
grp.ShotEffectSounds[index].SoundEvent = value; | ||
} | ||
break; | ||
case "shoteffect_sound_vol_1": | ||
case "shoteffect_sound_vol_2": | ||
case "shoteffect_sound_vol_3": | ||
int volIndex2 = int.Parse(key.Replace("shoteffect_sound_vol_", "")); | ||
if (grp.ShotEffectSounds[--volIndex2] != null) | ||
{ | ||
float vol = float.Parse(value, CultureInfo.InvariantCulture); | ||
grp.ShotEffectSounds[volIndex2].SoundVolune = vol; | ||
} | ||
break; | ||
case "shoteffect_sound_rad_1": | ||
case "shoteffect_sound_rad_2": | ||
case "shoteffect_sound_rad_3": | ||
int radIndex2 = int.Parse(key.Replace("shoteffect_sound_rad_", "")); | ||
if (grp.ShotEffectSounds[--radIndex2] != null) | ||
{ | ||
float rad = float.Parse(value, CultureInfo.InvariantCulture); | ||
grp.ShotEffectSounds[radIndex2].SoundRadius = rad; | ||
} | ||
break; | ||
case "shoteffect_sound_delay_1": | ||
case "shoteffect_sound_delay_2": | ||
case "shoteffect_sound_delay_3": | ||
int delayIndex2 = int.Parse(key.Replace("shoteffect_sound_delay_", "")); | ||
if (grp.ShotEffectSounds[--delayIndex2] != null) | ||
{ | ||
float delay = float.Parse(value, CultureInfo.InvariantCulture); | ||
grp.ShotEffectSounds[delayIndex2].SoundDelay = delay; | ||
} | ||
break; | ||
case "mfighter_cast": | ||
case "ffighter_cast": | ||
case "mmagic_cast": | ||
case "fmagic_cast": | ||
case "melf_cast": | ||
case "felf_cast": | ||
case "mdarkelf_cast": | ||
case "fdarkelf_cast": | ||
case "mdwarf_cast": | ||
case "fdwarf_cast": | ||
case "morc_cast": | ||
case "forc_cast": | ||
case "mshaman_cast": | ||
case "fshaman_cast": | ||
// case "mkamael_cast": | ||
// case "fkamael_cast": | ||
// case "mertheia_cast": | ||
// case "fertheia_cast": | ||
if (value != "None") | ||
{ | ||
CharacterModelType modelType = CharacterModelTypeParser.ParseRace(key.Replace("_cast", "")); | ||
grp.CastingVoices[(int)modelType] = value; | ||
} | ||
break; | ||
case "mfighter_magic": | ||
case "ffighter_magic": | ||
case "mmagic_magic": | ||
case "fmagic_magic": | ||
case "melf_magic": | ||
case "felf_magic": | ||
case "mdarkelf_magic": | ||
case "fdarkelf_magic": | ||
case "mdwarf_magic": | ||
case "fdwarf_magic": | ||
case "morc_magic": | ||
case "forc_magic": | ||
case "mshaman_magic": | ||
case "fshaman_magic": | ||
// case "mkamael_magic": | ||
// case "fkamael_magic": | ||
// case "mertheia_magic": | ||
// case "fertheia_magic": | ||
if (value != "None") | ||
{ | ||
CharacterModelType modelType = CharacterModelTypeParser.ParseRace(key.Replace("_magic", "")); | ||
grp.CastingEndVoices[(int)modelType] = value; | ||
} | ||
break; | ||
case "cast_volune": | ||
grp.CastVolume = float.Parse(value, CultureInfo.InvariantCulture); | ||
break; | ||
case "cast_rad": | ||
grp.CastRadius = float.Parse(value, CultureInfo.InvariantCulture); | ||
break; | ||
} | ||
} | ||
|
||
_data.TryAdd(grp.SkillId, grp); | ||
} | ||
Debug.Log($"Successfully imported {_data.Count} SkillSoundGrp(s)"); | ||
} | ||
} | ||
|
||
public SkillSoundgrp GetSkillSoundGrp(int key) | ||
{ | ||
SkillSoundgrp skillSoundgrp; | ||
_data.TryGetValue(key, out skillSoundgrp); | ||
|
||
if (skillSoundgrp == null) | ||
{ | ||
Debug.LogWarning($"SkillsoundGrp is null for skillId: {key}."); | ||
} | ||
|
||
return skillSoundgrp; | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
l2-unity/Assets/Scripts/Datatable/Grp/SkillSoundgrpTable.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.