Page 1 of 1

CP Recover not work!

Posted: Thu Oct 22, 2009 10:19 am
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:

Re: CP Recover not work!

Posted: Thu Oct 22, 2009 10:23 am
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 ^^

Re: CP Recover not work!

Posted: Thu Oct 22, 2009 10:55 am
by janiii
Formulas.calcCpRegen() should work fine. for testing try to set it to higher number.

Re: CP Recover not work!

Posted: Thu Oct 22, 2009 11:16 am
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...

Re: CP Recover not work!

Posted: Thu Oct 22, 2009 11:20 am
by Probe

Re: CP Recover not work!

Posted: Thu Oct 22, 2009 1:09 pm
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);

Re: CP Recover not work!

Posted: Thu Oct 22, 2009 1:14 pm
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));

Re: CP Recover not work!

Posted: Thu Oct 22, 2009 2:26 pm
by acoby7
yeah exactly that comment should be removed :D

Re: CP Recover not work!

Posted: Thu Oct 22, 2009 2:31 pm
by _DS_
Should CP be set only in L2PcInstance ? All other instances does not have CP at all.

Re: CP Recover not work!

Posted: Thu Oct 22, 2009 3:43 pm
by LaraCroft
Thx a lot to all...
:D