[Release] OpenNos Fast SP Upgrade

05/12/2019 17:11 Radiv#1
close
05/12/2019 17:14 fantasy942#2
Quote:
Originally Posted by Radiv View Post
Put this where you want. I recommend put this in the nrunhandler.cs to npc use.
HTML Code:
                        ItemInstance specialistInstance = Session.Character.Inventory.LoadBySlotAndType((byte)EquipmentType.Sp, InventoryType.Wear);
                        if (specialistInstance != null)
                        {
                            if (specialistInstance.Upgrade >= 15)
                            {
                                return;
                            }
                            byte[] upfail = { 20, 25, 30, 40, 50, 60, 65, 70, 75, 80, 90, 93, 95, 97, 99 };
                            byte[] destroy = { 0, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70 };

                            int[] goldprice = { 200000, 200000, 200000, 200000, 200000, 500000, 500000, 500000, 500000, 500000, 1000000, 1000000, 1000000, 1000000, 1000000 };
                            byte[] feather = { 3, 5, 8, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70 };
                            byte[] fullmoon = { 1, 3, 5, 7, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30 };
                            byte[] soul = { 2, 4, 6, 8, 10, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5 };
                            const short featherVnum = 2282;
                            const short fullmoonVnum = 1030;
                            const short greenSoulVnum = 2283;
                            const short redSoulVnum = 2284;
                            const short blueSoulVnum = 2285;
                            const short dragonSkinVnum = 2511;
                            const short dragonBloodVnum = 2512;
                            const short dragonHeartVnum = 2513;
                            const short blueScrollVnum = 1363;
                            const short redScrollVnum = 1364;

                            int fallimento = 0;
                            short itemToRemove = 2283;

                            if (!Session.HasCurrentMapInstance)
                            {
                                return;
                            }
                            if (specialistInstance.SpLevel < 99)
                            {
                                Session.SendPacket(Session.Character.GenerateSay(string.Format(Language.Instance.GetMessageFromKey("LVL_REQUIRED"), 99), 11));
                                return;
                            }
                            while (specialistInstance.Upgrade < 15)
                            {
                                if (Session.Character.Gold < goldprice[specialistInstance.Upgrade])
                                {
                                    Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey("NOT_ENOUGH_MONEY"), 10));
                                    break;
                                }
                                if (Session.Character.Inventory.CountItem(featherVnum) < feather[specialistInstance.Upgrade])
                                {
                                    Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(featherVnum).Name, feather[specialistInstance.Upgrade])), 10));
                                    break;
                                }
                                if (Session.Character.Inventory.CountItem(fullmoonVnum) < fullmoon[specialistInstance.Upgrade])
                                {
                                    Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(featherVnum).Name, fullmoon[specialistInstance.Upgrade])), 10));
                                    break;
                                }
                                if (specialistInstance.Item.Morph <= 16)
                                {
                                    if (specialistInstance.Upgrade < 5)
                                    {
                                        if (Session.Character.Inventory.CountItem(greenSoulVnum) < soul[specialistInstance.Upgrade])
                                        {
                                            Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(greenSoulVnum).Name, soul[specialistInstance.Upgrade])), 10));
                                            break;
                                        }
                                        if (Session.Character.Inventory.CountItem(blueScrollVnum) == 0)
                                        {
                                            Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(blueScrollVnum).Name, 1)), 10));
                                            break;
                                        }
                                        itemToRemove = greenSoulVnum;
                                        Session.Character.Inventory.RemoveItemAmount(blueScrollVnum);
                                    }
                                    else if (specialistInstance.Upgrade < 10)
                                    {
                                        if (Session.Character.Inventory.CountItem(redSoulVnum) < soul[specialistInstance.Upgrade])
                                        {
                                            Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(redSoulVnum).Name, soul[specialistInstance.Upgrade])), 10));
                                            break;
                                        }
                                        if (Session.Character.Inventory.CountItem(blueScrollVnum) == 0)
                                        {
                                            Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(blueScrollVnum).Name, 1)), 10));
                                            break;
                                        }
                                        itemToRemove = redSoulVnum;
                                        Session.Character.Inventory.RemoveItemAmount(blueScrollVnum);

                                    }
                                    else
                                    {
                                        if (Session.Character.Inventory.CountItem(blueSoulVnum) < soul[specialistInstance.Upgrade])
                                        {
                                            Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(blueSoulVnum).Name, soul[specialistInstance.Upgrade])), 10));
                                            break;
                                        }
                                        if (Session.Character.Inventory.CountItem(redScrollVnum) == 0)
                                        {
                                            Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(redScrollVnum).Name, 1)), 10));
                                            break;
                                        }
                                        itemToRemove = blueSoulVnum;
                                        Session.Character.Inventory.RemoveItemAmount(redScrollVnum);
                                    }
                                }
                                else
                                {
                                    if (specialistInstance.Upgrade < 5)
                                    {
                                        if (Session.Character.Inventory.CountItem(dragonSkinVnum) < soul[specialistInstance.Upgrade])
                                        {
                                            Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(dragonSkinVnum).Name, soul[specialistInstance.Upgrade])), 10));
                                            break;
                                        }
                                        if (Session.Character.Inventory.CountItem(blueScrollVnum) == 0)
                                        {
                                            Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(blueScrollVnum).Name, 1)), 10));
                                            break;
                                        }
                                        Session.Character.Inventory.RemoveItemAmount(blueScrollVnum);
                                        itemToRemove = dragonSkinVnum;
                                    }
                                    else if (specialistInstance.Upgrade < 10)
                                    {
                                        if (Session.Character.Inventory.CountItem(dragonBloodVnum) < soul[specialistInstance.Upgrade])
                                        {
                                            Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(dragonBloodVnum).Name, soul[specialistInstance.Upgrade])), 10));
                                            break;
                                        }
                                        if (Session.Character.Inventory.CountItem(blueScrollVnum) == 0)
                                        {
                                            Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(blueScrollVnum).Name, 1)), 10));
                                            break;
                                        }
                                        Session.Character.Inventory.RemoveItemAmount(blueScrollVnum);
                                        itemToRemove = dragonBloodVnum;

                                    }
                                    else
                                    {
                                        if (Session.Character.Inventory.CountItem(dragonHeartVnum) < soul[specialistInstance.Upgrade])
                                        {
                                            Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(dragonHeartVnum).Name, soul[specialistInstance.Upgrade])), 10));
                                            break;
                                        }
                                        if (Session.Character.Inventory.CountItem(redScrollVnum) == 0)
                                        {
                                            Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey(string.Format(Language.Instance.GetMessageFromKey("NOT_ENOUGH_ITEMS"), ServerManager.GetItem(redScrollVnum).Name, 1)), 10));
                                            break;
                                        }
                                        Session.Character.Inventory.RemoveItemAmount(redScrollVnum);
                                        itemToRemove = dragonHeartVnum;
                                    }
                                }

                                Session.Character.Gold -= goldprice[specialistInstance.Upgrade];
                                Session.Character.Inventory.RemoveItemAmount(featherVnum, feather[specialistInstance.Upgrade]);
                                int rnd = ServerManager.RandomNumber();
                                if (rnd < upfail[specialistInstance.Upgrade])
                                {
                                    Session.Character.Inventory.RemoveItemAmount(itemToRemove, soul[specialistInstance.Upgrade]);
                                    Session.Character.Inventory.RemoveItemAmount(fullmoonVnum, fullmoon[specialistInstance.Upgrade]);
                                    fallimento++;
                                }
                                else
                                {
                                    Session.Character.Inventory.RemoveItemAmount(itemToRemove, soul[specialistInstance.Upgrade]);
                                    Session.Character.Inventory.RemoveItemAmount(fullmoonVnum, fullmoon[specialistInstance.Upgrade]);
                                    specialistInstance.Upgrade++;
                                    if (specialistInstance.Upgrade == 5 || specialistInstance.Upgrade >= 10)
                                    {
                                        Session.Character.InsertSpUpgradeLog(specialistInstance.Upgrade, specialistInstance.ItemVNum);
                                    }
                                    if (specialistInstance.Upgrade > 8)
                                    {
                                        Session.Character.Family?.InsertFamilyLog(FamilyLogType.ItemUpgraded, Session.Character.Name, itemVNum: specialistInstance.ItemVNum, upgrade: specialistInstance.Upgrade);
                                    }
                                    Session.SendPacket(specialistInstance.GenerateInventoryAdd());
                                }
                                Session.SendPacket(Session.Character.GenerateGold());
                                Session.SendPacket(Session.Character.GenerateEq());
                            }
                            Session.CurrentMapInstance.Broadcast(StaticPacketHelper.GenerateEff(UserType.Player, Session.Character.CharacterId, 3005), Session.Character.MapX, Session.Character.MapY);
                            Session.SendPacket(Session.Character.GenerateSay("-------------Upgrade Status-------------", 11));
                            Session.SendPacket(Session.Character.GenerateSay("Upgrade Sp: " + specialistInstance.Upgrade, 11));
                            Session.SendPacket(Session.Character.GenerateSay("Fallimenti: " + fallimento, 11));
                            Session.SendPacket(Session.Character.GenerateSay("---------------------------------------", 11));
                        }
