Define some things in Character.cs

10/13/2010 01:31 copz1337#1
So I am trying to add a use for an item. It's for donators so it when you click on it it opens up like an npc box thingy and asks u if u want level 255 or 500 stat points. It uses 'System.GC', 'MyChar', 'AddSend', and 'N' (in N.Avatar) which says its not defined (in Character.cs) how do I define it here?

#Solved
10/13/2010 01:58 Arcо#2
Cause you're not supposed to be using System.GC
GC is a variable name for Main.GameClient, which is a different type entirely from System.GC so use GC as Main.GameClient. Don't ask me to describe more, cause thats as simple as it gets. And if you can't get it from that, then you should go take some C# Tuts off the web.
10/13/2010 02:00 copz1337#3
sigh here we go with the "go learn C#" again. and btw I am using GC but the error says System.GC - look at the code facepalm
10/13/2010 02:18 Arcо#4
Quote:
Originally Posted by copz1337 View Post
sigh here we go with the "go learn C#" again. and btw I am using GC but the error says System.GC - look at the code facepalm
Exactly, facepalm. You're not doing what I said. You're using garbage collection, not GameClient.
10/13/2010 02:20 copz1337#5
Quote:
Originally Posted by Аrco View Post
Exactly, facepalm. You're not doing what I said. You're using garbage collection, not GameClient.
Yes I am. I modified the codes a bit (friend 'helped') now I'm getting the error
Quote:
Error Control cannot fall through from one case label ('case 723020:') to another.
It's treating it like an npc lol?
10/13/2010 02:22 Arcо#6
break the case.
10/13/2010 02:24 copz1337#7
Quote:
Originally Posted by Аrco View Post
break the case.
Done.. but now when I use the item it just says the first lines asking what they want to claim but when I click any it doesnt do anything
10/13/2010 02:26 Arcо#8
Because you're making an npc out of the item. Not what you should be doing, you should be calling the npc out of NPCDialog.cs ,on USE of the item.
10/13/2010 02:29 copz1337#9
Quote:
Originally Posted by Аrco View Post
Because you're making an npc out of the item. Not what you should be doing, you should be calling the npc out of NPCDialog.cs ,on USE of the item.
great. hows that
10/13/2010 02:32 Arcо#10
public static void Handle(Main.GameClient GC, byte[] Data, uint NPC, byte Control)
10/13/2010 02:48 -diRt#11
Try this, don't know if it will work though.

Go to NPCDialog.cs and add this:
Code:
#region Star
                            case 8474834:
                                {
                                    if (Control == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("Choose the reward you want for donating. Make sure you don't already have the one you choose!"));
                                        GC.AddSend(Packets.NPCLink("Claim Level 255.", 1));
                                        GC.AddSend(Packets.NPCLink("Claim 500 stats points.", 2));
                                        GC.AddSend(Packets.NPCLink("Let me think about it.", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    if (Control == 1)
                                    {
                                        GC.MyChar.Level = 255;
                                        Game.World.SendMsgToAll("SYSTEM", "Congratulations, donater " + GC.MyChar.Name + " just became level 255! [You can donate at our site LostConquer.com]", 2011, 0);
                                    }
                                    if (Control == 2)
                                    {
                                        GC.MyChar.Str = 500;
                                        GC.MyChar.Agi = 500;
                                        GC.MyChar.Spi = 500;
                                        GC.MyChar.Vit = 500;
                                        GC.MyChar.CurHP = GC.MyChar.MaxHP;
                                        GC.MyChar.CurMP = GC.MyChar.MaxMP;
                                        Game.World.SendMsgToAll("SYSTEM", "Congratulations, donater " + GC.MyChar.Name + " just claimed 500 Stat Points! [You can donate at our site LostConquer.com]", 2011, 0);
                                    }
                                    break;
                                }
                            #endregion
Then in Character.cs, for the item add this:
Code:
#region Star (For Donators)
                    case 723038:
                        {
                            MyClient.DialogNPC = 8474834;
                            PacketHandling.NPCDialog.Handle(MyClient, null, 8474834, 0);
                            MyClient.EndSend();
                            break;
                        }
                    #endregion
10/13/2010 02:53 Arcо#12
And the spoonfeeding begins.
10/13/2010 02:57 copz1337#13
Quote:
Originally Posted by Аrco View Post
And the spoonfeeding begins.
And the bsing ends.
10/13/2010 03:59 biohazardous#14
Just wondering but the remove item code for the agi,vit, etc. does it remove the chracters old stuff or does it just add because he could take too much?
10/13/2010 04:08 -diRt#15
Quote:
Originally Posted by biohazardous View Post
Just wondering but the remove item code for the agi,vit, etc. does it remove the chracters old stuff or does it just add because he could take too much?
+= adds

-= lessens.

= makes it even