public void SetPlayerGUID(ObjectGuid guid) { m_playerGUID = guid; }
public static AreaTrigger CreateAreaTrigger(uint spellMiscId, Unit caster, Unit target, SpellInfo spell, Position pos, int duration, uint spellXSpellVisualId, ObjectGuid castId = default, AuraEffect aurEff = null) { AreaTrigger at = new AreaTrigger(); if (!at.Create(spellMiscId, caster, target, spell, pos, duration, spellXSpellVisualId, castId, aurEff)) { return(null); } return(at); }
bool Create(ulong lowGuid, uint conversationEntry, Map map, Unit creator, Position pos, List <ObjectGuid> participants, SpellInfo spellInfo = null) { ConversationTemplate conversationTemplate = Global.ConversationDataStorage.GetConversationTemplate(conversationEntry); //ASSERT(conversationTemplate); _creatorGuid = creator.GetGUID(); _participants = participants; SetMap(map); Relocate(pos); _Create(ObjectGuid.Create(HighGuid.Conversation, GetMapId(), conversationEntry, lowGuid)); PhasingHandler.InheritPhaseShift(this, creator); SetEntry(conversationEntry); SetObjectScale(1.0f); SetUInt32Value(ConversationFields.LastLineEndTime, conversationTemplate.LastLineEndTime); _duration = conversationTemplate.LastLineEndTime; for (ushort actorIndex = 0; actorIndex < conversationTemplate.Actors.Count; ++actorIndex) { ConversationActorTemplate actor = conversationTemplate.Actors[actorIndex]; if (actor != null) { ConversationDynamicFieldActor actorField = new ConversationDynamicFieldActor(); actorField.ActorTemplate = actor; actorField.Type = ConversationDynamicFieldActor.ActorType.CreatureActor; SetDynamicStructuredValue(ConversationDynamicFields.Actors, actorIndex, actorField); } } for (ushort actorIndex = 0; actorIndex < conversationTemplate.ActorGuids.Count; ++actorIndex) { ulong actorGuid = conversationTemplate.ActorGuids[actorIndex]; if (actorGuid == 0) { continue; } foreach (var creature in map.GetCreatureBySpawnIdStore().LookupByKey(actorGuid)) { // we just need the last one, overriding is legit AddActor(creature.GetGUID(), actorIndex); } } Global.ScriptMgr.OnConversationCreate(this, creator); List <ushort> actorIndices = new List <ushort>(); foreach (ConversationLineTemplate line in conversationTemplate.Lines) { actorIndices.Add(line.ActorIdx); AddDynamicStructuredValue(ConversationDynamicFields.Lines, line); } // All actors need to be set foreach (ushort actorIndex in actorIndices) { ConversationDynamicFieldActor actor = GetDynamicStructuredValue <ConversationDynamicFieldActor>(ConversationDynamicFields.Actors, actorIndex); if (actor == null || actor.IsEmpty()) { Log.outError(LogFilter.Conversation, $"Failed to create conversation (Id: {conversationEntry}) due to missing actor (Idx: {actorIndex})."); return(false); } } if (!GetMap().AddToMap(this)) { return(false); } return(true); }
public void AddOutOfRangeGUID(ObjectGuid guid) { outOfRangeGUIDs.Add(guid); }
public Petition GetPetitionByOwner(ObjectGuid ownerGuid) { return(_petitionStorage.FirstOrDefault(p => p.Value.ownerGuid == ownerGuid).Value); }
public void Reset() { Guid = ObjectGuid.Empty; IsUnselectable = false; }
public void Set(ObjectGuid guid, uint pct) { _targetGUID = guid; _threatPct = pct; }
public void SetOwnerGUID(ObjectGuid owner) { SetUpdateFieldValue(m_values.ModifyValue(m_corpseData).ModifyValue(m_corpseData.Owner), owner); }
public void SetPartyGUID(ObjectGuid partyGuid) { SetUpdateFieldValue(m_values.ModifyValue(m_corpseData).ModifyValue(m_corpseData.PartyGUID), partyGuid); }
void AddParticipant(ObjectGuid participantGuid) { _participants.Add(participantGuid); }
public void SetDuelArbiter(ObjectGuid guid) { SetUpdateFieldValue(m_values.ModifyValue(m_playerData).ModifyValue(m_playerData.DuelArbiter), guid); }
bool Create(ulong lowGuid, uint conversationEntry, Map map, Unit creator, Position pos, List <ObjectGuid> participants, SpellInfo spellInfo = null) { ConversationTemplate conversationTemplate = Global.ConversationDataStorage.GetConversationTemplate(conversationEntry); //ASSERT(conversationTemplate); _creatorGuid = creator.GetGUID(); _participants = participants; SetMap(map); Relocate(pos); _Create(ObjectGuid.Create(HighGuid.Conversation, GetMapId(), conversationEntry, lowGuid)); PhasingHandler.InheritPhaseShift(this, creator); SetEntry(conversationEntry); SetObjectScale(1.0f); SetUpdateFieldValue(m_values.ModifyValue(m_conversationData).ModifyValue(m_conversationData.LastLineEndTime), conversationTemplate.LastLineEndTime); _duration = conversationTemplate.LastLineEndTime; _textureKitId = conversationTemplate.TextureKitId; for (ushort actorIndex = 0; actorIndex < conversationTemplate.Actors.Count; ++actorIndex) { ConversationActorTemplate actor = conversationTemplate.Actors[actorIndex]; if (actor != null) { ConversationActor actorField = new ConversationActor(); actorField.CreatureID = actor.CreatureId; actorField.CreatureDisplayInfoID = actor.CreatureModelId; actorField.Type = ConversationActorType.CreatureActor; AddDynamicUpdateFieldValue(m_values.ModifyValue(m_conversationData).ModifyValue(m_conversationData.Actors), actorField); } } for (ushort actorIndex = 0; actorIndex < conversationTemplate.ActorGuids.Count; ++actorIndex) { ulong actorGuid = conversationTemplate.ActorGuids[actorIndex]; if (actorGuid == 0) { continue; } foreach (var creature in map.GetCreatureBySpawnIdStore().LookupByKey(actorGuid)) { // we just need the last one, overriding is legit AddActor(creature.GetGUID(), actorIndex); } } Global.ScriptMgr.OnConversationCreate(this, creator); List <ushort> actorIndices = new List <ushort>(); List <ConversationLine> lines = new List <ConversationLine>(); foreach (ConversationLineTemplate line in conversationTemplate.Lines) { actorIndices.Add(line.ActorIdx); ConversationLine lineField = new ConversationLine(); lineField.ConversationLineID = line.Id; lineField.StartTime = line.StartTime; lineField.UiCameraID = line.UiCameraID; lineField.ActorIndex = line.ActorIdx; lineField.Flags = line.Flags; lines.Add(lineField); } SetUpdateFieldValue(m_values.ModifyValue(m_conversationData).ModifyValue(m_conversationData.Lines), lines); Global.ScriptMgr.OnConversationCreate(this, creator); // All actors need to be set foreach (ushort actorIndex in actorIndices) { ConversationActor actor = actorIndex < m_conversationData.Actors.Size() ? m_conversationData.Actors[actorIndex] : null; if (actor == null || (actor.CreatureID == 0 && actor.ActorGUID.IsEmpty() && actor.NoActorObject == 0)) { Log.outError(LogFilter.Conversation, $"Failed to create conversation (Id: {conversationEntry}) due to missing actor (Idx: {actorIndex})."); return(false); } } if (!GetMap().AddToMap(this)) { return(false); } return(true); }
public PartyResult CanUninviteFromGroup(ObjectGuid guidMember = default(ObjectGuid)) { Group grp = GetGroup(); if (!grp) { return(PartyResult.NotInGroup); } if (grp.isLFGGroup()) { ObjectGuid gguid = grp.GetGUID(); if (Global.LFGMgr.GetKicksLeft(gguid) == 0) { return(PartyResult.PartyLfgBootLimit); } LfgState state = Global.LFGMgr.GetState(gguid); if (Global.LFGMgr.IsVoteKickActive(gguid)) { return(PartyResult.PartyLfgBootInProgress); } if (grp.GetMembersCount() <= SharedConst.LFGKickVotesNeeded) { return(PartyResult.PartyLfgBootTooFewPlayers); } if (state == LfgState.FinishedDungeon) { return(PartyResult.PartyLfgBootDungeonComplete); } if (grp.isRollLootActive()) { return(PartyResult.PartyLfgBootLootRolls); } // @todo Should also be sent when anyone has recently left combat, with an aprox ~5 seconds timer. for (GroupReference refe = grp.GetFirstMember(); refe != null; refe = refe.next()) { if (refe.GetSource() && refe.GetSource().IsInCombat()) { return(PartyResult.PartyLfgBootInCombat); } } /* Missing support for these types * return ERR_PARTY_LFG_BOOT_COOLDOWN_S; * return ERR_PARTY_LFG_BOOT_NOT_ELIGIBLE_S; */ } else { if (!grp.IsLeader(GetGUID()) && !grp.IsAssistant(GetGUID())) { return(PartyResult.NotLeader); } if (InBattleground()) { return(PartyResult.InviteRestricted); } if (grp.IsLeader(guidMember)) { return(PartyResult.NotLeader); } } return(PartyResult.Ok); }
public static void RemoveFromGroup(Group group, ObjectGuid guid, RemoveMethod method = RemoveMethod.Default, ObjectGuid kicker = default(ObjectGuid), string reason = null) { if (!group) { return; } group.RemoveMember(guid, method, kicker, reason); }
public void GetFriendInfo(Player player, ObjectGuid friendGUID, FriendInfo friendInfo) { if (!player) { return; } friendInfo.Status = FriendStatus.Offline; friendInfo.Area = 0; friendInfo.Level = 0; friendInfo.Class = 0; Player target = Global.ObjAccessor.FindPlayer(friendGUID); if (!target) { return; } var playerFriendInfo = player.GetSocial()._playerSocialMap.LookupByKey(friendGUID); if (playerFriendInfo != null) { friendInfo.Note = playerFriendInfo.Note; } // PLAYER see his team only and PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters // MODERATOR, GAME MASTER, ADMINISTRATOR can see all if (!player.GetSession().HasPermission(RBACPermissions.WhoSeeAllSecLevels) && target.GetSession().GetSecurity() > (AccountTypes)WorldConfig.GetIntValue(WorldCfg.GmLevelInWhoList)) { return; } // player can see member of other team only if CONFIG_ALLOW_TWO_SIDE_WHO_LIST if (target.GetTeam() != player.GetTeam() && !player.GetSession().HasPermission(RBACPermissions.TwoSideWhoList)) { return; } if (target.IsVisibleGloballyFor(player)) { if (target.isDND()) { friendInfo.Status = FriendStatus.DND; } else if (target.isAFK()) { friendInfo.Status = FriendStatus.AFK; } else { friendInfo.Status = FriendStatus.Online; } friendInfo.Area = target.GetZoneId(); friendInfo.Level = target.getLevel(); friendInfo.Class = target.GetClass(); } }
public void SetGuildGUID(ObjectGuid guildGuid) { SetUpdateFieldValue(m_values.ModifyValue(m_corpseData).ModifyValue(m_corpseData.GuildGUID), guildGuid); }
public void Reset() { Guid = ObjectGuid.Empty; IsUnselectable = false; IsGravityDisabled = false; }
public bool Create(ulong guidlow, Map map) { _Create(ObjectGuid.Create(HighGuid.Corpse, map.GetId(), 0, guidlow)); return(true); }
public SpellNonMeleeDamage(Unit _attacker, Unit _target, SpellInfo _spellInfo, uint _SpellXSpellVisualID, SpellSchoolMask _schoolMask, ObjectGuid _castId = default) { target = _target; attacker = _attacker; Spell = _spellInfo; SpellXSpellVisualID = _SpellXSpellVisualID; schoolMask = _schoolMask; castId = _castId; preHitHealth = (uint)_target.GetHealth(); }
bool Create(uint spellMiscId, Unit caster, Unit target, SpellInfo spell, Position pos, int duration, uint spellXSpellVisualId, ObjectGuid castId, AuraEffect aurEff) { _targetGuid = target ? target.GetGUID() : ObjectGuid.Empty; _aurEff = aurEff; SetMap(caster.GetMap()); Relocate(pos); if (!IsPositionValid()) { Log.outError(LogFilter.AreaTrigger, "AreaTrigger (spell {0}) not created. Invalid coordinates (X: {0} Y: {1})", spell.Id, GetPositionX(), GetPositionY()); return(false); } _areaTriggerMiscTemplate = Global.AreaTriggerDataStorage.GetAreaTriggerMiscTemplate(spellMiscId); if (_areaTriggerMiscTemplate == null) { Log.outError(LogFilter.AreaTrigger, "AreaTrigger (spellMiscId {0}) not created. Invalid areatrigger miscid ({1})", spellMiscId, spellMiscId); return(false); } _Create(ObjectGuid.Create(HighGuid.AreaTrigger, GetMapId(), GetTemplate().Id, caster.GetMap().GenerateLowGuid(HighGuid.AreaTrigger))); SetEntry(GetTemplate().Id); SetDuration(duration); SetObjectScale(1.0f); SetGuidValue(AreaTriggerFields.Caster, caster.GetGUID()); SetGuidValue(AreaTriggerFields.CreatingEffectGuid, castId); SetUInt32Value(AreaTriggerFields.SpellId, spell.Id); SetUInt32Value(AreaTriggerFields.SpellForVisuals, spell.Id); SetUInt32Value(AreaTriggerFields.SpellXSpellVisualId, spellXSpellVisualId); SetUInt32Value(AreaTriggerFields.TimeToTargetScale, GetMiscTemplate().TimeToTargetScale != 0 ? GetMiscTemplate().TimeToTargetScale : GetUInt32Value(AreaTriggerFields.Duration)); SetFloatValue(AreaTriggerFields.BoundsRadius2d, GetTemplate().MaxSearchRadius); SetUInt32Value(AreaTriggerFields.DecalPropertiesId, GetMiscTemplate().DecalPropertiesId); for (byte scaleCurveIndex = 0; scaleCurveIndex < SharedConst.MaxAreatriggerScale; ++scaleCurveIndex) { if (GetMiscTemplate().ScaleInfo.ExtraScale[scaleCurveIndex].AsInt32 != 0) { SetUInt32Value(AreaTriggerFields.ExtraScaleCurve + scaleCurveIndex, (uint)GetMiscTemplate().ScaleInfo.ExtraScale[scaleCurveIndex].AsInt32); } } PhasingHandler.InheritPhaseShift(this, caster); if (target && GetTemplate().HasFlag(AreaTriggerFlags.HasAttached)) { m_movementInfo.transport.guid = target.GetGUID(); } UpdateShape(); if (GetMiscTemplate().HasSplines()) { uint timeToTarget = GetMiscTemplate().TimeToTarget != 0 ? GetMiscTemplate().TimeToTarget : GetUInt32Value(AreaTriggerFields.Duration); InitSplineOffsets(GetMiscTemplate().SplinePoints, timeToTarget); } // movement on transport of areatriggers on unit is handled by themself Transport transport = m_movementInfo.transport.guid.IsEmpty() ? caster.GetTransport() : null; if (transport) { float x, y, z, o; pos.GetPosition(out x, out y, out z, out o); transport.CalculatePassengerOffset(ref x, ref y, ref z, ref o); m_movementInfo.transport.pos.Relocate(x, y, z, o); // This object must be added to transport before adding to map for the client to properly display it transport.AddPassenger(this); } AI_Initialize(); if (!GetMap().AddToMap(this)) { // Returning false will cause the object to be deleted - remove from transport if (transport) { transport.RemovePassenger(this); } return(false); } caster._RegisterAreaTrigger(this); _ai.OnCreate(); return(true); }
public void AddDestroyObject(ObjectGuid guid) { destroyGUIDs.Add(guid); }
public void RemovePlayerSocial(ObjectGuid guid) { _socialMap.Remove(guid); }
public Petition GetPetition(ObjectGuid petitionGuid) { return(_petitionStorage.LookupByKey(petitionGuid)); }
public bool HasFriend(ObjectGuid friendGuid) { return(_HasContact(friendGuid, SocialFlag.Friend)); }
public void LoadPetitions() { uint oldMSTime = Time.GetMSTime(); _petitionStorage.Clear(); SQLResult result = DB.Characters.Query("SELECT petitionguid, ownerguid, name FROM petition"); if (result.IsEmpty()) { Log.outInfo(LogFilter.ServerLoading, "Loaded 0 petitions."); return; } uint count = 0; do { AddPetition(ObjectGuid.Create(HighGuid.Item, result.Read <ulong>(0)), ObjectGuid.Create(HighGuid.Player, result.Read <ulong>(1)), result.Read <string>(2), true); ++count; } while (result.NextRow()); Log.outInfo(LogFilter.ServerLoading, $"Loaded {count} petitions in: {Time.GetMSTimeDiffToNow(oldMSTime)} ms."); }
public bool HasIgnore(ObjectGuid ignoreGuid) { return(_HasContact(ignoreGuid, SocialFlag.Ignored)); }
unsafe bool Create(uint spellMiscId, Unit caster, Unit target, SpellInfo spell, Position pos, int duration, uint spellXSpellVisualId, ObjectGuid castId, AuraEffect aurEff) { _targetGuid = target ? target.GetGUID() : ObjectGuid.Empty; _aurEff = aurEff; SetMap(caster.GetMap()); Relocate(pos); if (!IsPositionValid()) { Log.outError(LogFilter.AreaTrigger, $"AreaTrigger (spell {spell.Id}) not created. Invalid coordinates (X: {GetPositionX()} Y: {GetPositionY()})"); return(false); } _areaTriggerMiscTemplate = Global.AreaTriggerDataStorage.GetAreaTriggerMiscTemplate(spellMiscId); if (_areaTriggerMiscTemplate == null) { Log.outError(LogFilter.AreaTrigger, "AreaTrigger (spellMiscId {0}) not created. Invalid areatrigger miscid ({1})", spellMiscId, spellMiscId); return(false); } _Create(ObjectGuid.Create(HighGuid.AreaTrigger, GetMapId(), GetTemplate().Id, caster.GetMap().GenerateLowGuid(HighGuid.AreaTrigger))); SetEntry(GetTemplate().Id); SetDuration(duration); SetObjectScale(1.0f); SetUpdateFieldValue(m_values.ModifyValue(m_areaTriggerData).ModifyValue(m_areaTriggerData.Caster), caster.GetGUID()); SetUpdateFieldValue(m_values.ModifyValue(m_areaTriggerData).ModifyValue(m_areaTriggerData.CreatingEffectGUID), castId); SetUpdateFieldValue(m_values.ModifyValue(m_areaTriggerData).ModifyValue(m_areaTriggerData.SpellID), spell.Id); SetUpdateFieldValue(m_values.ModifyValue(m_areaTriggerData).ModifyValue(m_areaTriggerData.SpellForVisuals), spell.Id); SetUpdateFieldValue(m_values.ModifyValue(m_areaTriggerData).ModifyValue(m_areaTriggerData.SpellXSpellVisualID), spellXSpellVisualId); SetUpdateFieldValue(m_values.ModifyValue(m_areaTriggerData).ModifyValue(m_areaTriggerData.TimeToTargetScale), GetMiscTemplate().TimeToTargetScale != 0 ? GetMiscTemplate().TimeToTargetScale : m_areaTriggerData.Duration); SetUpdateFieldValue(m_values.ModifyValue(m_areaTriggerData).ModifyValue(m_areaTriggerData.BoundsRadius2D), GetTemplate().MaxSearchRadius); SetUpdateFieldValue(m_values.ModifyValue(m_areaTriggerData).ModifyValue(m_areaTriggerData.DecalPropertiesID), GetMiscTemplate().DecalPropertiesId); ScaleCurve extraScaleCurve = m_values.ModifyValue(m_areaTriggerData).ModifyValue(m_areaTriggerData.ExtraScaleCurve); if (GetMiscTemplate().ExtraScale.Structured.StartTimeOffset != 0) { SetUpdateFieldValue(extraScaleCurve.ModifyValue(extraScaleCurve.StartTimeOffset), GetMiscTemplate().ExtraScale.Structured.StartTimeOffset); } if (GetMiscTemplate().ExtraScale.Structured.X != 0 || GetMiscTemplate().ExtraScale.Structured.Y != 0) { Vector2 point = new Vector2(GetMiscTemplate().ExtraScale.Structured.X, GetMiscTemplate().ExtraScale.Structured.Y); SetUpdateFieldValue(ref extraScaleCurve.ModifyValue(extraScaleCurve.Points, 0), point); } if (GetMiscTemplate().ExtraScale.Structured.Z != 0 || GetMiscTemplate().ExtraScale.Structured.W != 0) { Vector2 point = new Vector2(GetMiscTemplate().ExtraScale.Structured.Z, GetMiscTemplate().ExtraScale.Structured.W); SetUpdateFieldValue(ref extraScaleCurve.ModifyValue(extraScaleCurve.Points, 1), point); } if (GetMiscTemplate().ExtraScale.Raw.Data[5] != 0) { SetUpdateFieldValue(extraScaleCurve.ModifyValue(extraScaleCurve.ParameterCurve), GetMiscTemplate().ExtraScale.Raw.Data[5]); } if (GetMiscTemplate().ExtraScale.Structured.OverrideActive != 0) { SetUpdateFieldValue(extraScaleCurve.ModifyValue(extraScaleCurve.OverrideActive), GetMiscTemplate().ExtraScale.Structured.OverrideActive != 0 ? true : false); } PhasingHandler.InheritPhaseShift(this, caster); if (target && GetTemplate().HasFlag(AreaTriggerFlags.HasAttached)) { m_movementInfo.transport.guid = target.GetGUID(); } UpdateShape(); uint timeToTarget = GetMiscTemplate().TimeToTarget != 0 ? GetMiscTemplate().TimeToTarget : m_areaTriggerData.Duration; if (GetTemplate().HasFlag(AreaTriggerFlags.HasCircularMovement)) { AreaTriggerCircularMovementInfo cmi = GetMiscTemplate().CircularMovementInfo; if (target && GetTemplate().HasFlag(AreaTriggerFlags.HasAttached)) { cmi.PathTarget.Set(target.GetGUID()); } else { cmi.Center.Set(new Vector3(pos.posX, pos.posY, pos.posZ)); } InitCircularMovement(cmi, timeToTarget); } else if (GetMiscTemplate().HasSplines()) { InitSplineOffsets(GetMiscTemplate().SplinePoints, timeToTarget); } // movement on transport of areatriggers on unit is handled by themself Transport transport = m_movementInfo.transport.guid.IsEmpty() ? caster.GetTransport() : null; if (transport) { float x, y, z, o; pos.GetPosition(out x, out y, out z, out o); transport.CalculatePassengerOffset(ref x, ref y, ref z, ref o); m_movementInfo.transport.pos.Relocate(x, y, z, o); // This object must be added to transport before adding to map for the client to properly display it transport.AddPassenger(this); } AI_Initialize(); // Relocate areatriggers with circular movement again if (HasCircularMovement()) { Relocate(CalculateCircularMovementPosition()); } if (!GetMap().AddToMap(this)) { // Returning false will cause the object to be deleted - remove from transport if (transport) { transport.RemovePassenger(this); } return(false); } caster._RegisterAreaTrigger(this); _ai.OnCreate(); return(true); }
public bool Satisfy(AccessRequirement ar, uint target_map, bool report = false) { if (!IsGameMaster()) { byte LevelMin = 0; byte LevelMax = 0; uint failedMapDifficultyXCondition = 0; uint missingItem = 0; uint missingQuest = 0; uint missingAchievement = 0; MapRecord mapEntry = CliDB.MapStorage.LookupByKey(target_map); if (mapEntry == null) { return(false); } Difficulty target_difficulty = GetDifficultyID(mapEntry); MapDifficultyRecord mapDiff = Global.DB2Mgr.GetDownscaledMapDifficultyData(target_map, ref target_difficulty); if (!WorldConfig.GetBoolValue(WorldCfg.InstanceIgnoreLevel)) { var mapDifficultyConditions = Global.DB2Mgr.GetMapDifficultyConditions(mapDiff.Id); foreach (var pair in mapDifficultyConditions) { if (!ConditionManager.IsPlayerMeetingCondition(this, pair.Item2)) { failedMapDifficultyXCondition = pair.Item1; break; } } } if (ar != null) { if (!WorldConfig.GetBoolValue(WorldCfg.InstanceIgnoreLevel)) { if (ar.levelMin != 0 && GetLevel() < ar.levelMin) { LevelMin = ar.levelMin; } if (ar.levelMax != 0 && GetLevel() > ar.levelMax) { LevelMax = ar.levelMax; } } if (ar.item != 0) { if (!HasItemCount(ar.item) && (ar.item2 == 0 || !HasItemCount(ar.item2))) { missingItem = ar.item; } } else if (ar.item2 != 0 && !HasItemCount(ar.item2)) { missingItem = ar.item2; } if (Global.DisableMgr.IsDisabledFor(DisableType.Map, target_map, this)) { GetSession().SendNotification("{0}", Global.ObjectMgr.GetCypherString(CypherStrings.InstanceClosed)); return(false); } if (GetTeam() == Team.Alliance && ar.quest_A != 0 && !GetQuestRewardStatus(ar.quest_A)) { missingQuest = ar.quest_A; } else if (GetTeam() == Team.Horde && ar.quest_H != 0 && !GetQuestRewardStatus(ar.quest_H)) { missingQuest = ar.quest_H; } Player leader = this; ObjectGuid leaderGuid = GetGroup() != null?GetGroup().GetLeaderGUID() : GetGUID(); if (leaderGuid != GetGUID()) { leader = Global.ObjAccessor.FindPlayer(leaderGuid); } if (ar.achievement != 0) { if (leader == null || !leader.HasAchieved(ar.achievement)) { missingAchievement = ar.achievement; } } } if (LevelMin != 0 || LevelMax != 0 || failedMapDifficultyXCondition != 0 || missingItem != 0 || missingQuest != 0 || missingAchievement != 0) { if (report) { if (missingQuest != 0 && !string.IsNullOrEmpty(ar.questFailedText)) { SendSysMessage("{0}", ar.questFailedText); } else if (mapDiff.Message[Global.WorldMgr.GetDefaultDbcLocale()][0] != '\0' || failedMapDifficultyXCondition != 0) // if (missingAchievement) covered by this case { SendTransferAborted(target_map, TransferAbortReason.Difficulty, (byte)target_difficulty, failedMapDifficultyXCondition); } else if (missingItem != 0) { GetSession().SendNotification(Global.ObjectMgr.GetCypherString(CypherStrings.LevelMinrequiredAndItem), LevelMin, Global.ObjectMgr.GetItemTemplate(missingItem).GetName()); } else if (LevelMin != 0) { GetSession().SendNotification(Global.ObjectMgr.GetCypherString(CypherStrings.LevelMinrequired), LevelMin); } } return(false); } } return(true); }