Register for your free account! | Forgot your password?

Go Back   elitepvpers > Conquer Online 2 > CO2 PServer - Discussions / Questions
You last visited: Today at 18:19

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


[Problem]CPs go into minus value(5165)

Discussion on [Problem]CPs go into minus value(5165) within the CO2 PServer - Discussions / Questions forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jun 2009
Posts: 143
Received Thanks: 155
[Problem]CPs go into minus value(5165)

(5165)
Even if my NPC checks for a certain amount of cps, you can buy what its selling even if you only have 1 CP. Say you have 1 cp and you wanna buy LVL180 Ring for 100k cps. You will be sold the ring for 1 cp but your cps will say -99,999. It's seriously ******* me off real bad cuz I went to a thread were the person had the same problem and nothing anyone suggested worked. I'm ****** MAD can anyone please help me???

EDIT: It wasnt like this earlier all i was doing was adding **** SIMPLY, WITH NO ERRORS AND NOW THIS ******* BULLSHIT...i can buy anything from any npc in the server with 0 ******* cps on my and the co value just gets -what ever tthe price was



Jay10291 is offline  
Old 06/15/2010, 02:01   #2
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,740
Received Thanks: 5,275
Define it as a uint not an int. That'll solve the going into negative problem.
Also post the npc here.


Arcо is offline  
Old 06/15/2010, 02:06   #3
 
elite*gold: 0
Join Date: Jun 2010
Posts: 95
Received Thanks: 11
Code:
if (GC.MyChar.CPs >= 1337/*ex. 1337*/)
{
//What to add
}
else
{
//Dont got enought cps, what to do
}
}
xStylo is offline  
Old 06/15/2010, 02:08   #4
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,740
Received Thanks: 5,275
Quote:
Originally Posted by xStylo View Post
Code:
if (GC.MyChar.CPs >= 1337/*ex. 1337*/)
{
//What to add
}
else
{
//Dont got enought cps, what to do
}
}
"Even if my NPC checks for a certain amount of cps, you can buy what its selling even if you only have 1 CP. "
He puts the checks and it still doesn't work.
Btw you got 1 too many brackets


Arcо is offline  
Thanks
1 User
Old 06/15/2010, 02:10   #5
 
elite*gold: 0
Join Date: Jun 2010
Posts: 95
Received Thanks: 11
oh i first wrote control and then i removed it again, then forgot remove bracket LOL
xStylo is offline  
Old 06/15/2010, 02:14   #6
 
