Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Nostale
You last visited: Today at 10:24

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release] OpenNos Fast SP Upgrade

Discussion on [Release] OpenNos Fast SP Upgrade within the Nostale forum part of the MMORPGs category.

Closed Thread
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2018
Posts: 149
Received Thanks: 58
[Release] OpenNos Fast SP Upgrade

close
Radiv is offline  
Old 05/12/2019, 17:14   #2
 
elite*gold: 0
Join Date: Dec 2009
Posts: 177
Received Thanks: 127
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?
fantasy942 is offline  
Old 05/12/2019, 17:17   #3
 
elite*gold: 0
Join Date: Apr 2018
Posts: 149
Received Thanks: 58
Quote:
Originally Posted by fantasy942 View Post
Is a your own release?
Why you asking?
Radiv is offline  
Old 05/12/2019, 17:48   #4
 
elite*gold: 0
Join Date: Dec 2009
Posts: 177
Received Thanks: 127
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.
fantasy942 is offline  
Thanks
1 User
Old 05/12/2019, 20:20   #5
 
elite*gold: 0
Join Date: Apr 2018
Posts: 149
Received Thanks: 58
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
Radiv is offline  
Old 05/12/2019, 21:54   #6
 
elite*gold: 0
Join Date: Dec 2009
Posts: 177
Received Thanks: 127
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
fantasy942 is offline  
Thanks
1 User
Old 05/13/2019, 11:50   #7

 
FI0w's Avatar
 
elite*gold: 50
Join Date: Jul 2014
Posts: 1,699
Received Thanks: 1,165
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.
FI0w is offline  
Old 05/13/2019, 12:44   #8
 
elite*gold: 0
Join Date: Dec 2009
Posts: 177
Received Thanks: 127
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 ^^
fantasy942 is offline  
Thanks
1 User
Old 05/13/2019, 12:48   #9
 
elite*gold: 0
Join Date: Jul 2017
Posts: 397
Received Thanks: 60
Especially since its code does nothing more than the basic upgrade system
redbull2905 is offline  
Old 05/13/2019, 13:49   #10
 
Saber none's Avatar
 
elite*gold: 30
Join Date: Sep 2014
Posts: 593
Received Thanks: 316
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.
Saber none is offline  
Old 05/13/2019, 18:30   #11
 
elite*gold: 0
Join Date: Apr 2018
Posts: 149
Received Thanks: 58
If someone there can more than 80 iq can see differences...
Radiv is offline  
Closed Thread

Tags
fast upgrade, opennos


Similar Threads Similar Threads
OpenNos "The project 'OpenNos.Login' failed to build."
06/19/2019 - Nostale - 11 Replies
Hello! When I put in update-database in Visual Studio I get the 'The project 'OpenNos.Login' failed to build.' error. I already did what was on the troubleshoot before I put it in. I've been at this for hours and I can't figure it out. Can someone help me please?
[OpenNos] ¿How to select the project OpenNos.DAL.EF?
05/04/2018 - Nostale - 4 Replies
Hello, I have a problem with my visual studio 2017, it turns out that to be able to give the update-database command I must have the project OpenNos.DAL.EF But the thing is that in my visual studio there is no option to select the project ... I need help!:D:D
[opennos]The project 'OpenNos.Login' failed to build.
08/03/2017 - Nostale - 9 Replies
Hello I have a problem with the package manager console to run the update- database command to opennos soon as I executes the command, he said: The project ' opennos.login ' failed to build What to do? I made the updates to Microsoft Visual Studio thank you ..
FAST!FAST!FAST! Biete 25€ PSC Suche e*Gold | gebe first | FAST!FAST!FAST!
10/02/2011 - elite*gold Trading - 1 Replies
^regelt. Sofortkauf 1200e*Gold | offline erworben. Sonst bitte vorschläge per pn oder im Thread. Es wird nicht via treasure gehandelt, von wegen log. Bei trusted leuten gebe ich first. Alles wird gefilmt, versteht sich. rgrds



All times are GMT +1. The time now is 10:25.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.