|
You last visited: Today at 06:43
Advertisement
Infinite mana problem
Discussion on Infinite mana problem within the CO2 Private Server forum part of the Conquer Online 2 category.
01/01/2012, 00:13
|
#1
|
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.
|
|
|
01/01/2012, 00:44
|
#2
|
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
|
So which source are you using?
|
|
|
01/01/2012, 01:04
|
#3
|
elite*gold: 0
Join Date: Jul 2008
Posts: 36
Received Thanks: 1
|
I am using this one
|
|
|
01/01/2012, 01:22
|
#4
|
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.
|
|
|
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.
|
|
|
01/01/2012, 22:10
|
#6
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,191
|
Quote:
Originally Posted by I don't have a username
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?!
|
|
|
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
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.
|
|
|
01/02/2012, 00:00
|
#8
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,191
|
Quote:
Originally Posted by I don't have a username
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.
|
|
|
01/02/2012, 02:04
|
#9
|
elite*gold: 0
Join Date: Jul 2008
Posts: 36
Received Thanks: 1
|
any hints to where i should put this check?
|
|
|
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;}
}
}
|
|
|
01/02/2012, 06:46
|
#11
|
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));
}
}
|
|
|
01/02/2012, 07:14
|
#12
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,191
|
Quote:
Originally Posted by pro4never
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.
|
|
|
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
^
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.
|
|
|
01/02/2012, 17:43
|
#14
|
elite*gold: 0
Join Date: May 2005
Posts: 1,892
Received Thanks: 920
|
Quote:
Originally Posted by pro4never
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.
|
|
|
01/02/2012, 22:10
|
#15
|
elite*gold: 0
Join Date: Feb 2011
Posts: 335
Received Thanks: 170
|
Quote:
Originally Posted by I don't have a username
@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.
|
|
|
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.
|
|