[Tutorial] Item for +20 Buff

06/10/2022 20:38 InnoTx#1
Hi, since i've helped some people with the +20 Item ...
i just want to make clear i didn't fix the buff or something im just telling how the item works... just copy the effect of the buff from Onyx and do it by your self idk...

First of all go to XV50 his Tutorial and do it first : [Only registered and activated users can see links. Click Here To Register...]


and now do this for the Item:

go to SpecialItem.cs and add this code:

Code:
case 20000:
                    if (byte.TryParse(packetsplit[9], out byte islot))
                    {
                        ItemInstance wearInstance = session.Character.Inventory.LoadBySlotAndType(islot, InventoryType.Equipment);
                        if(wearInstance != null && (wearInstance.Item.ItemType == ItemType.Specialist) && wearInstance.Plus20Buff == 0)
                        {
                            switch (EffectValue)
                            {
                                case 1: // Fire Dragon Gem
                                    wearInstance.Plus20Buff = 1;
                                    session.SendPacket(session.Character.GenerateSay($"Your SP has now a new Buff!", 12));
                                    session.Character.Inventory.RemoveItemFromInventory(inv.Id);
                                    break;

                                case 2: // Ice Dragon Gem
                                    wearInstance.Plus20Buff = 2;
                                    session.SendPacket(session.Character.GenerateSay("Your SP has now a new Buff!", 12));
                                    session.Character.Inventory.RemoveItemFromInventory(inv.Id);
                                    break;

                                case 3: // Moon Dragon Gem
                                    wearInstance.Plus20Buff = 3;
                                    session.SendPacket(session.Character.GenerateSay("Your SP has now a new Buff!", 12));
                                    session.Character.Inventory.RemoveItemFromInventory(inv.Id);
                                    break;

                                case 4: // Sky Dragon Gem
                                    wearInstance.Plus20Buff = 4;
                                    session.SendPacket(session.Character.GenerateSay("Your SP has now a new Buff!", 12));
                                    session.Character.Inventory.RemoveItemFromInventory(inv.Id);
                                    break;

                                default:
                                    break;

                            }

                        }
                    }
                    break;
then open NaviCat go to dbo.Item:

CTRL+F the name of the item or the Vnum idk which it was

go to Effect do it by all 4 Item on 20000
then go to EffectType do

1 = Fire Buff
2 = Ice Buff
3 = Moon Buff
4 = Sky Buff

and to remove the Item Buff when its in Card holder go to BoxItem.cs

Search for:
Code:
specialist.SlDamage = box.SlDamage;
go down and add:
Code:
specialist.Plus20Buff = 0;
thats for the next people who will add and ask for help i don't have that much time in the last days ... and dont want to spend my free time to sit behind the PC and for the buff just try copy it from Onyx or idk find other solution xD

[Only registered and activated users can see links. Click Here To Register...]

[Only registered and activated users can see links. Click Here To Register...]

[Only registered and activated users can see links. Click Here To Register...]
06/11/2022 19:25 Apourtartt#2
Am I missing something for the use of a switch statement instead of just

Code:
// + add condition for EffectValue > 0 && EffectValue < 4 if needed to replace the "default" case
wearInstance.Plus20Buff = EffectValue;
session.SendPacket(session.Character.GenerateSay($"Your SP has now a new Buff!", 12));
session.Character.Inventory.RemoveItemFromInventory(inv.Id);
?
06/11/2022 20:45 InnoTx#3
Quote:
Originally Posted by Apourtartt View Post
Am I missing something for the use of a switch statement instead of just

Code:
// + add condition for EffectValue > 0 && EffectValue < 4 if needed to replace the "default" case
wearInstance.Plus20Buff = EffectValue;
session.SendPacket(session.Character.GenerateSay($"Your SP has now a new Buff!", 12));
session.Character.Inventory.RemoveItemFromInventory(inv.Id);
?
lol how dumb am i to realize it now xDD thanks btw.