Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 14:16

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

Advertisement



How to get an npc to check?

Discussion on How to get an npc to check? within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: May 2010
Posts: 174
Received Thanks: 13
How to get an npc to check?

How would you get a npc to check the players level and if they are second reborn?
2010mrsurfer is offline  
Old 08/01/2010, 19:09   #2
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,765
Received Thanks: 382
Code:
public static byte LEVEL = 200;//If should be over level 200
public static byte REBORNS = 2;//If should be over 2nd rb
//You could also just replace LEVEL and REBORNS with the value u want
if (GC.MyChar.Level >= LEVEL && GC.MyChar.Reborns >= REBORNS)
Fish* is offline  
Thanks
1 User
Old 08/01/2010, 19:12   #3
 
elite*gold: 0
Join Date: May 2010
Posts: 174
Received Thanks: 13
Thanks grill!
2010mrsurfer is offline  
Old 08/01/2010, 21:01   #4
 
Zkiller110's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 276
Received Thanks: 99
Quote:
Originally Posted by grillmad View Post
Code:
public static byte LEVEL = 200;//If should be over level 200
public static byte REBORNS = 2;//If should be over 2nd rb
//You could also just replace LEVEL and REBORNS with the value u want
if (GC.MyChar.Level >= LEVEL && GC.MyChar.Reborns >= REBORNS)
or could just make a simple if statment
Code:
if (GC.MyChar.Level >= 200 && GC.MyChar.Reborns >= 2)
to make it easier and less typing
Zkiller110 is offline  
Thanks
1 User
Old 08/01/2010, 21:06   #5
 
elite*gold: 0
Join Date: May 2010
Posts: 174
Received Thanks: 13
Thanks
2010mrsurfer is offline  
Old 08/01/2010, 21:12   #6
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,765
Received Thanks: 382
Quote:
Originally Posted by Zkiller110 View Post
or could just me a simple if
Code:
if (GC.MyChar.Level >= 200 && GC.MyChar.Reborns >= 2)
to make it easier and less typing
I also wrote that
If u read the comments i putted.
Fish* is offline  
Old 08/02/2010, 03:27   #7
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
I don't feel like re-writing a TON of stuff seeing as it's already been posted... If you look at my linklist there is some mini tutorials I wrote up that cover how to use some different types of things in C# including if/else if/else, try/catch and some similar stuff.


The tldr version though is that if(code to check) checks everything inside the bracket to verify if it is either true or false. If true the code under it is executed... if not then it isn't run.

You can do a string of if statements using else if.

Else simple means if no preceding statement is called then the else statement is run.

Eg:


if(GC.MyChar.Level >= 100)
{
//you are level 100 or over
}
else if (GC.MyChar.Level >=120)
{
you are over 120. This will NEVER be called because the first if statement is already confirming you are over 100!
}
else
{
//will only be called if under 100
}


If you do a string of if statements and then an else... then only 2 things can be called!


if(GC.MyChar.Level >= 100)
{
100 or over called
}

if(GC.MyChar.Level >= 120)
{
120 or over called (ALWAYS calls both if over 120.. because you are obviously over 100 if you are 120+)
}
else
{
will be called at 0-120. EVEN IF YOU ARE 110-120 THIS WILL BE CALLED BECAUSE YOU DID NOT DO ELSE IF FOR THE SECOND CHECK!
}



Also here are the things you can use for if statements


&& = and (both statements must be true)

|| = or (either statement must be true)

> = greater than

< = less than

>= greater than or equal to

<= less than or equal to
pro4never is offline  
Old 08/02/2010, 04:27   #8
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,765
Received Thanks: 382
Quote:
Originally Posted by pro4never View Post
I don't feel like re-writing a TON of stuff seeing as it's already been posted... If you look at my linklist there is some mini tutorials I wrote up that cover how to use some different types of things in C# including if/else if/else, try/catch and some similar stuff.


The tldr version though is that if(code to check) checks everything inside the bracket to verify if it is either true or false. If true the code under it is executed... if not then it isn't run.

You can do a string of if statements using else if.

Else simple means if no preceding statement is called then the else statement is run.

Eg:


if(GC.MyChar.Level >= 100)
{
//you are level 100 or over
}
else if (GC.MyChar.Level >=120)
{
you are over 120. This will NEVER be called because the first if statement is already confirming you are over 100!
}
else
{
//will only be called if under 100
}


If you do a string of if statements and then an else... then only 2 things can be called!


if(GC.MyChar.Level >= 100)
{
100 or over called
}

if(GC.MyChar.Level >= 120)
{
120 or over called (ALWAYS calls both if over 120.. because you are obviously over 100 if you are 120+)
}
else
{
will be called at 0-120. EVEN IF YOU ARE 110-120 THIS WILL BE CALLED BECAUSE YOU DID NOT DO ELSE IF FOR THE SECOND CHECK!
}



Also here are the things you can use for if statements


&& = and (both statements must be true)

|| = or (either statement must be true)

> = greater than

< = less than

>= greater than or equal to

<= less than or equal to
remember to tell || can be used to make 2 checks to see if one is right.
ex.
Code:
if (GC.MyChar.Level >= 120 && GC.MyChar.Reborns >= 1 || GC.MyChar.Reborns >= 2 && GC.MyChar.Level >= 110)//If you are over level 120 and 1st rb OR if you are 2nd rb and over level 110
Fish* is offline  
Reply


Similar Threads Similar Threads
The Big Selling !! Check Check xD
03/11/2010 - Silkroad Online Trading - 3 Replies
Level : 96 Race: Rouge Build: INT 96 STR 314 SPs: 54,000 Gold: 8Million Skills: On Screen shots Contains level 45 Wolf :P Server: venus Price : PM Your Price ( Selling for the Highest One)
[WTT]No CRC check and gg bypass for dekaron eu and no crc check for 2moons
10/18/2008 - Dekaron Trading - 1 Replies
Look at the title:rolleyes: I wanna trade it for 50mill on dekaron eu. just add me to msn for proofs [email protected]



All times are GMT +2. The time now is 14:16.


Powered by vBulletin®
Copyright ©2000 - 2024, 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 ©2024 elitepvpers All Rights Reserved.