Register for your free account! | Forgot your password?

You last visited: Today at 06:43

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Infinite mana problem

Discussion on Infinite mana problem within the CO2 Private Server forum part of the Conquer Online 2 category.

Closed Thread
 
Old   #1
 
macht102's Avatar
 
elite*gold: 0
Join Date: Jul 2008
Posts: 36
Received Thanks: 1
Infinite mana problem

the problem is I have 30/30 MP on login like it should be. but it jumps to around 65000/30 after casting and then goes down from there.

if searched the forums. only found


and nothing in that thread has worked.
Its the same problem i think but cant figure it out.
macht102 is offline  
Old 01/01/2012, 00:44   #2

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
So which source are you using?
Kiyono is offline  
Old 01/01/2012, 01:04   #3
 
macht102's Avatar
 
elite*gold: 0
Join Date: Jul 2008
Posts: 36
Received Thanks: 1
I am using this one
macht102 is offline  
Old 01/01/2012, 01:22   #4

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
I guess that the best answer is to not use a LOTF based source.
Kiyono is offline  
Old 01/01/2012, 20:37   #5
 
elite*gold: 0
Join Date: Dec 2011
Posts: 1,537
Received Thanks: 785
Because it goes into negative and it's an ushort. unsigned integers cannot be negative, so it will jump to max value once it reaches a negative value. A simple if check can fix your problem, now it's up to you to do the rest yourself.
I don't have a username is offline  
Old 01/01/2012, 22:10   #6
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,191
Quote:
Originally Posted by I don't have a username View Post
Because it goes into negative and it's an ushort. unsigned integers cannot be negative, so it will jump to max value once it reaches a negative value. A simple if check can fix your problem, now it's up to you to do the rest yourself.
Are you serious?! That's the "Mana Problem" that everyone who uses LOTF brags about fixing?!
Spirited is offline  
Old 01/01/2012, 22:12   #7
 
elite*gold: 0
Join Date: Dec 2011
Posts: 1,537
Received Thanks: 785
Quote:
Originally Posted by Fаng View Post
Are you serious?! That's the "Mana Problem" that everyone who uses LOTF brags about fixing?!
No. The original LOTF didn't even have mana.
I don't have a username is offline  
Old 01/02/2012, 00:00   #8
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,191
Quote:
Originally Posted by I don't have a username View Post
No. The original LOTF didn't even have mana.
*exhales* Mk... that sounds a bit more understandable of a problem.
I can see how the problem could be overwhelming for some people that don't know how to break it down into manageable steps.
Spirited is offline  
Old 01/02/2012, 02:04   #9
 
macht102's Avatar
 
elite*gold: 0
Join Date: Jul 2008
Posts: 36
Received Thanks: 1
any hints to where i should put this check?
macht102 is offline  
Old 01/02/2012, 02:29   #10
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
Personally I'd write an accessor for mana which makes sure it never goes negative...

example..

public ushort Mana
{
get {return _mana;}
set{if(value < 0) value = 0; _mana = value;}
}
}
pro4never is offline  
Thanks
1 User
Old 01/02/2012, 06:46   #11
 
macht102's Avatar
 
elite*gold: 0
Join Date: Jul 2008
Posts: 36
Received Thanks: 1
ok now the problem is mana doesnt decrease after casting a spell

even if i do this for example under public void UseSkill

if (SkillId == 1000)
{
if (SkillLvl == 0)
{
if (CurMP >= 1)
{
CurMP -= 1;
MyClient.SendPacket(General.MyPackets.Vital(UID, 2, CurMP));
}
else
{
MyClient.SendPacket(General.MyPackets.SendMsg(MyCl ient.MessageId, "SYSTEM", Name, "You do not have enough mana to cast this spell!", 2005));
}
}
macht102 is offline  
Old 01/02/2012, 07:14   #12
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,191
Quote:
Originally Posted by pro4never View Post
Personally I'd write an accessor for mana which makes sure it never goes negative...

example..

public ushort Mana
{
get {return _mana;}
set{if(value < 0) value = 0; _mana = value;}
}
}
^
Is a better answer. That way you only have to write the check once and forget about it.
Spirited is offline  
Old 01/02/2012, 07:43   #13
 
elite*gold: 0
Join Date: Dec 2011
Posts: 1,537
Received Thanks: 785
Quote:
Originally Posted by Fаng View Post
^
Is a better answer. That way you only have to write the check once and forget about it.
You would be amazed how **** the 5017 lotf source is.

@OP If you really want to use 5017, then use Hybrids base or if you seek one with a bit features, then find Arco's version of it.
I don't have a username is offline  
Old 01/02/2012, 17:43   #14
 
Lateralus's Avatar
 
elite*gold: 0
Join Date: May 2005
Posts: 1,892
Received Thanks: 920
Quote:
Originally Posted by pro4never View Post
Personally I'd write an accessor for mana which makes sure it never goes negative...

example..

public ushort Mana
{
get {return _mana;}
set{if(value < 0) value = 0; _mana = value;}
}
}
If he's going to do that, he's going to have to cast the (implicitly casted) int to a ushort before setting the value, which means that the value will never be < 0 and he'd have the same problem he has now. I'd also suggest using Math.Max... It looks cleaner, is probably inlined, and does the exact same thing.
Lateralus is offline  
Old 01/02/2012, 22:10   #15
 
Arco.'s Avatar
 
elite*gold: 0
Join Date: Feb 2011
Posts: 335
Received Thanks: 170
Quote:
Originally Posted by I don't have a username View Post
@OP If you really want to use 5017, then use Hybrids base or if you seek one with a bit features, then find Arco's version of it.
Remember its not mine. I don't have the talent to make something like that.
Arco. is offline  
Thanks
1 User
Closed Thread


Similar Threads Similar Threads
Infinite Mana & HP
05/26/2009 - Dekaron - 6 Replies
Is possible is you scam mana and hp numbers freeze them and them just have unlimited of both, like you never die or run out of mana?



All times are GMT +1. The time now is 06:44.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.