[Release]Simple,but useful-Luckytime Giver! 5165 source!

02/19/2010 02:30 killersub#1
well I kno it's pretty simple...but like I say In all my posts...I'm a newb :)...I don't know if this has been released yet(post if it has) so I'll share it with you guys here...I intended this for the "newbies" to learn how to get a simple NPC to give a skill through the payment of 1k cps once they reach the 2nd rb state(available "ONCE" only)...

HERES THE CODE! ENJOY!

let's define our variables, etc...

in character.cs find
Quote:
public byte RebornSkill = 0;
and under it add
Quote:
public byte ClaimRBSkill = 0;
now for the NPC...

Code:
#region Bless(Luckytime)
                            case 6861:
                                {
                                    if (Control == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("Welcome stranger! I have been noticing some young adventurers reborning all the time and not getting the LuckyTime they desire,"));
                                        GC.AddSend(Packets.NPCSay(" I am here to help all those troubled conquerors with their LuckyTime problems!What do you say?"));
                                        GC.AddSend(Packets.NPCLink("I want LuckyTime.", 1));
                                        GC.AddSend(Packets.NPCLink("Maybe later.", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    if (Control == 1)
                                    {
                                        GC.AddSend(Packets.NPCSay("The LuckyTime ability helps those who have passed through such hard times by releasing their stress and allowing them to level up quicker than normal.You sure you want it?"));
                                        GC.AddSend(Packets.NPCLink("Yes, Please.", 2));
                                        GC.AddSend(Packets.NPCLink("No, I changed my mind.", 255));
                                        GC.AddSend(Packets.NPCSetFace(15));
                                        GC.AddSend(Packets.NPCFinish());
                                    }

                                    else if (GC.MyChar.Reborns < 2)
                                    {
                                        GC.AddSend(Packets.NPCSay("I'm sorry but you have not yet reached the 2nd reborn state. Please train harder."));
                                        GC.AddSend(Packets.NPCLink("Sure will.", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }

                                    if (Control == 2)
                                    {
                                        if (GC.MyChar.CPs >= 1000)
                                        if (GC.MyChar.ClaimRBSkill == 0)
                                        {
                                            GC.MyChar.CPs -= 1000;
                                            GC.MyChar.RWSkill(new Game.Skill() { ID = 9876, Lvl = 0, Exp = 0 });
                                            GC.AddSend(Packets.NPCSay("You have learned the skill LuckyTime! Congratulations!"));
                                            GC.AddSend(Packets.NPCLink("Just what I needed!", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You don't have a sufficent amount of CPs OR you have already learned this skill, Sorry!"));
                                            GC.AddSend(Packets.NPCLink("I'll try harder.", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());

                                        }

                                    }

                                    break;
                                }
                            #endregion
+thanks if this helped you anyhow and if any ideas were given...
~Enjoy!
02/19/2010 02:36 Decker_#2
Good job bro.
+k ;)
02/19/2010 02:38 ArtOfWar#3
This is a ok release goodjob
02/19/2010 02:40 killersub#4
Quote:
Originally Posted by Decker_ View Post
Good job bro.
+k ;)
thanks! i'm trying XD!

Quote:
Originally Posted by ArtOfWar View Post
This is a ok release goodjob
as I said at the top so "NO-1" confuses this thread I said "SIMPLE but useful" so yea thanks for your post XD
02/19/2010 11:12 Arcо#5
Hmm, instead of making an entire new definition, why not just do a check if the character has already learned the skill or not?
02/19/2010 22:31 killersub#6
Quote:
Originally Posted by .Arco View Post
Hmm, instead of making an entire new definition, why not just do a check if the character has already learned the skill or not?
maybe cuz I don't have the brain of a genius and I'm probably known as a "noob" :)? If I had known that wouldn't I have posted it along with the code XD, I'm a noob so "SORRY" :/...(don't take it personal just telling the truth XD)
02/20/2010 04:07 hunterman01#7
Or add it to when u get 2nd reborned
02/20/2010 04:41 killersub#8
Quote:
Originally Posted by hunterman01 View Post
Or add it to when u get 2nd reborned
that's the part I need help with since I'm a newb XD...

I know the code to add but I don't know where to add it lolz XD I think it's somewhere in character.cs but dunno exactly where ^^...
02/20/2010 05:36 hunterman01#9
Quote:
Originally Posted by killersub View Post
that's the part I need help with since I'm a newb XD...

I know the code to add but I don't know where to add it lolz XD I think it's somewhere in character.cs but dunno exactly where ^^...

Since i do not feel like downloading the entire source

Paste the code here and ill tell you were to put it at
02/20/2010 17:05 killersub#10
Quote:
Originally Posted by hunterman01 View Post
Since i do not feel like downloading the entire source

Paste the code here and ill tell you were to put it at
nvm FIXED lol...I did .Arco's fixed rb script and I found where to put it at! anyways thanx for helping! XD
07/18/2010 05:59 boredlol123#11
Quote:
Originally Posted by killersub View Post
well I kno it's pretty simple...but like I say In all my posts...I'm a newb :)...I don't know if this has been released yet(post if it has) so I'll share it with you guys here...I intended this for the "newbies" to learn how to get a simple NPC to give a skill through the payment of 1k cps once they reach the 2nd rb state(available "ONCE" only)...

HERES THE CODE! ENJOY!

let's define our variables, etc...

in character.cs find


and under it add


now for the NPC...

Code:
#region Bless(Luckytime)
                            case 6861:
                                {
                                    if (Control == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("Welcome stranger! I have been noticing some young adventurers reborning all the time and not getting the LuckyTime they desire,"));
                                        GC.AddSend(Packets.NPCSay(" I am here to help all those troubled conquerors with their LuckyTime problems!What do you say?"));
                                        GC.AddSend(Packets.NPCLink("I want LuckyTime.", 1));
                                        GC.AddSend(Packets.NPCLink("Maybe later.", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    if (Control == 1)
                                    {
                                        GC.AddSend(Packets.NPCSay("The LuckyTime ability helps those who have passed through such hard times by releasing their stress and allowing them to level up quicker than normal.You sure you want it?"));
                                        GC.AddSend(Packets.NPCLink("Yes, Please.", 2));
                                        GC.AddSend(Packets.NPCLink("No, I changed my mind.", 255));
                                        GC.AddSend(Packets.NPCSetFace(15));
                                        GC.AddSend(Packets.NPCFinish());
                                    }

                                    else if (GC.MyChar.Reborns < 2)
                                    {
                                        GC.AddSend(Packets.NPCSay("I'm sorry but you have not yet reached the 2nd reborn state. Please train harder."));
                                        GC.AddSend(Packets.NPCLink("Sure will.", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }

                                    if (Control == 2)
                                    {
                                        if (GC.MyChar.CPs >= 1000)
                                        if (GC.MyChar.ClaimRBSkill == 0)
                                        {
                                            GC.MyChar.CPs -= 1000;
                                            GC.MyChar.RWSkill(new Game.Skill() { ID = 9876, Lvl = 0, Exp = 0 });
                                            GC.AddSend(Packets.NPCSay("You have learned the skill LuckyTime! Congratulations!"));
                                            GC.AddSend(Packets.NPCLink("Just what I needed!", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You don't have a sufficent amount of CPs OR you have already learned this skill, Sorry!"));
                                            GC.AddSend(Packets.NPCLink("I'll try harder.", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());

                                        }

                                    }

                                    break;
                                }
                            #endregion
+thanks if this helped you anyhow and if any ideas were given...
~Enjoy!
bro, can i ask? where should i exactly put the code? i hav been in NPC.cs and i dunno where i put the code on it.