[Release] Fix for WeaponMaster (5165)

04/06/2010 13:40 12tails#1
Heya!

here is the fixed npc : P (without DC or anything else : D)

Code:
#region WeaponMaster
                            case 7050:
                                {
                                    if (Control == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("Choose the equipment you want to upgrade."));
                                        GC.AddSend(Packets.NPCLink("Headgear", 1));
                                        GC.AddSend(Packets.NPCLink("Necklace/Bag", 2));
                                        GC.AddSend(Packets.NPCLink("Armor", 3));
                                        GC.AddSend(Packets.NPCLink("Weapon", 4));
                                        GC.AddSend(Packets.NPCLink("Ring", 6));
                                        GC.AddSend(Packets.NPCLink("Boots", 8));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                        GC.Agreed = false;
                                    }
                                    else if (Control >= 1 && Control <= 8)
                                    {
                                        Item I = GC.MyChar.Equips.Get(Control);
                                        byte PrevLevel = I.DBInfo.LevReq;

                                        ItemIDManipulation IMan = new ItemIDManipulation(I.ID);
                                        IMan.IncreaseLevel();

                                        DatabaseItem Di = (DatabaseItem)Database.DatabaseItems[IMan.ToID()];

                                        if (I.DBInfo.LevReq < 110)
                                        {
                                            GC.AddSend(Packets.NPCSay("The item must be at last level 110, other else i won't upgrade it!"));
                                            GC.AddSend(Packets.NPCLink("I'll be right back!", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                            return;
                                        }

                                        byte NewLevel = Di.LevReq;
                                        if (NewLevel > PrevLevel)
                                        {
                                            if (GC.MyChar.Level >= NewLevel)
                                            {
                                                if (!GC.Agreed)
                                                {
                                                    GC.AddSend(Packets.NPCSay("You need a DragonBall. Are you ready?"));
                                                    GC.AddSend(Packets.NPCLink("Upgrade it.", Control));
                                                    GC.AddSend(Packets.NPCLink("Forget it.", 255));
                                                    GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                                    GC.AddSend(Packets.NPCFinish());
                                                    GC.Agreed = true;
                                                }
                                                else
                                                {
                                                    GC.Agreed = false;
                                                    if (GC.MyChar.InventoryContains(1088000, 1))
                                                    {
                                                        GC.MyChar.EquipStats(Control, false);
                                                        GC.MyChar.RemoveItem(GC.MyChar.NextItem(1088000));
                                                        I.ID = IMan.ToID();

                                                        GC.MyChar.Equips.Replace(Control, I, GC.MyChar);
                                                        GC.MyChar.EquipStats(Control, true);
                                                    }
                                                    else
                                                    {
                                                        GC.AddSend(Packets.NPCSay("You don't have a DragonBall."));
                                                        GC.AddSend(Packets.NPCLink("Oh hold on.", 255));
                                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                                        GC.AddSend(Packets.NPCFinish());
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                GC.AddSend(Packets.NPCSay("You aren't high level enough to wear the item after upgrading."));
                                                GC.AddSend(Packets.NPCLink("Alright.", 255));
                                                GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                                GC.AddSend(Packets.NPCFinish());
                                            }
                                        }

                                    }
                                    else
                                    {
                                        GC.AddSend(Packets.NPCSay("The item cannot be upgraded anymore."));
                                        GC.AddSend(Packets.NPCLink("Alright.", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    break;
                                }
                            #endregion
cya!
04/06/2010 14:56 Paralyzer[GM]#2
Nice release, Simple, Basic, Easy fix, I had that fix but then again simple fix but this is good for noobs!
04/06/2010 16:06 PeTe Ninja#3
I'm surprised 12tails that you are actually releasing good things... good job :) your not paralayzer
04/06/2010 16:38 12tails#4
thanks pete_ninja and paralyzer : D
04/06/2010 16:39 PeTe Ninja#5
Quote:
Originally Posted by 12tails View Post
thanks pete_ninja and paralyzer : D
noo its PeTe Ninja no _ :D
04/06/2010 16:43 Luiz01#6
lol, 12tails is gay :x jk
this is only what i think xD
04/06/2010 16:48 12tails#7
heya luiz! : P go to school hahaha (i'm not gay : D)
04/06/2010 18:53 Paralyzer[GM]#8
haha. :P this release is very good you do relise how many servers had this problem ?
04/06/2010 19:24 12tails#9
hmmm i think many : D... because is a very low number of coders that see this error... this make the attack of a character become more or less 400000k : D
04/07/2010 03:01 Arcо#10
GC.MyChar.EquipStats(Control, false);
Was the fix correct?
04/07/2010 08:30 12tails#11
yep : P
04/12/2010 00:10 walmartboi#12
I don't understand how this is any different than the one that comes with the source.
05/25/2010 22:22 Secrets-man#13
Quote:
Originally Posted by Paralyzer[GM] View Post
Nice release, Simple, Basic, Easy fix, I had that fix but then again simple fix but this is good for noobs!
"noobs" Lol, you should watch your mouth in the future. If you was a pro or at least advanced C# coder, you would be a little nicer. Example you could say: simple fix for the rookies. Instead of saying noobs, which sounds like an insult. If you ask me, I'd consider you as one of the "noobs" but in the other words, like I would say: I'll consider you as one of the rookies.
P.S Didn't wanna insult you or make fun of you and your banned account, but seen you trying to correct people whose spelling fails. Before doing anything, you should check your spelling and how much it fails. Me, myself.. my english Ain't so bad or good, but I'd say that my english is decent. Not so messy. Also, I know that the americans/britts does spelling mistakes such as.. they say your when they mean you're. but anyway, think at least twice, before you're trying to say anything to anyone. Good luck.

@12Tails Nice little fix. +k
06/15/2010 21:04 AngeaL™#14
Nice Release Easy and Simple!!!!!!!!!!!!!!!!!
08/19/2010 19:12 _DreadNought_#15
Seen some more servers with this problem(Getting annoying now) so I think it's fair to say I am #Bumping the thread for that reason.