Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Nostale
You last visited: Today at 12:01

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

Advertisement



Release autoloot with item

Discussion on Release autoloot with item within the Nostale forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2017
Posts: 397
Received Thanks: 60
Release autoloot with item

I quibbled a bit with the autoloot and I said to myself that it's boring for some players to wait for a reboot to deactivate or not the autoloot. So I modified it a bit. It can definitely be improved I think. Like click on it again and it deactivates instantly but I free for those who are beginners and who don't really know how to do it.

Code:
if (VNum == 1143) // Auto-Loot 
            {
                if (!session.Character.StaticBonusList.Any(s => s.StaticBonusType == StaticBonusType.AutoLoot))
                {
                    session.Character.StaticBonusList.Add(new StaticBonusDTO
                    {
                        CharacterId = session.Character.CharacterId,
                        DateEnd = DateTime.Now.AddMinutes(20),
                        StaticBonusType = StaticBonusType.AutoLoot
                    });
                    session.SendPacket(
                           session.Character.GenerateSay(
                               Language.Instance.GetMessageFromKey("AUTOLOOT_ON"), 0));


                    Observable.Timer(TimeSpan.FromMinutes(20)).Subscribe(observer =>
                    {
                        session.SendPacket(
                               session.Character.GenerateSay(
                                   Language.Instance.GetMessageFromKey("AUTOLOOT_OFF"), 0));
                    });
  

                }
                else
                {
                    session.SendPacket(UserInterfaceHelper.GenerateMsg(Language.Instance.GetMessageFromKey("ITEM_IN_USE"), 0));
                }


            }
In this case the autoloot is activated for 20 minutes and it will deactivate automatically
redbull2905 is offline  
Old 09/21/2022, 20:42   #2
 
elite*gold: 110
Join Date: Jun 2016
Posts: 605
Received Thanks: 210
Your observable timer is kinda useless btw
Fizo55 is offline  
Old 09/21/2022, 20:46   #3
 
elite*gold: 0
Join Date: Jul 2017
Posts: 397
Received Thanks: 60
Quote:
Originally Posted by Fizo55 View Post
Your observable timer is kinda useless btw
it's just for " session.SendPacket(
session.Character.GenerateSay(
Language.Instance.GetMessageFromKey("AUTOLOOT_OFF" ), 0));"
redbull2905 is offline  
Old 09/21/2022, 21:07   #4
 
elite*gold: 110
Join Date: Jun 2016
Posts: 605
Received Thanks: 210
Quote:
Originally Posted by redbull2905 View Post
it's just for " session.SendPacket(
session.Character.GenerateSay(
Language.Instance.GetMessageFromKey("AUTOLOOT_OFF" ), 0));"
Fizo55 is offline  
Thanks
2 Users
Old 09/21/2022, 23:14   #5
 
ZroIsHere's Avatar
 
elite*gold: 0
Join Date: Jun 2021
Posts: 36
Received Thanks: 9
Quote:
Originally Posted by redbull2905 View Post
I quibbled a bit with the autoloot and I said to myself that it's boring for some players to wait for a reboot to deactivate or not the autoloot. So I modified it a bit. It can definitely be improved I think. Like click on it again and it deactivates instantly but I free for those who are beginners and who don't really know how to do it.

Code:
if (VNum == 1143) // Auto-Loot 
            {
                if (!session.Character.StaticBonusList.Any(s => s.StaticBonusType == StaticBonusType.AutoLoot))
                {
                    session.Character.StaticBonusList.Add(new StaticBonusDTO
                    {
                        CharacterId = session.Character.CharacterId,
                        DateEnd = DateTime.Now.AddMinutes(20),
                        StaticBonusType = StaticBonusType.AutoLoot
                    });
                    session.SendPacket(
                           session.Character.GenerateSay(
                               Language.Instance.GetMessageFromKey("AUTOLOOT_ON"), 0));


                    Observable.Timer(TimeSpan.FromMinutes(20)).Subscribe(observer =>
                    {
                        session.SendPacket(
                               session.Character.GenerateSay(
                                   Language.Instance.GetMessageFromKey("AUTOLOOT_OFF"), 0));
                    });
  

                }
                else
                {
                    session.SendPacket(UserInterfaceHelper.GenerateMsg(Language.Instance.GetMessageFromKey("ITEM_IN_USE"), 0));
                }


            }
In this case the autoloot is activated for 20 minutes and it will deactivate automatically
Quote:
Originally Posted by Fizo55 View Post
It's better to put an if when you pick up an item. After 20 minutes, if you pick up an item, the if datetime will detect that the current time is greater than the time limit and delete the record. It's not exactly 20 minutes, it's when you pick up the next item after 20 minutes, but it's better than an observable.
ZroIsHere is offline  
Old 09/25/2022, 00:52   #6

 
NosBreak's Avatar
 
elite*gold: 101
Join Date: Oct 2016
Posts: 113
Received Thanks: 10
I need contact you , is possible sent me your discord?
NosBreak is offline  
Thanks
1 User
Old 10/15/2022, 16:06   #7
 
elite*gold: 0
Join Date: Oct 2022
Posts: 28
Received Thanks: 3
Is working?
Ripper1181 is offline  
Reply


Similar Threads Similar Threads
Autoloot bot anyone??
05/11/2006 - Conquer Online 2 - 3 Replies
I would need an autolooter bot for MC? I dunno how to make it and not necessarily asking anyone to make me one, just asking if anyone would have one already and would be willing to give me for karma... since on a new server without money is shit... so someone be nice and post... no flaming please



All times are GMT +2. The time now is 12:01.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

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