Register for your free account! | Forgot your password?

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

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

Advertisement



Troubles with pure skills

Discussion on Troubles with pure skills within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2013
Posts: 62
Received Thanks: 8
Troubles with pure skills

Hello, i've been trying to add pure skills to my Archer Master npc,
CODE 1

CODE 2:

the difference between the 2 codes is
PHP Code:
if (!client.AddSpell(LearnableSpell(10313))) 
can you please help me? i'm confused
derpingson is offline  
Old 01/24/2013, 16:09   #2
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
Not sure how the addspell method works in your source but there's a bit of poor logic involved here. Lets map it out.


You have 3 possible conditions


#1: You already know the skill.
#2: You qualify for the skill.
#3: You do not qualify for the skill.


Condition one is the simplest to check for. We just need to know if we already know the skill.

Condition two is a touch more difficult because we have to run a number of comparisons (current class, previous class, etc). Still pretty simple.



So... we end up with logic that flows something like...


Code:
if(user.KnowsSkill(skillID))
{	
	//Tell user they already know skill
}
else
{
	if(is pure archer)
	{
		//Learn the skill
	}
	else
	{
		//Tell them they don't qualify
	}
}
pro4never is offline  
Thanks
1 User
Old 01/24/2013, 17:34   #3
 
-Sensei-'s Avatar
 
elite*gold: 0
Join Date: Oct 2011
Posts: 267
Received Thanks: 59
Chang the checker to..

If(client.entity.reborn >= 2)
{
dial;og here.
}



Dont use this,, this only checks for reborn ^^.. I missunderstood something :>..
-Sensei- is offline  
Thanks
1 User
Old 01/24/2013, 17:45   #4
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 329
Quote:
Originally Posted by -Sensei- View Post
Chang the checker to..

If(client.entity.reborn >= 2)
{
dial;og here.
}
Code:
If(client.entity.reborn >= 2)
{
dialog here.
}
that check if the account is second reborn

Code:
if (client.Entity.Class == 45 && client.Entity.FirstRebornClass == 45 && client.Entity.SecondRebornClass == 45) 
                                    { 
dialog;
                                    }
but this check if the account is archer and was pure archer


back on topic
what confuse you is
Code:
                                        if (!client.AddSpell(LearnableSpell(10313))) 
                                        { 
                                            dialog.Text("You already know this skill."); 
                                            dialog.Option("Thank you master.", 255); 
                                            dialog.Send(); 
                                            break; 
                                        }
native trinity base doesn't have learnablespell method but AddSpell is a bool which add the spell if it failed return false
so your code will work pretty much the same if you removed learnablespell method
Code:
                                        if (!client.AddSpell(10313)) 
                                        { 
                                            dialog.Text("You already know this skill."); 
                                            dialog.Option("Thank you master.", 255); 
                                            dialog.Send(); 
                                            break; 
                                        }
but anyway you don't even need this check or this dialog , just treat him as he don't have the spell all the time , but if it false : the user won't get any notification
go for it is offline  
Thanks
1 User
Old 01/25/2013, 12:44   #5
 
elite*gold: 0
Join Date: Jan 2013
Posts: 62
Received Thanks: 8
the "you already know this skill isn't important" so i made this

PHP Code:
 case 30:
                                {

                                    if (
client.Entity.Reborn >= && client.Entity.SecondRebornClass >= 22 && client.Entity.SecondRebornClass <= 25 && client.Entity.Class >= 22 && client.Entity.Class <= 25 && client.Entity.FirstRebornClass >= 22 && client.Entity.FirstRebornClass <= 25)
                                        {
                                            
Interfaces.ISkill spell = new Conquer_Online_Server.Network.GamePackets.Spell(true);
                                            
spell.ID 10311;
                                            
client.AddSpell(spell);
                                            
dialog.Text("Congratulations! you have learned Perseverance.");
                                            
dialog.Option("Thank you."255);
                                            
dialog.Send();
                                        }
                                        else
                                        {
                                            
dialog.Text("You are not allowed, I think you're not promoted yet or you're not pure Warrior.");
                                            
dialog.Option("Thank you."255);
                                            
dialog.Send();
                                        }                
                                    break;
                                } 

