/// <summary>
 /// Loads all dialog dialog information.
 /// </summary>
 /// <remarks>
 /// The information is loaded from the data folder in dialogtemplates/{npcmodelid}.xml
 /// </remarks>
 /// <param name="npc">Npc who requires caching</param>
 /// <param name="name">Name of the found string</param>
 /// <param name="value">Value of the found string</param>
 protected internal override void OnCacheDialogInfo(BaseNPC npc, string name, uint value)
 {
     switch (name.ToUpperInvariant())
     {
         case "SHOP": _Shop = value; break;
     }
 }
 /// <summary>
 /// Registers all the menu's and buttons on the npc.
 /// </summary>
 /// <param name="npc">Npc who to register with</param>
 protected internal override void OnRegister(BaseNPC npc)
 {
     RegisterDialog(npc, DialogType.Kaftra, new FunctionCallback(OnKaftraService));
     RegisterDialog(npc, DialogType.Kaftra, 10, new FunctionCallback(OnSaveLocation));
     RegisterDialog(npc, DialogType.Kaftra, 11, new FunctionCallback(OnWarehouse));
     RegisterDialog(npc, DialogType.EventA, new FunctionCallback(OnEvents));
 }
 /// <summary>
 /// Registers all submenu's and cathelya buttons.
 /// </summary>
 /// <param name="npc"></param>
 protected internal override void OnRegister(BaseNPC npc)
 {
     RegisterDialog(npc, DialogType.BookStore, new FunctionCallback(OnBookStore));
     RegisterDialog(npc, DialogType.BookStore, 30, new FunctionCallback(PerformHeal));
     RegisterDialog(npc, DialogType.BookStore, 34, new FunctionCallback(OnShop));
     OnCacheShop(npc);
 }
예제 #4
0
 protected override void OnRegister(Saga.Templates.BaseNPC npc)
 {
     RegisterDialog(npc, DialogType.Smith, new FunctionCallback(OnBlackSmithMenu));
     RegisterDialog(npc, DialogType.Smith, 50, new FunctionCallback(OnRepairEquipment));
     RegisterDialog(npc, DialogType.Smith, 53, new FunctionCallback(OnUpgradeWeapon));
     RegisterDialog(npc, DialogType.Smith, 55, new FunctionCallback(OnChangeWeaponSuffix));
 }
 /// <summary>
 /// Loads all dialog dialog information.
 /// </summary>
 /// <remarks>
 /// The information is loaded from the data folder in dialogtemplates/{npcmodelid}.xml
 /// </remarks>
 /// <param name="npc">Npc who requires caching</param>
 /// <param name="name">Name of the found string</param>
 /// <param name="value">Value of the found string</param>
 protected internal override void OnCacheDialogInfo(BaseNPC npc, string name, uint value)
 {
     switch (name.ToUpperInvariant())
     {
         case "TRADEDIALOG": _TradeDialog = value; break;
     }
 }
예제 #6
0
 /// <summary>
 /// Occurs when the auction button is pressed.
 /// </summary>
 /// <param name="npc">Npc who calls the function</param>
 /// <param name="target">Character who requires interaction</param>
 protected virtual void OnAuction(BaseNPC npc, Character target)
 {
     Common.Actions.OpenSubmenu(target, npc,
         _Auction,               //Dialog script to show
         DialogType.Market,      //Button function
         21                      //Open market
     );
 }
예제 #7
0
 public void Open(Character character, BaseNPC basenpc)
 {
     character.Tag = this;
     SMSG_SUPPLYMENU spkt = new SMSG_SUPPLYMENU();
     spkt.MenuId = this.TradeMenu;
     spkt.SessionId = character.id;
     character.client.Send((byte[])spkt);
 }
예제 #8
0
 /// <summary>
 /// Registers all menu's
 /// </summary>
 /// <param name="npc">Npc who calls for registration</param>
 protected internal override void OnRegister(BaseNPC npc)
 {
     RegisterDialog(npc, DialogType.Smith, new FunctionCallback(OnBlackSmithMenu));
     RegisterDialog(npc, DialogType.Smith, 50, new FunctionCallback(OnRepairEquipment));
     RegisterDialog(npc, DialogType.Smith, 52, new FunctionCallback(OnChangeWeapon));
     RegisterDialog(npc, DialogType.Smith, 53, new FunctionCallback(OnUpgradeWeapon));
     RegisterDialog(npc, DialogType.Smith, 55, new FunctionCallback(OnChangeWeaponSuffix));
 }
