private Dictionary <string, string> BuildReplacementArguments()
        {
            var replacementArguments = new Dictionary <string, string>();

            if (QuestId > 0)
            {
                replacementArguments.Add("QuestId", QuestId.ToString());
            }
            if (QuestRequirementComplete != QuestCompleteRequirement.NotComplete)
            {
                replacementArguments.Add("QuestCompleteRequirement", QuestRequirementComplete.ToString());
            }
            if (QuestRequirementInLog != QuestInLogRequirement.InLog)
            {
                replacementArguments.Add("QuestCompleteRequirement", QuestRequirementInLog.ToString());
            }
            if (MobId > 0)
            {
                replacementArguments.Add("MobId", MobId.ToString());
            }
            if (FactionId > 0)
            {
                replacementArguments.Add("FactionId", FactionId.ToString());
            }
            if (IsMoveToMob)
            {
                replacementArguments.Add("MovementBy", "ClickToMoveOnly");
            }

            return(replacementArguments);
        }
Exemplo n.º 2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (MapAbilityGmtId.Length != 0)
            {
                hash ^= MapAbilityGmtId.GetHashCode();
            }
            if (targetCase_ == TargetOneofCase.PlayerNickname)
            {
                hash ^= PlayerNickname.GetHashCode();
            }
            if (targetCase_ == TargetOneofCase.MapCoordinate)
            {
                hash ^= MapCoordinate.GetHashCode();
            }
            if (targetCase_ == TargetOneofCase.MobId)
            {
                hash ^= MobId.GetHashCode();
            }
            hash ^= (int)targetCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 3
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (MobId.Length != 0)
            {
                hash ^= MobId.GetHashCode();
            }
            if (EncounterGmtId.Length != 0)
            {
                hash ^= EncounterGmtId.GetHashCode();
            }
            if (Hp != 0L)
            {
                hash ^= Hp.GetHashCode();
            }
            if (MaxHp != 0L)
            {
                hash ^= MaxHp.GetHashCode();
            }
            if (Level != 0)
            {
                hash ^= Level.GetHashCode();
            }
            if (EncounterTicket.Length != 0)
            {
                hash ^= EncounterTicket.GetHashCode();
            }
            if (X != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(X);
            }
            if (Y != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Y);
            }
            if (activeBuffList_ != null)
            {
                hash ^= ActiveBuffList.GetHashCode();
            }
            hash ^= rewards_.GetHashCode();
            if (TimeToSpawn != 0L)
            {
                hash ^= TimeToSpawn.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
            private void _reload()
            {
                if (_skillDbTuple != null)
                {
                    Name = _skillDbTuple.GetStringValue(ServerSkillAttributes.Desc.Index);
                }

                if (String.IsNullOrEmpty(Name))
                {
                    Name = MobId.ToString(CultureInfo.InvariantCulture);
                }

                if (_mobSkillDbTuple != null)
                {
                    int    icondition = _mobSkillDbTuple.GetValue <int>(ServerMobSkillAttributes.ConditionType);
                    string condition  = Enum.GetValues(typeof(ConditionType)).Cast <Enum>().Select(Description.GetDescription).ToList()[icondition];

                    Condition = condition.
                                Replace("[CValue]", _mobSkillDbTuple.GetStringValue(ServerMobSkillAttributes.ConditionValue.Index)).
                                Replace("[Val1]", _mobSkillDbTuple.GetStringValue(ServerMobSkillAttributes.Val1.Index));
                }
            }
Exemplo n.º 5
0
        public override void OnStart()
        {
            // This reports problems, and stops BT processing if there was a problem with attributes...
            // We had to defer this action, as the 'profile line number' is not available during the element's
            // constructor call.
            OnStart_HandleAttributeProblem();

            // If the quest is complete, this behavior is already done...
            // So we don't want to falsely inform the user of things that will be skipped.
            if (!IsDone)
            {
                // The ConfigMemento() class captures the user's existing configuration.
                // After its captured, we can change the configuration however needed.
                // When the memento is dispose'd, the user's original configuration is restored.
                // More info about how the ConfigMemento applies to saving and restoring user configuration
                // can be found here...
                //     http://www.thebuddyforum.com/mediawiki/index.php?title=Honorbuddy_Programming_Cookbook:_Saving_and_Restoring_User_Configuration
                _configMemento = new ConfigMemento();

                BotEvents.OnBotStop += BotEvents_OnBotStop;

                // Disable any settings that may interfere with the escort --
                // When we escort, we don't want to be distracted by other things.
                // NOTE: these settings are restored to their normal values when the behavior completes
                // or the bot is stopped.
                CharacterSettings.Instance.HarvestHerbs    = false;
                CharacterSettings.Instance.HarvestMinerals = false;
                CharacterSettings.Instance.LootChests      = false;
                CharacterSettings.Instance.LootMobs        = false;
                CharacterSettings.Instance.NinjaSkin       = false;
                CharacterSettings.Instance.SkinMobs        = false;

                WoWUnit mob = ObjectManager.GetObjectsOfType <WoWUnit>()
                              .Where(unit => MobId.Contains((int)unit.Entry))
                              .FirstOrDefault();

                TreeRoot.GoalText = "Escorting " + ((mob != null) ? mob.Name : ("Mob(" + MobId + ")"));
            }
        }