but it still gives the skill to any 2rb warrior, WTH i'm doing wrong!!!!
derpingson is offline  
Old 01/25/2013, 13:56   #6
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 329
about
Code:
                                    if (client.Entity.Reborn >= 2 && client.Entity.SecondRebornClass >= 22 && client.Entity.SecondRebornClass <= 25 && client.Entity.Class >= 22 && client.Entity.Class <= 25 && client.Entity.FirstRebornClass >= 22 && client.Entity.FirstRebornClass <= 25)
no warrior can reborn until first , second reb class is 25 , so you got useless check over there
replace it with
Code:
if (client.Entity.Class > 21 && client.Entity.Class < 26 && client.Entity.FirstRebornClass == 25 && client.Entity.SecondRebornClass == 25)
add break point on this check and run , open the database , figure out what's wrong , but this should work fine
go for it is offline  
Thanks
1 User
Old 01/25/2013, 15:37   #7
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
Why does no one use enumerated jobs? There's a reason TQ numbered them the way they did.


JobType = job / 10
JobLebel = job % 10


You can now enumerate them if you wish or create helper method (isWarrior, isArcher, etc)

There's no need for such... extensive (and expensive) logical checks)
pro4never is offline  
Thanks
2 Users
Old 01/26/2013, 10:55   #8
 
elite*gold: 0
Join Date: Jan 2013
Posts: 62
Received Thanks: 8
i was a bit curious about how other sources are handling this, so i got a 5672 one and i found something i couldn't understand
Quote:
dialogs.Text("You have learned the XP Skills.");
dialogs.Option("Thank you master.", 0xff);
dialogs.Send();
client.AddSpell(LearnableSpell(0x456));
client.AddSpell(LearnableSpell(0x3f7));
why are the IDs like this "0x3f7"? i mean all the source is based on these numbers & letters

if someone knows what are these, i'm dying to know lol
derpingson is offline  
Old 01/26/2013, 11:09   #9
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 329
this "numbers and letters" are hex
i see it pointless to use hex in such cases
you can simply convert that values to dec from windows calculator (view ~> programmer) , or you can google it or use calculator
anyway here is the formula
Hexadecimal - Wikipedia, the free encyclopedia



that piece of code you provide is not complete

Code:
dialogs.Text("You have learned the XP Skills.");
dialogs.Option("Thank you master.", 0xff);
dialogs.Send();
[B]the 3 above sending npc dialog to the client with one option of 255 which do nothing
[/B]client.AddSpell(LearnableSpell(0x456));
client.AddSpell(LearnableSpell(0x3f7));
[B]this add spell to the client , and most likely learnablespell is a method with checks for each skill but im not sure cuz i duno what source you working at[/B]
go for it is offline  
Thanks
1 User
Old 01/26/2013, 11:31   #10
 
elite*gold: 0
Join Date: Jan 2013
Posts: 62
Received Thanks: 8
thank you very much

it was useful to me,

thank you all
derpingson is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
Private server with pure skills and 3+ rbs
05/30/2012 - CO2 Private Server - 4 Replies
I wanna try out a private server in which I can be a pure warrior with twohand and shield but have cyclone, anyone know of one?
pure skills
12/18/2011 - CO2 Private Server - 6 Replies
ive been making my game(5165+) a little more like i like it. but ive noticed i dont have the pure skills as CK for ninjas, (2-h and shield)perservance for warriors azure shield for waters, Dragon whirl for trojans, heavenblade for Fires & last Star Arrow for Archers anyone maybe can help me with sharing me some details or a link to the files so i can add them to mine? thnx:D
Trade lvl.99(p2p) nice skills, for pure acc
02/01/2011 - Runescape Trading - 9 Replies
http://img7.imageshack.us/img7/9987/gjtzutu.png on this acc are, Dragon Gloves and Dragon axe.
Kr Skills Troubles..
01/30/2011 - Metin2 Private Server - 1 Replies
Hi community, By viewing a thread that was talking about adding new Kr skills (for Warrior and Assassin) I got some troubles: http://img145.imageshack.us/img145/4893/trouble.p ng I see the skill but it does not do any damage. I use 2010 SF and I already edited skill_power.txt with the skill ID of the skill added on skill_proto. Could someone tell me how to solve this problem? Thanks in advance :D
Pure Reborns Skills/Advantages?
06/19/2007 - Conquer Online 2 - 10 Replies
Just wondering if anyone knows anything about the patch thats supposedly going to add benefits to pure reborns? LIke example troj->troj->troj having a longer fb/ss, etc? Curious to know what the other pure classes would gain as far as skills are concerned.... Yes, I searched...



All times are GMT +1. The time now is 21:32.


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.