Is a your own release?
05/12/2019 17:17 Radiv#3
Quote:
Originally Posted by fantasy942 View Post
Is a your own release?
Why you asking?
05/12/2019 17:48 fantasy942#4
Quote:
Originally Posted by Radiv View Post
Why you asking?
Cause, i already know that isn't a your own release but only another Copy/Past release ^^

First to post something, remember to add the mention to the real creators.
05/12/2019 20:20 Radiv#5
Quote:
Originally Posted by fantasy942 View Post
Cause, i already know that isn't a your own release but only another Copy/Past release ^^

First to post something, remember to add the mention to the real creators.
idk what are u trying say to me, but it's create by ciapa with smart addons from me and idk
05/12/2019 21:54 fantasy942#6
Quote:
Originally Posted by Radiv View Post
idk what are u trying say to me, but it's create by ciapa with smart addons from me and idk
I already see this code.

And, i already know who is the real creator.

This is from the Batti Source so, if you want to release something add some mention for him at the last.

Stop post stuff w/o add mentions .-.

We all on this forum know you are not able to do that LOL
05/13/2019 11:50 FI0w#7
Quote:
Originally Posted by fantasy942 View Post
Cause, i already know that isn't a your own release but only another Copy/Past release ^^

First to post something, remember to add the mention to the real creators.
I dont think people really care if a code like this gets published, because the only things that got changed is that a While got added with some Texts at End and the Effect is outside of the While.

I mean when the "Owner" of this code has something against it he could tell it him self in this Thread lol.
Quote:
Originally Posted by lorenx911 View Post
ctrlc ctrlv
I really dont know if you should open your Mouth in this Thread about c&p

PS: Nice leech.
05/13/2019 12:44 fantasy942#8
Quote:
Originally Posted by FI0w View Post
I dont think people really care if a code like this gets published, because the only things that got changed is that a While got added with some Texts at End and the Effect is outside of the While.

I mean when the "Owner" of this code has something against it he could tell it him self in this Thread lol.


I really dont know if you should open your Mouth in this Thread about c&p

PS: Nice leech.
Idc about the code him self but, instead to post like you do that add some mention to the real One... Forse me is just respect nothing more ^^
05/13/2019 12:48 redbull2905#9
Especially since its code does nothing more than the basic upgrade system
05/13/2019 13:49 Saber none#10
I mean sure he should have mentioned the real "owner" of this code, but as some of you allready said, the code itself isn't that complex, so i don't think it will bother him that much.
05/13/2019 18:30 Radiv#11
If someone there can more than 80 iq can see differences...