From 777bda9cd9e4425ad8a8ef5b17882f1c413fe677 Mon Sep 17 00:00:00 2001 From: NguyenVanDat Date: Tue, 28 Oct 2025 17:51:50 +0700 Subject: [PATCH] inffo --- Assets/PerfectWorld/Scripts/Move/CECPlayer.cs | 10 ++++++++++ Assets/PerfectWorld/Scripts/UI/HUDPlayer.cs | 11 ++++++++++- Assets/Scenes/a61.unity | 4 ++-- Assets/Scripts/CECHostPlayer.cs | 9 +++++++++ 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/Assets/PerfectWorld/Scripts/Move/CECPlayer.cs b/Assets/PerfectWorld/Scripts/Move/CECPlayer.cs index e972c32407..4a8d9aac06 100644 --- a/Assets/PerfectWorld/Scripts/Move/CECPlayer.cs +++ b/Assets/PerfectWorld/Scripts/Move/CECPlayer.cs @@ -45,6 +45,7 @@ public abstract class CECPlayer : CECObject protected bool m_bFashionMode; public bool m_bShowWeapon; private QueueActionEvent queueActionEvent; + protected static PLAYER_LEVELEXP_CONFIG _player_levelup_exp; protected int NUM_WEAPON_TYPE = 15; public static readonly int[] m_sciStateIDForStateAction = { 117 }; @@ -155,6 +156,8 @@ public abstract class CECPlayer : CECObject public static void InitStaticRes() { BuildActionList(); + DATA_TYPE dt = default; + _player_levelup_exp = (PLAYER_LEVELEXP_CONFIG) ElementDataManProvider.GetElementDataMan().get_data_ptr(202,ID_SPACE. ID_SPACE_CONFIG, ref dt); } public bool IsDead() @@ -796,6 +799,13 @@ public abstract class CECPlayer : CECObject public bool CanAttackFactionPVPMineCar() => (m_factionPVPMask & 0x02) != 0; public bool CanAttackFactionPVPMineBase() => (m_factionPVPMask & 0x04) != 0; + public int GetLevelUpExp(int iLevel) + { + // BMLogger.LogError(); + return _player_levelup_exp.exp[iLevel - 1]; + //return iLevel * iLevel * 500; + } + // Get basic properties public ROLEBASICPROP GetBasicProps() { diff --git a/Assets/PerfectWorld/Scripts/UI/HUDPlayer.cs b/Assets/PerfectWorld/Scripts/UI/HUDPlayer.cs index 554f6b0f04..884598b890 100644 --- a/Assets/PerfectWorld/Scripts/UI/HUDPlayer.cs +++ b/Assets/PerfectWorld/Scripts/UI/HUDPlayer.cs @@ -11,11 +11,19 @@ namespace BrewMonster public TextMeshProUGUI manaText; public TextMeshProUGUI expText; public TextMeshProUGUI nameText; + public TextMeshProUGUI levelText; + public float neededExp; private void Awake() { EventBus.Subscribe(UpdateHostPlayerInfoUI); EventBus.Subscribe(UpdateNameHostPlayer); + EventBus.Subscribe(UpdateNeededExp); + } + + private void UpdateNeededExp(EXPToUpLevel obj) + { + neededExp = obj.NeededExp; } private void UpdateNameHostPlayer(InfoHostPlayer obj) @@ -27,7 +35,8 @@ namespace BrewMonster { healthText.text = $"{obj.iHP}/{obj.iMaxHP}"; manaText.text = $"{obj.iMP}/{obj.iMaxMP}"; - expText.text = $"{obj.iExp}"; + expText.text = $"{((float)obj.iExp/neededExp)*100}%"; + levelText.text = $"{obj.sLevel}"; } } } \ No newline at end of file diff --git a/Assets/Scenes/a61.unity b/Assets/Scenes/a61.unity index bde7d60f58..068aa45f69 100644 --- a/Assets/Scenes/a61.unity +++ b/Assets/Scenes/a61.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fae5696c45c05b5436fc10874f3d8270331d564a36c0780be638c9aeb1f69a4b -size 532496171 +oid sha256:1e7b86c2516571fa81812b77127ba2caeef08f280d26b69313c1e21a52fa43b0 +size 532497061 diff --git a/Assets/Scripts/CECHostPlayer.cs b/Assets/Scripts/CECHostPlayer.cs index 2e3bf82134..53044f66c9 100644 --- a/Assets/Scripts/CECHostPlayer.cs +++ b/Assets/Scripts/CECHostPlayer.cs @@ -408,6 +408,7 @@ public class CECHostPlayer : CECPlayer m_ExtProps.max_ap = pCmd.iMaxAP; EventBus.Publish(pCmd); + EventBus.Publish(new EXPToUpLevel(GetLevelUpExp(pCmd.sLevel))); // if (pCmd.State != 0 && m_bFight == false) PlayEnterBattleGfx(); m_bFight = pCmd.State != 0 ? true : false; @@ -1787,6 +1788,14 @@ public struct FACTION_FORTRESS_ENTER } } +public struct EXPToUpLevel +{ + public int NeededExp; + public EXPToUpLevel(int neededExp) + { + NeededExp = neededExp; + } +} public struct NPCINFO { public string Name; // Movement properties