/* this one gives the skill only to pure archers, but doesn't have (you already know this skill*/
case 40:
{
if (client.Entity.Class == 45 && client.Entity.FirstRebornClass == 45 && client.Entity.SecondRebornClass == 45)
{
client.AddSpell(LearnableSpell(10313));
dialog.Text("Congratulations! you have learned StarArrow.");
dialog.Option("Thank you.", 255);
dialog.Send();
}
else
{
dialog.Text("You are not allowed, I think your not promoted yet or your not pure Archer.");
dialog.Option("Thank you.", 255);
dialog.Send();
}
break;
}
/*this one gives the spell to all archers even if i put that only pure archers are allowed*/
case 40:
{
if (client.Entity.Class == 45 && client.Entity.FirstRebornClass == 45 && client.Entity.SecondRebornClass == 45)
{
if (!client.AddSpell(LearnableSpell(10313)))
{
dialog.Text("You already know this skill.");
dialog.Option("Thank you master.", 255);
dialog.Send();
break;
}
dialog.Text("Congratulations! you have learned StarArrow.");
dialog.Option("Thank you.", 255);
dialog.Send();
}
else
{
dialog.Text("You are not allowed, I think your not promoted yet or your not pure Archer.");
dialog.Option("Thank you.", 255);
dialog.Send();
}
break;
}
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
}
}
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
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
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]
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...