Some refactoring of code. and some cleanups
This commit is contained in:
@@ -49,7 +49,7 @@ namespace Game
|
||||
|
||||
public void SendAuctionHello(ObjectGuid guid, Creature unit)
|
||||
{
|
||||
if (GetPlayer().getLevel() < WorldConfig.GetIntValue(WorldCfg.AuctionLevelReq))
|
||||
if (GetPlayer().GetLevel() < WorldConfig.GetIntValue(WorldCfg.AuctionLevelReq))
|
||||
{
|
||||
SendNotification(Global.ObjectMgr.GetCypherString(CypherStrings.AuctionReq), WorldConfig.GetIntValue(WorldCfg.AuctionLevelReq));
|
||||
return;
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace Game
|
||||
public void SendBfEntered(ulong queueId, bool relocated, bool onOffense)
|
||||
{
|
||||
BFMgrEntering bfMgrEntering = new BFMgrEntering();
|
||||
bfMgrEntering.ClearedAFK = _player.isAFK();
|
||||
bfMgrEntering.ClearedAFK = _player.IsAFK();
|
||||
bfMgrEntering.Relocated = relocated;
|
||||
bfMgrEntering.OnOffense = onOffense;
|
||||
bfMgrEntering.QueueID = queueId;
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace Game
|
||||
return;
|
||||
|
||||
// expected bracket entry
|
||||
PvpDifficultyRecord bracketEntry = Global.DB2Mgr.GetBattlegroundBracketByLevel(bg.GetMapId(), GetPlayer().getLevel());
|
||||
PvpDifficultyRecord bracketEntry = Global.DB2Mgr.GetBattlegroundBracketByLevel(bg.GetMapId(), GetPlayer().GetLevel());
|
||||
if (bracketEntry == null)
|
||||
return;
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace Game
|
||||
// check queue conditions
|
||||
if (grp == null)
|
||||
{
|
||||
if (GetPlayer().isUsingLfg())
|
||||
if (GetPlayer().IsUsingLfg())
|
||||
{
|
||||
Global.BattlegroundMgr.BuildBattlegroundStatusFailed(out battlefieldStatusFailed, bg, GetPlayer(), 0, 0, GroupJoinBattlegroundResult.LfgCantUseBattleground);
|
||||
SendPacket(battlefieldStatusFailed);
|
||||
@@ -303,7 +303,7 @@ namespace Game
|
||||
bgTypeId = bg.GetTypeID();
|
||||
|
||||
// expected bracket entry
|
||||
PvpDifficultyRecord bracketEntry = Global.DB2Mgr.GetBattlegroundBracketByLevel(bg.GetMapId(), GetPlayer().getLevel());
|
||||
PvpDifficultyRecord bracketEntry = Global.DB2Mgr.GetBattlegroundBracketByLevel(bg.GetMapId(), GetPlayer().GetLevel());
|
||||
if (bracketEntry == null)
|
||||
return;
|
||||
|
||||
@@ -321,10 +321,10 @@ namespace Game
|
||||
Log.outDebug(LogFilter.Battleground, "Player {0} ({1}) has a deserter debuff, do not port him to Battleground!", GetPlayer().GetName(), GetPlayer().GetGUID().ToString());
|
||||
}
|
||||
//if player don't match Battlegroundmax level, then do not allow him to enter! (this might happen when player leveled up during his waiting in queue
|
||||
if (GetPlayer().getLevel() > bg.GetMaxLevel())
|
||||
if (GetPlayer().GetLevel() > bg.GetMaxLevel())
|
||||
{
|
||||
Log.outDebug(LogFilter.Network, "Player {0} ({1}) has level ({2}) higher than maxlevel ({3}) of Battleground({4})! Do not port him to Battleground!",
|
||||
GetPlayer().GetName(), GetPlayer().GetGUID().ToString(), GetPlayer().getLevel(), bg.GetMaxLevel(), bg.GetTypeID());
|
||||
GetPlayer().GetName(), GetPlayer().GetGUID().ToString(), GetPlayer().GetLevel(), bg.GetMaxLevel(), bg.GetTypeID());
|
||||
battlefieldPort.AcceptedInvite = false;
|
||||
}
|
||||
}
|
||||
@@ -467,7 +467,7 @@ namespace Game
|
||||
continue;
|
||||
|
||||
// expected bracket entry
|
||||
PvpDifficultyRecord bracketEntry = Global.DB2Mgr.GetBattlegroundBracketByLevel(bg.GetMapId(), GetPlayer().getLevel());
|
||||
PvpDifficultyRecord bracketEntry = Global.DB2Mgr.GetBattlegroundBracketByLevel(bg.GetMapId(), GetPlayer().GetLevel());
|
||||
if (bracketEntry == null)
|
||||
continue;
|
||||
|
||||
@@ -504,7 +504,7 @@ namespace Game
|
||||
|
||||
BattlegroundTypeId bgTypeId = bg.GetTypeID();
|
||||
BattlegroundQueueTypeId bgQueueTypeId = Global.BattlegroundMgr.BGQueueTypeId(bgTypeId, arenatype);
|
||||
PvpDifficultyRecord bracketEntry = Global.DB2Mgr.GetBattlegroundBracketByLevel(bg.GetMapId(), GetPlayer().getLevel());
|
||||
PvpDifficultyRecord bracketEntry = Global.DB2Mgr.GetBattlegroundBracketByLevel(bg.GetMapId(), GetPlayer().GetLevel());
|
||||
if (bracketEntry == null)
|
||||
return;
|
||||
|
||||
|
||||
@@ -450,7 +450,7 @@ namespace Game
|
||||
}
|
||||
|
||||
if ((haveSameRace && skipCinematics == 1) || skipCinematics == 2)
|
||||
newChar.setCinematic(1); // not show intro
|
||||
newChar.SetCinematic(1); // not show intro
|
||||
|
||||
newChar.atLoginFlags = AtLoginFlags.FirstLogin; // First login
|
||||
|
||||
@@ -478,7 +478,7 @@ namespace Game
|
||||
|
||||
Log.outInfo(LogFilter.Player, "Account: {0} (IP: {1}) Create Character: {2} {3}", GetAccountId(), GetRemoteAddress(), createInfo.Name, newChar.GetGUID().ToString());
|
||||
Global.ScriptMgr.OnPlayerCreate(newChar);
|
||||
Global.CharacterCacheStorage.AddCharacterCacheEntry(newChar.GetGUID(), GetAccountId(), newChar.GetName(), newChar.m_playerData.NativeSex, (byte)newChar.GetRace(), (byte)newChar.GetClass(), (byte)newChar.getLevel(), false);
|
||||
Global.CharacterCacheStorage.AddCharacterCacheEntry(newChar.GetGUID(), GetAccountId(), newChar.GetName(), newChar.m_playerData.NativeSex, (byte)newChar.GetRace(), (byte)newChar.GetClass(), (byte)newChar.GetLevel(), false);
|
||||
|
||||
newChar.CleanupsBeforeDelete();
|
||||
}
|
||||
@@ -710,9 +710,9 @@ namespace Game
|
||||
pCurrChar.SendInitialPacketsBeforeAddToMap();
|
||||
|
||||
//Show cinematic at the first time that player login
|
||||
if (pCurrChar.getCinematic() == 0)
|
||||
if (pCurrChar.GetCinematic() == 0)
|
||||
{
|
||||
pCurrChar.setCinematic(1);
|
||||
pCurrChar.SetCinematic(1);
|
||||
ChrClassesRecord cEntry = CliDB.ChrClassesStorage.LookupByKey(pCurrChar.GetClass());
|
||||
if (cEntry != null)
|
||||
{
|
||||
@@ -776,7 +776,7 @@ namespace Game
|
||||
pCurrChar.LoadCorpse(holder.GetResult(PlayerLoginQueryLoad.CorpseLocation));
|
||||
|
||||
// setting Ghost+speed if dead
|
||||
if (pCurrChar.getDeathState() != DeathState.Alive)
|
||||
if (pCurrChar.GetDeathState() != DeathState.Alive)
|
||||
{
|
||||
// not blizz like, we must correctly save and load player instead...
|
||||
if (pCurrChar.GetRace() == Race.NightElf && !pCurrChar.HasAura(20584))
|
||||
@@ -850,7 +850,7 @@ namespace Game
|
||||
|
||||
string IP_str = GetRemoteAddress();
|
||||
Log.outDebug(LogFilter.Network, "Account: {0} (IP: {1}) Login Character:[{2}] ({3}) Level: {4}",
|
||||
GetAccountId(), IP_str, pCurrChar.GetName(), pCurrChar.GetGUID().ToString(), pCurrChar.getLevel());
|
||||
GetAccountId(), IP_str, pCurrChar.GetName(), pCurrChar.GetGUID().ToString(), pCurrChar.GetLevel());
|
||||
|
||||
if (!pCurrChar.IsStandState() && !pCurrChar.HasUnitState(UnitState.Stunned))
|
||||
pCurrChar.SetStandState(UnitStandStateType.Stand);
|
||||
@@ -2159,7 +2159,7 @@ namespace Game
|
||||
// creatures can kill players
|
||||
// so if the server is lagging enough the player can
|
||||
// release spirit after he's killed but before he is updated
|
||||
if (GetPlayer().getDeathState() == DeathState.JustDied)
|
||||
if (GetPlayer().GetDeathState() == DeathState.JustDied)
|
||||
{
|
||||
Log.outDebug(LogFilter.Network, "HandleRepopRequestOpcode: got request after player {0} ({1}) was killed and before he was updated",
|
||||
GetPlayer().GetName(), GetPlayer().GetGUID().ToString());
|
||||
@@ -2284,7 +2284,7 @@ namespace Game
|
||||
GetPlayer().SetStandState(packet.StandState);
|
||||
}
|
||||
|
||||
void SendCharCreate(ResponseCodes result, ObjectGuid guid = default(ObjectGuid))
|
||||
void SendCharCreate(ResponseCodes result, ObjectGuid guid = default)
|
||||
{
|
||||
CreateChar response = new CreateChar();
|
||||
response.Code = result;
|
||||
|
||||
@@ -192,7 +192,7 @@ namespace Game
|
||||
if (!sender.IsAlive())
|
||||
return;
|
||||
|
||||
if (sender.getLevel() < WorldConfig.GetIntValue(WorldCfg.ChatSayLevelReq))
|
||||
if (sender.GetLevel() < WorldConfig.GetIntValue(WorldCfg.ChatSayLevelReq))
|
||||
{
|
||||
SendNotification(Global.ObjectMgr.GetCypherString(CypherStrings.SayReq), WorldConfig.GetIntValue(WorldCfg.ChatSayLevelReq));
|
||||
return;
|
||||
@@ -205,7 +205,7 @@ namespace Game
|
||||
if (!sender.IsAlive())
|
||||
return;
|
||||
|
||||
if (sender.getLevel() < WorldConfig.GetIntValue(WorldCfg.ChatEmoteLevelReq))
|
||||
if (sender.GetLevel() < WorldConfig.GetIntValue(WorldCfg.ChatEmoteLevelReq))
|
||||
{
|
||||
SendNotification(Global.ObjectMgr.GetCypherString(CypherStrings.SayReq), WorldConfig.GetIntValue(WorldCfg.ChatEmoteLevelReq));
|
||||
return;
|
||||
@@ -218,7 +218,7 @@ namespace Game
|
||||
if (!sender.IsAlive())
|
||||
return;
|
||||
|
||||
if (sender.getLevel() < WorldConfig.GetIntValue(WorldCfg.ChatYellLevelReq))
|
||||
if (sender.GetLevel() < WorldConfig.GetIntValue(WorldCfg.ChatYellLevelReq))
|
||||
{
|
||||
SendNotification(Global.ObjectMgr.GetCypherString(CypherStrings.SayReq), WorldConfig.GetIntValue(WorldCfg.ChatYellLevelReq));
|
||||
return;
|
||||
@@ -237,12 +237,12 @@ namespace Game
|
||||
}
|
||||
|
||||
Player receiver = Global.ObjAccessor.FindPlayerByName(extName.Name);
|
||||
if (!receiver || (lang != Language.Addon && !receiver.isAcceptWhispers() && receiver.GetSession().HasPermission(RBACPermissions.CanFilterWhispers) && !receiver.IsInWhisperWhiteList(sender.GetGUID())))
|
||||
if (!receiver || (lang != Language.Addon && !receiver.IsAcceptWhispers() && receiver.GetSession().HasPermission(RBACPermissions.CanFilterWhispers) && !receiver.IsInWhisperWhiteList(sender.GetGUID())))
|
||||
{
|
||||
SendChatPlayerNotfoundNotice(target);
|
||||
return;
|
||||
}
|
||||
if (!sender.IsGameMaster() && sender.getLevel() < WorldConfig.GetIntValue(WorldCfg.ChatWhisperLevelReq) && !receiver.IsInWhisperWhiteList(sender.GetGUID()))
|
||||
if (!sender.IsGameMaster() && sender.GetLevel() < WorldConfig.GetIntValue(WorldCfg.ChatWhisperLevelReq) && !receiver.IsInWhisperWhiteList(sender.GetGUID()))
|
||||
{
|
||||
SendNotification(Global.ObjectMgr.GetCypherString(CypherStrings.WhisperReq), WorldConfig.GetIntValue(WorldCfg.ChatWhisperLevelReq));
|
||||
return;
|
||||
@@ -260,8 +260,8 @@ namespace Game
|
||||
return;
|
||||
}
|
||||
|
||||
if (receiver.getLevel() < WorldConfig.GetIntValue(WorldCfg.ChatWhisperLevelReq) ||
|
||||
(HasPermission(RBACPermissions.CanFilterWhispers) && !sender.isAcceptWhispers() && !sender.IsInWhisperWhiteList(receiver.GetGUID())))
|
||||
if (receiver.GetLevel() < WorldConfig.GetIntValue(WorldCfg.ChatWhisperLevelReq) ||
|
||||
(HasPermission(RBACPermissions.CanFilterWhispers) && !sender.IsAcceptWhispers() && !sender.IsInWhisperWhiteList(receiver.GetGUID())))
|
||||
sender.AddWhisperWhiteList(receiver.GetGUID());
|
||||
|
||||
GetPlayer().Whisper(msg, lang, receiver);
|
||||
@@ -344,7 +344,7 @@ namespace Game
|
||||
case ChatMsg.Channel:
|
||||
if (!HasPermission(RBACPermissions.SkipCheckChatChannelReq))
|
||||
{
|
||||
if (GetPlayer().getLevel() < WorldConfig.GetIntValue(WorldCfg.ChatChannelLevelReq))
|
||||
if (GetPlayer().GetLevel() < WorldConfig.GetIntValue(WorldCfg.ChatChannelLevelReq))
|
||||
{
|
||||
SendNotification(Global.ObjectMgr.GetCypherString(CypherStrings.ChannelReq), WorldConfig.GetIntValue(WorldCfg.ChatChannelLevelReq));
|
||||
return;
|
||||
@@ -477,7 +477,7 @@ namespace Game
|
||||
return;
|
||||
}
|
||||
|
||||
if (sender.isAFK()) // Already AFK
|
||||
if (sender.IsAFK()) // Already AFK
|
||||
{
|
||||
if (string.IsNullOrEmpty(packet.Text))
|
||||
sender.ToggleAFK(); // Remove AFK
|
||||
@@ -488,7 +488,7 @@ namespace Game
|
||||
{
|
||||
sender.autoReplyMsg = string.IsNullOrEmpty(packet.Text) ? Global.ObjectMgr.GetCypherString(CypherStrings.PlayerAfkDefault) : packet.Text;
|
||||
|
||||
if (sender.isDND())
|
||||
if (sender.IsDND())
|
||||
sender.ToggleDND();
|
||||
|
||||
sender.ToggleAFK();
|
||||
@@ -511,7 +511,7 @@ namespace Game
|
||||
return;
|
||||
}
|
||||
|
||||
if (sender.isDND()) // Already DND
|
||||
if (sender.IsDND()) // Already DND
|
||||
{
|
||||
if (string.IsNullOrEmpty(packet.Text))
|
||||
sender.ToggleDND(); // Remove DND
|
||||
@@ -522,7 +522,7 @@ namespace Game
|
||||
{
|
||||
sender.autoReplyMsg = string.IsNullOrEmpty(packet.Text) ? Global.ObjectMgr.GetCypherString(CypherStrings.PlayerDndDefault) : packet.Text;
|
||||
|
||||
if (sender.isAFK())
|
||||
if (sender.IsAFK())
|
||||
sender.ToggleAFK();
|
||||
|
||||
sender.ToggleDND();
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace Game
|
||||
return;
|
||||
}
|
||||
|
||||
if (!player.GetSocial().HasFriend(GetPlayer().GetGUID()) && GetPlayer().getLevel() < WorldConfig.GetIntValue(WorldCfg.PartyLevelReq))
|
||||
if (!player.GetSocial().HasFriend(GetPlayer().GetGUID()) && GetPlayer().GetLevel() < WorldConfig.GetIntValue(WorldCfg.PartyLevelReq))
|
||||
{
|
||||
SendPartyResult(PartyOperation.Invite, player.GetName(), PartyResult.InviteRestricted);
|
||||
return;
|
||||
|
||||
@@ -20,7 +20,6 @@ using Game.Entities;
|
||||
using Game.Guilds;
|
||||
using Game.Network;
|
||||
using Game.Network.Packets;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Game
|
||||
{
|
||||
|
||||
@@ -934,7 +934,7 @@ namespace Game
|
||||
{
|
||||
if (gems[i])
|
||||
{
|
||||
uint gemScalingLevel = _player.getLevel();
|
||||
uint gemScalingLevel = _player.GetLevel();
|
||||
uint fixedLevel = gems[i].GetModifier(ItemModifier.ScalingStatDistributionFixedLevel);
|
||||
if (fixedLevel != 0)
|
||||
gemScalingLevel = fixedLevel;
|
||||
@@ -1027,7 +1027,7 @@ namespace Game
|
||||
GetPlayer().RefundItem(item);
|
||||
}
|
||||
|
||||
bool CanUseBank(ObjectGuid bankerGUID = default(ObjectGuid))
|
||||
bool CanUseBank(ObjectGuid bankerGUID = default)
|
||||
{
|
||||
// bankerGUID parameter is optional, set to 0 by default.
|
||||
if (bankerGUID.IsEmpty())
|
||||
|
||||
@@ -120,7 +120,7 @@ namespace Game
|
||||
[WorldPacketHandler(ClientOpcodes.DfGetJoinStatus, Processing = PacketProcessing.ThreadSafe)]
|
||||
void HandleDfGetJoinStatus(DFGetJoinStatus packet)
|
||||
{
|
||||
if (!GetPlayer().isUsingLfg())
|
||||
if (!GetPlayer().IsUsingLfg())
|
||||
return;
|
||||
|
||||
ObjectGuid guid = GetPlayer().GetGUID();
|
||||
@@ -143,7 +143,7 @@ namespace Game
|
||||
public void SendLfgPlayerLockInfo()
|
||||
{
|
||||
// Get Random dungeons that can be done at a certain level and expansion
|
||||
uint level = GetPlayer().getLevel();
|
||||
uint level = GetPlayer().GetLevel();
|
||||
List<uint> randomDungeons = Global.LFGMgr.GetRandomAndSeasonalDungeons(level, (uint)GetExpansion());
|
||||
|
||||
LfgPlayerInfo lfgPlayerInfo = new LfgPlayerInfo();
|
||||
|
||||
@@ -19,7 +19,6 @@ using Framework.Constants;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Groups;
|
||||
using Game.Guilds;
|
||||
using Game.Loots;
|
||||
using Game.Maps;
|
||||
using Game.Network;
|
||||
@@ -259,7 +258,7 @@ namespace Game
|
||||
if (!_looter.IsWithinDist(creature, LootDistance))
|
||||
return false;
|
||||
|
||||
return _looter.isAllowedToLoot(creature);
|
||||
return _looter.IsAllowedToLoot(creature);
|
||||
}
|
||||
|
||||
Player _looter;
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Game
|
||||
return;
|
||||
|
||||
Player player = GetPlayer();
|
||||
if (player.getLevel() < WorldConfig.GetIntValue(WorldCfg.MailLevelReq))
|
||||
if (player.GetLevel() < WorldConfig.GetIntValue(WorldCfg.MailLevelReq))
|
||||
{
|
||||
SendNotification(CypherStrings.MailSenderReq, WorldConfig.GetIntValue(WorldCfg.MailLevelReq));
|
||||
return;
|
||||
@@ -150,7 +150,7 @@ namespace Game
|
||||
{
|
||||
receiverTeam = receiver.GetTeam();
|
||||
mailsCount = (byte)receiver.GetMails().Count;
|
||||
receiverLevel = (byte)receiver.getLevel();
|
||||
receiverLevel = (byte)receiver.GetLevel();
|
||||
receiverAccountId = receiver.GetSession().GetAccountId();
|
||||
receiverBnetAccountId = receiver.GetSession().GetBattlenetAccountId();
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ namespace Game
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.isDebugAreaTriggers)
|
||||
if (player.IsDebugAreaTriggers)
|
||||
player.SendSysMessage(packet.Entered ? CypherStrings.DebugAreatriggerEntered : CypherStrings.DebugAreatriggerLeft, packet.AreaTriggerID);
|
||||
|
||||
if (Global.ScriptMgr.OnAreaTrigger(player, atEntry, packet.Entered))
|
||||
|
||||
@@ -366,14 +366,14 @@ namespace Game
|
||||
|
||||
uint petSlot = 0;
|
||||
// not let move dead pet in slot
|
||||
if (pet && pet.IsAlive() && pet.getPetType() == PetType.Hunter)
|
||||
if (pet && pet.IsAlive() && pet.GetPetType() == PetType.Hunter)
|
||||
{
|
||||
PetStableInfo stableEntry;// = new PetStableInfo();
|
||||
stableEntry.PetSlot = petSlot;
|
||||
stableEntry.PetNumber = pet.GetCharmInfo().GetPetNumber();
|
||||
stableEntry.CreatureID = pet.GetEntry();
|
||||
stableEntry.DisplayID = pet.GetDisplayId();
|
||||
stableEntry.ExperienceLevel = pet.getLevel();
|
||||
stableEntry.ExperienceLevel = pet.GetLevel();
|
||||
stableEntry.PetFlags = PetStableinfo.Active;
|
||||
stableEntry.PetName = pet.GetName();
|
||||
++petSlot;
|
||||
@@ -498,7 +498,7 @@ namespace Game
|
||||
int leftInStock = vendorItem.maxcount == 0 ? -1 : (int)vendor.GetVendorItemCurrentCount(vendorItem);
|
||||
if (!GetPlayer().IsGameMaster())
|
||||
{
|
||||
if (!Convert.ToBoolean(itemTemplate.GetAllowableClass() & GetPlayer().getClassMask()) && itemTemplate.GetBonding() == ItemBondingType.OnAcquire)
|
||||
if (!Convert.ToBoolean(itemTemplate.GetAllowableClass() & GetPlayer().GetClassMask()) && itemTemplate.GetBonding() == ItemBondingType.OnAcquire)
|
||||
continue;
|
||||
|
||||
if ((itemTemplate.GetFlags2().HasAnyFlag(ItemFlags2.FactionHorde) && GetPlayer().GetTeam() == Team.Alliance) ||
|
||||
|
||||
@@ -202,7 +202,7 @@ namespace Game
|
||||
pet.ToCreature().GetAI().AttackStart(TargetUnit);
|
||||
|
||||
//10% chance to play special pet attack talk, else growl
|
||||
if (pet.IsPet() && pet.ToPet().getPetType() == PetType.Summon && pet != TargetUnit && RandomHelper.IRand(0, 100) < 10)
|
||||
if (pet.IsPet() && pet.ToPet().GetPetType() == PetType.Summon && pet != TargetUnit && RandomHelper.IRand(0, 100) < 10)
|
||||
pet.SendPetTalk(PetTalk.Attack);
|
||||
else
|
||||
{
|
||||
@@ -232,11 +232,11 @@ namespace Game
|
||||
Cypher.Assert(pet.IsTypeId(TypeId.Unit));
|
||||
if (pet.IsPet())
|
||||
{
|
||||
if (pet.ToPet().getPetType() == PetType.Hunter)
|
||||
if (pet.ToPet().GetPetType() == PetType.Hunter)
|
||||
GetPlayer().RemovePet(pet.ToPet(), PetSaveMode.AsDeleted);
|
||||
else
|
||||
//dismissing a summoned pet is like killing them (this prevents returning a soulshard...)
|
||||
pet.setDeathState(DeathState.Corpse);
|
||||
pet.SetDeathState(DeathState.Corpse);
|
||||
}
|
||||
else if (pet.HasUnitTypeMask(UnitTypeMask.Minion))
|
||||
{
|
||||
@@ -317,7 +317,7 @@ namespace Game
|
||||
SpellCastResult result = spell.CheckPetCast(unit_target);
|
||||
|
||||
//auto turn to target unless possessed
|
||||
if (result == SpellCastResult.UnitNotInfront && !pet.isPossessed() && !pet.IsVehicle())
|
||||
if (result == SpellCastResult.UnitNotInfront && !pet.IsPossessed() && !pet.IsVehicle())
|
||||
{
|
||||
Unit unit_target2 = spell.m_targets.GetUnitTarget();
|
||||
if (unit_target)
|
||||
@@ -351,14 +351,14 @@ namespace Game
|
||||
|
||||
//10% chance to play special pet attack talk, else growl
|
||||
//actually this only seems to happen on special spells, fire shield for imp, torment for voidwalker, but it's stupid to check every spell
|
||||
if (pet.IsPet() && (pet.ToPet().getPetType() == PetType.Summon) && (pet != unit_target) && (RandomHelper.IRand(0, 100) < 10))
|
||||
if (pet.IsPet() && (pet.ToPet().GetPetType() == PetType.Summon) && (pet != unit_target) && (RandomHelper.IRand(0, 100) < 10))
|
||||
pet.SendPetTalk(PetTalk.SpecialSpell);
|
||||
else
|
||||
{
|
||||
pet.SendPetAIReaction(guid1);
|
||||
}
|
||||
|
||||
if (unit_target && !GetPlayer().IsFriendlyTo(unit_target) && !pet.isPossessed() && !pet.IsVehicle())
|
||||
if (unit_target && !GetPlayer().IsFriendlyTo(unit_target) && !pet.IsPossessed() && !pet.IsVehicle())
|
||||
{
|
||||
// This is true if pet has no target or has target but targets differs.
|
||||
if (pet.GetVictim() != unit_target)
|
||||
@@ -373,7 +373,7 @@ namespace Game
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pet.isPossessed() || pet.IsVehicle()) // @todo: confirm this check
|
||||
if (pet.IsPossessed() || pet.IsVehicle()) // @todo: confirm this check
|
||||
Spell.SendCastResult(GetPlayer(), spellInfo, spell.m_SpellVisual, spell.m_castId, result);
|
||||
else
|
||||
spell.SendPetCastResult(result);
|
||||
@@ -524,7 +524,7 @@ namespace Game
|
||||
|
||||
Pet pet = ObjectAccessor.GetPet(GetPlayer(), petguid);
|
||||
// check it!
|
||||
if (!pet || !pet.IsPet() || pet.ToPet().getPetType() != PetType.Hunter || !pet.HasPetFlag(UnitPetFlags.CanBeRenamed) ||
|
||||
if (!pet || !pet.IsPet() || pet.ToPet().GetPetType() != PetType.Hunter || !pet.HasPetFlag(UnitPetFlags.CanBeRenamed) ||
|
||||
pet.GetOwnerGUID() != GetPlayer().GetGUID() || pet.GetCharmInfo() == null)
|
||||
return;
|
||||
|
||||
@@ -582,7 +582,7 @@ namespace Game
|
||||
|
||||
// pet/charmed
|
||||
Creature pet = ObjectAccessor.GetCreatureOrPetOrVehicle(GetPlayer(), packet.Pet);
|
||||
if (pet && pet.ToPet() && pet.ToPet().getPetType() == PetType.Hunter)
|
||||
if (pet && pet.ToPet() && pet.ToPet().GetPetType() == PetType.Hunter)
|
||||
{
|
||||
_player.RemovePet((Pet)pet, PetSaveMode.AsDeleted);
|
||||
}
|
||||
@@ -680,7 +680,7 @@ namespace Game
|
||||
{
|
||||
// 10% chance to play special pet attack talk, else growl
|
||||
// actually this only seems to happen on special spells, fire shield for imp, torment for voidwalker, but it's stupid to check every spell
|
||||
if (pet.getPetType() == PetType.Summon && (RandomHelper.IRand(0, 100) < 10))
|
||||
if (pet.GetPetType() == PetType.Summon && (RandomHelper.IRand(0, 100) < 10))
|
||||
pet.SendPetTalk(PetTalk.SpecialSpell);
|
||||
else
|
||||
pet.SendPetAIReaction(petCastSpell.PetGUID);
|
||||
|
||||
@@ -23,7 +23,6 @@ using Game.Maps;
|
||||
using Game.Misc;
|
||||
using Game.Network;
|
||||
using Game.Network.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Game
|
||||
|
||||
@@ -23,7 +23,6 @@ using Game.Network;
|
||||
using Game.Network.Packets;
|
||||
using Game.DataStorage;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
|
||||
namespace Game
|
||||
{
|
||||
@@ -122,7 +121,7 @@ namespace Game
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!obj.hasQuest(packet.QuestID))
|
||||
if (!obj.HasQuest(packet.QuestID))
|
||||
{
|
||||
CLOSE_GOSSIP_CLEAR_DIVIDER();
|
||||
return;
|
||||
@@ -199,7 +198,7 @@ namespace Game
|
||||
{
|
||||
// Verify that the guid is valid and is a questgiver or involved in the requested quest
|
||||
var obj = Global.ObjAccessor.GetObjectByTypeMask(GetPlayer(), packet.QuestGiverGUID, (TypeMask.Unit | TypeMask.GameObject | TypeMask.Item));
|
||||
if (!obj || (!obj.hasQuest(packet.QuestID) && !obj.hasInvolvedQuest(packet.QuestID)))
|
||||
if (!obj || (!obj.HasQuest(packet.QuestID) && !obj.HasInvolvedQuest(packet.QuestID)))
|
||||
{
|
||||
GetPlayer().PlayerTalkClass.SendCloseGossip();
|
||||
return;
|
||||
@@ -308,7 +307,7 @@ namespace Game
|
||||
if (!quest.HasFlag(QuestFlags.AutoComplete))
|
||||
{
|
||||
obj = Global.ObjAccessor.GetObjectByTypeMask(GetPlayer(), packet.QuestGiverGUID, TypeMask.Unit | TypeMask.GameObject);
|
||||
if (!obj || !obj.hasInvolvedQuest(packet.QuestID))
|
||||
if (!obj || !obj.HasInvolvedQuest(packet.QuestID))
|
||||
return;
|
||||
|
||||
// some kind of WPE protection
|
||||
@@ -389,7 +388,7 @@ namespace Game
|
||||
void HandleQuestgiverRequestReward(QuestGiverRequestReward packet)
|
||||
{
|
||||
WorldObject obj = Global.ObjAccessor.GetObjectByTypeMask(GetPlayer(), packet.QuestGiverGUID, TypeMask.Unit | TypeMask.GameObject);
|
||||
if (obj == null || !obj.hasInvolvedQuest(packet.QuestID))
|
||||
if (obj == null || !obj.HasInvolvedQuest(packet.QuestID))
|
||||
return;
|
||||
|
||||
// some kind of WPE protection
|
||||
@@ -509,7 +508,7 @@ namespace Game
|
||||
|
||||
if (!autoCompleteMode)
|
||||
{
|
||||
if (!obj.hasInvolvedQuest(packet.QuestID))
|
||||
if (!obj.HasInvolvedQuest(packet.QuestID))
|
||||
return;
|
||||
|
||||
// some kind of WPE protection
|
||||
|
||||
@@ -40,13 +40,13 @@ namespace Game
|
||||
error = ReferAFriendError.NotReferredBy;
|
||||
else if (target.GetTeamId() != GetPlayer().GetTeamId())
|
||||
error = ReferAFriendError.DifferentFaction;
|
||||
else if (target.getLevel() >= GetPlayer().getLevel())
|
||||
else if (target.GetLevel() >= GetPlayer().GetLevel())
|
||||
error = ReferAFriendError.TargetTooHigh;
|
||||
else if (target.getLevel() >= WorldConfig.GetIntValue(WorldCfg.MaxRecruitAFriendBonusPlayerLevel))
|
||||
else if (target.GetLevel() >= WorldConfig.GetIntValue(WorldCfg.MaxRecruitAFriendBonusPlayerLevel))
|
||||
error = ReferAFriendError.GrantLevelMaxI;
|
||||
else if (target.GetGroup() != GetPlayer().GetGroup())
|
||||
error = ReferAFriendError.NotInGroup;
|
||||
else if (target.getLevel() >= Global.ObjectMgr.GetMaxLevelForExpansion(target.GetSession().GetExpansion()))
|
||||
else if (target.GetLevel() >= Global.ObjectMgr.GetMaxLevelForExpansion(target.GetSession().GetExpansion()))
|
||||
error = ReferAFriendError.InsufExpanLvl;
|
||||
|
||||
if (error != 0)
|
||||
@@ -80,7 +80,7 @@ namespace Game
|
||||
else
|
||||
return;
|
||||
|
||||
GetPlayer().GiveLevel(GetPlayer().getLevel() + 1);
|
||||
GetPlayer().GiveLevel(GetPlayer().GetLevel() + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ namespace Game
|
||||
return;
|
||||
|
||||
// can't use our own spells when we're in possession of another unit,
|
||||
if (GetPlayer().isPossessing())
|
||||
if (GetPlayer().IsPossessing())
|
||||
return;
|
||||
|
||||
// client provided targets
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace Game
|
||||
if (curloc == 0)
|
||||
return;
|
||||
|
||||
bool lastTaxiCheaterState = GetPlayer().isTaxiCheater();
|
||||
bool lastTaxiCheaterState = GetPlayer().IsTaxiCheater();
|
||||
if (unit.GetEntry() == 29480)
|
||||
GetPlayer().SetTaxiCheater(true); // Grimwing in Ebon Hold, special case. NOTE: Not perfect, Zul'Aman should not be included according to WoWhead, and I think taxicheat includes it.
|
||||
|
||||
@@ -186,7 +186,7 @@ namespace Game
|
||||
if (to == null)
|
||||
return;
|
||||
|
||||
if (!GetPlayer().isTaxiCheater())
|
||||
if (!GetPlayer().IsTaxiCheater())
|
||||
{
|
||||
if (!GetPlayer().m_taxi.IsTaximaskNodeKnown(curloc) || !GetPlayer().m_taxi.IsTaximaskNodeKnown(activateTaxi.Node))
|
||||
{
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Game
|
||||
return;
|
||||
}
|
||||
|
||||
if (_player.isPossessing())
|
||||
if (_player.IsPossessing())
|
||||
return;
|
||||
|
||||
SpellCastTargets targets = new SpellCastTargets(_player, packet.Cast);
|
||||
|
||||
@@ -592,7 +592,7 @@ namespace Game
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetPlayer().getLevel() < WorldConfig.GetIntValue(WorldCfg.TradeLevelReq))
|
||||
if (GetPlayer().GetLevel() < WorldConfig.GetIntValue(WorldCfg.TradeLevelReq))
|
||||
{
|
||||
SendNotification(Global.ObjectMgr.GetCypherString(CypherStrings.TradeReq), WorldConfig.GetIntValue(WorldCfg.TradeLevelReq));
|
||||
return;
|
||||
@@ -667,7 +667,7 @@ namespace Game
|
||||
return;
|
||||
}
|
||||
|
||||
if (pOther.getLevel() < WorldConfig.GetIntValue(WorldCfg.TradeLevelReq))
|
||||
if (pOther.GetLevel() < WorldConfig.GetIntValue(WorldCfg.TradeLevelReq))
|
||||
{
|
||||
SendNotification(Global.ObjectMgr.GetCypherString(CypherStrings.TradeOtherReq), WorldConfig.GetIntValue(WorldCfg.TradeLevelReq));
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user