Quote:
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;}
}
}
Because its a ushort and not a int, that won't actually work because it never goes below 0. So you would have to do something like this each time your subtracting from mana.
Code:
if (Amount > Mana)
{ Mana = 0; }
else { Mana -= Amount; }
#edit, little late on making that response haha, lateralus beat me
#edit 2
That is JUST for thunder. and Elementary level for thunder.Quote:
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));
}
}