CP Recover not work!

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
LaraCroft
Posts: 360
Joined: Sat Aug 08, 2009 1:37 am

CP Recover not work!

Post by LaraCroft »

If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number: 3643
L2JDP Revision Number: 6747

Hi guys...

In my server i'm using the CP and HP recovery, when the players die.
The HP recovery works fine.
But the CP recovery don't work.

Anyone can help me to solve this problem?
:?:
Thxxxxx...
:wink:
!!!knowledge and intelligence must be shared!!!
User avatar
acoby7
Posts: 64
Joined: Tue Apr 03, 2007 12:39 pm

Re: CP Recover not work!

Post by acoby7 »

the code is commented iirc
right now i can't help you find it because i'm at uni but you can try to search in the core starting from the configs

when i'll come home i'll try to help you ^^
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: CP Recover not work!

Post by janiii »

Formulas.calcCpRegen() should work fine. for testing try to set it to higher number.
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
User avatar
LaraCroft
Posts: 360
Joined: Sat Aug 08, 2009 1:37 am

Re: CP Recover not work!

Post by LaraCroft »

Where i find the code "Formulas.calcCpRegen() "??
:?:

On "Character.properties" i'm using this configs:
# Percent of HP, MP, and CP which is restored on character revival.
# Default: 0, 70, 70
RespawnRestoreCP = 100
RespawnRestoreHP = 100
RespawnRestoreMP = 100

HP and MP works fine.
But... CP not restore any percent.

This config "RespawnRestoreCP" is not working on server code??
:?:

Thx...
Last edited by LaraCroft on Thu Oct 22, 2009 11:27 am, edited 1 time in total.
!!!knowledge and intelligence must be shared!!!
Probe
Posts: 915
Joined: Thu Sep 03, 2009 6:36 pm
Location: Israel
Contact:

Re: CP Recover not work!

Post by Probe »

cleodj
Posts: 9
Joined: Wed Feb 04, 2009 5:17 pm

Re: CP Recover not work!

Post by cleodj »

maybe this way:

PS: just uncomment those 2 lines and should work.

PS2: not a diff file, just an example, tested and work here for what you need.

java/net/sf/l2j/gameserver/model/actor/L2Character.java

Code: Select all

	else		_status.setCurrentHp(getMaxHp() * Config.RESPAWN_RESTORE_HP);-		//_status.setCurrentCp(getMaxCp() * Config.RESPAWN_RESTORE_CP);- 		//_Status.setCurrentMp(getMaxMp() * Config.RESPAWN_RESTORE_MP);+		_status.setCurrentCp(getMaxCp() * Config.RESPAWN_RESTORE_CP);+		_status.setCurrentMp(getMaxMp() * Config.RESPAWN_RESTORE_MP);
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: CP Recover not work!

Post by janiii »

ah, yeah, i checked wrong property :D

dont forget to add parenthesis around all the restore

Code: Select all

Index: java/net/sf/l2j/gameserver/model/actor/L2Character.java===================================================================--- java/net/sf/l2j/gameserver/model/actor/L2Character.java	(revision 3633)+++ java/net/sf/l2j/gameserver/model/actor/L2Character.java	(working copy)@@ -2156,9 +2156,11 @@ 				_status.setCurrentMp(getMaxMp()); //and also confirmed 			} 			else+			{ 				_status.setCurrentHp(getMaxHp() * Config.RESPAWN_RESTORE_HP);-			//_status.setCurrentCp(getMaxCp() * Config.RESPAWN_RESTORE_CP);-		 	//_Status.setCurrentMp(getMaxMp() * Config.RESPAWN_RESTORE_MP);+				_status.setCurrentCp(getMaxCp() * Config.RESPAWN_RESTORE_CP);+				_status.setCurrentMp(getMaxMp() * Config.RESPAWN_RESTORE_MP);+			}  			// Start broadcast status 			broadcastPacket(new Revive(this));
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
User avatar
acoby7
Posts: 64
Joined: Tue Apr 03, 2007 12:39 pm

Re: CP Recover not work!

Post by acoby7 »

yeah exactly that comment should be removed :D
_DS_
L2j Veteran
L2j Veteran
Posts: 3437
Joined: Wed Apr 30, 2008 8:53 am
Location: Russia

Re: CP Recover not work!

Post by _DS_ »

Should CP be set only in L2PcInstance ? All other instances does not have CP at all.
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
User avatar
LaraCroft
Posts: 360
Joined: Sat Aug 08, 2009 1:37 am

Re: CP Recover not work!

Post by LaraCroft »

Thx a lot to all...
:D
!!!knowledge and intelligence must be shared!!!
Post Reply