Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Nostale
You last visited: Today at 02:54

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

Advertisement



Portal restriction by item

Discussion on Portal restriction by item within the Nostale forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2018
Posts: 33
Received Thanks: 10
Question Portal restriction by item

I want to add a restriction that the player need a item to go in portal and I did that:

if (Session.Character.Inventory.CountItem(1400) <= 0) // Not working

WHat Im doing wrong?

========[The code:]========

if (portal.DestinationMapId == 189)
{

if (Session.Character.PrestigeLevel < 1)
{
Session.SendPacket(UserInterfaceHelper.GenerateMsg ("You need atleast prestige 1 to go in there!", 10));
return;
}
else
{
if (Session.Character.Inventory.CountItem(1400) <= 0) // Not working
{
Session.SendPacket(UserInterfaceHelper.GenerateMsg ("You need to craft the key of Prestige Lobby first or reach Prestige 1!", 10));
return;
}
else
{
ServerManager.Instance.ChangeMap(Session.Character .CharacterId, 189, 42, 161);

}
}
}
JaDroK is offline  
Old 11/07/2018, 14:52   #2
 
Zagith's Avatar
 
elite*gold: 0
Join Date: Apr 2017
Posts: 55
Received Thanks: 22
This is hardcode, just create a new filed into Portal table with a migration and script it into basicpackethandler like this:

Code:
if (portal.RequiredItem != 0)
                {
                    if (Session.Character.Inventory.GetAllItems().All(i => i.ItemVNum != portal.RequiredItem))
                    {
                        Session.SendPacket(UserInterfaceHelper.GenerateMsg ("You need to craft the key of Prestige Lobby first or reach Prestige 1!", 10));
                        return;
                    }
                }
without else because you already have the ChangeMap method
Zagith is offline  
Thanks
3 Users
Old 11/07/2018, 19:10   #3
 
elite*gold: 0
Join Date: Jan 2018
Posts: 33
Received Thanks: 10
Thumbs up Thank you :)

Quote:
Originally Posted by Zagith View Post
This is hardcode, just create a new filed into Portal table with a migration and script it into basicpackethandler like this:

Code:
if (portal.RequiredItem != 0)
                {
                    if (Session.Character.Inventory.GetAllItems().All(i => i.ItemVNum != portal.RequiredItem))
                    {
                        Session.SendPacket(UserInterfaceHelper.GenerateMsg ("You need to craft the key of Prestige Lobby first or reach Prestige 1!", 10));
                        return;
                    }
                }
without else because you already have the ChangeMap method
Thank you alot m8
JaDroK is offline  
Reply


Similar Threads Similar Threads
[Selling] Drafting Service (Ranked Restriction, Chat Restriction)
02/01/2016 - League of Legends Trading - 14 Replies
Currently doing EVERY region. Price per win: ??? up for discussion We can discuss a price/time frame through: Skype: BoostJobs4U
[Selling] Draft Wins/Chat Restriction/Ranked Restriction SERVICE LF VOUCHES TOO!
04/09/2015 - League of Legends Trading - 3 Replies
Hello i want play for u service Chat Restricted (ranked/draft wins ) i looking for vouches from only trusted members can play some games cant quarante all wins ! I can play in any elos ! servers : EUNE/EUW/RU/TR/NA LF VOUCHES ! skype : ralmorx
[Selling] Elo Boosting/Coaching/Ranked Restriction/Chat Restriction
03/07/2015 - League of Legends Trading - 2 Replies
Hello guys,we are 5 elo booster from NA server, all master/challenger. You can find us on facebook : https://www.facebook.com/pages/ELO-Boosting/152592 2984354641?fref=ts. This is very cheap and fast boost. We are boosting on NA/Euw/Eune! Prices: Bronze to Silver - 30e Silver to Gold - 40e Gold to Platinum - 70e Platinum to Diamond -100e Diamond to Master - 200e Coaching-15e per hour Chat/Ranked restriction: 30 wins 20e, 60 wins, 40e. Payments: Paypal or add us on skype:...



All times are GMT +2. The time now is 02:54.


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