Skip to content

Commit

Permalink
userinfo, nameplate fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shnok committed Oct 28, 2024
1 parent 96e9b9b commit b92dd3a
Show file tree
Hide file tree
Showing 14 changed files with 518 additions and 241 deletions.
16 changes: 8 additions & 8 deletions l2-unity/Assets/Resources/Data/Effects/skybox/L2Sky.mat
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SunMoon:
m_Texture: {fileID: 2800000, guid: 87bfdbc0202b0e440b4b25a3824f15db, type: 3}
m_Scale: {x: 1.5, y: 1.5}
m_Texture: {fileID: 2800000, guid: b443728fc86061b4f8ecbe8a96c9d2ef, type: 3}
m_Scale: {x: 2.5, y: 2.5}
m_Offset: {x: 0.5, y: 0.5}
- unity_Lightmaps:
m_Texture: {fileID: 0}
Expand All @@ -70,13 +70,13 @@ Material:
- _Cloud_Cutoff: 4.01
- _Cloud_Distance: 0.8
- _Clouds_Far_Tiling: 0.352
- _Clouds_Opacity: 2.54
- _Clouds_Opacity: 0.12
- _Clouds_Tiling: 0.12
- _GradientColor1Influence: 0.6
- _GradientColor2Influence: 0.5
- _HorizonCloudsRotationSpeed: -0.1
- _Horizon_Clouds_Height: 1.44
- _Horizon_Clouds_Opacity: 1
- _Horizon_Clouds_Opacity: 0.05
- _Horizon_Clouds_X_Tile: 1
- _Horizon_Clouds_Y_Tile: 3.17
- _QueueControl: 0
Expand All @@ -92,12 +92,12 @@ Material:
- _Stars_Y_Tile: 1
- _SunMoonSize: 0.13
m_Colors:
- _GradientColor1: {r: 0, g: 0.3529412, b: 0.54901963, a: 1}
- _GradientColor1: {r: -0.003921569, g: -0.003921569, b: -0.007843138, a: -1}
- _GradientColor2: {r: 0, g: 0, b: 0, a: 1}
- _GradientColor3: {r: 7.488819, g: 7.981503, b: 8.47419, a: 1}
- _MainLightForward: {r: -0.23021153, g: -0.9455186, b: -0.23021153, a: 0}
- _MainLightRight: {r: 0.7071067, g: 0, b: -0.7071068, a: 0}
- _MainLightUp: {r: 0.6685827, g: -0.32556826, b: 0.66858256, a: 0}
- _MainLightForward: {r: 0.6710624, g: -0.31519955, b: 0.67106223, a: 0}
- _MainLightRight: {r: 0.7071067, g: 0.000000007450581, b: -0.7071069, a: 0}
- _MainLightUp: {r: 0.22287974, g: 0.94902545, b: 0.22287972, a: 0}
- _SunMoonColor: {r: 1, g: 1, b: 1, a: 0}
m_BuildTextureStacks: []
m_AllowLocking: 1
222 changes: 111 additions & 111 deletions l2-unity/Assets/Resources/Scenes/Game.unity
Original file line number Diff line number Diff line change
Expand Up @@ -118,42 +118,6 @@ NavMeshSettings:
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!21 &2491187
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Height Fog Global
m_Shader: {fileID: 4800000, guid: 3a7ef1b66bafb7a448a880ef76d2e6e6, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3001
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs: []
m_Ints: []
m_Floats:
- _AdvancedCat: 1
- _Banner: 1
- _DirectionalCat: 1
- _FogCat: 1
- _HeightFogGlobal: 1
- _IsHeightFogShader: 1
- _NoiseCat: 1
- _SkyboxCat: 1
m_Colors: []
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!1 &119250918
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -555,7 +519,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 2364867935603570975, guid: 50559bb8d22c3c04a8a788ca6ec38fec, type: 3}
propertyPath: m_CullingMask.m_Bits
value: 4294967295
value: 2097151
objectReference: {fileID: 0}
- target: {fileID: 5966979649214767529, guid: 50559bb8d22c3c04a8a788ca6ec38fec, type: 3}
propertyPath: _camSpeed
Expand Down Expand Up @@ -900,76 +864,6 @@ Material:
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!21 &490068225
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Override
m_Shader: {fileID: 4800000, guid: a3a3bc8785681554d9558e2ea68f100e, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs: []
m_Ints: []
m_Floats:
- _AdvancedCat: 1
- _Banner: 1
- _DirectionalCat: 1
- _DirectionalFalloff: 2
- _DirectionalIntensity: 1
- _FarDistanceHeight: 0
- _FarDistanceOffset: 0
- _FogAxisMode: 1
- _FogCameraMode: 0
- _FogCat: 1
- _FogColorDuo: 1
- _FogDistanceEnd: 100
- _FogDistanceFalloff: 2
- _FogDistanceStart: 0
- _FogHeightEnd: 100
- _FogHeightFalloff: 2
- _FogHeightStart: 0
- _FogIntensity: 1
- _FogLayersMode: 0
- _IsHeightFogPreset: 1
- _IsHeightFogShader: 1
- _JitterIntensity: 1
- _NoiseCat: 1
- _NoiseDistanceEnd: 50
- _NoiseIntensity: 1
- _NoiseMax: 1
- _NoiseMin: 0
- _NoiseModeBlend: 1
- _NoiseScale: 30
- _SkyboxCat: 1
- _SkyboxFogBottom: 0
- _SkyboxFogFalloff: 1
- _SkyboxFogFill: 1
- _SkyboxFogHeight: 1
- _SkyboxFogIntensity: 1
- _SkyboxFogOffset: 0
m_Colors:
- _DirectionalColor: {r: 1, g: 0.7793103, b: 0.5, a: 1}
- _DirectionalDir: {r: 0, g: 0, b: 0, a: 0}
- _FogAxisOption: {r: 0, g: 0, b: 0, a: 0}
- _FogColorEnd: {r: 0.8862745, g: 1.443137, b: 2, a: 1}
- _FogColorStart: {r: 0.4411765, g: 0.722515, b: 1, a: 1}
- _NoiseSpeed: {r: 0.5, g: 0, b: 0.5, a: 0}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!21 &500247091
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1693,6 +1587,42 @@ Material:
- _SpecColor: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!21 &923182931
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Height Fog Global
m_Shader: {fileID: 4800000, guid: 3a7ef1b66bafb7a448a880ef76d2e6e6, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3001
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs: []
m_Ints: []
m_Floats:
- _AdvancedCat: 1
- _Banner: 1
- _DirectionalCat: 1
- _FogCat: 1
- _HeightFogGlobal: 1
- _IsHeightFogShader: 1
- _NoiseCat: 1
- _SkyboxCat: 1
m_Colors: []
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!21 &1002695749
Material:
serializedVersion: 8
Expand Down Expand Up @@ -2595,19 +2525,19 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 7988497584237515198, guid: 824ee6870a432f9439e35ee4e771a1f5, type: 3}
propertyPath: m_LocalRotation.w
value: 0.24371772
value: 0.9145923
objectReference: {fileID: 0}
- target: {fileID: 7988497584237515198, guid: 824ee6870a432f9439e35ee4e771a1f5, type: 3}
propertyPath: m_LocalRotation.x
value: 0.8911538
value: 0.13066855
objectReference: {fileID: 0}
- target: {fileID: 7988497584237515198, guid: 824ee6870a432f9439e35ee4e771a1f5, type: 3}
propertyPath: m_LocalRotation.y
value: 0.100951195
value: 0.37883657
objectReference: {fileID: 0}
- target: {fileID: 7988497584237515198, guid: 824ee6870a432f9439e35ee4e771a1f5, type: 3}
propertyPath: m_LocalRotation.z
value: -0.36912805
value: -0.05412469
objectReference: {fileID: 0}
- target: {fileID: 7988497584237515198, guid: 824ee6870a432f9439e35ee4e771a1f5, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
Expand Down Expand Up @@ -2866,6 +2796,76 @@ Transform:
m_Children: []
m_Father: {fileID: 702052364}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!21 &1947748953
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Override
m_Shader: {fileID: 4800000, guid: a3a3bc8785681554d9558e2ea68f100e, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs: []
m_Ints: []
m_Floats:
- _AdvancedCat: 1
- _Banner: 1
- _DirectionalCat: 1
- _DirectionalFalloff: 2
- _DirectionalIntensity: 1
- _FarDistanceHeight: 0
- _FarDistanceOffset: 0
- _FogAxisMode: 1
- _FogCameraMode: 0
- _FogCat: 1
- _FogColorDuo: 1
- _FogDistanceEnd: 100
- _FogDistanceFalloff: 2
- _FogDistanceStart: 0
- _FogHeightEnd: 100
- _FogHeightFalloff: 2
- _FogHeightStart: 0
- _FogIntensity: 1
- _FogLayersMode: 0
- _IsHeightFogPreset: 1
- _IsHeightFogShader: 1
- _JitterIntensity: 1
- _NoiseCat: 1
- _NoiseDistanceEnd: 50
- _NoiseIntensity: 1
- _NoiseMax: 1
- _NoiseMin: 0
- _NoiseModeBlend: 1
- _NoiseScale: 30
- _SkyboxCat: 1
- _SkyboxFogBottom: 0
- _SkyboxFogFalloff: 1
- _SkyboxFogFill: 1
- _SkyboxFogHeight: 1
- _SkyboxFogIntensity: 1
- _SkyboxFogOffset: 0
m_Colors:
- _DirectionalColor: {r: 1, g: 0.7793103, b: 0.5, a: 1}
- _DirectionalDir: {r: 0, g: 0, b: 0, a: 0}
- _FogAxisOption: {r: 0, g: 0, b: 0, a: 0}
- _FogColorEnd: {r: 0.8862745, g: 1.443137, b: 2, a: 1}
- _FogColorStart: {r: 0.4411765, g: 0.722515, b: 1, a: 1}
- _NoiseSpeed: {r: 0.5, g: 0, b: 0.5, a: 0}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!1 &2004756523
GameObject:
m_ObjectHideFlags: 0
Expand Down
4 changes: 4 additions & 0 deletions l2-unity/Assets/Scripts/Game/Combat/Stats/Stats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ public class Stats
{
[SerializeField] private int _level;
[SerializeField] private int _runSpeed;
[SerializeField] private float _moveSpeedMultiplier;
[SerializeField] private int _walkSpeed;
[SerializeField] private float _scaledRunSpeed;
[SerializeField] private float _scaledWalkSpeed;
[SerializeField] private float _attackSpeedMultiplier;
[SerializeField] private int _pAtkSpd;
[SerializeField] private int _mAtkSpd;
[SerializeField] private int _maxHp;
Expand All @@ -17,6 +19,8 @@ public class Stats
public int Level { get => _level; set => _level = value; }
public int RunSpeed { get => _runSpeed; set => _runSpeed = value; }
public int WalkSpeed { get => _walkSpeed; set => _walkSpeed = value; }
public float MoveSpeedMultiplier { get => _moveSpeedMultiplier; set => _moveSpeedMultiplier = value; }
public float AttackSpeedMultiplier { get => _attackSpeedMultiplier; set => _attackSpeedMultiplier = value; }
public float ScaledRunSpeed { get => _scaledRunSpeed; set => _scaledRunSpeed = value; }
public float ScaledWalkSpeed { get => _scaledWalkSpeed; set => _scaledWalkSpeed = value; }
public int PAtkSpd { get => _pAtkSpd; set => _pAtkSpd = value; }
Expand Down
3 changes: 3 additions & 0 deletions l2-unity/Assets/Scripts/Game/Manager/World.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public void SpawnPlayer(NetworkIdentity identity, PlayerStatus status, PlayerSta
go.transform.eulerAngles = new Vector3(transform.eulerAngles.x, identity.Heading, transform.eulerAngles.z);
go.transform.position = identity.Position;
go.transform.name = "_Player";
go.layer = LayerMask.NameToLayer("Invisible"); //Invisible

PlayerEntity player = go.GetComponent<PlayerEntity>();

Expand Down Expand Up @@ -172,6 +173,8 @@ public void SpawnPlayer(NetworkIdentity identity, PlayerStatus status, PlayerSta

public void UpdatePlayer(Entity entity, NetworkIdentity identity, PlayerStatus status, PlayerStats stats, PlayerAppearance appearance, bool running)
{
entity.gameObject.layer = LayerMask.NameToLayer("Player");

((PlayerEntity)entity).Identity.UpdateEntity(identity);
((PlayerStatus)entity.Status).UpdateStatus(status);
((PlayerStats)entity.Stats).UpdateStats(stats);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
public enum GameServerPacketType : int
{
VersionCheck = 0x00,
UserInfo = 0x04,
CharSelectionInfo = 0x13,
LoginFail = 0x14,
CharSelected = 0x15,
Expand Down Expand Up @@ -33,7 +34,6 @@ public enum GameServerPacketType : int
ApplyDamage = 0xFFB,
NpcInfo = 0xFFC,
ObjectMoveTo = 0xFFD,
UserInfo = 0xFFE,
ObjectMoveDirection = 0xFFF,
GameTime = 0xFD0,
EntitySetTarget = 0xFD1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ public override void Parse()
_info.Stats.Level = ReadI();
_info.Stats.Karma = ReadI();
_info.Stats.PkKills = ReadI();
_info.Stats.Int = ReadB();
_info.Stats.Str = ReadB();
_info.Stats.Con = ReadB();
_info.Stats.Men = ReadB();
_info.Stats.Dex = ReadB();
_info.Stats.Wit = ReadB();
_info.Stats.Int = (byte)ReadI();
_info.Stats.Str = (byte)ReadI();
_info.Stats.Con = (byte)ReadI();
_info.Stats.Men = (byte)ReadI();
_info.Stats.Dex = (byte)ReadI();
_info.Stats.Wit = (byte)ReadI();

for (int i = 0; i < 30; i++)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public override void Parse()
character.Slot = i;
character.Name = ReadS();
character.Id = ReadI();
character.Id = i; // CharId shared by the server is always the same
character.Account = ReadS();
_sessionId = ReadI();
character.ClanId = ReadI();
Expand Down
Loading

0 comments on commit b92dd3a

Please sign in to comment.