예제 #9
0
 /// <summary>
 /// Shows all warp function of the current npc.
 /// </summary>
 /// <param name="npc">Npc to hold the dialog</param>
 protected internal override void OnCacheDialogInfo(BaseNPC npc, string name, uint value)
 {
     switch (name.ToUpperInvariant())
     {
         case "AUCTION": _Auction = value; break;
         case "AUCTIONOPEN": _AuctionOpen = value; break;
     }
 }
 /// <summary>
 /// Registers all the menu's and buttons on the npc.
 /// </summary>
 /// <param name="npc">Npc who to register with</param>
 protected internal override void OnRegister(BaseNPC npc)
 {
     RegisterDialog(npc, DialogType.BookStore, new FunctionCallback(OnSkillmasterMenu));
     RegisterDialog(npc, DialogType.BookStore, 31, new FunctionCallback(OnChangeJob));
     RegisterDialog(npc, DialogType.BookStore, 32, new FunctionCallback(OnSpecialAbillities));
     RegisterDialog(npc, DialogType.BookStore, 33, new FunctionCallback(OnSkillbook));
     OnCacheShop(npc);
 }
 /// <summary>
 /// Loads all dialog dialog information.
 /// </summary>
 /// <remarks>
 /// The information is loaded from the data folder in dialogtemplates/{npcmodelid}.xml
 /// </remarks>
 /// <param name="npc">Npc who requires caching</param>
 /// <param name="name">Name of the found string</param>
 /// <param name="value">Value of the found string</param>
 protected internal override void OnCacheDialogInfo(BaseNPC npc, string name, uint value)
 {
     switch (name.ToUpperInvariant())
     {
         case "SAVELOCATION": _SaveLocation = value; break;
         case "STORAGE": _Storage = value; break;
         case "KAFTRASERVICE": _KaftraService = value; break;
     }
 }
 /// <summary>
 /// Loads all dialog dialog information.
 /// </summary>
 /// <remarks>
 /// The information is loaded from the data folder in dialogtemplates/{npcmodelid}.xml
 /// </remarks>
 /// <param name="npc">Npc who requires caching</param>
 /// <param name="name">Name of the found string</param>
 /// <param name="value">Value of the found string</param>
 protected internal override void OnCacheDialogInfo(BaseNPC npc, string name, uint value)
 {
     switch (name.ToUpperInvariant())
     {
         case "BOOKSTORE": _BookStore = value; break;
         case "SHOP": _Shop = value; break;
         case "HEAL": _Heal = value; break;
     }
 }
예제 #13
0
 protected override void OnBlackSmithMenu(BaseNPC npc, Saga.PrimaryTypes.Character target)
 {
     Common.Actions.OpenSubmenu(target, npc,
       _BlackSmithMenu,        //Dialog script to show
       DialogType.Smith,       //Button function
       50,                     //Repair
       53,                     //Upgrade
       55                      //Change Suffix
     );
 }
 /// <summary>
 /// Loads all dialog dialog information.
 /// </summary>
 /// <remarks>
 /// The information is loaded from the data folder in dialogtemplates/{npcmodelid}.xml
 /// </remarks>
 /// <param name="npc">Npc who requires caching</param>
 /// <param name="name">Name of the found string</param>
 /// <param name="value">Value of the found string</param>
 protected internal override void OnCacheDialogInfo(BaseNPC npc, string name, uint value)
 {
     switch (name.ToUpperInvariant())
     {
         case "SHOWSKILLMASTERMENU": _ShowSkillMasterMenu = value; break;
         case "CHANGEJOB": _ChangeJob = value; break;
         case "SPECIALABILLITIES": _OnSpecialAbillities = value; break;
         case "SKILLBOOK": _OnSkillbook = value; break;
     }
 }
 /// <summary>
 /// Occurs after the Kaftra button is pressed.
 /// </summary>
 /// <param name="npc">Npc who called the event</param>
 /// <param name="target">Character who requirs interaction</param>
 protected virtual void OnKaftraService(BaseNPC npc, Character target)
 {
     Common.Actions.OpenSubmenu(
         target, npc,
         _KaftraService,
         DialogType.Kaftra,
         10,
         11
     );
 }
