public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
 {
     if ((Asda2ItemId)value1 != this.ItemId)
     {
         return;
     }
     achievements.SetCriteriaProgress((AchievementCriteriaEntry)this, 1U, ProgressType.ProgressAccumulate);
 }
 public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
 {
     if (value1 == 0U || achievements.Owner.FactionGroup == (FactionGroup)value1)
     {
         return;
     }
     achievements.SetCriteriaProgress((AchievementCriteriaEntry)this, 1U, ProgressType.ProgressAccumulate);
 }
Esempio n. 3
0
 public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
 {
     if (CreatureId != (NPCId)value1)
     {
         return;
     }
     achievements.SetCriteriaProgress(this, value2, ProgressType.ProgressAccumulate);
 }
 public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
 {
     if ((int)this.AchievementToCompleteId != (int)value1)
     {
         return;
     }
     achievements.SetCriteriaProgress((AchievementCriteriaEntry)this, value2, ProgressType.ProgressSet);
 }
 public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
 {
     if (value1 == 0U)
     {
         return;
     }
     achievements.SetCriteriaProgress((AchievementCriteriaEntry)this, value1, ProgressType.ProgressHighest);
 }
Esempio n. 6
0
        public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
        {
            if (value1 == 0 || value1 != (uint)emoteId)
            {
                return;
            }

            achievements.SetCriteriaProgress(this, 1, ProgressType.ProgressAccumulate);
        }
Esempio n. 7
0
 public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
 {
     /*if(ItemId != (ItemId)value1)
      *  return;
      * var itemCount = (uint)achievements.Owner.Inventory.GetAmount(ItemId);
      * if(itemCount == 0)
      *  return;
      * achievements.SetCriteriaProgress(this, itemCount, ProgressType.ProgressHighest);*/
 }
Esempio n. 8
0
        public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
        {
            if ((FactionId)value1 != this.FactionId)
            {
                return;
            }
            int num = achievements.Owner.Reputations.GetValue(FactionMgr.GetFactionIndex(this.FactionId));

            achievements.SetCriteriaProgress((AchievementCriteriaEntry)this, (uint)num, ProgressType.ProgressHighest);
        }
Esempio n. 9
0
 public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
 {
     if (value1 == 0)
     {
         return;
     }
     if (MapId != (MapId)value1)
     {
         return;
     }
     achievements.SetCriteriaProgress(this, value2, ProgressType.ProgressAccumulate);
 }
Esempio n. 10
0
 public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
 {
     if (this.AchievementEntry.IsRealmFirstType() &&
         (int)AchievementCollection.ClassSpecificAchievementId[(int)achievements.Owner.Class] !=
         (int)this.AchievementEntryId &&
         (int)AchievementCollection.RaceSpecificAchievementId[(int)achievements.Owner.Race] !=
         (int)this.AchievementEntryId)
     {
         return;
     }
     achievements.SetCriteriaProgress((AchievementCriteriaEntry)this, value1, ProgressType.ProgressSet);
 }
Esempio n. 11
0
        public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
        {
            if ((SpellId)value1 != SpellId)
            {
                return;
            }

            if (!achievements.Owner.PlayerSpells.Contains((uint)SpellId))
            {
                return;
            }

            achievements.SetCriteriaProgress(this, 1, ProgressType.ProgressHighest);
        }
Esempio n. 12
0
        public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
        {
            if (value1 != (uint)WorldMapOverlayId)
            {
                return;
            }
            var worldMapOverlayEntry = World.s_WorldMapOverlayEntries[value1];

            if (worldMapOverlayEntry == null)
            {
                return;
            }

            bool matchFound = false;

            foreach (var zoneTemplateId in worldMapOverlayEntry.ZoneTemplateId)
            {
                if (zoneTemplateId == 0)        // no more areaids to come, let's stop the search
                {
                    break;
                }

                var zoneTemplate = World.GetZoneInfo(zoneTemplateId);
                if (zoneTemplate.ExplorationBit < 0)
                {
                    continue;
                }

                if (achievements.Owner.IsZoneExplored(zoneTemplate.ExplorationBit))
                {
                    matchFound = true;
                    break;
                }
            }

            if (!matchFound)
            {
                return;
            }

            achievements.SetCriteriaProgress(this, 1);
        }
        public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
        {
            if ((WorldMapOverlayId)value1 != this.WorldMapOverlayId)
            {
                return;
            }
            WorldMapOverlayEntry worldMapOverlayEntry = WCell.RealmServer.Global.World.s_WorldMapOverlayEntries[value1];

            if (worldMapOverlayEntry == null)
            {
                return;
            }
            bool flag = false;

            foreach (ZoneId zoneID in worldMapOverlayEntry.ZoneTemplateId)
            {
                if (zoneID != ZoneId.None)
                {
                    ZoneTemplate zoneInfo = WCell.RealmServer.Global.World.GetZoneInfo(zoneID);
                    if (zoneInfo.ExplorationBit >= 0 && achievements.Owner.IsZoneExplored(zoneInfo.ExplorationBit))
                    {
                        flag = true;
                        break;
                    }
                }
                else
                {
                    break;
                }
            }

            if (!flag)
            {
                return;
            }
            achievements.SetCriteriaProgress((AchievementCriteriaEntry)this, 1U, ProgressType.ProgressSet);
        }
