9 [
RplProp(condition: RplCondition.OwnerOnly)]
10 protected int m_iPlayerXP = 0;
68 RplComponent rpl = RplComponent.Cast(
GetOwner().FindComponent(RplComponent));
70 return (rpl && rpl.IsProxy());
87 if (!playerController)
90 IEntity player = playerController.GetMainEntity();
103 if (newRank == curRank)
106 comp.SetCharacterRank(newRank, !notify);
111 [
RplRpc(RplChannel.Reliable, RplRcver.Server)]
126 reqXP = factionManager.GetRequiredRankXP(newRank) - m_iPlayerXP;
135 reqXP = factionManager.GetRequiredRankXP(newRank) - m_iPlayerXP;
138 SCR_XPHandlerComponent comp = SCR_XPHandlerComponent.Cast(
GetGame().
GetGameMode().FindComponent(SCR_XPHandlerComponent));
152 if (!playerController)
155 int playerID = playerController.GetPlayerId();
160 [
RplRpc(RplChannel.Reliable, RplRcver.Owner)]
164 m_OnXPChanged.Invoke(currentXP, rewardID, XPToAdd, volunteer, profileUsed, skillLevel);
178 SCR_XPHandlerComponent comp = SCR_XPHandlerComponent.Cast(
GetGame().
GetGameMode().FindComponent(SCR_XPHandlerComponent));
180 if (addDirectly != 0)
182 m_iPlayerXP += (addDirectly);
183 Replication.BumpMe();
189 int XP = comp.GetXPRewardAmount(rewardID);
194 float skillXPMultiplier = 1;
202 int XPToAdd = Math.Round(XP * multiplier * comp.GetXPMultiplier());
204 int XPToAddBySkill = 0;
205 bool profileUsed =
false;
225 if (XPToAdd + XPToAddBySkill == 0)
228 m_iPlayerXP += (XPToAdd + XPToAddBySkill);
233 Replication.BumpMe();
236 Rpc(
RpcDo_OnPlayerXPChanged, m_iPlayerXP, XPToAdd + XPToAddBySkill, volunteer, rewardID, profileUsed, skillLevel);