예제 #16
0
        /// <summary>
        /// Occurs when subemnu item 'Open market' is pressed.
        /// </summary>
        /// <param name="npc">Npc who calls the function</param>
        /// <param name="target">Character who requires interaction</param>
        protected virtual void OnAuctionOpen(BaseNPC npc, Character target)
        {
            CommonFunctions.ShowAuction(target, npc);

            Common.Actions.OpenMenu(
                target, npc,
                _AuctionOpen,
                DialogType.Market,
                new byte[] { }
            );
        }
        /// <summary>
        /// Occurs after showing the trader dialog.
        /// </summary>
        /// <param name="npc"></param>
        /// <param name="target"></param>
        protected virtual void OnTradeDialog(BaseNPC npc, Character target)
        {
            Common.Actions.OpenMenu(
                target, npc,
                _TradeDialog,
                DialogType.TradeItems,
                npc.GetDialogButtons(target)
            );

            _container.Open(target, npc);
        }
예제 #18
0
 /// <summary>
 /// Caches all dialog information
 /// </summary>
 /// <param name="npc">Npc who calls for registration</param>
 protected internal override void OnCacheDialogInfo(BaseNPC npc, string name, uint value)
 {
     switch (name.ToUpperInvariant())
     {
         case "BLACKSMITHMENU": _BlackSmithMenu = value; break;
         case "WEAPONTYPECHANGE": _WeaponChange = value; break;
         case "SUFFIXCHANGE": _WeaponSuffixChange = value; break;
         case "WEAPONUPGRADE": _WeaponUpgrade = value; break;
         case "REPAIREQUIPMENT": _RepairEquipment = value; break;
     }
 }
예제 #19
0
 /// <summary>
 /// Occurs when opening the blacksmith menu
 /// </summary>
 /// <param name="npc">Npc who requires shows the menu</param>
 /// <param name="target">Character who requires interaction</param>
 protected virtual void OnBlackSmithMenu(BaseNPC npc, Character target)
 {
     Common.Actions.OpenSubmenu(target, npc,
         _BlackSmithMenu,        //Dialog script to show
         DialogType.Smith,       //Button function
         50,                     //Repair
         52,                     //Change Type
         53,                     //Upgrade
         55                      //Change Suffix
     );
 }
예제 #20
0
        /// <summary>
        /// Occurs when pressing the shop buttong
        /// </summary>
        /// <param name="npc">Npc who calls the event</param>
        /// <param name="target">Character who requires interaction</param>
        protected virtual void OnShop(BaseNPC npc, Character target)
        {
            //Open menu
            Common.Actions.OpenMenu(
                target, npc,
                _Shop,
                DialogType.Shop,
                npc.GetDialogButtons(target)
            );

            //Open shoplist
            _shoplist.Open(target, npc);
        }
        /// <summary>
        /// Caches the location items.
        /// </summary>
        /// <remarks>
        /// This will load all shop items from the data directory from read from
        /// file Guides/{npcmodelid}.xml.
        /// </remarks>
        /// <param name="npc">Npc who requires caching</param>
        protected void CacheLocations(BaseNPC npc)
        {
            _guidelist = new List<GuidePoint>();
            string filename = Server.SecurePath("~/Guides/{0}.xml", npc.ModelId);
            if (File.Exists(filename))
                using (GuideReader reader = GuideReader.Open(filename))
                    while (reader.Read())
                    {
                        _locmenuid = reader.Menu;
                        switch (reader.Type)
                        {
                            case GuideReader.NodeType.Npc:
                                _guidelist.Add(new GuideNpc(reader.Item, 0));
                                break;

                            case GuideReader.NodeType.Position:
                                _guidelist.Add(new GuidePosition(reader.X, reader.Y, reader.Z, reader.Item, 0));
                                break;
                        }
                    }
        }
