Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        private void CheckRewards()
        {
            Character.CachedBuffer = true;

            if (m_reward != null)
            {
                foreach (var item in m_reward.RewardedItems)
                {
                    Character.Dispatch(WorldMessage.EXCHANGE_DISTANT_MOVEMENT(ExchangeMoveEnum.MOVE_OBJECT, OperatorEnum.OPERATOR_REMOVE, item.TemplateId.ToString()));
                }
            }

            m_reward = null;

            Character.Dispatch(WorldMessage.EXCHANGE_DISTANT_MOVEMENT(ExchangeMoveEnum.MOVE_GOLD, OperatorEnum.OPERATOR_ADD, "0"));

            m_reward = (m_templateQuantity.Count > 0 || m_exchangedKamas[Character.Id] > 0) ? Npc.Rewards.Find(entry => entry.Match(m_templateQuantity, m_exchangedKamas[Character.Id])) : null;
            if (m_reward != null)
            {
                foreach (var item in m_reward.RewardedItems)
                {
                    Character.Dispatch(WorldMessage.EXCHANGE_DISTANT_MOVEMENT(ExchangeMoveEnum.MOVE_OBJECT, OperatorEnum.OPERATOR_ADD, item.TemplateId + "|" + item.Quantity + '|' + item.TemplateId + '|' + item.Template.Effects));
                }
                Character.Dispatch(WorldMessage.EXCHANGE_DISTANT_MOVEMENT(ExchangeMoveEnum.MOVE_GOLD, OperatorEnum.OPERATOR_ADD, m_reward.RewardedKamas.ToString()));
            }

            Character.CachedBuffer = false;
        }
Exemplo n.º 2
0
        private void AddRewardToContainer(Container cont, RewardEntry entry)
        {
            object obj = Activator.CreateInstance(entry.m_type);

            if (obj != null && obj is Item && cont != null)
            {
                if (((Item)obj).Stackable && entry.m_amount > 1)
                {
                    ((Item)obj).Amount = entry.m_amount;
                }

                cont.DropItem(((Item)obj));
            }
        }
Exemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reward"></param>
        private void AddReward(RewardEntry reward)
        {
            var mainNode = new TreeNode(reward.GetHashCode().ToString())
            {
                Tag = reward
            };

            var requiredNode = new TreeNode("required")
            {
                Tag = reward.RequiredItems
            };

            if (reward.RequiredKamas > 0)
            {
                requiredNode.Nodes.Add(reward.RequiredKamas + " kamas");
            }
            foreach (var item in reward.RequiredItems)
            {
                requiredNode.Nodes.Add(new TreeNode(item.Quantity + "x " + item.Template.Name)
                {
                    Tag = item
                });
            }

            var rewardedNode = new TreeNode("rewarded")
            {
                Tag = reward.RewardedItems
            };

            if (reward.RewardedKamas > 0)
            {
                rewardedNode.Nodes.Add(reward.RewardedKamas + " kamas");
            }
            foreach (var item in reward.RewardedItems)
            {
                rewardedNode.Nodes.Add(new TreeNode(item.Quantity + "x " + item.Template.Name)
                {
                    Tag = item
                });
            }

            mainNode.Nodes.Add(requiredNode);
            mainNode.Nodes.Add(rewardedNode);
            treeView1.Nodes.Add(mainNode);
            treeView1.ExpandAll();
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="reward"></param>
        private void AddReward(RewardEntry reward)
        {
            var mainNode = new TreeNode(reward.GetHashCode().ToString())
            {
                Tag = reward
            };

            var requiredNode = new TreeNode("required")
            {
                Tag = reward.RequiredItems
            };

            if(reward.RequiredKamas > 0)
                requiredNode.Nodes.Add(reward.RequiredKamas + " kamas");
            foreach (var item in reward.RequiredItems)
                requiredNode.Nodes.Add(new TreeNode(item.Quantity + "x " + item.Template.Name)
                {
                    Tag = item
                });

            var rewardedNode = new TreeNode("rewarded")
            {
                Tag = reward.RewardedItems
            };

            if (reward.RewardedKamas > 0)
            rewardedNode.Nodes.Add(reward.RewardedKamas + " kamas");
            foreach(var item in reward.RewardedItems)
                rewardedNode.Nodes.Add(new TreeNode(item.Quantity + "x " + item.Template.Name)
                    {
                        Tag = item
                    });

            mainNode.Nodes.Add(requiredNode);
            mainNode.Nodes.Add(rewardedNode);
            treeView1.Nodes.Add(mainNode);
            treeView1.ExpandAll();
        }
		private void AddRewardToContainer( Container cont, RewardEntry entry )
		{
			object obj = Activator.CreateInstance( entry.m_type );
			if(obj != null && obj is Item && cont != null)
			{
				if( ((Item)obj).Stackable && entry.m_amount > 1 )
					((Item)obj).Amount = entry.m_amount;

				cont.DropItem( ((Item)obj) );
			}
		}
Exemplo n.º 6
0
        /// <summary>
        /// 
        /// </summary>
        private void CheckRewards()
        {
            Character.CachedBuffer = true;

            if(m_reward != null)
                foreach(var item in m_reward.RewardedItems)
                    Character.Dispatch(WorldMessage.EXCHANGE_DISTANT_MOVEMENT(ExchangeMoveEnum.MOVE_OBJECT, OperatorEnum.OPERATOR_REMOVE, item.TemplateId.ToString()));

            m_reward = null;

            Character.Dispatch(WorldMessage.EXCHANGE_DISTANT_MOVEMENT(ExchangeMoveEnum.MOVE_GOLD, OperatorEnum.OPERATOR_ADD, "0"));

            m_reward = (m_templateQuantity.Count > 0 || m_exchangedKamas[Character.Id] > 0) ? Npc.Rewards.Find(entry => entry.Match(m_templateQuantity, m_exchangedKamas[Character.Id])) : null;
            if (m_reward != null)
            {
                foreach (var item in m_reward.RewardedItems)
                    Character.Dispatch(WorldMessage.EXCHANGE_DISTANT_MOVEMENT(ExchangeMoveEnum.MOVE_OBJECT, OperatorEnum.OPERATOR_ADD, item.TemplateId + "|" + item.Quantity + '|' + item.TemplateId + '|' + item.Template.Effects));
                Character.Dispatch(WorldMessage.EXCHANGE_DISTANT_MOVEMENT(ExchangeMoveEnum.MOVE_GOLD, OperatorEnum.OPERATOR_ADD, m_reward.RewardedKamas.ToString()));
            }

            Character.CachedBuffer = false;
        }
Exemplo n.º 7
0
        public static bool CanHue(Item item)
        {
            if (item.IsNamed)
            {
                return(true);
            }

            if (item is PigmentsOfTokuno || item is PigmentsOfTokunoMajor)
            {
                return(false);
            }

            if (item is IFactionArtifact)
            {
                return(true);
            }

            if (item is ElvenGlasses)
            {
                return(true);
            }

            if (item is LuckyNecklace)
            {
                return(true);
            }

            if (item is BaseWeapon && (((BaseWeapon)item).ArtifactRarity > 0 || !CraftResources.IsStandard(((BaseWeapon)item).Resource)))
            {
                return(true);
            }

            if (item is BaseArmor && (((BaseArmor)item).ArtifactRarity > 0 || !CraftResources.IsStandard(((BaseArmor)item).Resource)))
            {
                return(true);
            }

            if (item is BaseClothing && ((BaseClothing)item).ArtifactRarity > 0)
            {
                return(true);
            }

            if (item is BaseJewel && ((BaseJewel)item).ArtifactRarity > 0)
            {
                return(true);
            }

            if (item is StealableArtifact || item is StealableContainerArtifact || item is StealableLightArtifact || item is StealableLongswordArtifact || item is StealablePlateGlovesArtifact || item is StealableWarHammerArtifact || item is StealableExecutionersAxeArtifact || item is StealableFoodArtifact)
            {
                return(true);
            }

            if (item is SamuraiHelm || item is LeggingsOfEmbers || item is HolySword || item is ShaminoCrossbow)
            {
                return(true);
            }

            #region Heritage Items
            if (item is DupresShield || item is OssianGrimoire || item is QuiverOfInfinity)
            {
                return(true);
            }
            #endregion

            #region Champion Artifacts
            if (item is AcidProofRobe || item is CrownOfTalKeesh || item is Calm || item is FangOfRactus || item is GladiatorsCollar || item is OrcChieftainHelm ||
                item is Pacify || item is Quell || item is ShroudOfDeciet || item is Subdue || item is ANecromancerShroud || item is BraveKnightOfTheBritannia ||
                item is CaptainJohnsHat || item is DetectiveBoots || item is DjinnisRing || item is EmbroideredOakLeafCloak || item is GuantletsOfAnger || item is LieutenantOfTheBritannianRoyalGuard ||
                item is OblivionsNeedle || item is RoyalGuardSurvivalKnife || item is SamaritanRobe || item is TheMostKnowledgePerson || item is TheRobeOfBritanniaAri)
            {
                return(true);
            }
            #endregion

            for (int i = 0; i < Paragon.Artifacts.Length; i++)
            {
                Type type = Paragon.Artifacts[i];

                if (type == item.GetType())
                {
                    return(true);
                }
            }

            if (item is ScrappersCompendium)
            {
                return(true);
            }

            for (int i = 0; i < NamedMiniBosses.Artifacts.Length; i++)
            {
                Type type = NamedMiniBosses.Artifacts[i];

                if (type == item.GetType())
                {
                    return(true);
                }
            }

            for (int i = 0; i < Leviathan.Artifacts.Length; i++)
            {
                Type type = Leviathan.Artifacts[i];

                if (type == item.GetType())
                {
                    return(true);
                }
            }


            for (int i = 0; i < TreasureMapChest.m_Artifacts.Length; i++)
            {
                Type type = TreasureMapChest.m_Artifacts[i];

                if (type == item.GetType())
                {
                    return(true);
                }
            }

            for (int i = 0; i < TokunoTreasures.MinorArtifacts.Length; i++)
            {
                Type type = TokunoTreasures.MinorArtifacts[i];

                if (type == item.GetType())
                {
                    return(true);
                }
            }

            for (int i = 0; i < TokunoTreasures.MajorArtifacts.Length; i++)
            {
                Type type = TokunoTreasures.MajorArtifacts[i];

                if (type == item.GetType())
                {
                    return(true);
                }
            }

            if (CraftableArtifacts.IsCraftableArtifact(item))
            {
                return(true);
            }

            if (item is CrimsonCincture || item is DreadsRevenge)
            {
                return(true);
            }

            for (int i = 0; i < MoonglowZooCollection.RewardList.Length; i++)
            {
                RewardEntry entry = (RewardEntry)MoonglowZooCollection.RewardList[i];

                if (entry.Type == item.GetType())
                {
                    return(true);
                }
            }

            for (int i = 0; i < VesperMuseumCollection.RewardList.Length; i++)
            {
                RewardEntry entry = (RewardEntry)VesperMuseumCollection.RewardList[i];

                if (entry.Type == item.GetType())
                {
                    return(true);
                }
            }

            for (int i = 0; i < BritainLibraryAnimalTrainerCollection.RewardList.Length; i++)
            {
                RewardEntry entry = (RewardEntry)BritainLibraryAnimalTrainerCollection.RewardList[i];

                if (entry.Type == item.GetType())
                {
                    return(true);
                }
            }

            if (item is DecorativeCarpet)
            {
                return(true);
            }

            if (SAArtifacts.IsSAArtifact(item))
            {
                return(true);
            }

            if (item is NocturneEarrings)
            {
                return(true);
            }

            return(false);
        }