Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Nostale
You last visited: Today at 14:46

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

Advertisement



[TUTORIAL] How to add your own Item-Code!

Discussion on [TUTORIAL] How to add your own Item-Code! within the Nostale forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2017
Posts: 81
Received Thanks: 33
Talking [TUTORIAL] How to add your own Item-Code!

Hey Guys, this tutorial will show you how to add your own Item-Code!


Knowledge: 6/10

Step 1: Visit OpenNos.GameObject/Item/then choose the wished handler.
For example:
- Special Item = Speaker, Bubbles, Fairy-Booster etc.
- Magic Item = Dowsing Rod, Airwaves etc.
- No Function Item = Quest Items, some Materials

Step 2: After u choose the handler, let's start with adding a case!
For this, you write:
Code:
case <INSERT_RANDOM_NUMBER>:
break;
What is meant with INSERT_RANDOM_NUMBER? That means, you can add a number you want to have in there.
I personally start behind 9000
so: case 9000:

Step 3: After writing the code, you have to insert the case as effect to the wished item.
If you want to create your own Random Box, then search for the Item in the Database, and insert the case Number in "Effect" on the item values.
Item: Random Box of divine Fairys
Case Number: 9000
Effect Value: 9000

Step 4: Insert your code!
As i already said, we will add the Random Box of divine Fairy.

HELPER

The code i will show now, is a bit complexer. Its just to show you, how to add a randomizer for Random Boxes.
Code:
// Random Box of Divine Fairys
                case 9000:
//For this Code, you have to add also 9000 as EffectValue to the Database
                    if (EffectValue == 9000)
                    {
                        int rnd = ServerManager.RandomNumber(0, 1);
                        if (rnd < 1)
                        {
                            short[] vnums =
                            {
                            //ID's of the Items, you will get
                                4129, 4130, 4131, 4132
                            };
                            //This Code counts the Items, you inserted
                            byte[] counts = { 1, 1, 1, 1};
                            int item = ServerManager.RandomNumber(0, 4);
                            session.Character.GiftAdd(vnums[item], counts[item]);
                        }
                            //This Code, deltes the Item from the Inventory                      session.Character.Inventory.RemoveItemFromInventory(inv.Id);
                    }
                    break;
Another Example:
Code:
//Item: White Tiger Costume Set
//ID: 5487
                case 9001: //9000 already in use, so just go up
//Adds the Costume and the Hat to the inventory
                    session.Character.GiftAdd(4248, 1);
                    session.Character.GiftAdd(4256, 1);
//Deletes the Item from Inventory
                   session.Character.Inventory.RemoveItemFromInventory(inv.Id);
//You can also add a message, ON_USE
//session.SendPacket("msg 5 Success! You recieved your Items.");
                    break;
DB_HELPER
ImTheReal is offline  
Thanks
2 Users
Old 07/05/2018, 16:11   #2

 
Blowa's Avatar
 
elite*gold: 148
Join Date: Jan 2010
Posts: 656
Received Thanks: 1,769
This solution is the result of what OpenNos became : An unmaintainable project.

Having a Dictionary, with Id/Effect/EffectValue as keys and Lambdas as values (splitted over files) would be much more maintainable than a 4054305340 length switch case.
(Even if the dictionary is slower than switch statement, you would not notice the difference)
Blowa is online now  
Thanks
1 User
Old 07/05/2018, 16:30   #3
 
elite*gold: 0
Join Date: Nov 2017
Posts: 81
Received Thanks: 33
Talking

Quote:
Originally Posted by val77 View Post
This solution is the result of what OpenNos became : An unmaintainable project.

Having a Dictionary, with Id/Effect/EffectValue as keys and Lambdas as values (splitted over files) would be much more maintainable than a 4054305340 length switch case.
(Even if the dictionary is slower than switch statement, you would not notice the difference)
Im just willing to help, and ye prob. that is a better solution, but i like this way and its easy to explain for newbies. But Blowa, i please you to be more kind cuz the way u comment, is like an insult. Im just willing to help, nothing more.
ImTheReal is offline  
Old 07/06/2018, 05:47   #4
 
Worldie's Avatar
 
elite*gold: 0
Join Date: Jul 2018
Posts: 79
Received Thanks: 91
I don't understand, why not use the table RollGeneratedItem ?
Worldie is offline  
Old 07/06/2018, 10:02   #5

 
Blowa's Avatar
 
elite*gold: 148
Join Date: Jan 2010
Posts: 656
Received Thanks: 1,769
Quote:
Originally Posted by Worldie View Post
I don't understand, why not use the table RollGeneratedItem ?
He tried to explain to add a custom handling when an item is used

But his solution will actually result in an unmaintainable code
Blowa is online now  
Old 07/10/2018, 18:29   #6
 
elite*gold: 0
Join Date: Jun 2018
Posts: 27
Received Thanks: 2
RollgeneratedItem?? have we forgotten?
[NH]Pyro is offline  
Old 07/10/2018, 19:13   #7

 
elite*gold: 64
Join Date: May 2011
Posts: 1,229
Received Thanks: 854
Quote:
Originally Posted by [NH]Pyro View Post
RollgeneratedItem?? have we forgotten?
Where is the dislike button... We actually need one.
And I guess he just want some posts.
BladeTiger12 is offline  
Thanks
2 Users
Old 07/10/2018, 19:14   #8
 
Zanouu's Avatar
 
elite*gold: 50
Join Date: Feb 2018
Posts: 150
Received Thanks: 130
RollGeneratedItem is For , ONLY 1 item random But if you have Box " Not random " ( exemple :Box for Suit , Box for wedding etc U cant ** )

** If you do not Added Another Column in RollGenerated
Zanouu is offline  
Old 07/10/2018, 21:05   #9
 
elite*gold: 0
Join Date: Nov 2017
Posts: 81
Received Thanks: 33
Talking

Quote:
Originally Posted by [NH]Pyro View Post
RollgeneratedItem?? have we forgotten?
First: What kind of english is that?
Secondly: ????????????????????????????????????
I guess some people don't understand Examples.
Although, have fun adding a Ancelloan Blessing in RollGeneratedItems
ImTheReal is offline  
Old 07/10/2018, 21:27   #10
 
elite*gold: 0
Join Date: Jun 2018
Posts: 27
Received Thanks: 2
Ancelloan non a box, but divine fairy yes
[NH]Pyro is offline  
Old 07/10/2018, 23:31   #11
 
elite*gold: 0
Join Date: Mar 2010
Posts: 24
Received Thanks: 2
This tutorial is awesome
Useless
But awesome
roxas9797 is offline  
Thanks
1 User
Reply

Tags
nostale, opennos, privateserver, tutorial


Similar Threads Similar Threads
[Video Tutorial] - Very Easy Tutorial How to make your Own Wallhack in C++
09/01/2012 - Soldier Front Hacks, Bots, Cheats & Exploits - 16 Replies
Hello Everyone!Hellow Philippines - Mabuhay Pinoy Cheaters! Confidentials000 of GZP and Me Babyface21 ay iisa lang! Today i Will Teach you on How to Make Your Own Wallhack in C++ Very Simple By Video Tutorials Step by Step Part 1 - 3 Dont Ask me to Release my Private Wallhack coz i Need it to still Undetected



All times are GMT +1. The time now is 14:48.


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.