Esempio n. 14
0
        public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
        {
            if (value1 != (uint)WorldMapOverlayId)
                return;
            var worldMapOverlayEntry = World.s_WorldMapOverlayEntries[value1];
            if (worldMapOverlayEntry == null)
                return;

            bool matchFound = false;
            foreach (var zoneTemplateId in worldMapOverlayEntry.ZoneTemplateId)
            {
                if (zoneTemplateId == 0)        // no more areaids to come, let's stop the search
                    break;

                var zoneTemplate = World.GetZoneInfo(zoneTemplateId);
                if (zoneTemplate.ExplorationBit < 0)
                    continue;

                if (achievements.Owner.IsZoneExplored(zoneTemplate.ExplorationBit))
                {
                    matchFound = true;
                    break;
                }
            }

            if (!matchFound)
                return;

            achievements.SetCriteriaProgress(this, 1);
        }
Esempio n. 15
0
 public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
 {
     if (value1 == 0 || (SkillId)value1 != SkillId)
         return;
     achievements.SetCriteriaProgress(this, value2);
 }
Esempio n. 16
0
 public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
 {
     if (ItemId != (ItemId)value1)
         return;
     var itemCount = (uint)achievements.Owner.Inventory.GetAmount(ItemId);
     if (itemCount == 0)
         return;
     achievements.SetCriteriaProgress(this, itemCount, ProgressType.ProgressHighest);
 }
Esempio n. 17
0
        public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
        {
            if ((SpellId)value1 != SpellId)
                return;

            if (!achievements.Owner.PlayerSpells.Contains((uint)SpellId))
                return;

            achievements.SetCriteriaProgress(this, 1, ProgressType.ProgressHighest);
        }
Esempio n. 18
0
        public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
        {
            if (value1 == 0)
                return;
            if ((EnviromentalDamageType)value1 != EnviromentalDamageType)
                return;

            achievements.SetCriteriaProgress(this, value2, ProgressType.ProgressAccumulate);
        }
Esempio n. 19
0
 public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
 {
     if (value1 == 0)
         return;
     achievements.SetCriteriaProgress(this, value1, ProgressType.ProgressHighest);
 }
Esempio n. 20
0
 // 23
 public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
 {
     if (value1 == 0)
         return;
     if (achievements.Owner.FactionGroup == (FactionGroup)value1)
         return;
     achievements.SetCriteriaProgress(this, 1, ProgressType.ProgressAccumulate);
 }
Esempio n. 21
0
        public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
        {
            if (value1 != (uint)FactionId)
                return;

            int reputation = achievements.Owner.Reputations.GetValue(FactionMgr.GetFactionIndex(FactionId));
            achievements.SetCriteriaProgress(this, (uint)reputation, ProgressType.ProgressHighest);
        }
Esempio n. 22
0
 public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
 {
     achievements.SetCriteriaProgress(this, achievements.Owner.BankBagSlots, ProgressType.ProgressHighest);
 }
 public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
 {
 }
Esempio n. 24
0
 public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
 {
     achievements.SetCriteriaProgress(this, achievements.Owner.Reputations.GetVisibleReputations(), ProgressType.ProgressHighest);
 }