예제 #22
0
        public override void Open(Character character, BaseNPC basenpc, uint supplyid)
        {
            character.Tag = this;
            SMSG_EQUIPMENTTRADINGLIST spkt = new SMSG_EQUIPMENTTRADINGLIST();
            spkt.ActorID = basenpc.id;
            spkt.SupplyID = supplyid;
            spkt.SessionId = character.id;

            for (int i = 0; i < this.list.Count; i++)
            {
                spkt.AddItem(
                    //First production item
                    this.list[i].GetProduction(0),
                    //First production item
                    this.list[i].GetSupplement(0),
                    //Seccond production item
                    this.list[i].GetSupplement(1)
               );
            }

            character.client.Send((byte[])spkt);
        }
        /// masters submenu.
        /// </summary>
        /// <param name="npc">Npc who calls the event</param><summary>
        /// Shows the skill
        /// <param name="target">Character who requires interaction</param>
        protected virtual void OnSkillmasterMenu(BaseNPC npc, Character target)
        {
            Console.WriteLine("Open skill master menu");

            Common.Actions.OpenSubmenu(target, npc,
                _ShowSkillMasterMenu,   //Dialog script to show
                DialogType.BookStore,   //Button function
                31,                     //Change Job
                32,                     //Special skills
                33                      //Skill books
            );
        }
예제 #24
0
 /// <summary>
 /// Registers all dialogs for the npc.
 /// </summary>
 /// <param name="npc">Npc to hold the dialog</param>
 protected internal override void OnRegister(BaseNPC npc)
 {
     RegisterDialog(npc, DialogType.Market, new FunctionCallback(OnAuction));
     RegisterDialog(npc, DialogType.Market, 21, new FunctionCallback(OnAuctionOpen));
 }
예제 #25
0
 /// <summary>
 /// When overriden this will open the shoplist
 /// </summary>
 /// <param name="character">Character to open the list</param>
 /// <param name="basenpc">Npc who shows the list</param>
 public virtual void Open(Character character, BaseNPC basenpc)
 {
 }
        /// <summary>
        /// Shows all a list of skillbooks.
        /// (uses shoppinglist object)
        /// </summary>
        /// <param name="npc">Npc who calls the event</param>
        /// <param name="target">Character who requires interaction</param>
        protected virtual void OnSkillbook(BaseNPC npc, Character target)
        {
            //Open bookstore
            _shoplist.Open(target, npc);

            //Show dialog
            Common.Actions.OpenMenu(
                target, npc,
                _OnSkillbook,
                DialogType.BookStore,
                npc.GetDialogButtons(target)
            );
        }
        /// <summary>
        /// Shows all special abillities.
        /// </summary>
        /// <param name="npc">Npc who calls the event</param>
        /// <param name="target">Character who requires interaction</param>
        protected virtual void OnSpecialAbillities(BaseNPC npc, Character target)
        {
            CommonDialogs.OpenSpecialSkillsDialog(target, Singleton.Database.GetAllLearnedSkills(target));
            //CommonFunctions.ShowDialog(target, npc, _OnSpecialAbillities, npc.GetDialogButtons(target));

            //Show dialog
            Common.Actions.OpenMenu(
                target, npc,
                _OnSpecialAbillities,
                DialogType.BookStore,
                npc.GetDialogButtons(target)
            );
        }
 /// <summary>
 /// Caches the trader object form a file.
 /// </summary>
 /// <param name="npc"></param>
 protected virtual void OnCacheTrader(BaseNPC npc)
 {
     string filename = Server.SecurePath("~/traders/{0}.xml", npc.ModelId);
     _container = TradelistContainer.FromFile(filename);
 }
 /// <summary>
 /// Registers all the menu's and buttons on the npc.
 /// </summary>
 /// <param name="npc">Npc who to register with</param>
 protected internal override void OnRegister(BaseNPC npc)
 {
     RegisterDialog(npc, DialogType.TradeItems, new FunctionCallback(OnTradeDialog));
     OnCacheTrader(npc);
 }
 /// <summary>
 /// Refreshes the trader
 /// </summary>
 /// <param name="npc">Target npc</param>
 protected internal override void OnRefresh(BaseNPC npc)
 {
     OnCacheTrader(npc);
 }
 /// <summary>
 /// Caches the shop
 /// </summary>
 /// <param name="npc">Npc who requires his shop to be cached</param>
 protected virtual void OnCacheShop(BaseNPC npc)
 {
     string filename = Server.SecurePath("~/bookstore/{0}.xml", npc.ModelId);
     _shoplist = BookstoreCollection.FromFile(filename);
 }