elite*gold: 0
Join Date: Jun 2009
Posts: 143
Received Thanks: 155
The NPC is here..even though NONE of the NPCs seem to be checking for cps...even the ones that were b4...and like I said I can buy anything from any npc even if i have 0 cps...it just goes minus
Code:
case 35022:
{
    if (Control == 0)
    {
        GC.AddSend(Packets.NPCSay("You must be a Master of your profession before you try to level."));
        GC.AddSend(Packets.NPCLink("Trojan", 1));
        GC.AddSend(Packets.NPCLink("Archer", 2));
        GC.AddSend(Packets.NPCLink("Water Taoist", 3));
        GC.AddSend(Packets.NPCLink("Melee Water Taoist", 4));
        GC.AddSend(Packets.NPCLink("Warrior", 5));
        GC.AddSend(Packets.NPCLink("Ninja", 6));
        GC.AddSend(Packets.NPCLink("Fire Taoist", 7));
        GC.AddSend(Packets.NPCLink("No thanks.", 255));
        GC.AddSend(Packets.NPCSetFace(N.Avatar));
        GC.AddSend(Packets.NPCFinish());
    }
    if (Control == 1)
    {
        GC.AddSend(Packets.NPCSay("What level do you want to be? Trojans Only!"));
        GC.AddSend(Packets.NPCLink("Level 137 - 100k CPs.", 12));
        GC.AddSend(Packets.NPCLink("Just passing by.", 255));
        GC.AddSend(Packets.NPCSetFace(N.Avatar));
        GC.AddSend(Packets.NPCFinish());

    }
    if (Control == 12)
    {
        if (GC.MyChar.Level == 120)
        { }
        else
        {
            GC.AddSend(Packets.NPCSay("You must be level 120 before leveling to 137!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
        if (GC.MyChar.CPs >= 100000)
        {
        }
        if (GC.MyChar.Job == 15)
        {
            GC.MyChar.CPs -= 100000;
            GC.MyChar.Level = 137;
            GC.MyChar.StatPoints = 112;
            GC.MyChar.Str = 176;
            GC.MyChar.Vit = 250;
            GC.MyChar.Agi = 65;
            GC.MyChar.Spi = 10;
            GC.AddSend(Packets.NPCSay("Congrats!"));
            GC.AddSend(Packets.NPCLink("Woot", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
        else
        {
            GC.AddSend(Packets.NPCSay("You don't have enough CPs, Or you aren't a Trojan!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
    }
    if (Control == 2)
    {

        GC.AddSend(Packets.NPCSay("What level do you want to be? Archers Only!"));
        GC.AddSend(Packets.NPCLink("Level 137 - 100k CPs.", 17));
        GC.AddSend(Packets.NPCLink("Just passing by.", 255));
        GC.AddSend(Packets.NPCSetFace(N.Avatar));
        GC.AddSend(Packets.NPCFinish());
    }
    if (Control == 17)
    {
        if (GC.MyChar.Level == 120)
        { }
        else
        {
            GC.AddSend(Packets.NPCSay("You must be level 120 before leveling to 137!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
        if (GC.MyChar.CPs >= 100000)
        {
        }
        if (GC.MyChar.Job == 45)
        {
            GC.MyChar.CPs -= 100000;
            GC.MyChar.Level = 137;
            GC.MyChar.StatPoints = 112;
            GC.MyChar.Str = 74;
            GC.MyChar.Vit = 177;
            GC.MyChar.Agi = 240;
            GC.MyChar.Spi = 10;
            GC.AddSend(Packets.NPCSay("Congrats!"));
            GC.AddSend(Packets.NPCLink("Woot", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
        else
        {
            GC.AddSend(Packets.NPCSay("You don't have enough CPs, Or you aren't an Archer!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
    }
    if (Control == 3)
    {

        GC.AddSend(Packets.NPCSay("What level do you want to be? Water Taoists Only!"));
        GC.AddSend(Packets.NPCLink("Level 137 - 100k CPs.", 22));
        GC.AddSend(Packets.NPCLink("Just passing by.", 255));
        GC.AddSend(Packets.NPCSetFace(N.Avatar));
        GC.AddSend(Packets.NPCFinish());
    }
    if (Control == 22)
    {
        if (GC.MyChar.Level == 120)
        { }
        else
        {
            GC.AddSend(Packets.NPCSay("You must be level 120 before leveling to 137!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
        if (GC.MyChar.CPs >= 100000)
        {
        }
        if (GC.MyChar.Job == 135)
        {
            GC.MyChar.CPs -= 100000;
            GC.MyChar.Level = 137;
            GC.MyChar.StatPoints = 112;
            GC.MyChar.Str = 0;
            GC.MyChar.Vit = 251;
            GC.MyChar.Agi = 20;
            GC.MyChar.Spi = 230;
            GC.AddSend(Packets.NPCSay("Congrats!"));
            GC.AddSend(Packets.NPCLink("Woot", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
        else
        {
            GC.AddSend(Packets.NPCSay("You don't have enough CPs, Or you aren't a Water Taoist!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
    }
    if (Control == 4)
    {

        GC.AddSend(Packets.NPCSay("What level do you want to be? Water Taoists Only!"));
        GC.AddSend(Packets.NPCLink("Level 137 - 100k CPs.", 27));
        GC.AddSend(Packets.NPCLink("Just passing by.", 255));
        GC.AddSend(Packets.NPCSetFace(N.Avatar));
        GC.AddSend(Packets.NPCFinish());
    }
    if (Control == 27)
    {
        if (GC.MyChar.Level == 120)
        { }
        else
        {
            GC.AddSend(Packets.NPCSay("You must be level 120 before leveling to 137!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
        if (GC.MyChar.CPs >= 100000)
        {
        }
        if (GC.MyChar.Job == 135)
        {
            GC.MyChar.CPs -= 100000;
            GC.MyChar.Level = 137;
            GC.MyChar.StatPoints = 112;
            GC.MyChar.Str = 176;
            GC.MyChar.Vit = 150;
            GC.MyChar.Agi = 65;
            GC.MyChar.Spi = 110;
            GC.AddSend(Packets.NPCSay("Congrats!"));
            GC.AddSend(Packets.NPCLink("Woot", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
        else
        {
            GC.AddSend(Packets.NPCSay("You don't have enough CPs, Or you aren't a Water Taoist!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
    }
    if (Control == 5)
    {

        GC.AddSend(Packets.NPCSay("What level do you want to be? Warriors Only!"));
        GC.AddSend(Packets.NPCLink("Level 137 - 100k CPs.", 32));
        GC.AddSend(Packets.NPCLink("Just passing by.", 255));
        GC.AddSend(Packets.NPCSetFace(N.Avatar));
        GC.AddSend(Packets.NPCFinish());
    }
    if (Control == 32)
    {
        if (GC.MyChar.Level == 120)
        { }
        else
        {
            GC.AddSend(Packets.NPCSay("You must be level 120 before leveling to 137!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
        if (GC.MyChar.CPs >= 100000)
        {
        }
        if (GC.MyChar.Job == 25)
        {
            GC.MyChar.CPs -= 100000;
            GC.MyChar.Level = 137;
            GC.MyChar.StatPoints = 112;
            GC.MyChar.Str = 176;
            GC.MyChar.Vit = 250;
            GC.MyChar.Agi = 65;
            GC.MyChar.Spi = 10;
            GC.AddSend(Packets.NPCSay("Congrats!"));
            GC.AddSend(Packets.NPCLink("Woot", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
        else
        {
            GC.AddSend(Packets.NPCSay("You don't have enough CPs, Or you aren't a Warrior!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
    }
    if (Control == 6)
    {

        GC.AddSend(Packets.NPCSay("What level do you want to be? Ninjas Only!"));
        GC.AddSend(Packets.NPCLink("Level 137 - 100k CPs.", 37));
        GC.AddSend(Packets.NPCLink("Just passing by.", 255));
        GC.AddSend(Packets.NPCSetFace(N.Avatar));
        GC.AddSend(Packets.NPCFinish());
    }
    if (Control == 37)
    {
        if (GC.MyChar.Level == 120)
        { }
        else
        {
            GC.AddSend(Packets.NPCSay("You must be level 120 before leveling to 137!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
        if (GC.MyChar.CPs >= 100000)
        {
        }
        if (GC.MyChar.Job == 55)
        {
            GC.MyChar.CPs -= 100000;
            GC.MyChar.Level = 137;
            GC.MyChar.StatPoints = 112;
            GC.MyChar.Str = 66;
            GC.MyChar.Vit = 150;
            GC.MyChar.Agi = 275;
            GC.MyChar.Spi = 10;
            GC.AddSend(Packets.NPCSay("Congrats!"));
            GC.AddSend(Packets.NPCLink("Woot", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
        else
        {
            GC.AddSend(Packets.NPCSay("You don't have enough CPs, Or you aren't a Ninja!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
    }
    if (Control == 7)
    {
        GC.AddSend(Packets.NPCSay("What level do you want to be? Fire Taoists Only!"));
        GC.AddSend(Packets.NPCLink("Level 137 - 100k CPs.", 42));
        GC.AddSend(Packets.NPCLink("Just passing by.", 255));
        GC.AddSend(Packets.NPCSetFace(N.Avatar));
        GC.AddSend(Packets.NPCFinish());
    }
    if (Control == 42)
    {
        if (GC.MyChar.Level == 120)
        { }
        else
        {
            GC.AddSend(Packets.NPCSay("You must be level 120 before leveling to 137!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
        if (GC.MyChar.CPs >= 100000)
        {
        }
        if (GC.MyChar.Job == 145)
        {
            GC.MyChar.CPs -= 100000;
            GC.MyChar.Level = 137;
            GC.MyChar.StatPoints = 112;
            GC.MyChar.Str = 0;
            GC.MyChar.Vit = 251;
            GC.MyChar.Agi = 20;
            GC.MyChar.Spi = 230;
            GC.AddSend(Packets.NPCSay("Congrats!"));
            GC.AddSend(Packets.NPCLink("Woot", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
        else
        {
            GC.AddSend(Packets.NPCSay("You don't have enough CPs, Or you aren't a Fire Taoist!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
    }
    break;
}
Jay10291 is offline  
Old 06/15/2010, 02:17   #7
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,740
Received Thanks: 5,275
instead of

if (GC.MyChar.CPs >= 100000)
{
}
if (GC.MyChar.Job == 15)
{
GC.MyChar.CPs -= 100000;
GC.MyChar.Level = 137;
GC.MyChar.StatPoints = 112;
GC.MyChar.Str = 176;
GC.MyChar.Vit = 250;
GC.MyChar.Agi = 65;
GC.MyChar.Spi = 10;
GC.AddSend(Packets.NPCSay("Congrats!"));
GC.AddSend(Packets.NPCLink("Woot", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}

It should be like that for each check.
if (GC.MyChar.Job == 15 && GC.MyChar.CPs >= 100000)
{
GC.MyChar.CPs -= 100000;
GC.MyChar.Level = 137;
GC.MyChar.StatPoints = 112;
GC.MyChar.Str = 176;
GC.MyChar.Vit = 250;
GC.MyChar.Agi = 65;
GC.MyChar.Spi = 10;
GC.AddSend(Packets.NPCSay("Congrats!"));
GC.AddSend(Packets.NPCLink("Woot", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
Arcо is offline  
Thanks
1 User
Old 06/15/2010, 02:29   #8
 
elite*gold: 0
Join Date: Jun 2009
Posts: 143
Received Thanks: 155
Thanks, that fixed the checking error but if I get rid of the line that checks for CPs I can still buy something for 1 CP and get into minus. Is that normal for 5165 sources, I've never noticed?
It's also only supposed to lvl you if you're lvl 120 or higher so how do I make it do that? I thought I was right but I was unsure. And I was obviously incorrect if it's not working

Edit-> It does work if I do it like this. But if you're not the right level I wanted it to tell you that one thing. Not everything at once like "Either you do not have 100,000 CPs, you are not a Fire Tao or you are not level 120 yet."
Code:
if (GC.MyChar.Job == 145 && GC.MyChar.CPs >= 100000 && GC.MyChar.Level >= 120)
        {
            GC.MyChar.CPs -= 100000;
            GC.MyChar.Level = 137;
            GC.MyChar.StatPoints = 112;
            GC.MyChar.Str = 0;
            GC.MyChar.Vit = 251;
            GC.MyChar.Agi = 20;
            GC.MyChar.Spi = 230;
            GC.AddSend(Packets.NPCSay("Congrats!"));
            GC.AddSend(Packets.NPCLink("Woot", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
        else
        {
            GC.AddSend(Packets.NPCSay("Either you do not have 100,000 CPs, you are not a Fire Tao or you are not level 120 yet."));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
Jay10291 is offline  
Old 06/15/2010, 02:50   #9
 
elite*gold: 0
Join Date: Jun 2010
Posts: 95
Received Thanks: 11
Your problems was:
Brackets was set:
if (xxx)
{
}
if (xxx)
{

}
it skips the first and goes to next.

Code:
case 35022:
{
    if (Control == 0)
    {
        GC.AddSend(Packets.NPCSay("You must be a Master of your profession before you try to level."));
        GC.AddSend(Packets.NPCLink("Trojan", 1));
        GC.AddSend(Packets.NPCLink("Archer", 2));
        GC.AddSend(Packets.NPCLink("Water Taoist", 3));
        GC.AddSend(Packets.NPCLink("Melee Water Taoist", 4));
        GC.AddSend(Packets.NPCLink("Warrior", 5));
        GC.AddSend(Packets.NPCLink("Ninja", 6));
        GC.AddSend(Packets.NPCLink("Fire Taoist", 7));
        GC.AddSend(Packets.NPCLink("No thanks.", 255));
        GC.AddSend(Packets.NPCSetFace(N.Avatar));
        GC.AddSend(Packets.NPCFinish());
    }
    if (Control == 1)
    {
        GC.AddSend(Packets.NPCSay("What level do you want to be? Trojans Only!"));
        GC.AddSend(Packets.NPCLink("Level 137 - 100k CPs.", 12));
        GC.AddSend(Packets.NPCLink("Just passing by.", 255));
        GC.AddSend(Packets.NPCSetFace(N.Avatar));
        GC.AddSend(Packets.NPCFinish());

    }
    if (Control == 12)
    {
        if (GC.MyChar.Level == 120)
        {
            GC.AddSend(Packets.NPCSay("Level 120"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
}
        else
        {
            GC.AddSend(Packets.NPCSay("You must be level 120 before leveling to 137!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
}
        if (GC.MyChar.CPs >= 100000)
        {
        if (GC.MyChar.Job == 15)
        {
            GC.MyChar.CPs -= 100000;
            GC.MyChar.Level = 137;
            GC.MyChar.StatPoints = 112;
            GC.MyChar.Str = 176;
            GC.MyChar.Vit = 250;
            GC.MyChar.Agi = 65;
            GC.MyChar.Spi = 10;
            GC.AddSend(Packets.NPCSay("Congrats!"));
            GC.AddSend(Packets.NPCLink("Woot", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
}
        else
        {
            GC.AddSend(Packets.NPCSay("You don't have enough CPs, Or you aren't a Trojan!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
    }
    if (Control == 2)
    {

        GC.AddSend(Packets.NPCSay("What level do you want to be? Archers Only!"));
        GC.AddSend(Packets.NPCLink("Level 137 - 100k CPs.", 17));
        GC.AddSend(Packets.NPCLink("Just passing by.", 255));
        GC.AddSend(Packets.NPCSetFace(N.Avatar));
        GC.AddSend(Packets.NPCFinish());
    }
    if (Control == 17)
    {
        if (GC.MyChar.Level == 120)
        {
            GC.AddSend(Packets.NPCSay("Level 120"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
}
        else
        {
            GC.AddSend(Packets.NPCSay("You must be level 120 before leveling to 137!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
}
        if (GC.MyChar.CPs >= 100000)
        {
        if (GC.MyChar.Job == 45)
        {
            GC.MyChar.CPs -= 100000;
            GC.MyChar.Level = 137;
            GC.MyChar.StatPoints = 112;
            GC.MyChar.Str = 74;
            GC.MyChar.Vit = 177;
            GC.MyChar.Agi = 240;
            GC.MyChar.Spi = 10;
            GC.AddSend(Packets.NPCSay("Congrats!"));
            GC.AddSend(Packets.NPCLink("Woot", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
}
        else
        {
            GC.AddSend(Packets.NPCSay("You don't have enough CPs, Or you aren't an Archer!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
    }
    if (Control == 3)
    {

        GC.AddSend(Packets.NPCSay("What level do you want to be? Water Taoists Only!"));
        GC.AddSend(Packets.NPCLink("Level 137 - 100k CPs.", 22));
        GC.AddSend(Packets.NPCLink("Just passing by.", 255));
        GC.AddSend(Packets.NPCSetFace(N.Avatar));
        GC.AddSend(Packets.NPCFinish());
    }
    if (Control == 22)
    {
        if (GC.MyChar.Level == 120)
        {
            GC.AddSend(Packets.NPCSay("Level 120!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
}
        else
        {
            GC.AddSend(Packets.NPCSay("You must be level 120 before leveling to 137!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
}
        if (GC.MyChar.CPs >= 100000)
        {
        if (GC.MyChar.Job == 135)
        {
            GC.MyChar.CPs -= 100000;
            GC.MyChar.Level = 137;
            GC.MyChar.StatPoints = 112;
            GC.MyChar.Str = 0;
            GC.MyChar.Vit = 251;
            GC.MyChar.Agi = 20;
            GC.MyChar.Spi = 230;
            GC.AddSend(Packets.NPCSay("Congrats!"));
            GC.AddSend(Packets.NPCLink("Woot", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
}
        else
        {
            GC.AddSend(Packets.NPCSay("You don't have enough CPs, Or you aren't a Water Taoist!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
    }
    if (Control == 4)
    {

        GC.AddSend(Packets.NPCSay("What level do you want to be? Water Taoists Only!"));
        GC.AddSend(Packets.NPCLink("Level 137 - 100k CPs.", 27));
        GC.AddSend(Packets.NPCLink("Just passing by.", 255));
        GC.AddSend(Packets.NPCSetFace(N.Avatar));
        GC.AddSend(Packets.NPCFinish());
    }
    if (Control == 27)
    {
        if (GC.MyChar.Level == 120)
        { 
            GC.AddSend(Packets.NPCSay("Level 120"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        else
        {
            GC.AddSend(Packets.NPCSay("You must be level 120 before leveling to 137!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
}
        if (GC.MyChar.CPs >= 100000)
        {
        if (GC.MyChar.Job == 135)
        {
            GC.MyChar.CPs -= 100000;
            GC.MyChar.Level = 137;
            GC.MyChar.StatPoints = 112;
            GC.MyChar.Str = 176;
            GC.MyChar.Vit = 150;
            GC.MyChar.Agi = 65;
            GC.MyChar.Spi = 110;
            GC.AddSend(Packets.NPCSay("Congrats!"));
            GC.AddSend(Packets.NPCLink("Woot", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
}
        else
        {
            GC.AddSend(Packets.NPCSay("You don't have enough CPs, Or you aren't a Water Taoist!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
    }
    if (Control == 5)
    {

        GC.AddSend(Packets.NPCSay("What level do you want to be? Warriors Only!"));
        GC.AddSend(Packets.NPCLink("Level 137 - 100k CPs.", 32));
        GC.AddSend(Packets.NPCLink("Just passing by.", 255));
        GC.AddSend(Packets.NPCSetFace(N.Avatar));
        GC.AddSend(Packets.NPCFinish());
    }
    if (Control == 32)
    {
        if (GC.MyChar.Level == 120)
        { 
            GC.AddSend(Packets.NPCSay("Level 120"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
}
        else
        {
            GC.AddSend(Packets.NPCSay("You must be level 120 before leveling to 137!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
}
        if (GC.MyChar.CPs >= 100000)
        {
        if (GC.MyChar.Job == 25)
        {
            GC.MyChar.CPs -= 100000;
            GC.MyChar.Level = 137;
            GC.MyChar.StatPoints = 112;
            GC.MyChar.Str = 176;
            GC.MyChar.Vit = 250;
            GC.MyChar.Agi = 65;
            GC.MyChar.Spi = 10;
            GC.AddSend(Packets.NPCSay("Congrats!"));
            GC.AddSend(Packets.NPCLink("Woot", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
}
        else
        {
            GC.AddSend(Packets.NPCSay("You don't have enough CPs, Or you aren't a Warrior!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
    }
    if (Control == 6)
    {

        GC.AddSend(Packets.NPCSay("What level do you want to be? Ninjas Only!"));
        GC.AddSend(Packets.NPCLink("Level 137 - 100k CPs.", 37));
        GC.AddSend(Packets.NPCLink("Just passing by.", 255));
        GC.AddSend(Packets.NPCSetFace(N.Avatar));
        GC.AddSend(Packets.NPCFinish());
    }
    if (Control == 37)
    {
        if (GC.MyChar.Level == 120)
        { }
        else
        {
            GC.AddSend(Packets.NPCSay("You must be level 120 before leveling to 137!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
        if (GC.MyChar.CPs >= 100000)
        {
        if (GC.MyChar.Job == 55)
        {
            GC.MyChar.CPs -= 100000;
            GC.MyChar.Level = 137;
            GC.MyChar.StatPoints = 112;
            GC.MyChar.Str = 66;
            GC.MyChar.Vit = 150;
            GC.MyChar.Agi = 275;
            GC.MyChar.Spi = 10;
            GC.AddSend(Packets.NPCSay("Congrats!"));
            GC.AddSend(Packets.NPCLink("Woot", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
}
        else
        {
            GC.AddSend(Packets.NPCSay("You don't have enough CPs, Or you aren't a Ninja!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
}
    if (Control == 7)
    {
        GC.AddSend(Packets.NPCSay("What level do you want to be? Fire Taoists Only!"));
        GC.AddSend(Packets.NPCLink("Level 137 - 100k CPs.", 42));
        GC.AddSend(Packets.NPCLink("Just passing by.", 255));
        GC.AddSend(Packets.NPCSetFace(N.Avatar));
        GC.AddSend(Packets.NPCFinish());
    }
    if (Control == 42)
    {
        if (GC.MyChar.Level == 120)
        { }
        else
        {
            GC.AddSend(Packets.NPCSay("You must be level 120 before leveling to 137!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
        if (GC.MyChar.CPs >= 100000)
        {
        if (GC.MyChar.Job == 145)
        {
            GC.MyChar.CPs -= 100000;
            GC.MyChar.Level = 137;
            GC.MyChar.StatPoints = 112;
            GC.MyChar.Str = 0;
            GC.MyChar.Vit = 251;
            GC.MyChar.Agi = 20;
            GC.MyChar.Spi = 230;
            GC.AddSend(Packets.NPCSay("Congrats!"));
            GC.AddSend(Packets.NPCLink("Woot", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
}
        else
        {
            GC.AddSend(Packets.NPCSay("You don't have enough CPs, Or you aren't a Fire Taoist!"));
            GC.AddSend(Packets.NPCLink("I see.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
    }
    break;
}
xStylo is offline  
Old 06/15/2010, 03:14   #10
 
elite*gold: 0
Join Date: Jun 2009
Posts: 143
Received Thanks: 155
is that the fixed code? :S
if so, you didn't have to fix, you could have made an example.
Jay10291 is offline  
Old 06/15/2010, 03:27   #11
 
elite*gold: 0
Join Date: Jun 2010
Posts: 95
Received Thanks: 11
it is fixed LOL
remember you cant do:
Code:
if (xxxx)
{

}
if (xxxx)
{

}
if is supposed to only take one of them.
in this case it checked on both instead check 1 after 1.

just use 2 if.
Code:
if (xxxx)
{
if (xxxx)
{

}
}
xStylo is offline  
Old 06/15/2010, 03:38   #12
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,740
Received Thanks: 5,275
Also make sure its a uint and not an int.
A uint can range from 0 to 4,294,967,295 meaning it doesn't have the capability to go into the negatives.
Meanwhile an int can range from -2,147,483,648 to 2,147,483,647 so it can go negative.
CPs should NEVER go negative so it should be defined as a uint.
Arcо is offline  
Thanks
1 User
Old 06/15/2010, 04:28   #13
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 908
The whole reason it does this is because computers store them in binary, and; **** it I'm not explaining it.
Just store Cps as a uint or ulong instead.
kinshi88 is offline  
Thanks
2 Users
Old 06/15/2010, 04:35   #14

 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,397
Received Thanks: 1,068
In the client, most of the variable are signed integer. Why you don't use the right type and just make some check at the good time?
CptSky is offline  
Old 06/15/2010, 05:36   #15
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,740
Received Thanks: 5,275
The whole problem was he was doing the checks wrong.


Arcо is offline  
Reply



« Meelee | Anyone have The ItemAdd.ini +13-+15 gears plz add »

Similar Threads
PayPal im Minus
06/28/2010 - Off Topic - 3 Replies
Wenn ich bei PayPal in Minus bin, zieht es das von meinem Geld auf meinem Bankkonto ab?
minus exp LoL?
03/14/2010 - Metin2 PServer - Discussions / Questions - 4 Replies
hi wenn ich auf meinen p server die raten sagen wir mal auf 850 stelle dann gibt es allen spielern minus exp also wenn man 50% hatt und ein monster killt hatt man nurnoch 49% exp LOL? kann mir einer helfen?
Minus HP Bug
02/18/2010 - Metin2 PServer - Discussions / Questions - 5 Replies
euch ist bestimmt irgendwann mal aufgefallen , nachdem ihr bonis auf euerem server geändert habt,dass ihr euch in spiel einlogt und seht , -25k hp/tp ?? wie ist die einstellung zu auto +hp. wie der bug beseitigt wird mit hp absorb.: erklär ich euch ... ihr dürft auf gar keinen fall die grenze des HP absorb überschreiten. denn sonst , machst du dir immer selber dmg beim mop. ^^ also bei mir auf dem server habe ich es auf 15% gelassen ... es funzt . (aupassen beim waffensura, der...
[REQUEST] Minus EXP hack
08/15/2009 - Cabal Main - Discussions / Questions - 0 Replies
is there anyone here know how to decrease exp so that u cant level while doing ft b2f dungeon? i hope someone will open it here.... tnx in advance...
STATS Minus HACK
05/08/2009 - Cabal Hacks, Bots, Cheats, Exploits & Macros - 3 Replies
Bringt eure STATS (STR,DEX,INT) so ins minus das ihr z.B Atack,Defens usw bis zu 20000 oder mehr anheben könnt. Erfolgreich getestet auf Cabal Online ChronicleGamerz Private Server der grad wegen mir offline gegangen wohl ist^^ Hier bitte ich es zum tausch an! gegen andere Hackz.. exploits.. usw.. schreibt einfach PN mit angebot.



All times are GMT +2. The time now is 18:19.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

BTC: 3KeUpz52VCbhmLwuwydqxu6U1xsgbT8YT5
ETH: 0xc6ec801B7563A4376751F33b0573308aDa611E05

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