Esempio n. 25
0
		/// <summary>
		/// Creates a new character and loads all required character data from the database
		/// </summary>
		/// <param name="acc">The account the character is associated with</param>
		/// <param name="record">The name of the character to load</param>
		/// <param name="client">The client to associate with this character</param>
		internal protected void Create(RealmAccount acc, CharacterRecord record, IRealmClient client)
		{
			client.ActiveCharacter = this;
			acc.ActiveCharacter = this;

			Type |= ObjectTypes.Player;
			ChatChannels = new List<ChatChannel>(5);

			m_logoutTimer = new TimerEntry(0, DefaultLogoutDelayMillis, totalTime => FinishLogout());

			Account = acc;
			m_client = client;

			m_record = record;
			EntityId = EntityId.GetPlayerId(m_record.EntityLowId);
			m_name = m_record.Name;

			Archetype = ArchetypeMgr.GetArchetype(record.Race, record.Class);
			MainWeapon = GenericWeapon.Fists;
			PowerType = m_archetype.Class.DefaultPowerType;

			StandState = StandState.Sit;

			Money = (uint) m_record.Money;
			Outfit = m_record.Outfit;
			//ScaleX = m_archetype.Race.Scale;
			ScaleX = 1;
			Gender = m_record.Gender;
			Skin = m_record.Skin;
			Facial = m_record.Face;
			HairStyle = m_record.HairStyle;
			HairColor = m_record.HairColor;
			FacialHair = m_record.FacialHair;
			UnitFlags = UnitFlags.PlayerControlled;
			Experience = m_record.Xp;
			RestXp = m_record.RestXp;

			SetInt32(UnitFields.LEVEL, m_record.Level);
				// cannot use Level property, since it will trigger certain events that we don't want triggered
			NextLevelXP = XpGenerator.GetXpForlevel(m_record.Level + 1);
			MaxLevel = RealmServerConfiguration.MaxCharacterLevel;

			RestState = RestState.Normal;

			Orientation = m_record.Orientation;

			m_bindLocation = new WorldZoneLocation(
				m_record.BindMap,
				new Vector3(m_record.BindX, m_record.BindY, m_record.BindZ),
				m_record.BindZone);

			PvPRank = 1;
			YieldsXpOrHonor = true;

			foreach (var school in WCellDef.AllDamageSchools)
			{
				SetFloat(PlayerFields.MOD_DAMAGE_DONE_PCT + (int) school, 1);
			}
			SetFloat(PlayerFields.DODGE_PERCENTAGE, 1.0f);

			// Auras
			m_auras = new PlayerAuraCollection(this);

			// spells
			m_spells = PlayerSpellCollection.Obtain(this);

			// factions
			WatchedFaction = m_record.WatchedFaction;
			Faction = FactionMgr.ByRace[(uint) record.Race];
			m_reputations = new ReputationCollection(this);

			// skills
			m_skills = new SkillCollection(this);

			// talents
			m_talents = new PlayerTalentCollection(this);

			// achievements
			m_achievements = new AchievementCollection(this);

			// Items
			m_inventory = new PlayerInventory(this);

			m_mailAccount = new MailAccount(this);

			m_questLog = new QuestLog(this);

			// tutorial flags
			TutorialFlags = new TutorialFlags(m_record.TutorialFlags);

			// Make sure client and internal state is updated with combat base values
			UnitUpdates.UpdateSpellCritChance(this);

			// Mask of activated TaxiNodes
			m_taxiNodeMask = new TaxiNodeMask();

			PowerCostMultiplier = 1f;

			m_lastPlayTimeUpdate = DateTime.Now;

			MoveControl.Mover = this;
			MoveControl.CanControl = true;

			CanMelee = true;

			SpeedFactor = DefaultSpeedFactor;

			// basic setup
			if (record.JustCreated)
			{
				ModStatsForLevel(m_record.Level);
				BasePower = RegenerationFormulas.GetPowerForLevel(this);
			}
			else
			{
				BaseHealth = m_record.BaseHealth;
				SetBasePowerDontUpdate(m_record.BasePower);

				SetBaseStat(StatType.Strength, m_record.BaseStrength);
				SetBaseStat(StatType.Stamina, m_record.BaseStamina);
				SetBaseStat(StatType.Spirit, m_record.BaseSpirit);
				SetBaseStat(StatType.Intellect, m_record.BaseIntellect);
				SetBaseStat(StatType.Agility, m_record.BaseAgility);

				Power = m_record.Power;
				SetInt32(UnitFields.HEALTH, m_record.Health);
			}
		}
 public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
 {
     achievements.SetCriteriaProgress((AchievementCriteriaEntry)this,
                                      achievements.Owner.Reputations.GetExaltedReputations(), ProgressType.ProgressHighest);
 }
Esempio n. 27
0
 public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
 {
     achievements.SetCriteriaProgress(this, achievements.Owner.BankBagSlots, ProgressType.ProgressHighest);
 }
Esempio n. 28
0
 public virtual void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
 {
 }
Esempio n. 29
0
 public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
 {
     if (ZoneId == (ZoneId)value1)
         achievements.SetCriteriaProgress(this, value2);
 }
Esempio n. 30
0
        public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
        {
            if (value1 == 0 || value1 != (uint)emoteId)
                return;

            achievements.SetCriteriaProgress(this, 1, ProgressType.ProgressAccumulate);
        }
Esempio n. 31
0
 public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
 {
     if (value1 == 0)
         return;
     if (MapId != (MapId)value1)
         return;
     achievements.SetCriteriaProgress(this, value2, ProgressType.ProgressAccumulate);
 }
Esempio n. 32
0
 public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
 {
     achievements.SetCriteriaProgress(this, 1, ProgressType.ProgressAccumulate);
 }
 public virtual void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
 {
 }
Esempio n. 34
0
 public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
 {
     achievements.SetCriteriaProgress((AchievementCriteriaEntry)this, 1U, ProgressType.ProgressAccumulate);
 }
Esempio n. 35
0
 public override void OnUpdate(AchievementCollection achievements, uint value1, uint value2, ObjectBase involved)
 {
     if (!AchievementEntry.IsRealmFirstType() || AchievementCollection.ClassSpecificAchievementId[(int)achievements.Owner.Class] == AchievementEntryId
         || AchievementCollection.RaceSpecificAchievementId[(int)achievements.Owner.Race] == AchievementEntryId)
     {
         achievements.SetCriteriaProgress(this, value1);
     }
 }