Merge branch 'community' into move_consumable_to_gameaccount
This commit is contained in:
commit
a899bc2566
@ -43,7 +43,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
var val = new ByteStringPresenceField<D3.OnlineService.EntityId>(FieldKeyHelper.Program.D3, FieldKeyHelper.OriginatingClass.Account, 2, 0, this.LastSelectedGameAccount);
|
||||
var val = new ByteStringPresenceField<D3.OnlineService.EntityId>(FieldKeyHelper.Program.D3, FieldKeyHelper.OriginatingClass.Account, 2, 0, LastSelectedGameAccount);
|
||||
return val;
|
||||
}
|
||||
}
|
||||
@ -53,8 +53,8 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
get
|
||||
{
|
||||
ByteStringPresenceField<D3.OnlineService.EntityId> val = null;
|
||||
if (this.GameAccount.CurrentToon != null)
|
||||
val = new ByteStringPresenceField<D3.OnlineService.EntityId>(FieldKeyHelper.Program.D3, FieldKeyHelper.OriginatingClass.Account, 1, 0, this.GameAccount.CurrentToon.D3EntityID);
|
||||
if (GameAccount.CurrentToon != null)
|
||||
val = new ByteStringPresenceField<D3.OnlineService.EntityId>(FieldKeyHelper.Program.D3, FieldKeyHelper.OriginatingClass.Account, 1, 0, GameAccount.CurrentToon.D3EntityID);
|
||||
else
|
||||
{
|
||||
var Fake = D3.OnlineService.EntityId.CreateBuilder().SetIdHigh(0).SetIdLow(0);
|
||||
@ -77,7 +77,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
var val = new BoolPresenceField(FieldKeyHelper.Program.BNet, FieldKeyHelper.OriginatingClass.Account, 2, 0, this.IsOnline);
|
||||
var val = new BoolPresenceField(FieldKeyHelper.Program.BNet, FieldKeyHelper.OriginatingClass.Account, 2, 0, IsOnline);
|
||||
return val;
|
||||
}
|
||||
}
|
||||
@ -86,7 +86,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
var val = new StringPresenceField(FieldKeyHelper.Program.BNet, FieldKeyHelper.OriginatingClass.Account, 4, 0, this.BattleTagName + "#" + HashCode.ToString("D4"));
|
||||
var val = new StringPresenceField(FieldKeyHelper.Program.BNet, FieldKeyHelper.OriginatingClass.Account, 4, 0, BattleTagName + "#" + HashCode.ToString("D4"));
|
||||
return val;
|
||||
}
|
||||
}
|
||||
@ -95,7 +95,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
var val = new StringPresenceField(FieldKeyHelper.Program.BNet, FieldKeyHelper.OriginatingClass.Account, 2, 0, this.BroadcastMessage);
|
||||
var val = new StringPresenceField(FieldKeyHelper.Program.BNet, FieldKeyHelper.OriginatingClass.Account, 2, 0, BroadcastMessage);
|
||||
return val;
|
||||
}
|
||||
}
|
||||
@ -105,7 +105,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
get
|
||||
{
|
||||
var val = new EntityIdPresenceFieldList(FieldKeyHelper.Program.BNet, FieldKeyHelper.OriginatingClass.Account, 3, 0);
|
||||
val.Value.Add(this.GameAccount.BnetEntityId);
|
||||
val.Value.Add(GameAccount.BnetEntityId);
|
||||
return val;
|
||||
}
|
||||
}
|
||||
@ -117,15 +117,15 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
get
|
||||
{
|
||||
var val = new IntPresenceField(FieldKeyHelper.Program.BNet, FieldKeyHelper.OriginatingClass.Account, 6, 0, 0);
|
||||
val.Value = (long)this.LastOnline;
|
||||
val.Value = (long)LastOnline;
|
||||
return val;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.LastOnline = (ulong)value.Value;
|
||||
this.DBAccount.LastOnline = (ulong)value.Value;
|
||||
DBSessions.SessionUpdate(this.DBAccount);
|
||||
LastOnline = (ulong)value.Value;
|
||||
DBAccount.LastOnline = (ulong)value.Value;
|
||||
DBSessions.SessionUpdate(DBAccount);
|
||||
}
|
||||
|
||||
}
|
||||
@ -152,7 +152,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.DBAccount.Email;
|
||||
return DBAccount.Email;
|
||||
}
|
||||
private set
|
||||
{
|
||||
@ -160,34 +160,34 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
}
|
||||
public string SaltedTicket
|
||||
{
|
||||
get { return this.DBAccount.SaltedTicket; }
|
||||
get { return DBAccount.SaltedTicket; }
|
||||
internal set
|
||||
{
|
||||
this.DBAccount.SaltedTicket = value;
|
||||
DBSessions.SessionUpdate(this.DBAccount);
|
||||
DBAccount.SaltedTicket = value;
|
||||
DBSessions.SessionUpdate(DBAccount);
|
||||
}
|
||||
}
|
||||
public byte[] Salt
|
||||
{
|
||||
get { return this.DBAccount.Salt.ToArray(); }
|
||||
get { return DBAccount.Salt.ToArray(); }
|
||||
internal set
|
||||
{
|
||||
this.DBAccount.Salt = value;
|
||||
DBSessions.SessionUpdate(this.DBAccount);
|
||||
DBAccount.Salt = value;
|
||||
DBSessions.SessionUpdate(DBAccount);
|
||||
}
|
||||
} // s- User's salt.
|
||||
public byte[] FullSalt
|
||||
{
|
||||
get { return this.DBAccount.Salt.ToArray(); }
|
||||
get { return DBAccount.Salt.ToArray(); }
|
||||
} // s- User's salt.
|
||||
|
||||
public byte[] PasswordVerifier
|
||||
{
|
||||
get { return this.DBAccount.PasswordVerifier; }
|
||||
get { return DBAccount.PasswordVerifier; }
|
||||
internal set
|
||||
{
|
||||
this.DBAccount.PasswordVerifier = value;
|
||||
DBSessions.SessionUpdate(this.DBAccount);
|
||||
DBAccount.PasswordVerifier = value;
|
||||
DBSessions.SessionUpdate(DBAccount);
|
||||
}
|
||||
} // v - password verifier.
|
||||
|
||||
@ -195,12 +195,12 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.DBAccount.HashCode;
|
||||
return DBAccount.HashCode;
|
||||
}
|
||||
private set
|
||||
{
|
||||
this.DBAccount.HashCode = value;
|
||||
DBSessions.SessionUpdate(this.DBAccount);
|
||||
DBAccount.HashCode = value;
|
||||
DBSessions.SessionUpdate(DBAccount);
|
||||
}
|
||||
}
|
||||
|
||||
@ -208,21 +208,21 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
bool staff = (this.DBAccount.UserLevel > Account.UserLevels.Tester);
|
||||
bool staff = (DBAccount.UserLevel > UserLevels.Tester);
|
||||
//(controller as HandlerController).Client.Account.GameAccount.ProgramField.Value
|
||||
if(this.GameAccount.ProgramField.Value == "APP")
|
||||
return string.Format("{0}", this.DBAccount.BattleTagName);
|
||||
else if (this.GameAccount.ProgramField.Value == "D3")
|
||||
return string.Format("{0}", this.DBAccount.BattleTagName);
|
||||
if(GameAccount.ProgramField.Value == "APP")
|
||||
return string.Format("{0}", DBAccount.BattleTagName);
|
||||
else if (GameAccount.ProgramField.Value == "D3")
|
||||
return string.Format("{0}", DBAccount.BattleTagName);
|
||||
//return string.Format(staff ? " {{icon:bnet}} {{c_legendary}}{0}{{/c}}" : ("{0}"), this.DBAccount.BattleTagName);
|
||||
else
|
||||
return string.Format("{0}", this.DBAccount.BattleTagName);
|
||||
return string.Format("{0}", DBAccount.BattleTagName);
|
||||
//return (staff ? " {icon:bnet} " : (premium ? " {icon:gold} " : "")) + dbAcc.BattleTagName;
|
||||
} //{c_blue}{/c}
|
||||
private set
|
||||
{
|
||||
this.DBAccount.BattleTagName = value;
|
||||
DBSessions.SessionUpdate(this.DBAccount);
|
||||
DBAccount.BattleTagName = value;
|
||||
DBSessions.SessionUpdate(DBAccount);
|
||||
}
|
||||
}
|
||||
|
||||
@ -230,7 +230,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.BattleTagName + "#" + this.HashCode.ToString("D4");
|
||||
return BattleTagName + "#" + HashCode.ToString("D4");
|
||||
}
|
||||
set
|
||||
{
|
||||
@ -238,19 +238,19 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
throw new Exception("BattleTag must contain '#'");
|
||||
|
||||
var split = value.Split('#');
|
||||
this.DBAccount.BattleTagName = split[0];
|
||||
this.DBAccount.HashCode = Convert.ToInt32(split[1]);
|
||||
DBSessions.SessionUpdate(this.DBAccount);
|
||||
DBAccount.BattleTagName = split[0];
|
||||
DBAccount.HashCode = Convert.ToInt32(split[1]);
|
||||
DBSessions.SessionUpdate(DBAccount);
|
||||
}
|
||||
}
|
||||
|
||||
public UserLevels UserLevel
|
||||
{
|
||||
get { return this.DBAccount.UserLevel; }
|
||||
get { return DBAccount.UserLevel; }
|
||||
internal set
|
||||
{
|
||||
this.DBAccount.UserLevel = value;
|
||||
DBSessions.SessionUpdate(this.DBAccount);
|
||||
DBAccount.UserLevel = value;
|
||||
DBSessions.SessionUpdate(DBAccount);
|
||||
}
|
||||
} // user level for account.
|
||||
|
||||
@ -263,16 +263,16 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.CurrentGameAccountId == 0) return null;
|
||||
if (this._currentGameAccount == null)
|
||||
this._currentGameAccount = GameAccountManager.GetAccountByPersistentID(this.CurrentGameAccountId);
|
||||
if (CurrentGameAccountId == 0) return null;
|
||||
if (_currentGameAccount == null)
|
||||
_currentGameAccount = GameAccountManager.GetAccountByPersistentID(CurrentGameAccountId);
|
||||
|
||||
return this._currentGameAccount;
|
||||
return _currentGameAccount;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._currentGameAccount = value;
|
||||
this.CurrentGameAccountId = value.PersistentID;
|
||||
_currentGameAccount = value;
|
||||
CurrentGameAccountId = value.PersistentID;
|
||||
}
|
||||
}
|
||||
|
||||
@ -283,7 +283,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GameAccount.D3GameAccountId;
|
||||
return GameAccount.D3GameAccountId;
|
||||
}
|
||||
}
|
||||
|
||||
@ -292,18 +292,18 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
public Account(DBAccount dbAccount)
|
||||
: base(dbAccount.Id)
|
||||
{
|
||||
this.DBAccount = dbAccount;
|
||||
var account_relations = DBSessions.SessionQueryWhere<DBAccountLists>(dbl => dbl.ListOwner.Id == this.PersistentID);
|
||||
this.FriendsIds = new HashSet<ulong>(account_relations.Where(dbl => dbl.Type == "FRIEND").Select(a => a.ListTarget.Id)).ToList();
|
||||
this.IgnoreIds = new HashSet<ulong>(account_relations.Where(dbl => dbl.Type == "IGNORE").Select(a => a.ListTarget.Id)).ToList();
|
||||
this.LastOnline = dbAccount.LastOnline;
|
||||
DBAccount = dbAccount;
|
||||
var account_relations = DBSessions.SessionQueryWhere<DBAccountLists>(dbl => dbl.ListOwner.Id == PersistentID);
|
||||
FriendsIds = new HashSet<ulong>(account_relations.Where(dbl => dbl.Type == "FRIEND").Select(a => a.ListTarget.Id)).ToList();
|
||||
IgnoreIds = new HashSet<ulong>(account_relations.Where(dbl => dbl.Type == "IGNORE").Select(a => a.ListTarget.Id)).ToList();
|
||||
LastOnline = dbAccount.LastOnline;
|
||||
SetFields();
|
||||
}
|
||||
|
||||
|
||||
private void SetFields()
|
||||
{
|
||||
this.BnetEntityId = bgs.protocol.EntityId.CreateBuilder().SetHigh((ulong)EntityIdHelper.HighIdType.AccountId).SetLow(this.PersistentID).Build();
|
||||
BnetEntityId = bgs.protocol.EntityId.CreateBuilder().SetHigh((ulong)EntityIdHelper.HighIdType.AccountId).SetLow(PersistentID).Build();
|
||||
}
|
||||
|
||||
public void Update(IList<FieldOperation> operations)
|
||||
@ -331,7 +331,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
}
|
||||
}
|
||||
if (operationsToUpdate.Count > 0)
|
||||
base.UpdateSubscribers(Subscribers, operationsToUpdate);
|
||||
UpdateSubscribers(Subscribers, operationsToUpdate);
|
||||
}
|
||||
|
||||
private Field.Builder DoSet(Field field)
|
||||
@ -339,7 +339,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
FieldOperation.Builder operation = FieldOperation.CreateBuilder();
|
||||
|
||||
Field.Builder returnField = Field.CreateBuilder().SetKey(field.Key);
|
||||
if (this.GameAccount.LoggedInClient == null) return returnField;
|
||||
if (GameAccount.LoggedInClient == null) return returnField;
|
||||
|
||||
switch ((FieldKeyHelper.Program)field.Key.Program)
|
||||
{
|
||||
@ -352,7 +352,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
if (field.Key.Group == 1 && field.Key.Field == 2) // Account's broadcast message
|
||||
{
|
||||
Logger.Trace("{0} set broadcast message to {1}.", this, field.Value.StringValue);
|
||||
this.BroadcastMessage = field.Value.StringValue;
|
||||
BroadcastMessage = field.Value.StringValue;
|
||||
}
|
||||
else if (field.Key.Group == 1 && field.Key.Field == 7) // Account's AFK status
|
||||
{
|
||||
@ -392,22 +392,22 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
}*/
|
||||
}
|
||||
|
||||
public bgs.protocol.presence.v1.Field QueryField(bgs.protocol.presence.v1.FieldKey queryKey)
|
||||
public Field QueryField(FieldKey queryKey)
|
||||
{
|
||||
var field = bgs.protocol.presence.v1.Field.CreateBuilder().SetKey(queryKey);
|
||||
var field = Field.CreateBuilder().SetKey(queryKey);
|
||||
|
||||
switch ((FieldKeyHelper.Program)queryKey.Program)
|
||||
{
|
||||
case FieldKeyHelper.Program.D3:
|
||||
if (queryKey.Group == 1 && queryKey.Field == 1) // Account's last selected toon.
|
||||
{
|
||||
if (this.IsOnline) // check if the account is online actually.
|
||||
field.SetValue(bgs.protocol.Variant.CreateBuilder().SetMessageValue(this.GameAccount.LastPlayedHeroId.ToByteString()).Build());
|
||||
if (IsOnline) // check if the account is online actually.
|
||||
field.SetValue(bgs.protocol.Variant.CreateBuilder().SetMessageValue(GameAccount.LastPlayedHeroId.ToByteString()).Build());
|
||||
}
|
||||
else if (queryKey.Group == 1 && queryKey.Field == 2) // Account's last selected Game Account
|
||||
{
|
||||
if (this.IsOnline) // check if the account is online actually.
|
||||
field.SetValue(bgs.protocol.Variant.CreateBuilder().SetMessageValue(this.LastSelectedGameAccount.ToByteString()).Build());
|
||||
if (IsOnline) // check if the account is online actually.
|
||||
field.SetValue(bgs.protocol.Variant.CreateBuilder().SetMessageValue(LastSelectedGameAccount.ToByteString()).Build());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -417,11 +417,11 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
case FieldKeyHelper.Program.BNet:
|
||||
if (queryKey.Group == 1 && queryKey.Field == 4) // Account's battleTag
|
||||
{
|
||||
field.SetValue(bgs.protocol.Variant.CreateBuilder().SetStringValue(this.BattleTag).Build());
|
||||
field.SetValue(bgs.protocol.Variant.CreateBuilder().SetStringValue(BattleTag).Build());
|
||||
}
|
||||
else if (queryKey.Group == 1 && queryKey.Field == 2) // Account's broadcast message
|
||||
{
|
||||
field.SetValue(bgs.protocol.Variant.CreateBuilder().SetStringValue(this.BroadcastMessage).Build());
|
||||
field.SetValue(bgs.protocol.Variant.CreateBuilder().SetStringValue(BroadcastMessage).Build());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -440,7 +440,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
var operations = ChangedFields.GetChangedFieldList();
|
||||
ChangedFields.ClearChanged();
|
||||
base.UpdateSubscribers(this.Subscribers, operations);
|
||||
UpdateSubscribers(Subscribers, operations);
|
||||
}
|
||||
|
||||
//account class generated
|
||||
@ -450,7 +450,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
//Bnet, Account,3,index -> GameAccount EntityIds
|
||||
//Bnet, Account,4,0 -> BattleTag
|
||||
|
||||
public override List<bgs.protocol.presence.v1.FieldOperation> GetSubscriptionNotifications()
|
||||
public override List<FieldOperation> GetSubscriptionNotifications()
|
||||
{
|
||||
//TODO: Create delegate-move this out
|
||||
/*this.GameAccountListField.Value.Clear();
|
||||
@ -460,20 +460,20 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
}*/
|
||||
|
||||
|
||||
var operationList = new List<bgs.protocol.presence.v1.FieldOperation>();
|
||||
var operationList = new List<FieldOperation>();
|
||||
//if (this.LastSelectedHero != AccountHasNoToons)
|
||||
//operationList.Add(this.LastPlayedHeroIdField.GetFieldOperation());
|
||||
if (this.LastSelectedGameAccount != AccountHasNoToons)
|
||||
if (LastSelectedGameAccount != AccountHasNoToons)
|
||||
{
|
||||
operationList.Add(this.LastPlayedToonIdField.GetFieldOperation());
|
||||
operationList.Add(this.LastPlayedGameAccountIdField.GetFieldOperation());
|
||||
operationList.Add(LastPlayedToonIdField.GetFieldOperation());
|
||||
operationList.Add(LastPlayedGameAccountIdField.GetFieldOperation());
|
||||
}
|
||||
operationList.Add(this.RealIDTagField.GetFieldOperation());
|
||||
operationList.Add(this.AccountOnlineField.GetFieldOperation());
|
||||
operationList.AddRange(this.GameAccountListField.GetFieldOperationList());
|
||||
operationList.Add(this.AccountBattleTagField.GetFieldOperation());
|
||||
operationList.Add(this.BroadcastMessageField.GetFieldOperation());
|
||||
operationList.Add(this.LastOnlineField.GetFieldOperation());
|
||||
operationList.Add(RealIDTagField.GetFieldOperation());
|
||||
operationList.Add(AccountOnlineField.GetFieldOperation());
|
||||
operationList.AddRange(GameAccountListField.GetFieldOperationList());
|
||||
operationList.Add(AccountBattleTagField.GetFieldOperation());
|
||||
operationList.Add(BroadcastMessageField.GetFieldOperation());
|
||||
operationList.Add(LastOnlineField.GetFieldOperation());
|
||||
|
||||
return operationList;
|
||||
}
|
||||
@ -489,13 +489,13 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
if (password.Length < 8 || password.Length > 16)
|
||||
return false;
|
||||
|
||||
var calculatedVerifier = SRP6a.CalculatePasswordVerifierForAccount(this.Email, password, this.FullSalt);
|
||||
return calculatedVerifier.SequenceEqual(this.PasswordVerifier);
|
||||
var calculatedVerifier = SRP6a.CalculatePasswordVerifierForAccount(Email, password, FullSalt);
|
||||
return calculatedVerifier.SequenceEqual(PasswordVerifier);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return String.Format("{{ Account: {0} [lowId: {1}] }}", this.Email, this.BnetEntityId.Low);
|
||||
return String.Format("{{ Account: {0} [lowId: {1}] }}", Email, BnetEntityId.Low);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -58,9 +58,9 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
}
|
||||
set
|
||||
{
|
||||
lock (this.DBGameAccount)
|
||||
lock (DBGameAccount)
|
||||
{
|
||||
var dbGAcc = this.DBGameAccount;
|
||||
var dbGAcc = DBGameAccount;
|
||||
dbGAcc.DBAccount = value.DBAccount;
|
||||
DBSessions.SessionUpdate(dbGAcc);
|
||||
}
|
||||
@ -73,16 +73,16 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DBSessions.SessionGet<DBGameAccount>(this.PersistentID);
|
||||
return DBSessions.SessionGet<DBGameAccount>(PersistentID);
|
||||
}
|
||||
set { }
|
||||
}
|
||||
|
||||
public D3.OnlineService.EntityId D3GameAccountId
|
||||
public EntityId D3GameAccountId
|
||||
{
|
||||
get
|
||||
{
|
||||
return D3.OnlineService.EntityId.CreateBuilder().SetIdHigh(BnetEntityId.High).SetIdLow(PersistentID).Build();
|
||||
return EntityId.CreateBuilder().SetIdHigh(BnetEntityId.High).SetIdLow(PersistentID).Build();
|
||||
}
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return new IntPresenceField(FieldKeyHelper.Program.D3, FieldKeyHelper.OriginatingClass.GameAccount, 3, 0, this.CurrentActivity);
|
||||
return new IntPresenceField(FieldKeyHelper.Program.D3, FieldKeyHelper.OriginatingClass.GameAccount, 3, 0, CurrentActivity);
|
||||
}
|
||||
}
|
||||
|
||||
@ -120,7 +120,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
get
|
||||
{
|
||||
var val = new ByteStringPresenceField<D3.Guild.GuildSummary>(FieldKeyHelper.Program.D3, FieldKeyHelper.OriginatingClass.GameAccount, 7, 0);
|
||||
val.Value = this.Clan.Summary;
|
||||
val.Value = Clan.Summary;
|
||||
return val;
|
||||
}
|
||||
}
|
||||
@ -138,9 +138,9 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.CurrentToon == null)
|
||||
if (CurrentToon == null)
|
||||
return Toons.Count > 0 ? Toons.First().D3EntityID : AccountHasNoToons;
|
||||
return this.CurrentToon.D3EntityID;
|
||||
return CurrentToon.D3EntityID;
|
||||
}
|
||||
}
|
||||
|
||||
@ -173,11 +173,11 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.LoggedInClient != null && this.LoggedInClient.CurrentChannel != null)
|
||||
if (LoggedInClient != null && LoggedInClient.CurrentChannel != null)
|
||||
{
|
||||
return bgs.protocol.channel.v1.ChannelId.CreateBuilder()
|
||||
.SetType(0)
|
||||
.SetId((uint)this.LoggedInClient.CurrentChannel.D3EntityId.IdLow)
|
||||
.SetId((uint)LoggedInClient.CurrentChannel.D3EntityId.IdLow)
|
||||
.SetHost(bgs.protocol.ProcessId.CreateBuilder().SetLabel(1).SetEpoch(0))
|
||||
.Build();
|
||||
}
|
||||
@ -187,7 +187,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
set
|
||||
{
|
||||
if (value != null)
|
||||
this.LoggedInClient.CurrentChannel = ChannelManager.GetChannelByChannelId (value);
|
||||
LoggedInClient.CurrentChannel = ChannelManager.GetChannelByChannelId (value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -195,9 +195,9 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.LoggedInClient != null && this.LoggedInClient.CurrentChannel != null)
|
||||
if (LoggedInClient != null && LoggedInClient.CurrentChannel != null)
|
||||
{
|
||||
return this.LoggedInClient.CurrentChannel.D3EntityId;
|
||||
return LoggedInClient.CurrentChannel.D3EntityId;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
@ -205,7 +205,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
set
|
||||
{
|
||||
if (value != null)
|
||||
this.LoggedInClient.CurrentChannel = ChannelManager.GetChannelByEntityId(value);
|
||||
LoggedInClient.CurrentChannel = ChannelManager.GetChannelByEntityId(value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -244,7 +244,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
get
|
||||
{
|
||||
var val = new EntityIdPresenceField(FieldKeyHelper.Program.BNet, FieldKeyHelper.OriginatingClass.GameAccount, 7, 0);
|
||||
val.Value = this.Owner.BnetEntityId;
|
||||
val.Value = Owner.BnetEntityId;
|
||||
return val;
|
||||
}
|
||||
}
|
||||
@ -268,7 +268,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return new IntPresenceField(FieldKeyHelper.Program.BNet, FieldKeyHelper.OriginatingClass.GameAccount, 4, 0, (long)this.LastOnline);
|
||||
return new IntPresenceField(FieldKeyHelper.Program.BNet, FieldKeyHelper.OriginatingClass.GameAccount, 4, 0, (long)LastOnline);
|
||||
}
|
||||
}
|
||||
|
||||
@ -281,10 +281,10 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._bannerConfiguration != null)
|
||||
return this._bannerConfiguration;
|
||||
if (_bannerConfiguration != null)
|
||||
return _bannerConfiguration;
|
||||
var res = BannerConfiguration.CreateBuilder();
|
||||
if (this.DBGameAccount.Banner == null || this.DBGameAccount.Banner.Length < 1)
|
||||
if (DBGameAccount.Banner == null || DBGameAccount.Banner.Length < 1)
|
||||
{
|
||||
res = BannerConfiguration.CreateBuilder()
|
||||
.SetBannerShape(189701627)
|
||||
@ -300,25 +300,25 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
//.SetEpicBanner((uint)StringHashHelper.HashNormal("Banner_Epic_03_PVP_Class_Completion"))
|
||||
//.SetEpicBanner((uint)StringHashHelper.HashNormal("Banner_Epic_01_Hardcore"))
|
||||
|
||||
lock (this.DBGameAccount)
|
||||
lock (DBGameAccount)
|
||||
{
|
||||
var dbGAcc = this.DBGameAccount;
|
||||
var dbGAcc = DBGameAccount;
|
||||
dbGAcc.Banner = res.Build().ToByteArray();
|
||||
DBSessions.SessionUpdate(dbGAcc);
|
||||
}
|
||||
}
|
||||
else
|
||||
res = BannerConfiguration.CreateBuilder(BannerConfiguration.ParseFrom(this.DBGameAccount.Banner));
|
||||
res = BannerConfiguration.CreateBuilder(BannerConfiguration.ParseFrom(DBGameAccount.Banner));
|
||||
|
||||
this._bannerConfiguration = res.Build();
|
||||
return this._bannerConfiguration;
|
||||
_bannerConfiguration = res.Build();
|
||||
return _bannerConfiguration;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._bannerConfiguration = value;
|
||||
lock (this.DBGameAccount)
|
||||
_bannerConfiguration = value;
|
||||
lock (DBGameAccount)
|
||||
{
|
||||
var dbGAcc = this.DBGameAccount;
|
||||
var dbGAcc = DBGameAccount;
|
||||
dbGAcc.Banner = value.ToByteArray();
|
||||
DBSessions.SessionUpdate(dbGAcc);
|
||||
}
|
||||
@ -350,7 +350,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.CurrentToon.IsHardcore)
|
||||
if (CurrentToon.IsHardcore)
|
||||
return "D3_GOLD_HC";
|
||||
else
|
||||
return "D3_GOLD";
|
||||
@ -363,16 +363,16 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._currentToonId == 0) return null;
|
||||
return ToonManager.GetToonByLowID(this._currentToonId);
|
||||
if (_currentToonId == 0) return null;
|
||||
return ToonManager.GetToonByLowID(_currentToonId);
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value.GameAccount.PersistentID != this.PersistentID) return; //just in case...
|
||||
this._currentToonId = value.PersistentID;
|
||||
lock (this.DBGameAccount)
|
||||
if (value.GameAccount.PersistentID != PersistentID) return; //just in case...
|
||||
_currentToonId = value.PersistentID;
|
||||
lock (DBGameAccount)
|
||||
{
|
||||
var dbGAcc = this.DBGameAccount;
|
||||
var dbGAcc = DBGameAccount;
|
||||
dbGAcc.LastPlayedHero = value.DBToon;
|
||||
DBSessions.SessionUpdate(dbGAcc);
|
||||
}
|
||||
@ -942,7 +942,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
get
|
||||
{
|
||||
GameAccountSettings res = null;
|
||||
if (this.DBGameAccount.UISettings == null || this.DBGameAccount.UISettings.Length < 1)
|
||||
if (DBGameAccount.UISettings == null || DBGameAccount.UISettings.Length < 1)
|
||||
{
|
||||
res = GameAccountSettings.CreateBuilder()
|
||||
//.SetChatFontSize(8)
|
||||
@ -951,23 +951,23 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
.AddAutoJoinChannelsDeprecated("D3_GeneralChat")
|
||||
.Build();
|
||||
|
||||
lock (this.DBGameAccount)
|
||||
lock (DBGameAccount)
|
||||
{
|
||||
var dbGAcc = this.DBGameAccount;
|
||||
var dbGAcc = DBGameAccount;
|
||||
dbGAcc.UISettings = res.ToByteArray();
|
||||
DBSessions.SessionUpdate(dbGAcc);
|
||||
}
|
||||
}
|
||||
else
|
||||
res = GameAccountSettings.ParseFrom(this.DBGameAccount.UISettings);
|
||||
res = GameAccountSettings.ParseFrom(DBGameAccount.UISettings);
|
||||
|
||||
return res;
|
||||
}
|
||||
set
|
||||
{
|
||||
lock (this.DBGameAccount)
|
||||
lock (DBGameAccount)
|
||||
{
|
||||
var dbGAcc = this.DBGameAccount;
|
||||
var dbGAcc = DBGameAccount;
|
||||
dbGAcc.UISettings = value.ToByteArray();
|
||||
DBSessions.SessionUpdate(dbGAcc);
|
||||
}
|
||||
@ -991,9 +991,9 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
//.SetActionBindingVoiceptt(D3.Client.ActionBinding.CreateBuilder().SetKey1(112).SetKey2(-1).SetKeyModifierFlags1(0).SetKeyModifierFlags2(0).Build())
|
||||
.Build();
|
||||
|
||||
lock (this.DBGameAccount)
|
||||
lock (DBGameAccount)
|
||||
{
|
||||
var dbGAcc = this.DBGameAccount;
|
||||
var dbGAcc = DBGameAccount;
|
||||
dbGAcc.UIPrefs = res.ToByteArray();
|
||||
DBSessions.SessionUpdate(dbGAcc);
|
||||
}
|
||||
@ -1005,9 +1005,9 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
}
|
||||
set
|
||||
{
|
||||
lock (this.DBGameAccount)
|
||||
lock (DBGameAccount)
|
||||
{
|
||||
var dbGAcc = this.DBGameAccount;
|
||||
var dbGAcc = DBGameAccount;
|
||||
dbGAcc.UIPrefs = value.ToByteArray();
|
||||
DBSessions.SessionUpdate(dbGAcc);
|
||||
}
|
||||
@ -1028,13 +1028,13 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._achievements == null)
|
||||
this.SetField();
|
||||
return this._achievements;
|
||||
if (_achievements == null)
|
||||
SetField();
|
||||
return _achievements;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._achievements = value;
|
||||
_achievements = value;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1042,13 +1042,13 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._criteria == null)
|
||||
this.SetField();
|
||||
return this._criteria;
|
||||
if (_criteria == null)
|
||||
SetField();
|
||||
return _criteria;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._criteria = value;
|
||||
_criteria = value;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1058,7 +1058,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
uint highestLevel = 1;
|
||||
var _toons = DBSessions.SessionQueryWhere<DBToon>(
|
||||
dbi =>
|
||||
dbi.DBGameAccount.Id == this.PersistentID
|
||||
dbi.DBGameAccount.Id == PersistentID
|
||||
&& dbi.Class == className).ToList();
|
||||
foreach (var toon in _toons)
|
||||
{
|
||||
@ -1077,7 +1077,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
uint highestLevel = 0;
|
||||
var _toons = DBSessions.SessionQueryWhere<DBToon>(
|
||||
dbi =>
|
||||
dbi.DBGameAccount.Id == this.PersistentID
|
||||
dbi.DBGameAccount.Id == PersistentID
|
||||
&& dbi.isHardcore == true).ToList();
|
||||
foreach (var toon in _toons)
|
||||
{
|
||||
@ -1088,7 +1088,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
|
||||
public bool InviteToGuild(Guild guild, GameAccount inviter)
|
||||
{
|
||||
if (guild.IsClan && this.Clan != null)
|
||||
if (guild.IsClan && Clan != null)
|
||||
return false;
|
||||
else
|
||||
{
|
||||
@ -1097,10 +1097,10 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
.SetGuildName(guild.Name)
|
||||
.SetInviterId(inviter.PersistentID)
|
||||
.SetCategory(guild.Category)
|
||||
.SetInviteType(inviter.PersistentID == this.PersistentID ? 1U : 0U)
|
||||
.SetInviteType(inviter.PersistentID == PersistentID ? 1U : 0U)
|
||||
.SetExpireTime(3600);
|
||||
if (guild.IsClan) invite.SetGuildTag(guild.Prefix);
|
||||
this.GuildInvites.Add(invite.Build());
|
||||
GuildInvites.Add(invite.Build());
|
||||
|
||||
|
||||
var update = D3.Notification.GuildInvitesListUpdate.CreateBuilder();
|
||||
@ -1108,16 +1108,16 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
|
||||
var notification = bgs.protocol.notification.v1.Notification.CreateBuilder();
|
||||
notification.SetSenderId(bgs.protocol.EntityId.CreateBuilder().SetHigh(0UL).SetLow(0UL));
|
||||
notification.SetTargetAccountId(this.Owner.BnetEntityId);
|
||||
notification.SetTargetId(this.BnetEntityId);
|
||||
notification.SetTargetAccountId(Owner.BnetEntityId);
|
||||
notification.SetTargetId(BnetEntityId);
|
||||
notification.SetType("D3.NotificationMessage");
|
||||
notification.AddAttribute(bgs.protocol.Attribute.CreateBuilder()
|
||||
.SetName("D3.NotificationMessage.MessageId").SetValue(bgs.protocol.Variant.CreateBuilder().SetIntValue(0)));
|
||||
notification.AddAttribute(bgs.protocol.Attribute.CreateBuilder()
|
||||
.SetName("D3.NotificationMessage.Payload").SetValue(bgs.protocol.Variant.CreateBuilder().SetMessageValue(update.Build().ToByteString())));
|
||||
|
||||
this.LoggedInClient.MakeRPC((lid) =>
|
||||
bgs.protocol.notification.v1.NotificationListener.CreateStub(this.LoggedInClient).OnNotificationReceived(new HandlerController() { ListenerId = lid
|
||||
LoggedInClient.MakeRPC((lid) =>
|
||||
bgs.protocol.notification.v1.NotificationListener.CreateStub(LoggedInClient).OnNotificationReceived(new HandlerController() { ListenerId = lid
|
||||
}, notification.Build(), callback => { }));
|
||||
return true;
|
||||
}
|
||||
@ -1127,7 +1127,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
var dbGAcc = this.DBGameAccount;
|
||||
var dbGAcc = DBGameAccount;
|
||||
var profile = AccountProfile.CreateBuilder()
|
||||
.SetParagonLevel((uint)dbGAcc.ParagonLevel)
|
||||
.SetDeprecatedBestLadderParagonLevel((uint)dbGAcc.ParagonLevel)
|
||||
@ -1137,7 +1137,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
.AddSeasons(1)
|
||||
//deprecated //.SetHighestDifficulty(Convert.ToUInt32(progress[0], 10))
|
||||
.SetNumFallenHeroes(3)
|
||||
.SetParagonLevelHardcore(0) // Level of perfection in ger mode
|
||||
.SetParagonLevelHardcore(0) // Hardcore Paragon Level
|
||||
.SetBountiesCompleted((uint)dbGAcc.TotalBounties) // Executed orders
|
||||
.SetLootRunsCompleted(0) // Closed by the Nephalemic Portals
|
||||
.SetPvpWins(0)
|
||||
@ -1218,16 +1218,16 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
: base(dbGameAccount.Id)
|
||||
{
|
||||
//DBGameAccount = dbGameAccount;
|
||||
this.AccountId = dbGameAccount.DBAccount.Id;
|
||||
AccountId = dbGameAccount.DBAccount.Id;
|
||||
if (dbGameAccount.LastPlayedHero != null)
|
||||
this._currentToonId = dbGameAccount.LastPlayedHero.Id;
|
||||
this.LastOnline = dbGameAccount.LastOnline;
|
||||
var banner = this.BannerConfiguration; //just pre-loading it
|
||||
_currentToonId = dbGameAccount.LastPlayedHero.Id;
|
||||
LastOnline = dbGameAccount.LastOnline;
|
||||
var banner = BannerConfiguration; //just pre-loading it
|
||||
|
||||
const ulong bnetGameAccountHigh = ((ulong)EntityIdHelper.HighIdType.GameAccountId) + (0x0100004433);// + (0x0100004433);
|
||||
|
||||
this.BnetEntityId = bgs.protocol.EntityId.CreateBuilder().SetHigh(bnetGameAccountHigh).SetLow(PersistentID).Build();
|
||||
this.ProgramField.Value = "D3";
|
||||
BnetEntityId = bgs.protocol.EntityId.CreateBuilder().SetHigh(bnetGameAccountHigh).SetLow(PersistentID).Build();
|
||||
ProgramField.Value = "D3";
|
||||
}
|
||||
|
||||
private void SetField()
|
||||
@ -1235,7 +1235,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
Achievements = new List<AchievementUpdateRecord>();
|
||||
AchievementCriteria = new List<CriteriaUpdateRecord>();
|
||||
|
||||
var achs = DBSessions.SessionQueryWhere<Core.Storage.AccountDataBase.Entities.DBAchievements>(dbi => dbi.DBGameAccount.Id == this.PersistentID).ToList();
|
||||
var achs = DBSessions.SessionQueryWhere<Core.Storage.AccountDataBase.Entities.DBAchievements>(dbi => dbi.DBGameAccount.Id == PersistentID).ToList();
|
||||
foreach (var ach in achs)
|
||||
{
|
||||
if (ach.AchievementId == 1)
|
||||
@ -1301,7 +1301,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
|
||||
|
||||
//checking last online
|
||||
var dbAcc = this.Owner.DBAccount;
|
||||
var dbAcc = Owner.DBAccount;
|
||||
|
||||
ChangedFields.SetPresenceFieldValue(GameAccountStatusField);
|
||||
ChangedFields.SetPresenceFieldValue(LastOnlineField);
|
||||
@ -1326,13 +1326,13 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return (GameAccountFlags)this.DBGameAccount.Flags | GameAccountFlags.HardcoreAdventureModeUnlocked;
|
||||
return (GameAccountFlags)DBGameAccount.Flags | GameAccountFlags.HardcoreAdventureModeUnlocked;
|
||||
}
|
||||
set
|
||||
{
|
||||
lock (this.DBGameAccount)
|
||||
lock (DBGameAccount)
|
||||
{
|
||||
var dbGAcc = this.DBGameAccount;
|
||||
var dbGAcc = DBGameAccount;
|
||||
dbGAcc.Flags = (int)value;
|
||||
DBSessions.SessionUpdate(dbGAcc);
|
||||
}
|
||||
@ -1345,7 +1345,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
Digest.Builder builder = Digest.CreateBuilder().SetVersion(116)
|
||||
// 7447=>99, 7728=> 100, 8801=>102, 8296=>105, 8610=>106, 8815=>106, 8896=>106, 9183=>107
|
||||
.SetBannerConfiguration(this.BannerConfiguration)
|
||||
.SetBannerConfiguration(BannerConfiguration)
|
||||
//.SetFlags((uint)this.Flags) //1 - Enable Hardcore
|
||||
.SetFlags((uint)114)
|
||||
.SetLastPlayedHeroId(LastPlayedHeroId)
|
||||
@ -1356,11 +1356,11 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
.SetChallengeRiftAccountData(D3.ChallengeRifts.AccountData.CreateBuilder()
|
||||
.SetLastChallengeRewardEarned(416175).SetLastChallengeTried(416175)
|
||||
)
|
||||
.AddAltLevels((uint)this.DBGameAccount.ParagonLevel)
|
||||
.AddAltLevels((uint)DBGameAccount.ParagonLevel)
|
||||
//.AddAltLevels((uint)this.DBGameAccount.ParagonLevelHardcore)
|
||||
;
|
||||
if (this.Clan != null)
|
||||
builder.SetGuildId(this.Clan.PersistentId);
|
||||
if (Clan != null)
|
||||
builder.SetGuildId(Clan.PersistentId);
|
||||
|
||||
return builder.Build();
|
||||
}
|
||||
@ -1370,7 +1370,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return (uint)this.Achievements.Where(a => a.Completion != -1).Count() * 10U;
|
||||
return (uint)Achievements.Where(a => a.Completion != -1).Count() * 10U;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1380,7 +1380,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
{
|
||||
var operations = ChangedFields.GetChangedFieldList();
|
||||
ChangedFields.ClearChanged();
|
||||
base.UpdateSubscribers(Subscribers, operations);
|
||||
UpdateSubscribers(Subscribers, operations);
|
||||
}
|
||||
|
||||
public override List<FieldOperation> GetSubscriptionNotifications()
|
||||
@ -1423,7 +1423,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
operationList.Add(BattleTagField.GetFieldOperation());
|
||||
operationList.Add(GameAccountNameField.GetFieldOperation());
|
||||
operationList.Add(OwnerIdField.GetFieldOperation());
|
||||
if (this.Clan != null)
|
||||
if (Clan != null)
|
||||
operationList.Add(ClanIdField.GetFieldOperation());
|
||||
operationList.Add(GameVersionField.GetFieldOperation());
|
||||
operationList.Add(PartyIdField.GetFieldOperation());
|
||||
@ -1460,12 +1460,12 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
}
|
||||
}
|
||||
if (operationsToUpdate.Count > 0)
|
||||
base.UpdateSubscribers(Subscribers, operationsToUpdate);
|
||||
UpdateSubscribers(Subscribers, operationsToUpdate);
|
||||
}
|
||||
|
||||
public void TestUpdate()
|
||||
{
|
||||
var operations = this.GetSubscriptionNotifications();
|
||||
var operations = GetSubscriptionNotifications();
|
||||
/*
|
||||
operations.Add(
|
||||
FieldOperation.CreateBuilder()
|
||||
@ -1493,7 +1493,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
case FieldKeyHelper.Program.D3:
|
||||
if (field.Key.Group == 2 && field.Key.Field == 3) //CurrentActivity
|
||||
{
|
||||
this.CurrentActivity = (int)field.Value.IntValue;
|
||||
CurrentActivity = (int)field.Value.IntValue;
|
||||
returnField.SetValue(field.Value);
|
||||
Logger.Trace("{0} set CurrentActivity to {1}", this, field.Value.IntValue);
|
||||
}
|
||||
@ -1523,7 +1523,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
Channel channel = ChannelManager.GetChannelByChannelId(bgs.protocol.channel.v1.ChannelId.ParseFrom(field.Value.MessageValue));
|
||||
//this.PartyId = EntityId.CreateBuilder().SetIdLow(NewChannelID.Id).SetIdHigh(0x600000000000000).Build();
|
||||
|
||||
this.PartyChannelId = bgs.protocol.channel.v1.ChannelId.ParseFrom(field.Value.MessageValue);
|
||||
PartyChannelId = bgs.protocol.channel.v1.ChannelId.ParseFrom(field.Value.MessageValue);
|
||||
LoggedInClient.CurrentChannel = channel;
|
||||
var c = bgs.protocol.channel.v1.ChannelId.ParseFrom(field.Value.MessageValue);
|
||||
//returnField.SetValue(bgs.protocol.Variant.CreateBuilder().SetMessageValue(PartyChannelId.ToByteString()).Build());
|
||||
@ -1536,7 +1536,7 @@ namespace DiIiS_NA.LoginServer.AccountsSystem
|
||||
}
|
||||
else
|
||||
{
|
||||
this.PartyId = null;
|
||||
PartyId = null;
|
||||
//if(PartyChannelId != null)
|
||||
// returnField.SetValue(bgs.protocol.Variant.CreateBuilder().SetMessageValue(PartyChannelId.ToByteString()).Build());
|
||||
//else
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
//Blizzless Project 2022
|
||||
#define LOG_KEEP_ALIVE
|
||||
|
||||
//Blizzless Project 2022
|
||||
using bgs.protocol;
|
||||
//Blizzless Project 2022
|
||||
@ -40,7 +41,6 @@ using System.Net.Security;
|
||||
//Blizzless Project 2022
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
namespace DiIiS_NA.LoginServer.Battle
|
||||
{
|
||||
public class BattleClient : SimpleChannelInboundHandler<BNetPacket>, IRpcChannel
|
||||
@ -50,24 +50,21 @@ namespace DiIiS_NA.LoginServer.Battle
|
||||
public Dictionary<uint, uint> Services { get; private set; }
|
||||
public ISocketChannel SocketConnection { get; private set; }
|
||||
public IChannelHandlerContext Connect { get; private set; }
|
||||
public bool AuthentificationStatus = false;
|
||||
public bool AuthenticationStatus = false;
|
||||
public ClientLocale ClientLanguage = ClientLocale.enUS;
|
||||
public IRpcController listenercontroller;
|
||||
public IRpcController ListenerController;
|
||||
private uint _tokenCounter = 0;
|
||||
public static bgs.protocol.NO_RESPONSE NO_RESPONSE = bgs.protocol.NO_RESPONSE.CreateBuilder().Build();
|
||||
private Dictionary<int, RPCCallBack> pendingResponses = new Dictionary<int, RPCCallBack>();
|
||||
private readonly Dictionary<int, RPCCallBack> _pendingResponses = new Dictionary<int, RPCCallBack>();
|
||||
public bgs.protocol.v2.Attribute AttributeOfServer { get; set; }
|
||||
|
||||
public Account Account { get; set; }
|
||||
public bool MMJoined = false;
|
||||
public const byte ServiceReply = 0xFE;
|
||||
public SslStream ssl = null;
|
||||
private static int REQUEST_SERVICE_ID = 0;
|
||||
private static int RESPONSE_SERVICE_ID = 254;
|
||||
public ulong LastPartitionIdHigh = 0; //HACK: fix it later
|
||||
public ulong LastPartitionIdLow = 0;
|
||||
//public object clientLock = new object();
|
||||
public object serviceLock = new object();
|
||||
public object _serviceLock = new object();
|
||||
public object messageLock = new object();
|
||||
private ulong _listenerId; // last targeted rpc object.
|
||||
public bool MOTDSent { get; private set; }
|
||||
@ -160,10 +157,10 @@ namespace DiIiS_NA.LoginServer.Battle
|
||||
Services = new Dictionary<uint, uint>();
|
||||
MappedObjects = new ConcurrentDictionary<ulong, ulong>();
|
||||
this.MOTDSent = false;
|
||||
|
||||
if (SocketConnection.Active)
|
||||
Logger.Trace("Клиент - {0} - успешно зашифровал соединение ", socketChannel.RemoteAddress);
|
||||
Logger.Trace("Client - {0} - successfully encrypted the connection", socketChannel.RemoteAddress);
|
||||
}
|
||||
|
||||
protected override void ChannelRead0(IChannelHandlerContext ctx, BNetPacket msg)
|
||||
{
|
||||
Connect = ctx;
|
||||
@ -172,8 +169,8 @@ namespace DiIiS_NA.LoginServer.Battle
|
||||
|
||||
if (msg.GetHeader().ServiceId == RESPONSE_SERVICE_ID)
|
||||
{
|
||||
if (pendingResponses.Count == 0) return;
|
||||
RPCCallBack done = pendingResponses[(int)header.Token];
|
||||
if (_pendingResponses.Count == 0) return;
|
||||
RPCCallBack done = _pendingResponses[(int)header.Token];
|
||||
if (done != null)
|
||||
{
|
||||
var service = Service.GetByID(header.ServiceId);
|
||||
@ -181,10 +178,11 @@ namespace DiIiS_NA.LoginServer.Battle
|
||||
{
|
||||
IMessage message = DescriptorProto.ParseFrom(payload);
|
||||
done.Action(message);
|
||||
pendingResponses.Remove((int)header.Token);
|
||||
_pendingResponses.Remove((int)header.Token);
|
||||
}
|
||||
else
|
||||
Logger.Debug(String.Format("Incoming Response: Unable to identify service (id: %d, hash: 0x%04X)", header.ServiceId, header.ServiceHash));
|
||||
Logger.Debug(
|
||||
$"Incoming Response: Unable to identify service (id: {header.ServiceId}, hash: 0x{header.ServiceHash:04X})");
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -193,7 +191,8 @@ namespace DiIiS_NA.LoginServer.Battle
|
||||
if (header.ServiceHash != 2119327385)
|
||||
if (service != null)
|
||||
{
|
||||
#region Все хэши сервисов
|
||||
#region All service hashes
|
||||
|
||||
/*
|
||||
AccountService - 1658456209
|
||||
AccountNotify - 1423956503
|
||||
@ -261,8 +260,11 @@ namespace DiIiS_NA.LoginServer.Battle
|
||||
ReportService_v2 - 0x3A4218FB
|
||||
VoiceService_v2 - 0xF5709E48
|
||||
*/
|
||||
|
||||
#endregion
|
||||
MethodDescriptor method = service.DescriptorForType.Methods.Single(m => GetMethodId(m) == header.MethodId);
|
||||
|
||||
MethodDescriptor method =
|
||||
service.DescriptorForType.Methods.Single(m => GetMethodId(m) == header.MethodId);
|
||||
IMessage proto = service.GetRequestPrototype(method);
|
||||
IBuilder builder = proto.WeakCreateBuilderForType();
|
||||
IMessage message = builder.WeakMergeFrom(ByteString.CopyFrom(payload)).WeakBuild();
|
||||
@ -270,26 +272,37 @@ namespace DiIiS_NA.LoginServer.Battle
|
||||
{
|
||||
lock (service)
|
||||
{
|
||||
var controller = new HandlerController();
|
||||
controller.Client = this;
|
||||
controller.LastCallHeader = header;
|
||||
controller.Status = 0;
|
||||
controller.ListenerId = 0;
|
||||
HandlerController controller = new()
|
||||
{
|
||||
Client = this,
|
||||
LastCallHeader = header,
|
||||
Status = 0,
|
||||
ListenerId = 0
|
||||
};
|
||||
#if DEBUG
|
||||
Logger.Warn("Вызов: {0}, Хэш сервиса: {1}, Метод: {2}, ID: {3}", service.GetType().Name, header.ServiceHash, method.Name, header.MethodId);
|
||||
#if !LOG_KEEP_ALIVE
|
||||
if (method.Name != "KeepAlive")
|
||||
#endif
|
||||
{
|
||||
Logger.Warn("Call: {0}, Service hash: {1}, Method: {2}, ID: {3}",
|
||||
service.GetType().Name, header.ServiceHash, method.Name, header.MethodId);
|
||||
}
|
||||
#endif
|
||||
|
||||
service.CallMethod(method, controller, message, (IMessage m) => { sendResponse(ctx, (int)header.Token, m, controller.Status); });
|
||||
service.CallMethod(method, controller, message,
|
||||
(IMessage m) => { sendResponse(ctx, (int)header.Token, m, controller.Status); });
|
||||
}
|
||||
}
|
||||
catch (NotImplementedException)
|
||||
{
|
||||
Logger.Warn("Неимплементированный метод сервиса: {0}.{1}", service.GetType().Name, method.Name);
|
||||
Logger.Warn("Unimplemented service method: {0}.{1}", service.GetType().Name, method.Name);
|
||||
}
|
||||
}
|
||||
else
|
||||
Logger.Warn(String.Format("Клиент обращается к неподключенному сервису(id: {0}, hash: {1} Method id: {2})", header.ServiceId, header.ServiceHash, header.MethodId));
|
||||
|
||||
{
|
||||
Logger.Warn(
|
||||
$"Client is calling unconnected service (id: {header.ServiceId}, hash: {header.ServiceHash} Method id: {header.MethodId})");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -434,7 +447,8 @@ namespace DiIiS_NA.LoginServer.Battle
|
||||
|
||||
if (!this.Services.ContainsKey(serviceHash))
|
||||
{
|
||||
Logger.Warn("Не найден сервис привязанный к клиенту {0} [0x{1}].", serviceName, serviceHash.ToString("X8"));
|
||||
Logger.Warn("Service not found for client {0} [0x{1}].", serviceName, serviceHash.ToString("X8"));
|
||||
// in english: "Service not found for client {0} [0x{1}]."
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -28,12 +28,29 @@ namespace DiIiS_NA.LoginServer.Battle
|
||||
OnlinePlayers.Add(client);
|
||||
}
|
||||
|
||||
public static BattleClient GetClientbyCID(ulong cid)
|
||||
public static BattleClient GetClientByCID(ulong cid)
|
||||
{
|
||||
foreach (var bc in OnlinePlayers)
|
||||
if (bc.CID == cid)
|
||||
return bc;
|
||||
return null;
|
||||
return OnlinePlayers.FirstOrDefault(bc => bc.CID == cid);
|
||||
}
|
||||
|
||||
public static void SendWhisper(string message)
|
||||
{
|
||||
Broadcast(client =>
|
||||
{
|
||||
client.SendServerWhisper(message);
|
||||
});
|
||||
}
|
||||
|
||||
public static void Broadcast(Action<BattleClient> action, Func<BattleClient, bool> predicate)
|
||||
{
|
||||
foreach (var client in OnlinePlayers.Where(predicate))
|
||||
action(client);
|
||||
}
|
||||
|
||||
public static void Broadcast(Action<BattleClient> action)
|
||||
{
|
||||
foreach (var client in OnlinePlayers)
|
||||
action(client);
|
||||
}
|
||||
|
||||
public static void PlayerDisconnected(BattleClient client)
|
||||
|
||||
@ -20,8 +20,8 @@ namespace DiIiS_NA.LoginServer.ChannelSystem
|
||||
{
|
||||
public class ChannelInvitationManager : RPCObject
|
||||
{
|
||||
public readonly Dictionary<ulong, bgs.protocol.Invitation> _onGoingInvitations = new Dictionary<ulong, bgs.protocol.Invitation>();
|
||||
public static Dictionary<ulong, bgs.protocol.Invitation> GoingInvitations = new Dictionary<ulong, bgs.protocol.Invitation>();
|
||||
public readonly Dictionary<ulong, Invitation> _onGoingInvitations = new Dictionary<ulong, Invitation>();
|
||||
public static Dictionary<ulong, Invitation> GoingInvitations = new Dictionary<ulong, Invitation>();
|
||||
|
||||
public static ulong InvitationIdCounter = 1;
|
||||
|
||||
@ -29,13 +29,13 @@ namespace DiIiS_NA.LoginServer.ChannelSystem
|
||||
{
|
||||
// TODO: Hardcoded 1 as channel persistent id in this case...
|
||||
|
||||
this.BnetEntityId = bgs.protocol.EntityId.CreateBuilder().SetHigh((ulong)EntityIdHelper.HighIdType.ChannelId).SetLow(10000000000).Build();
|
||||
BnetEntityId = EntityId.CreateBuilder().SetHigh((ulong)EntityIdHelper.HighIdType.ChannelId).SetLow(10000000000).Build();
|
||||
}
|
||||
|
||||
public bgs.protocol.Invitation GetInvitationById(ulong Id)
|
||||
public Invitation GetInvitationById(ulong Id)
|
||||
{
|
||||
|
||||
if (!this._onGoingInvitations.ContainsKey(Id))
|
||||
if (!_onGoingInvitations.ContainsKey(Id))
|
||||
{
|
||||
foreach (var inv in _onGoingInvitations.Values)
|
||||
if (inv.GetExtension(bgs.protocol.channel.v1.ChannelInvitation.ChannelInvitationProp).ChannelDescription.ChannelId.Low == Id)
|
||||
@ -44,20 +44,20 @@ namespace DiIiS_NA.LoginServer.ChannelSystem
|
||||
}
|
||||
|
||||
else
|
||||
return this._onGoingInvitations[Id];
|
||||
return _onGoingInvitations[Id];
|
||||
}
|
||||
|
||||
public void ClearInvitations()
|
||||
{
|
||||
this._onGoingInvitations.Clear();
|
||||
_onGoingInvitations.Clear();
|
||||
}
|
||||
|
||||
public void HandleInvitation(BattleClient client, bgs.protocol.Invitation invitation)
|
||||
public void HandleInvitation(BattleClient client, Invitation invitation)
|
||||
{
|
||||
var invitee = this.Subscribers.FirstOrDefault(subscriber => subscriber.Key.Account.GameAccount.BnetEntityId.Low == invitation.InviteeIdentity.GameAccountId.Low).Key;
|
||||
var invitee = Subscribers.FirstOrDefault(subscriber => subscriber.Key.Account.GameAccount.BnetEntityId.Low == invitation.InviteeIdentity.GameAccountId.Low).Key;
|
||||
if (invitee == null) return;
|
||||
|
||||
this._onGoingInvitations.Add(invitation.Id, invitation);
|
||||
_onGoingInvitations.Add(invitation.Id, invitation);
|
||||
GoingInvitations.Add(invitation.Id, invitation);
|
||||
|
||||
var notification = bgs.protocol.channel.v1.InvitationAddedNotification.CreateBuilder().SetInvitation(invitation);
|
||||
@ -69,7 +69,7 @@ namespace DiIiS_NA.LoginServer.ChannelSystem
|
||||
public Channel HandleAccept(BattleClient client, bgs.protocol.channel.v1.AcceptInvitationRequest request)
|
||||
{
|
||||
Invitation invitation = null;
|
||||
if (!this._onGoingInvitations.ContainsKey(request.InvitationId))
|
||||
if (!_onGoingInvitations.ContainsKey(request.InvitationId))
|
||||
{
|
||||
foreach (var inv in _onGoingInvitations.Values)
|
||||
if(inv.GetExtension(bgs.protocol.channel.v1.ChannelInvitation.ChannelInvitationProp).ChannelDescription.ChannelId.Low == request.InvitationId)
|
||||
@ -80,12 +80,12 @@ namespace DiIiS_NA.LoginServer.ChannelSystem
|
||||
}
|
||||
|
||||
if (invitation == null)
|
||||
invitation = this._onGoingInvitations[request.InvitationId];
|
||||
invitation = _onGoingInvitations[request.InvitationId];
|
||||
|
||||
var channel = ChannelManager.GetChannelByEntityId(invitation.GetExtension(bgs.protocol.channel.v1.ChannelInvitation.ChannelInvitationProp).ChannelDescription.ChannelId);
|
||||
|
||||
var notification = bgs.protocol.channel.v1.InvitationRemovedNotification.CreateBuilder().SetInvitation(invitation.ToBuilder()).SetReason((uint)InvitationRemoveReason.Accepted);
|
||||
this._onGoingInvitations.Remove(invitation.Id);
|
||||
_onGoingInvitations.Remove(invitation.Id);
|
||||
GoingInvitations.Remove(request.InvitationId);
|
||||
|
||||
client.MakeTargetedRPC(this, (lid) =>
|
||||
@ -94,7 +94,7 @@ namespace DiIiS_NA.LoginServer.ChannelSystem
|
||||
channel.Join(client, request.ObjectId);
|
||||
|
||||
var stateNotification = bgs.protocol.channel.v1.UpdateChannelStateNotification.CreateBuilder()
|
||||
.SetAgentId(bgs.protocol.EntityId.CreateBuilder().SetHigh(0).SetLow(0).Build())
|
||||
.SetAgentId(EntityId.CreateBuilder().SetHigh(0).SetLow(0).Build())
|
||||
.SetStateChange(bgs.protocol.channel.v1.ChannelState.CreateBuilder().AddInvitation(invitation).SetReason(0).Build())
|
||||
.Build();
|
||||
|
||||
@ -109,12 +109,12 @@ namespace DiIiS_NA.LoginServer.ChannelSystem
|
||||
|
||||
public void HandleHardJoin(BattleClient client, bgs.protocol.channel.v1.AcceptInvitationRequest request)
|
||||
{
|
||||
if (!this._onGoingInvitations.ContainsKey(request.InvitationId)) return;
|
||||
if (!_onGoingInvitations.ContainsKey(request.InvitationId)) return;
|
||||
|
||||
var invitation = this._onGoingInvitations[request.InvitationId];
|
||||
var invitation = _onGoingInvitations[request.InvitationId];
|
||||
var channel = ChannelManager.GetChannelByEntityId(invitation.GetExtension(bgs.protocol.channel.v1.ChannelInvitation.ChannelInvitationProp).ChannelDescription.ChannelId);
|
||||
|
||||
this._onGoingInvitations.Remove(invitation.Id);
|
||||
_onGoingInvitations.Remove(invitation.Id);
|
||||
var a = GameAccountManager.GetAccountByPersistentID(invitation.InviteeIdentity.GameAccountId.Low);
|
||||
|
||||
var JoinClient = a.LoggedInClient;
|
||||
@ -132,10 +132,10 @@ namespace DiIiS_NA.LoginServer.ChannelSystem
|
||||
|
||||
var notification = bgs.protocol.matchmaking.v1.MatchmakingResultNotification.CreateBuilder();
|
||||
var connectInfo = bgs.protocol.matchmaking.v1.ConnectInfo.CreateBuilder();
|
||||
connectInfo.SetAddress(bgs.protocol.Address.CreateBuilder().SetAddress_(GAME_SERVER_IP).SetPort(GAME_SERVER_PORT));
|
||||
connectInfo.SetAddress(Address.CreateBuilder().SetAddress_(GAME_SERVER_IP).SetPort(GAME_SERVER_PORT));
|
||||
connectInfo.AddAttribute(bgs.protocol.v2.Attribute.CreateBuilder().SetName("GameAccount").SetValue(bgs.protocol.v2.Variant.CreateBuilder().SetBlobValue(member.Build().ToByteString())));
|
||||
connectInfo.AddAttribute(bgs.protocol.v2.Attribute.CreateBuilder().SetName("Token").SetValue(bgs.protocol.v2.Variant.CreateBuilder().SetUintValue(0xEEF4364684EE186E))); // FIXME
|
||||
//connectInfo.AddAttribute(AttributeOfServer); // Настройки игры
|
||||
//connectInfo.AddAttribute(AttributeOfServer); // Game settings
|
||||
|
||||
var gh = bgs.protocol.matchmaking.v1.GameHandle.CreateBuilder();
|
||||
gh.SetMatchmaker(bgs.protocol.matchmaking.v1.MatchmakerHandle.CreateBuilder()
|
||||
@ -155,9 +155,9 @@ namespace DiIiS_NA.LoginServer.ChannelSystem
|
||||
if (JoinClient.CurrentChannel != null)
|
||||
{
|
||||
var channelStatePermission = bgs.protocol.channel.v1.ChannelState.CreateBuilder()
|
||||
.AddAttribute(bgs.protocol.Attribute.CreateBuilder()
|
||||
.AddAttribute(Attribute.CreateBuilder()
|
||||
.SetName("D3.Party.JoinPermissionPreviousToLock")
|
||||
.SetValue(bgs.protocol.Variant.CreateBuilder().SetIntValue(1).Build())
|
||||
.SetValue(Variant.CreateBuilder().SetIntValue(1).Build())
|
||||
.Build()).Build();
|
||||
|
||||
var notificationPermission = bgs.protocol.channel.v1.UpdateChannelStateNotification.CreateBuilder()
|
||||
@ -174,9 +174,9 @@ namespace DiIiS_NA.LoginServer.ChannelSystem
|
||||
.SetSenderId(client.Account.GameAccount.BnetEntityId)
|
||||
.SetTargetId(JoinClient.Account.GameAccount.BnetEntityId)
|
||||
.SetType("GO_ENTRY");
|
||||
var attrF = bgs.protocol.Attribute.CreateBuilder()
|
||||
var attrF = Attribute.CreateBuilder()
|
||||
.SetName("game_request_id")
|
||||
.SetValue(bgs.protocol.Variant.CreateBuilder().SetUintValue(gameFound.RequestId).Build());
|
||||
.SetValue(Variant.CreateBuilder().SetUintValue(gameFound.RequestId).Build());
|
||||
notificationFound.AddAttribute(attrF);
|
||||
|
||||
JoinClient.MakeRPC((lid) =>
|
||||
@ -234,7 +234,7 @@ namespace DiIiS_NA.LoginServer.ChannelSystem
|
||||
channel.Join(client, request.ObjectId);
|
||||
|
||||
var stateNotification = bgs.protocol.channel.v1.UpdateChannelStateNotification.CreateBuilder()
|
||||
.SetAgentId(bgs.protocol.EntityId.CreateBuilder().SetHigh(0).SetLow(0).Build())
|
||||
.SetAgentId(EntityId.CreateBuilder().SetHigh(0).SetLow(0).Build())
|
||||
.SetStateChange(bgs.protocol.channel.v1.ChannelState.CreateBuilder().AddInvitation(invitation).SetReason(0).Build())
|
||||
.Build();
|
||||
|
||||
@ -256,13 +256,13 @@ namespace DiIiS_NA.LoginServer.ChannelSystem
|
||||
|
||||
public Channel HandleAcceptAnother(BattleClient client, bgs.protocol.channel.v1.AcceptInvitationRequest request)
|
||||
{
|
||||
if (!this._onGoingInvitations.ContainsKey(request.InvitationId)) return null;
|
||||
if (!_onGoingInvitations.ContainsKey(request.InvitationId)) return null;
|
||||
|
||||
var invitation = this._onGoingInvitations[request.InvitationId];
|
||||
var invitation = _onGoingInvitations[request.InvitationId];
|
||||
var channel = ChannelManager.GetChannelByEntityId(invitation.GetExtension(bgs.protocol.channel.v1.ChannelInvitation.ChannelInvitationProp).ChannelDescription.ChannelId);
|
||||
|
||||
var notification = bgs.protocol.channel.v1.InvitationRemovedNotification.CreateBuilder().SetInvitation(invitation.ToBuilder()).SetReason((uint)InvitationRemoveReason.Accepted);
|
||||
this._onGoingInvitations.Remove(invitation.Id);
|
||||
_onGoingInvitations.Remove(invitation.Id);
|
||||
var a = GameAccountManager.GetAccountByPersistentID(invitation.InviteeIdentity.GameAccountId.Low);
|
||||
|
||||
//client.MakeTargetedRPC(this, (lid) =>
|
||||
@ -280,7 +280,7 @@ namespace DiIiS_NA.LoginServer.ChannelSystem
|
||||
var inviter = GameAccountManager.GetAccountByPersistentID(invitation.InviterIdentity.GameAccountId.Low);
|
||||
|
||||
var stateNotification = bgs.protocol.channel.v1.UpdateChannelStateNotification.CreateBuilder()
|
||||
.SetAgentId(bgs.protocol.EntityId.CreateBuilder().SetHigh(0).SetLow(0).Build())
|
||||
.SetAgentId(EntityId.CreateBuilder().SetHigh(0).SetLow(0).Build())
|
||||
.SetStateChange(bgs.protocol.channel.v1.ChannelState.CreateBuilder().AddInvitation(invitation).SetReason(0).Build())
|
||||
.Build();
|
||||
|
||||
@ -298,19 +298,19 @@ namespace DiIiS_NA.LoginServer.ChannelSystem
|
||||
|
||||
public void HandleDecline(BattleClient client, bgs.protocol.channel.v1.DeclineInvitationRequest request)
|
||||
{
|
||||
if (!this._onGoingInvitations.ContainsKey(request.InvitationId)) return;
|
||||
var invitation = this._onGoingInvitations[request.InvitationId];
|
||||
if (!_onGoingInvitations.ContainsKey(request.InvitationId)) return;
|
||||
var invitation = _onGoingInvitations[request.InvitationId];
|
||||
|
||||
var inviter = GameAccountManager.GetAccountByPersistentID(invitation.InviterIdentity.GameAccountId.Low);
|
||||
if (inviter == null || inviter.LoggedInClient == null) return;
|
||||
|
||||
var notification =
|
||||
bgs.protocol.channel.v1.UpdateChannelStateNotification.CreateBuilder()
|
||||
.SetAgentId(bgs.protocol.EntityId.CreateBuilder().SetHigh(0).SetLow(0)) // caps have this set to high: 0 low: 0 /raist.
|
||||
.SetAgentId(EntityId.CreateBuilder().SetHigh(0).SetLow(0)) // caps have this set to high: 0 low: 0 /raist.
|
||||
.SetStateChange(bgs.protocol.channel.v1.ChannelState.CreateBuilder().AddInvitation(invitation)
|
||||
.SetReason((uint)InvitationRemoveReason.Declined));
|
||||
|
||||
this._onGoingInvitations.Remove(invitation.Id);
|
||||
_onGoingInvitations.Remove(invitation.Id);
|
||||
GoingInvitations.Remove(request.InvitationId);
|
||||
|
||||
inviter.LoggedInClient.MakeTargetedRPC(inviter.LoggedInClient.CurrentChannel, (lid) =>
|
||||
@ -319,9 +319,9 @@ namespace DiIiS_NA.LoginServer.ChannelSystem
|
||||
|
||||
public void Revoke(BattleClient client, bgs.protocol.channel.v1.RevokeInvitationRequest request)
|
||||
{
|
||||
if (!this._onGoingInvitations.ContainsKey(request.InvitationId)) return;
|
||||
this.CheckSubscribers();
|
||||
var invitation = this._onGoingInvitations[request.InvitationId];
|
||||
if (!_onGoingInvitations.ContainsKey(request.InvitationId)) return;
|
||||
CheckSubscribers();
|
||||
var invitation = _onGoingInvitations[request.InvitationId];
|
||||
var inviter = GameAccountManager.GetAccountByPersistentID(invitation.InviterIdentity.GameAccountId.Low);
|
||||
|
||||
var channel = ChannelManager.GetChannelByEntityId(request.ChannelId);
|
||||
@ -329,11 +329,11 @@ namespace DiIiS_NA.LoginServer.ChannelSystem
|
||||
//notify inviter about revoke
|
||||
var updateChannelNotification =
|
||||
bgs.protocol.channel.v1.UpdateChannelStateNotification.CreateBuilder()
|
||||
.SetAgentId(bgs.protocol.EntityId.CreateBuilder().SetHigh(0).SetLow(0)) // caps have this set to high: 0 low: 0 /dustin
|
||||
.SetAgentId(EntityId.CreateBuilder().SetHigh(0).SetLow(0)) // caps have this set to high: 0 low: 0 /dustin
|
||||
.SetStateChange(bgs.protocol.channel.v1.ChannelState.CreateBuilder().AddInvitation(invitation)
|
||||
.SetReason((uint)InvitationRemoveReason.Revoked));
|
||||
|
||||
this._onGoingInvitations.Remove(request.InvitationId);
|
||||
_onGoingInvitations.Remove(request.InvitationId);
|
||||
GoingInvitations.Remove(request.InvitationId);
|
||||
|
||||
inviter.LoggedInClient.MakeTargetedRPC(inviter.LoggedInClient.CurrentChannel, (lid) =>
|
||||
@ -345,7 +345,7 @@ namespace DiIiS_NA.LoginServer.ChannelSystem
|
||||
.SetInvitation(invitation);
|
||||
//.SetReason((uint)InvitationRemoveReason.Declined);
|
||||
|
||||
if (!this.Subscribers.Any(subscriber => subscriber.Key.Account.GameAccount.BnetEntityId.Low == invitation.InviteeIdentity.AccountId.Low)) return;
|
||||
if (Subscribers.All(subscriber => subscriber.Key.Account.GameAccount.BnetEntityId.Low != invitation.InviteeIdentity.AccountId.Low)) return;
|
||||
|
||||
client.MakeTargetedRPC(this, (lid) =>
|
||||
bgs.protocol.channel.v1.ChannelInvitationListener.CreateStub(client).OnReceivedInvitationRemoved(new HandlerController() { ListenerId = lid }, invitationRemoved.Build(), callback => { }));
|
||||
|
||||
@ -248,19 +248,20 @@ namespace DiIiS_NA.LoginServer.GamesSystem
|
||||
|
||||
switch (request.Partition)
|
||||
{
|
||||
case 1: //Кампания
|
||||
case 1: //"Campaign"
|
||||
|
||||
handicap = request.HandicapLevel;
|
||||
Difficulty = request.MonsterLevel;
|
||||
GameTag = request.GameTag;
|
||||
GameAct = request.GameAct;
|
||||
GameQuest = request.GameQuest;
|
||||
break;
|
||||
case 2: //Приключения
|
||||
case 2: //"Adventure"
|
||||
|
||||
Difficulty = request.HandicapLevel;
|
||||
GameTag = request.GameTag;
|
||||
break;
|
||||
case 3: //Порталы дерзаний
|
||||
|
||||
case 3: //"Adventure"
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@ -48,19 +48,19 @@ namespace DiIiS_NA.LoginServer.ServicesSystem.Services
|
||||
|
||||
public override void Logon(IRpcController controller, LogonRequest request, Action<NoData> done)
|
||||
{
|
||||
//Error 28 - Появилось обновление Diablo III, клиент закрывается.
|
||||
//Error 33 - Профилактические работы
|
||||
//Error 35 - Служба Battle.net - Отключена
|
||||
//Error 36 - Не удалось загрузить модуль аутентификации
|
||||
//Error 37 - Служба аутентификации получает слишком много обращений.
|
||||
//Error 38 - Для игры требуется получить BattleTag
|
||||
//Error 42 - Вы подключаетесь к неверному серверу (Неверная последовательность действий)
|
||||
//Error 43 - Вы заблокировали свою учетную запись с мобильного телефона.
|
||||
//Error 44 - Невозможно выполнить это действие. Учетная запись лишена функции голосового общения.
|
||||
//Error 50 - Предоплаченное для учетной записи время игры истекло.
|
||||
//Error 51 - Подписка для данной учетной записи истекла.
|
||||
//Error 52 - Данная учетная запись была заблокирована в связи с многочисленными нарушениями условий использования службы Battle.net
|
||||
//Error 53 - Действие данной учетной записи было приостановлено в связи с нарушениями условий использования службы Batle.net.
|
||||
//Error 28 - There is an update for Diablo III, the client is closing.
|
||||
//Error 33 - Maintenance
|
||||
//Error 35 - Battle.net service - Disabled
|
||||
//Error 36 - Failed to load authentication module
|
||||
//Error 37 - Authentication service is receiving too many requests.
|
||||
//Error 38 - To play you need to get BattleTag
|
||||
//Error 42 - You are connecting to the wrong server (Wrong sequence of actions)
|
||||
//Error 43 - You blocked your account from your mobile phone.
|
||||
//Error 44 - Unable to perform this action. The account is deprived of the function of voice communication.
|
||||
//Error 50 - Prepaid time for the account has expired.
|
||||
//Error 51 - Subscription for this account has expired.
|
||||
//Error 52 - This account has been blocked due to numerous violations of the terms of use of the Battle.net service
|
||||
//Error 53: Action of this account has been suspended due to violations of the terms of use of the Batle.net service
|
||||
|
||||
int VersionRetail = 81850; //74291 - 2.7.0, 76761 - 2.7.1, 79575 - 2.7.2;
|
||||
int VersionPTR = 79151;
|
||||
@ -82,9 +82,9 @@ namespace DiIiS_NA.LoginServer.ServicesSystem.Services
|
||||
}
|
||||
if (request.ApplicationVersion == 0)
|
||||
{
|
||||
var Parts = request.Version.Split('"');
|
||||
if (Parts.Length > 1)
|
||||
version = Parts[1];
|
||||
var parts = request.Version.Split('"');
|
||||
if (parts.Length > 1)
|
||||
version = parts[1];
|
||||
}
|
||||
else
|
||||
version = request.ApplicationVersion.ToString();
|
||||
@ -92,27 +92,27 @@ namespace DiIiS_NA.LoginServer.ServicesSystem.Services
|
||||
if (request.Program.ToLower() == "d3")
|
||||
if (request.ApplicationVersion != VersionRetail & request.ApplicationVersion != VersionPTR)
|
||||
{
|
||||
//Logger.Error("Подключение не правильной версии клиента!");
|
||||
//Logger.Error("Connecting the wrong client version!");
|
||||
var ercomplete = LogonResult.CreateBuilder().SetErrorCode(28);
|
||||
//(controller as HandlerController).Client.MakeRPC((lid) => AuthenticationListener.CreateStub((controller as HandlerController).Client).OnLogonComplete(controller, ercomplete.Build(), callback => { }));
|
||||
//((HandlerController)controller).Client.MakeRPC((lid) => AuthenticationListener.CreateStub(((HandlerController)controller).Client).OnLogonComplete(controller, ercomplete.Build(), callback => { }));
|
||||
}
|
||||
switch (request.Locale)
|
||||
{
|
||||
case "deDE": (controller as HandlerController).Client.ClientLanguage = Battle.BattleClient.ClientLocale.deDE; break;
|
||||
case "enGB": (controller as HandlerController).Client.ClientLanguage = Battle.BattleClient.ClientLocale.enGB; break;
|
||||
case "enSG": (controller as HandlerController).Client.ClientLanguage = Battle.BattleClient.ClientLocale.enSG; break;
|
||||
case "enUS": (controller as HandlerController).Client.ClientLanguage = Battle.BattleClient.ClientLocale.enUS; break;
|
||||
case "esES": (controller as HandlerController).Client.ClientLanguage = Battle.BattleClient.ClientLocale.esES; break;
|
||||
case "esMX": (controller as HandlerController).Client.ClientLanguage = Battle.BattleClient.ClientLocale.esMX; break;
|
||||
case "frFR": (controller as HandlerController).Client.ClientLanguage = Battle.BattleClient.ClientLocale.frFR; break;
|
||||
case "itIT": (controller as HandlerController).Client.ClientLanguage = Battle.BattleClient.ClientLocale.itIT; break;
|
||||
case "koKR": (controller as HandlerController).Client.ClientLanguage = Battle.BattleClient.ClientLocale.koKR; break;
|
||||
case "plPL": (controller as HandlerController).Client.ClientLanguage = Battle.BattleClient.ClientLocale.plPL; break;
|
||||
case "ptBR": (controller as HandlerController).Client.ClientLanguage = Battle.BattleClient.ClientLocale.ptBR; break;
|
||||
case "ptPT": (controller as HandlerController).Client.ClientLanguage = Battle.BattleClient.ClientLocale.ptPT; break;
|
||||
case "ruRU": (controller as HandlerController).Client.ClientLanguage = Battle.BattleClient.ClientLocale.ruRU; break;
|
||||
case "trTR": (controller as HandlerController).Client.ClientLanguage = Battle.BattleClient.ClientLocale.trTR; break;
|
||||
case "zhCN": (controller as HandlerController).Client.ClientLanguage = Battle.BattleClient.ClientLocale.zhCN; break;
|
||||
case "deDE": ((HandlerController)controller).Client.ClientLanguage = Battle.BattleClient.ClientLocale.deDE; break;
|
||||
case "enGB": ((HandlerController)controller).Client.ClientLanguage = Battle.BattleClient.ClientLocale.enGB; break;
|
||||
case "enSG": ((HandlerController)controller).Client.ClientLanguage = Battle.BattleClient.ClientLocale.enSG; break;
|
||||
case "enUS": ((HandlerController)controller).Client.ClientLanguage = Battle.BattleClient.ClientLocale.enUS; break;
|
||||
case "esES": ((HandlerController)controller).Client.ClientLanguage = Battle.BattleClient.ClientLocale.esES; break;
|
||||
case "esMX": ((HandlerController)controller).Client.ClientLanguage = Battle.BattleClient.ClientLocale.esMX; break;
|
||||
case "frFR": ((HandlerController)controller).Client.ClientLanguage = Battle.BattleClient.ClientLocale.frFR; break;
|
||||
case "itIT": ((HandlerController)controller).Client.ClientLanguage = Battle.BattleClient.ClientLocale.itIT; break;
|
||||
case "koKR": ((HandlerController)controller).Client.ClientLanguage = Battle.BattleClient.ClientLocale.koKR; break;
|
||||
case "plPL": ((HandlerController)controller).Client.ClientLanguage = Battle.BattleClient.ClientLocale.plPL; break;
|
||||
case "ptBR": ((HandlerController)controller).Client.ClientLanguage = Battle.BattleClient.ClientLocale.ptBR; break;
|
||||
case "ptPT": ((HandlerController)controller).Client.ClientLanguage = Battle.BattleClient.ClientLocale.ptPT; break;
|
||||
case "ruRU": ((HandlerController)controller).Client.ClientLanguage = Battle.BattleClient.ClientLocale.ruRU; break;
|
||||
case "trTR": ((HandlerController)controller).Client.ClientLanguage = Battle.BattleClient.ClientLocale.trTR; break;
|
||||
case "zhCN": ((HandlerController)controller).Client.ClientLanguage = Battle.BattleClient.ClientLocale.zhCN; break;
|
||||
}
|
||||
done(NoData.CreateBuilder().Build());
|
||||
Logger.Info("----------------------------------------------------------------");
|
||||
@ -123,21 +123,23 @@ namespace DiIiS_NA.LoginServer.ServicesSystem.Services
|
||||
case "d3":
|
||||
//if (!request.HasCachedWebCredentials)
|
||||
{
|
||||
#region Процедура аутентификации через WEB
|
||||
#region Authentication procedure through WEB
|
||||
if (request.HasCachedWebCredentials)
|
||||
VerifyWebCredentials(controller, VerifyWebCredentialsRequest.CreateBuilder().SetWebCredentials(request.CachedWebCredentials).Build(), callback => { });
|
||||
builder.SetPayloadType("web_auth_url");
|
||||
if (REST.Config.Instance.Public)
|
||||
builder.SetPayload(ByteString.CopyFromUtf8(String.Format("http://{0}:{1}/battlenet/login", REST.Config.Instance.PublicIP, REST.Config.Instance.PORT)));
|
||||
builder.SetPayload(ByteString.CopyFromUtf8(
|
||||
$"http://{REST.Config.Instance.PublicIP}:{REST.Config.Instance.PORT}/battlenet/login"));
|
||||
else
|
||||
builder.SetPayload(ByteString.CopyFromUtf8(String.Format("http://{0}:{1}/battlenet/login", Program.RESTSERVERIP, REST.Config.Instance.PORT)));
|
||||
builder.SetPayload(ByteString.CopyFromUtf8(
|
||||
$"http://{Program.RESTSERVERIP}:{REST.Config.Instance.PORT}/battlenet/login"));
|
||||
|
||||
(controller as HandlerController).Client.MakeRPC((lid) => ChallengeListener.CreateStub((controller as HandlerController).Client).OnExternalChallenge(controller, builder.Build(), callback => { }));
|
||||
((HandlerController)controller).Client.MakeRPC((lid) => ChallengeListener.CreateStub(((HandlerController)controller).Client).OnExternalChallenge(controller, builder.Build(), callback => { }));
|
||||
#endregion
|
||||
}
|
||||
break;
|
||||
default:
|
||||
Logger.Error("Authorization not implemeted for Game: {0}", game);
|
||||
Logger.Error("Authorization not implemented for Game: {0}", game);
|
||||
Logger.Info("----------------------------------------------------------------");
|
||||
break;
|
||||
}
|
||||
@ -170,10 +172,10 @@ namespace DiIiS_NA.LoginServer.ServicesSystem.Services
|
||||
#region Authentication complete
|
||||
if (request.WebCredentials.ToStringUtf8().ToLower().Contains("eu-"))
|
||||
{
|
||||
(controller as HandlerController).Client.Account = AccountManager.GetAccountByPersistentID(1);
|
||||
((HandlerController)controller).Client.Account = AccountManager.GetAccountByPersistentID(1);
|
||||
|
||||
var comple = LogonResult.CreateBuilder()
|
||||
.SetAccountId((controller as HandlerController).Client.Account.BnetEntityId)
|
||||
.SetAccountId(((HandlerController)controller).Client.Account.BnetEntityId)
|
||||
.SetEmail("TEST@MAIL.DU")
|
||||
.SetBattleTag("Test#0000")
|
||||
.SetSessionKey(ByteString.CopyFrom("7CB18EDA470F96A4DD70C70B9307CBBA2A4131043075648D8B2F55EE0E383132025D3CC3BA43406DC0740D776B1E5C366BD1123D16E6D6759075B475C28C4022".ToByteArray()))
|
||||
@ -184,49 +186,49 @@ namespace DiIiS_NA.LoginServer.ServicesSystem.Services
|
||||
.SetGeoipCountry("RU")
|
||||
.SetRestrictedMode(false)
|
||||
.SetErrorCode(0);
|
||||
comple.AddGameAccountId((controller as HandlerController).Client.Account.GameAccount.BnetEntityId);
|
||||
(controller as HandlerController).Client.Account.GameAccount.LoggedInClient = (controller as HandlerController).Client;
|
||||
(controller as HandlerController).Client.MakeRPC((lid) => AuthenticationListener.CreateStub((controller as HandlerController).Client).OnLogonComplete(controller, comple.Build(), callback => { }));
|
||||
(controller as HandlerController).Client.Account.GameAccount.ProgramField.Value = "FEN";
|
||||
PlayerManager.PlayerConnected((controller as HandlerController).Client);
|
||||
var ga1selected = GameAccountSelectedRequest.CreateBuilder().SetResult(0).SetGameAccountId((controller as HandlerController).Client.Account.GameAccount.BnetEntityId);
|
||||
(controller as HandlerController).Client.MakeRPC((lid) =>
|
||||
AuthenticationListener.CreateStub((controller as HandlerController).Client).OnGameAccountSelected(new HandlerController() { ListenerId = lid }, ga1selected.Build(), callback => { }));
|
||||
comple.AddGameAccountId(((HandlerController)controller).Client.Account.GameAccount.BnetEntityId);
|
||||
((HandlerController)controller).Client.Account.GameAccount.LoggedInClient = ((HandlerController)controller).Client;
|
||||
((HandlerController)controller).Client.MakeRPC((lid) => AuthenticationListener.CreateStub(((HandlerController)controller).Client).OnLogonComplete(controller, comple.Build(), callback => { }));
|
||||
((HandlerController)controller).Client.Account.GameAccount.ProgramField.Value = "FEN";
|
||||
PlayerManager.PlayerConnected(((HandlerController)controller).Client);
|
||||
var ga1selected = GameAccountSelectedRequest.CreateBuilder().SetResult(0).SetGameAccountId(((HandlerController)controller).Client.Account.GameAccount.BnetEntityId);
|
||||
((HandlerController)controller).Client.MakeRPC((lid) =>
|
||||
AuthenticationListener.CreateStub(((HandlerController)controller).Client).OnGameAccountSelected(new HandlerController() { ListenerId = lid }, ga1selected.Build(), callback => { }));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
(controller as HandlerController).Client.Account = AccountManager.GetAccountBySaltTicket(request.WebCredentials.ToStringUtf8());
|
||||
((HandlerController)controller).Client.Account = AccountManager.GetAccountBySaltTicket(request.WebCredentials.ToStringUtf8());
|
||||
|
||||
if ((controller as HandlerController).Client.Account == null)
|
||||
if (((HandlerController)controller).Client.Account == null)
|
||||
{
|
||||
var complete = LogonResult.CreateBuilder().SetErrorCode(2);
|
||||
(controller as HandlerController).Client.MakeRPC((lid) => AuthenticationListener.CreateStub((controller as HandlerController).Client).OnLogonComplete(controller, complete.Build(), callback => { }));
|
||||
(controller as HandlerController).Client.SocketConnection.CloseAsync();
|
||||
(controller as HandlerController).Client.Connect.CloseAsync();
|
||||
((HandlerController)controller).Client.MakeRPC((lid) => AuthenticationListener.CreateStub(((HandlerController)controller).Client).OnLogonComplete(controller, complete.Build(), callback => { }));
|
||||
((HandlerController)controller).Client.SocketConnection.CloseAsync();
|
||||
((HandlerController)controller).Client.Connect.CloseAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.Info("Client connected - {0}#{1}", (controller as HandlerController).Client.Account.DBAccount.BattleTagName, (controller as HandlerController).Client.Account.HashCode);
|
||||
Logger.Info("Client connected - {0}#{1}", ((HandlerController)controller).Client.Account.DBAccount.BattleTagName, ((HandlerController)controller).Client.Account.HashCode);
|
||||
Logger.Info("----------------------------------------------------------------");
|
||||
var complete = LogonResult.CreateBuilder()
|
||||
.SetAccountId((controller as HandlerController).Client.Account.BnetEntityId)
|
||||
.SetEmail((controller as HandlerController).Client.Account.Email)
|
||||
.SetBattleTag((controller as HandlerController).Client.Account.BattleTag)
|
||||
.SetAccountId(((HandlerController)controller).Client.Account.BnetEntityId)
|
||||
.SetEmail(((HandlerController)controller).Client.Account.Email)
|
||||
.SetBattleTag(((HandlerController)controller).Client.Account.BattleTag)
|
||||
.AddAvailableRegion(1)
|
||||
.SetConnectedRegion(1)
|
||||
.SetGeoipCountry("RU")
|
||||
.SetRestrictedMode(false)
|
||||
.SetErrorCode(0);
|
||||
complete.AddGameAccountId((controller as HandlerController).Client.Account.GameAccount.BnetEntityId); //D3
|
||||
(controller as HandlerController).Client.Account.GameAccount.LoggedInClient = (controller as HandlerController).Client;
|
||||
(controller as HandlerController).Client.MakeRPC((lid) => AuthenticationListener.CreateStub((controller as HandlerController).Client).OnLogonComplete(controller, complete.Build(), callback => { }));
|
||||
complete.AddGameAccountId(((HandlerController)controller).Client.Account.GameAccount.BnetEntityId); //D3
|
||||
((HandlerController)controller).Client.Account.GameAccount.LoggedInClient = ((HandlerController)controller).Client;
|
||||
((HandlerController)controller).Client.MakeRPC((lid) => AuthenticationListener.CreateStub(((HandlerController)controller).Client).OnLogonComplete(controller, complete.Build(), callback => { }));
|
||||
|
||||
PlayerManager.PlayerConnected((controller as HandlerController).Client);
|
||||
PlayerManager.PlayerConnected(((HandlerController)controller).Client);
|
||||
|
||||
var gaselected = GameAccountSelectedRequest.CreateBuilder().SetResult(0).SetGameAccountId((controller as HandlerController).Client.Account.GameAccount.BnetEntityId);
|
||||
(controller as HandlerController).Client.MakeRPC((lid) =>
|
||||
AuthenticationListener.CreateStub((controller as HandlerController).Client).OnGameAccountSelected(new HandlerController() { ListenerId = lid }, gaselected.Build(), callback => { }));
|
||||
var gaselected = GameAccountSelectedRequest.CreateBuilder().SetResult(0).SetGameAccountId(((HandlerController)controller).Client.Account.GameAccount.BnetEntityId);
|
||||
((HandlerController)controller).Client.MakeRPC((lid) =>
|
||||
AuthenticationListener.CreateStub(((HandlerController)controller).Client).OnGameAccountSelected(new HandlerController() { ListenerId = lid }, gaselected.Build(), callback => { }));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -98,7 +98,7 @@ namespace DiIiS_NA.Core.Discord.Modules
|
||||
var messages = await Context.Guild.GetTextChannel(AnnounceChannelId).GetMessagesAsync(10).FlattenAsync();
|
||||
await Context.Guild.GetTextChannel(AnnounceChannelId).DeleteMessagesAsync(messages);
|
||||
await Context.Guild.GetTextChannel(AnnounceChannelId).SendMessageAsync("Servers status: :tools: **PLANNED MAINTENANCE**.");
|
||||
await Context.Guild.GetTextChannel(AnnounceChannelId).SendMessageAsync($"@here Servers will be restarted in **{minutes}** minutes for a planned maintenance.\n----\nСерверы будут перезагружены через **{minutes}** минут для плановых профилактических работ.");
|
||||
await Context.Guild.GetTextChannel(AnnounceChannelId).SendMessageAsync($"@here Servers will be restarted in **{minutes}** minutes for a planned maintenance.");
|
||||
}
|
||||
|
||||
[Command("online")]
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -17,44 +17,55 @@ using System.Linq;
|
||||
using System;
|
||||
//Blizzless Project 2022
|
||||
using DiIiS_NA.Core.Helpers.Math;
|
||||
using DiIiS_NA.D3_GameServer.Core.Types.SNO;
|
||||
|
||||
namespace DiIiS_NA.Core.MPQ.FileFormats
|
||||
{
|
||||
[FileFormat(SNOGroup.AnimSet)]
|
||||
public class AnimSet : FileFormat
|
||||
{
|
||||
private static readonly AnimationTags[] deathTags = new AnimationTags[]
|
||||
{
|
||||
AnimationTags.DeathArcane,
|
||||
AnimationTags.DeathFire,
|
||||
AnimationTags.DeathLightning,
|
||||
AnimationTags.DeathPoison,
|
||||
AnimationTags.DeathPlague,
|
||||
AnimationTags.DeathDismember,
|
||||
AnimationTags.DeathDefault,
|
||||
AnimationTags.DeathPulverise,
|
||||
AnimationTags.DeathCold,
|
||||
AnimationTags.DeathLava,
|
||||
AnimationTags.DeathHoly,
|
||||
AnimationTags.DeathSpirit,
|
||||
AnimationTags.DeathFlyingOrDefault
|
||||
};
|
||||
public Header Header { get; private set; }
|
||||
public int SNOParentAnimSet { get; private set; }
|
||||
public TagMap TagMapAnimDefault { get; private set; }
|
||||
public TagMap[] AnimSetTagMaps;
|
||||
private TagMap TagMapAnimDefault;
|
||||
private TagMap[] AnimSetTagMaps;
|
||||
|
||||
|
||||
private Dictionary<int, int> _animations;
|
||||
public Dictionary<int, int> Animations
|
||||
private Dictionary<int, AnimationSno> _animations;
|
||||
public Dictionary<int, AnimationSno> Animations
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_animations == null)
|
||||
{
|
||||
_animations = new Dictionary<int, int>();
|
||||
foreach (var x in TagMapAnimDefault.TagMapEntries)
|
||||
{
|
||||
_animations.Add(x.TagID, x.Int);
|
||||
}
|
||||
//not sure how better to do this, cant load parents anims on init as they may not be loaded first. - DarkLotus
|
||||
if (SNOParentAnimSet != -1)
|
||||
{
|
||||
var ani = (FileFormats.AnimSet)MPQStorage.Data.Assets[SNOGroup.AnimSet][SNOParentAnimSet].Data;
|
||||
foreach (var x in ani.Animations)
|
||||
{
|
||||
if (!_animations.ContainsKey(x.Key))
|
||||
_animations.Add(x.Key, x.Value);
|
||||
return _animations ??= InitAnimations();
|
||||
}
|
||||
}
|
||||
|
||||
private Dictionary<int, AnimationSno> InitAnimations()
|
||||
{
|
||||
var defaultAnimations = TagMapAnimDefault.TagMapEntries.ToDictionary(x => x.TagID, x => (AnimationSno)x.Int);
|
||||
|
||||
//not sure how better to do this, cant load parents anims on init as they may not be loaded first. - DarkLotus
|
||||
if (SNOParentAnimSet != -1)
|
||||
{
|
||||
var ani = (AnimSet)MPQStorage.Data.Assets[SNOGroup.AnimSet][SNOParentAnimSet].Data;
|
||||
return defaultAnimations.Union(ani.Animations.Where(x => !defaultAnimations.ContainsKey(x.Key))).ToDictionary(x => x.Key, x => (AnimationSno)x.Value);
|
||||
}
|
||||
return _animations;
|
||||
}
|
||||
return defaultAnimations;
|
||||
}
|
||||
|
||||
public AnimSet(MpqFile file)
|
||||
@ -74,24 +85,17 @@ namespace DiIiS_NA.Core.MPQ.FileFormats
|
||||
stream.Close();
|
||||
}
|
||||
|
||||
public int GetAniSNO(AnimationTags type)
|
||||
public AnimationSno GetAniSNO(AnimationTags type)
|
||||
{
|
||||
if (Animations.Keys.Contains((int)type))
|
||||
{
|
||||
if (Animations[(int)type] != -1)
|
||||
{
|
||||
return Animations[(int)type];
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
return AnimationSno._NONE;
|
||||
}
|
||||
public bool TagExists(AnimationTags type)
|
||||
{
|
||||
if (Animations.Keys.Contains((int)type))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return Animations.Keys.Contains((int)type);
|
||||
}
|
||||
public int GetAnimationTag(AnimationTags type)
|
||||
{
|
||||
@ -101,32 +105,13 @@ namespace DiIiS_NA.Core.MPQ.FileFormats
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
public int GetRandomDeath()
|
||||
public AnimationSno GetRandomDeath()
|
||||
{
|
||||
int ani = -1;
|
||||
if (!TagExists(AnimationTags.DeathDefault)) { return -1; }
|
||||
while (ani == -1)
|
||||
if (!TagExists(AnimationTags.DeathDefault))
|
||||
{
|
||||
Array values = Enum.GetValues(typeof(DeathTags));
|
||||
ani = GetAniSNO((AnimationTags)values.GetValue(RandomHelper.Next(0, values.Length - 1)));
|
||||
return AnimationSno._NONE;
|
||||
}
|
||||
return ani;
|
||||
}
|
||||
private enum DeathTags
|
||||
{
|
||||
Arcane = 73776,
|
||||
Fire = 73744,
|
||||
Lightning = 73760,
|
||||
Poison = 73792,
|
||||
Plague = 73856,
|
||||
Dismember = 73872,
|
||||
Default = 69712,
|
||||
Pulverise = 73824,
|
||||
Cold = 74016,
|
||||
Lava = 74032,
|
||||
Holy = 74048,
|
||||
Spirit = 74064,
|
||||
FlyingOrDefault = 71424
|
||||
return deathTags.Select(x => GetAniSNO(x)).Where(x => x != AnimationSno._NONE).OrderBy(x => RandomHelper.Next()).First();
|
||||
}
|
||||
}
|
||||
public enum AnimationTags
|
||||
|
||||
@ -42,7 +42,7 @@ namespace DiIiS_NA.Core.MPQ
|
||||
return;
|
||||
}
|
||||
this.BaseMPQFiles.Add(mpqFile);
|
||||
Logger.Trace("Добавлено хранилище MPQ: {0}.", file);
|
||||
Logger.Trace("Added MPQ storage: {0}.", file);
|
||||
}
|
||||
|
||||
this.PatchPattern = patchPattern;
|
||||
@ -93,11 +93,11 @@ namespace DiIiS_NA.Core.MPQ
|
||||
{
|
||||
foreach (var mpq in pair.Value)
|
||||
{
|
||||
Logger.Trace("Архив: {0}, включен в систему.", System.IO.Path.GetFileName(mpq));
|
||||
Logger.Trace("MPQ: {0}, added to the system.", System.IO.Path.GetFileName(mpq));
|
||||
this.FileSystem.Archives.Add(new MpqArchive(new FileStream(mpq, FileMode.Open, FileAccess.Read, FileShare.ReadWrite), true));
|
||||
}
|
||||
}
|
||||
Logger.Trace("Система сконструирована.");
|
||||
Logger.Trace("MPQ system constructed.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,11 +32,11 @@ namespace DiIiS_NA.Core.MPQ
|
||||
|
||||
if (!Directory.Exists(MpqRoot))
|
||||
{
|
||||
Logger.Error("MPQ арихивы не найдены: {0}.", MpqRoot);
|
||||
Logger.Error("MPQ archives not found: {0}.", MpqRoot);
|
||||
return;
|
||||
}
|
||||
|
||||
Logger.Info("Initializating of data..");
|
||||
Logger.Info("Initializing of data..");
|
||||
MPQList = FileHelpers.GetFilesByExtensionRecursive(MpqRoot, ".mpq");
|
||||
|
||||
Data = new Data();
|
||||
|
||||
@ -181,7 +181,7 @@ namespace DiIiS_NA.GameServer.AchievementSystem
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
lock (client.serviceLock)
|
||||
lock (client._serviceLock)
|
||||
{
|
||||
Logger.Trace("GrantAchievement(): id {0}", achievementId);
|
||||
if (client.Account.GameAccount.Achievements.Where(a => a.AchievementId == achievementId && a.Completion != -1).Count() > 0) return;
|
||||
@ -202,7 +202,7 @@ namespace DiIiS_NA.GameServer.AchievementSystem
|
||||
DBGameAccount = client.Account.GameAccount.DBGameAccount,
|
||||
AchievementId = achievementId,
|
||||
Criteria = new byte[0],
|
||||
IsHardcore = AchievementManager.IsHardcore(achievementId),
|
||||
IsHardcore = IsHardcore(achievementId),
|
||||
CompleteTime = (int)DateTime.Now.ToUnixTime()
|
||||
};
|
||||
DBSessions.SessionSave(achievement);
|
||||
@ -222,7 +222,7 @@ namespace DiIiS_NA.GameServer.AchievementSystem
|
||||
|
||||
UpdateSnapshot(client, achievementId);
|
||||
|
||||
if (AchievementManager.IsHardcore(achievementId))
|
||||
if (IsHardcore(achievementId))
|
||||
{
|
||||
if (achs.Where(a => a.CompleteTime != -1 && a.IsHardcore == true).Count() >= 30) //31 in total
|
||||
{
|
||||
@ -246,7 +246,7 @@ namespace DiIiS_NA.GameServer.AchievementSystem
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
lock (client.serviceLock)
|
||||
lock (client._serviceLock)
|
||||
{
|
||||
Logger.Trace("GrantCriteria(): id {0}", criteriaId);
|
||||
D3.AchievementsStaticData.StaticCriteriaDefinition definition = null;
|
||||
@ -271,7 +271,7 @@ namespace DiIiS_NA.GameServer.AchievementSystem
|
||||
Logger.Trace("GrantCriteria(): creating new ach data");
|
||||
achievement.DBGameAccount = client.Account.GameAccount.DBGameAccount;
|
||||
achievement.AchievementId = definition.ParentAchievementId;
|
||||
achievement.IsHardcore = AchievementManager.IsHardcore(definition.ParentAchievementId);
|
||||
achievement.IsHardcore = IsHardcore(definition.ParentAchievementId);
|
||||
achievement.CompleteTime = -1;
|
||||
achievement.Quantity = 0;
|
||||
List<uint> crits = new List<uint>();
|
||||
@ -381,13 +381,13 @@ namespace DiIiS_NA.GameServer.AchievementSystem
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
lock (client.serviceLock)
|
||||
lock (client._serviceLock)
|
||||
{
|
||||
if (additionalQuantity == 0) return;
|
||||
Logger.Trace("UpdateQuantity(): id {0}", achievementId);
|
||||
if (client.Account.GameAccount.Achievements.Where(a => a.AchievementId == achievementId && a.Completion != -1).Count() > 0) return;
|
||||
|
||||
ulong mainCriteriaId = AchievementManager.GetMainCriteria(achievementId);
|
||||
ulong mainCriteriaId = GetMainCriteria(achievementId);
|
||||
var aa = client.Account.GameAccount.AchievementCriteria;
|
||||
D3.Achievements.CriteriaUpdateRecord mainCriteria;
|
||||
lock (client.Account.GameAccount.AchievementCriteria)
|
||||
@ -420,7 +420,7 @@ namespace DiIiS_NA.GameServer.AchievementSystem
|
||||
Logger.Trace("UpdateQuantity(): creating new ach data");
|
||||
achievement.DBGameAccount = client.Account.GameAccount.DBGameAccount;
|
||||
achievement.AchievementId = achievementId;
|
||||
achievement.IsHardcore = AchievementManager.IsHardcore(achievementId);
|
||||
achievement.IsHardcore = IsHardcore(achievementId);
|
||||
achievement.CompleteTime = -1;
|
||||
List<uint> crits = new List<uint>();
|
||||
achievement.Criteria = SerializeBytes(crits);
|
||||
|
||||
@ -31,18 +31,18 @@ namespace DiIiS_NA.GameServer.ClientSystem.Base
|
||||
// Note that this method should only be called prior to encryption!
|
||||
public int Receive(int start, int count)
|
||||
{
|
||||
return this.Socket.Receive(_recvBuffer, start, count, SocketFlags.None);
|
||||
return Socket.Receive(_recvBuffer, start, count, SocketFlags.None);
|
||||
}
|
||||
|
||||
// Wrapper for the Send method that will send the data either to the
|
||||
// Socket (unecnrypted) or to the TLSStream (encrypted).
|
||||
public int _Send(byte[] buffer, int start, int count, SocketFlags flags)
|
||||
{
|
||||
if (!this.IsOpen()) return 0;
|
||||
if (!IsOpen()) return 0;
|
||||
int bytes = 0;
|
||||
try
|
||||
{
|
||||
bytes = this.Socket.Send(buffer, start, count, flags);
|
||||
bytes = Socket.Send(buffer, start, count, flags);
|
||||
}
|
||||
catch
|
||||
{
|
||||
@ -79,8 +79,8 @@ namespace DiIiS_NA.GameServer.ClientSystem.Base
|
||||
if (socket == null)
|
||||
throw new ArgumentNullException("socket");
|
||||
|
||||
this.LastKeepAliveTick = DateTime.Now.ToUnixTime();
|
||||
this.Socket = socket;
|
||||
LastKeepAliveTick = DateTime.Now.ToUnixTime();
|
||||
Socket = socket;
|
||||
}
|
||||
|
||||
#region socket stuff
|
||||
@ -122,10 +122,10 @@ using (var socketEventargs = new SocketAsyncEventArgs())
|
||||
socketEventargs.SetBuffer(_recvBuffer, 0, BufferSize);
|
||||
socketEventargs.Completed += (sender, args) => ReadCallback(args);
|
||||
socketEventargs.SocketFlags = SocketFlags.None;
|
||||
socketEventargs.RemoteEndPoint = this.Socket.RemoteEndPoint;
|
||||
socketEventargs.RemoteEndPoint = Socket.RemoteEndPoint;
|
||||
socketEventargs.UserToken = this;
|
||||
|
||||
if (!this.Socket.ReceiveAsync(socketEventargs))
|
||||
if (!Socket.ReceiveAsync(socketEventargs))
|
||||
ReadCallback(socketEventargs);
|
||||
}
|
||||
}
|
||||
@ -153,7 +153,7 @@ using (var socketEventargs = new SocketAsyncEventArgs())
|
||||
{
|
||||
if (a.BytesTransferred > 0)
|
||||
{
|
||||
this.Server.OnDataReceived(new ConnectionDataEventArgs(connection, connection.RecvBuffer.Enumerate(0, a.BytesTransferred))); // Raise the DataReceived event.
|
||||
Server.OnDataReceived(new ConnectionDataEventArgs(connection, connection.RecvBuffer.Enumerate(0, a.BytesTransferred))); // Raise the DataReceived event.
|
||||
|
||||
if (connection.IsOpen())
|
||||
connection.AsyncRead();
|
||||
@ -184,7 +184,7 @@ using (var socketEventargs = new SocketAsyncEventArgs())
|
||||
public int Send(byte[] buffer)
|
||||
{
|
||||
if (buffer == null) throw new ArgumentNullException("buffer");
|
||||
if (!this.IsOpen()) return 0;
|
||||
if (!IsOpen()) return 0;
|
||||
return Send(buffer, 0, buffer.Length, SocketFlags.None);
|
||||
}
|
||||
|
||||
@ -197,7 +197,7 @@ using (var socketEventargs = new SocketAsyncEventArgs())
|
||||
public int Send(byte[] buffer, SocketFlags flags)
|
||||
{
|
||||
if (buffer == null) throw new ArgumentNullException("buffer");
|
||||
if (!this.IsOpen()) return 0;
|
||||
if (!IsOpen()) return 0;
|
||||
return Send(buffer, 0, buffer.Length, flags);
|
||||
}
|
||||
|
||||
@ -211,7 +211,7 @@ using (var socketEventargs = new SocketAsyncEventArgs())
|
||||
public int Send(byte[] buffer, int start, int count)
|
||||
{
|
||||
if (buffer == null) throw new ArgumentNullException("buffer");
|
||||
if (!this.IsOpen()) return 0;
|
||||
if (!IsOpen()) return 0;
|
||||
return Send(buffer, start, count, SocketFlags.None);
|
||||
}
|
||||
|
||||
@ -226,19 +226,19 @@ using (var socketEventargs = new SocketAsyncEventArgs())
|
||||
public int Send(byte[] buffer, int start, int count, SocketFlags flags)
|
||||
{
|
||||
if (buffer == null) throw new ArgumentNullException("buffer");
|
||||
if (!this.IsOpen()) return 0;
|
||||
if (!IsOpen()) return 0;
|
||||
|
||||
var totalBytesSent = 0;
|
||||
var bytesRemaining = buffer.Length;
|
||||
|
||||
try
|
||||
{
|
||||
if (this.Socket == null || this.Socket.Available < 0) throw new Exception("socket is null");
|
||||
lock (this.socketLock)
|
||||
if (Socket == null || Socket.Available < 0) throw new Exception("socket is null");
|
||||
lock (socketLock)
|
||||
{
|
||||
while (bytesRemaining > 0 && this.IsOpen() && !_closing) // Ensure we send every byte.
|
||||
while (bytesRemaining > 0 && IsOpen() && !_closing) // Ensure we send every byte.
|
||||
{
|
||||
int bytesSent = this._Send(buffer, totalBytesSent, bytesRemaining, flags);
|
||||
int bytesSent = _Send(buffer, totalBytesSent, bytesRemaining, flags);
|
||||
|
||||
if (bytesSent == 0) break;
|
||||
bytesRemaining -= bytesSent;
|
||||
@ -248,11 +248,11 @@ using (var socketEventargs = new SocketAsyncEventArgs())
|
||||
}
|
||||
catch (SocketException)
|
||||
{
|
||||
this.Disconnect();
|
||||
Disconnect();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.Disconnect();
|
||||
Disconnect();
|
||||
Logger.WarnException(e, "Send");
|
||||
}
|
||||
|
||||
@ -267,7 +267,7 @@ using (var socketEventargs = new SocketAsyncEventArgs())
|
||||
public int Send(IEnumerable<byte> data)
|
||||
{
|
||||
if (data == null) throw new ArgumentNullException("data");
|
||||
if (!this.IsOpen()) return 0;
|
||||
if (!IsOpen()) return 0;
|
||||
return Send(data, SocketFlags.None);
|
||||
}
|
||||
|
||||
@ -280,7 +280,7 @@ using (var socketEventargs = new SocketAsyncEventArgs())
|
||||
public int Send(IEnumerable<byte> data, SocketFlags flags)
|
||||
{
|
||||
if (data == null) throw new ArgumentNullException("data");
|
||||
if (!this.IsOpen()) return 0;
|
||||
if (!IsOpen()) return 0;
|
||||
var buffer = data.ToArray();
|
||||
return Send(buffer, 0, buffer.Length, SocketFlags.None);
|
||||
}
|
||||
@ -297,14 +297,14 @@ using (var socketEventargs = new SocketAsyncEventArgs())
|
||||
Task.Run(() => {
|
||||
try
|
||||
{
|
||||
this.Server.OnClientDisconnect(new ConnectionEventArgs(this));
|
||||
if (this.Socket != null)
|
||||
Server.OnClientDisconnect(new ConnectionEventArgs(this));
|
||||
if (Socket != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.Socket.Shutdown(SocketShutdown.Both);
|
||||
this.Socket.Close();
|
||||
this.Socket = null;
|
||||
Socket.Shutdown(SocketShutdown.Both);
|
||||
Socket.Close();
|
||||
Socket = null;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@ -324,7 +324,7 @@ using (var socketEventargs = new SocketAsyncEventArgs())
|
||||
{
|
||||
get
|
||||
{
|
||||
return (this.Client is BattleClient);
|
||||
return (Client is BattleClient);
|
||||
}
|
||||
}
|
||||
|
||||
@ -333,7 +333,7 @@ using (var socketEventargs = new SocketAsyncEventArgs())
|
||||
_closed = true;
|
||||
}
|
||||
|
||||
public bool IsOpen() { return !_closed && this.Socket != null/* && (!this.IsMooNet || this.LastKeepAliveTick > (DateTime.Now.ToUnixTime() - 120U))*/; }
|
||||
public bool IsOpen() { return !_closed && Socket != null/* && (!this.IsMooNet || this.LastKeepAliveTick > (DateTime.Now.ToUnixTime() - 120U))*/; }
|
||||
public uint LastKeepAliveTick { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -18,7 +18,7 @@ namespace DiIiS_NA.GameServer.ClientSystem.Base
|
||||
public ConnectionDataEventArgs(IConnection connection, IEnumerable<byte> data)
|
||||
: base(connection)
|
||||
{
|
||||
this.Data = data ?? new byte[0];
|
||||
Data = data ?? new byte[0];
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
|
||||
@ -19,7 +19,7 @@ namespace DiIiS_NA.GameServer.ClientSystem.Base
|
||||
{
|
||||
if (connection == null)
|
||||
throw new ArgumentNullException("connection");
|
||||
this.Connection = connection;
|
||||
Connection = connection;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
|
||||
@ -41,11 +41,11 @@ namespace DiIiS_NA.GameServer.ClientSystem.Base
|
||||
public virtual bool Listen(string bindIP, int port)
|
||||
{
|
||||
// Check if the server has been disposed.
|
||||
if (_disposed) throw new ObjectDisposedException(this.GetType().Name, "Server has been disposed.");
|
||||
if (_disposed) throw new ObjectDisposedException(GetType().Name, "Server has been disposed.");
|
||||
|
||||
// Check if the server is already listening.
|
||||
if (IsListening) throw new InvalidOperationException("Server is already listening.");
|
||||
this.Port = port;
|
||||
Port = port;
|
||||
|
||||
Acceptor = new AsyncAcceptor();
|
||||
if (!Acceptor.Start(bindIP, port))
|
||||
|
||||
@ -136,7 +136,7 @@ namespace DiIiS_NA.GameServer.ClientSystem
|
||||
if (client.Player.PlayerIndex > 0)
|
||||
{
|
||||
//make sure toons Difficulty is set
|
||||
toon.CurrentDifficulty = (int)game.Difficulty;
|
||||
toon.CurrentDifficulty = game.Difficulty;
|
||||
client.SendMessage(new HandicapMessage(Opcodes.HandicapMessage)
|
||||
{
|
||||
Difficulty = (uint)game.Difficulty
|
||||
|
||||
@ -48,11 +48,11 @@ namespace DiIiS_NA.GameServer.ClientSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._tickingEnabled;
|
||||
return _tickingEnabled;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._tickingEnabled = value;
|
||||
_tickingEnabled = value;
|
||||
//if (value == true)
|
||||
//this.SendTick();
|
||||
}
|
||||
@ -64,8 +64,8 @@ namespace DiIiS_NA.GameServer.ClientSystem
|
||||
|
||||
public GameClient(IConnection connection)
|
||||
{
|
||||
this.TickingEnabled = false;
|
||||
this.Connection = connection;
|
||||
TickingEnabled = false;
|
||||
Connection = connection;
|
||||
_outgoingBuffer.WriteInt(32, 0);
|
||||
}
|
||||
|
||||
@ -87,12 +87,12 @@ namespace DiIiS_NA.GameServer.ClientSystem
|
||||
|
||||
_incomingBuffer.AppendData(e.Data.ToArray());
|
||||
|
||||
while (this.Connection.IsOpen() && _incomingBuffer.IsPacketAvailable())
|
||||
while (Connection.IsOpen() && _incomingBuffer.IsPacketAvailable())
|
||||
{
|
||||
int end = _incomingBuffer.Position;
|
||||
end += _incomingBuffer.ReadInt(32) * 8;
|
||||
|
||||
while ((end - _incomingBuffer.Position) >= 9 && this.Connection.IsOpen())
|
||||
while ((end - _incomingBuffer.Position) >= 9 && Connection.IsOpen())
|
||||
{
|
||||
var message = _incomingBuffer.ParseMessage();
|
||||
//217
|
||||
@ -106,7 +106,7 @@ namespace DiIiS_NA.GameServer.ClientSystem
|
||||
if (message.Consumer != Consumers.None)
|
||||
{
|
||||
if (message.Consumer == Consumers.ClientManager) ClientManager.Instance.Consume(this, message); // Client should be greeted by ClientManager and sent initial game-setup messages.
|
||||
else this.Game.Route(this, message);
|
||||
else Game.Route(this, message);
|
||||
}
|
||||
|
||||
else if (message is ISelfHandler) (message as ISelfHandler).Handle(this); // if message is able to handle itself, let it do so.
|
||||
@ -143,9 +143,9 @@ namespace DiIiS_NA.GameServer.ClientSystem
|
||||
public virtual void SendMessage(GameMessage message)
|
||||
{
|
||||
//System.Threading.Thread.Sleep(50);
|
||||
lock (this._outgoingBuffer)
|
||||
lock (_outgoingBuffer)
|
||||
{
|
||||
if (this.Game.TickCounter > this.LastReplicatedTick && this.TickingEnabled && !(message is GameTickMessage) /*&& !(message is EndOfTickMessage)*/ && !this.Player.BetweenWorlds)
|
||||
if (Game.TickCounter > LastReplicatedTick && TickingEnabled && !(message is GameTickMessage) /*&& !(message is EndOfTickMessage)*/ && !Player.BetweenWorlds)
|
||||
{
|
||||
/*var endMessage = new EndOfTickMessage()
|
||||
{
|
||||
@ -156,8 +156,8 @@ namespace DiIiS_NA.GameServer.ClientSystem
|
||||
_outgoingBuffer.EncodeMessage(endMessage);
|
||||
Connection.Send(_outgoingBuffer.GetPacketAndReset());*/
|
||||
|
||||
this.LastReplicatedTick = this.Game.TickCounter;
|
||||
var tickMessage = new GameTickMessage(this.Game.TickCounter);
|
||||
LastReplicatedTick = Game.TickCounter;
|
||||
var tickMessage = new GameTickMessage(Game.TickCounter);
|
||||
Logger.LogOutgoingPacket(tickMessage);
|
||||
_outgoingBuffer.EncodeMessage(tickMessage);
|
||||
Connection.Send(_outgoingBuffer.GetPacketAndReset());
|
||||
@ -168,7 +168,7 @@ namespace DiIiS_NA.GameServer.ClientSystem
|
||||
Logger.LogOutgoingPacket(message);
|
||||
_outgoingBuffer.EncodeMessage(message); // change ConsoleTarget's level to Level.Dump in program.cs if u want to see messages on console.
|
||||
|
||||
if (this.TickingEnabled)
|
||||
if (TickingEnabled)
|
||||
{
|
||||
var data = _outgoingBuffer.GetPacketAndReset();
|
||||
Connection.Send(data);
|
||||
@ -190,19 +190,19 @@ namespace DiIiS_NA.GameServer.ClientSystem
|
||||
public void SendTick()
|
||||
{
|
||||
//if (_outgoingBuffer.Length <= 32) return;
|
||||
lock (this._outgoingBuffer)
|
||||
lock (_outgoingBuffer)
|
||||
{
|
||||
if (!dataSent) return;
|
||||
|
||||
if (this.TickingEnabled && this.Game.TickCounter > this.LastReplicatedTick)
|
||||
if (TickingEnabled && Game.TickCounter > LastReplicatedTick)
|
||||
{
|
||||
/*this.SendMessage(new EndOfTickMessage()
|
||||
{
|
||||
Field0 = this.Game.TickCounter,
|
||||
Field1 = this.LastReplicatedTick
|
||||
}); // send the tick end.*/
|
||||
this.SendMessage(new GameTickMessage(this.Game.TickCounter)); // send the tick.
|
||||
this.LastReplicatedTick = this.Game.TickCounter;
|
||||
SendMessage(new GameTickMessage(Game.TickCounter)); // send the tick.
|
||||
LastReplicatedTick = Game.TickCounter;
|
||||
//this.SendMessage(new GameTickMessage(0)); //before client enters game causes freeze with PvP scoreboard
|
||||
/*this.SendMessage(new EndOfTickMessage()
|
||||
{
|
||||
@ -210,14 +210,14 @@ namespace DiIiS_NA.GameServer.ClientSystem
|
||||
Field1 = 0
|
||||
}); // send the tick end*/
|
||||
dataSent = false;
|
||||
this.FlushOutgoingBuffer();
|
||||
FlushOutgoingBuffer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void FlushOutgoingBuffer()
|
||||
{
|
||||
lock (this._outgoingBuffer)
|
||||
lock (_outgoingBuffer)
|
||||
{
|
||||
if (_outgoingBuffer.Length <= 32) return;
|
||||
|
||||
|
||||
@ -28,9 +28,9 @@ namespace DiIiS_NA.GameServer.ClientSystem
|
||||
public Bot DiscordBot { get; set; }
|
||||
public GameServer()
|
||||
{
|
||||
this.OnConnect += ClientManager.Instance.OnConnect;
|
||||
this.OnDisconnect += ClientManager.Instance.OnDisconnect;
|
||||
this.DataReceived += GameServer_DataReceived;
|
||||
OnConnect += ClientManager.Instance.OnConnect;
|
||||
OnDisconnect += ClientManager.Instance.OnDisconnect;
|
||||
DataReceived += GameServer_DataReceived;
|
||||
}
|
||||
|
||||
void GameServer_DataReceived(object sender, ConnectionDataEventArgs e)
|
||||
@ -43,7 +43,7 @@ namespace DiIiS_NA.GameServer.ClientSystem
|
||||
{
|
||||
int Port = 2001;
|
||||
|
||||
if (!this.Listen(Program.GAMESERVERIP, Port)) return;
|
||||
if (!Listen(Program.GAMESERVERIP, Port)) return;
|
||||
Logger.Info("Game Server Started - {0}:{1}...", Program.GAMESERVERIP, Port);
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,9 +33,9 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
|
||||
public CommandGroupAttribute(string name, string help, Account.UserLevels minUserLevel = Account.UserLevels.Admin)
|
||||
{
|
||||
this.Name = name.ToLower();
|
||||
this.Help = help;
|
||||
this.MinUserLevel = minUserLevel;
|
||||
Name = name.ToLower();
|
||||
Help = help;
|
||||
MinUserLevel = minUserLevel;
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,9 +59,9 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
|
||||
public CommandAttribute(string command, string help, Account.UserLevels minUserLevel = Account.UserLevels.User)
|
||||
{
|
||||
this.Name = command.ToLower();
|
||||
this.Help = help;
|
||||
this.MinUserLevel = minUserLevel;
|
||||
Name = command.ToLower();
|
||||
Help = help;
|
||||
MinUserLevel = minUserLevel;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -28,14 +28,14 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
|
||||
public void Register(CommandGroupAttribute attributes)
|
||||
{
|
||||
this.Attributes = attributes;
|
||||
this.RegisterDefaultCommand();
|
||||
this.RegisterCommands();
|
||||
Attributes = attributes;
|
||||
RegisterDefaultCommand();
|
||||
RegisterCommands();
|
||||
}
|
||||
|
||||
private void RegisterCommands()
|
||||
{
|
||||
foreach (var method in this.GetType().GetMethods())
|
||||
foreach (var method in GetType().GetMethods())
|
||||
{
|
||||
object[] attributes = method.GetCustomAttributes(typeof(CommandAttribute), true);
|
||||
if (attributes.Length == 0) continue;
|
||||
@ -43,8 +43,8 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
var attribute = (CommandAttribute)attributes[0];
|
||||
if (attribute is DefaultCommand) continue;
|
||||
|
||||
if (!this._commands.ContainsKey(attribute))
|
||||
this._commands.Add(attribute, method);
|
||||
if (!_commands.ContainsKey(attribute))
|
||||
_commands.Add(attribute, method);
|
||||
else
|
||||
Logger.Warn("There exists an already registered command '{0}'.", attribute.Name);
|
||||
}
|
||||
@ -52,38 +52,38 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
|
||||
private void RegisterDefaultCommand()
|
||||
{
|
||||
foreach (var method in this.GetType().GetMethods())
|
||||
foreach (var method in GetType().GetMethods())
|
||||
{
|
||||
object[] attributes = method.GetCustomAttributes(typeof(DefaultCommand), true);
|
||||
if (attributes.Length == 0) continue;
|
||||
if (method.Name.ToLower() == "fallback") continue;
|
||||
|
||||
this._commands.Add(new DefaultCommand(this.Attributes.MinUserLevel), method);
|
||||
_commands.Add(new DefaultCommand(Attributes.MinUserLevel), method);
|
||||
return;
|
||||
}
|
||||
|
||||
// set the fallback command if we couldn't find a defined DefaultCommand.
|
||||
this._commands.Add(new DefaultCommand(this.Attributes.MinUserLevel), this.GetType().GetMethod("Fallback"));
|
||||
_commands.Add(new DefaultCommand(Attributes.MinUserLevel), GetType().GetMethod("Fallback"));
|
||||
}
|
||||
|
||||
public virtual string Handle(string parameters, BattleClient invokerClient = null)
|
||||
{
|
||||
// check if the user has enough privileges to access command group.
|
||||
// check if the user has enough privileges to invoke the command.
|
||||
if (invokerClient != null && this.Attributes.MinUserLevel > invokerClient.Account.UserLevel)
|
||||
if (invokerClient != null && Attributes.MinUserLevel > invokerClient.Account.UserLevel)
|
||||
return "You don't have enough privileges to invoke that command.";
|
||||
|
||||
string[] @params = null;
|
||||
CommandAttribute target = null;
|
||||
|
||||
if (parameters == string.Empty)
|
||||
target = this.GetDefaultSubcommand();
|
||||
target = GetDefaultSubcommand();
|
||||
else
|
||||
{
|
||||
@params = parameters.Split(' ');
|
||||
target = this.GetSubcommand(@params[0]) ?? this.GetDefaultSubcommand();
|
||||
target = GetSubcommand(@params[0]) ?? GetDefaultSubcommand();
|
||||
|
||||
if (target != this.GetDefaultSubcommand())
|
||||
if (target != GetDefaultSubcommand())
|
||||
@params = @params.Skip(1).ToArray();
|
||||
}
|
||||
|
||||
@ -91,12 +91,12 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
if (invokerClient != null && target.MinUserLevel > invokerClient.Account.UserLevel)
|
||||
return "You don't have enough privileges to invoke that command.";
|
||||
|
||||
return (string)this._commands[target].Invoke(this, new object[] { @params, invokerClient });
|
||||
return (string)_commands[target].Invoke(this, new object[] { @params, invokerClient });
|
||||
}
|
||||
|
||||
public string GetHelp(string command)
|
||||
{
|
||||
foreach (var pair in this._commands)
|
||||
foreach (var pair in _commands)
|
||||
{
|
||||
if (command != pair.Key.Name) continue;
|
||||
return pair.Key.Help;
|
||||
@ -109,7 +109,7 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
public virtual string Fallback(string[] @params = null, BattleClient invokerClient = null)
|
||||
{
|
||||
var output = "Available subcommands: ";
|
||||
foreach (var pair in this._commands)
|
||||
foreach (var pair in _commands)
|
||||
{
|
||||
if (pair.Key.Name.Trim() == string.Empty) continue; // skip fallback command.
|
||||
if (invokerClient != null && pair.Key.MinUserLevel > invokerClient.Account.UserLevel) continue;
|
||||
@ -121,12 +121,12 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
|
||||
protected CommandAttribute GetDefaultSubcommand()
|
||||
{
|
||||
return this._commands.Keys.First();
|
||||
return _commands.Keys.First();
|
||||
}
|
||||
|
||||
protected CommandAttribute GetSubcommand(string name)
|
||||
{
|
||||
return this._commands.Keys.FirstOrDefault(command => command.Name == name);
|
||||
return _commands.Keys.FirstOrDefault(command => command.Name == name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -171,7 +171,7 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
public override string Handle(string parameters, BattleClient invokerClient = null)
|
||||
{
|
||||
if (parameters == string.Empty)
|
||||
return this.Fallback();
|
||||
return Fallback();
|
||||
|
||||
string output = string.Empty;
|
||||
bool found = false;
|
||||
|
||||
@ -13,7 +13,7 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
{
|
||||
public sealed class Config : DiIiS_NA.Core.Config.Config
|
||||
{
|
||||
public char CommandPrefix { get { return this.GetString("CommandPrefix", "!")[0]; } set { this.Set("CommandPrefix", value); } }
|
||||
public char CommandPrefix { get { return GetString("CommandPrefix", "!")[0]; } set { Set("CommandPrefix", value); } }
|
||||
|
||||
private static readonly Config _instance = new Config();
|
||||
public static Config Instance { get { return _instance; } }
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
//Blizzless Project 2022
|
||||
//Blizzless Project 2022
|
||||
using DiIiS_NA.Core.Helpers.Math;
|
||||
//Blizzless Project 2022
|
||||
using DiIiS_NA.Core.MPQ;
|
||||
@ -37,11 +37,37 @@ using System.Linq;
|
||||
using System.Text;
|
||||
//Blizzless Project 2022
|
||||
using System.Threading.Tasks;
|
||||
using DiIiS_NA.GameServer.GSSystem.ObjectsSystem;
|
||||
using DiIiS_NA.LoginServer.AccountsSystem;
|
||||
//Blizzless Project 2022
|
||||
using static DiIiS_NA.Core.MPQ.FileFormats.GameBalance;
|
||||
|
||||
namespace DiIiS_NA.GameServer.CommandManager
|
||||
{
|
||||
[CommandGroup("invulnerable", "Makes you invulnerable")]
|
||||
public class InvulnerableCommand : CommandGroup
|
||||
{
|
||||
[DefaultCommand]
|
||||
public string Invulnerable(string[] @params, BattleClient invokerClient)
|
||||
{
|
||||
if (invokerClient?.InGameClient?.Player is not { } player)
|
||||
return "You can not invoke this command from console.";
|
||||
|
||||
if (player.Attributes.FixedMap.Contains(FixedAttribute.Invulnerable))
|
||||
{
|
||||
player.Attributes.FixedMap.Remove(FixedAttribute.Invulnerable);
|
||||
player.Attributes[GameAttribute.Invulnerable] = false;
|
||||
player.Attributes.BroadcastChangedIfRevealed();
|
||||
return "You are no longer invulnerable.";
|
||||
}
|
||||
|
||||
player.Attributes.FixedMap.Add(FixedAttribute.Invulnerable,
|
||||
attributes => { attributes[GameAttribute.Invulnerable] = true; });
|
||||
player.Attributes.BroadcastChangedIfRevealed();
|
||||
return "You are now invulnerable.";
|
||||
}
|
||||
}
|
||||
|
||||
[CommandGroup("spawn", "Spawns a mob.\nUsage: spawn [actorSNO] [amount]")]
|
||||
public class SpawnCommand : CommandGroup
|
||||
{
|
||||
@ -93,7 +119,7 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
var monster = player.World.SpawnMonster((ActorSno)actorSNO, position);
|
||||
|
||||
}
|
||||
return string.Format("Spawned {0} mobs with ActorSNO: {1}", amount, actorSNO);
|
||||
return $"Spawned {amount} mobs with ActorSNO: {actorSNO}";
|
||||
}
|
||||
|
||||
}
|
||||
@ -140,9 +166,9 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
|
||||
player.Toon.GameAccount.NotifyUpdate();
|
||||
if (player.Level >= 70)
|
||||
return string.Format("New paragon level: {0}", player.ParagonLevel);
|
||||
return $"New paragon level: {player.ParagonLevel}";
|
||||
else
|
||||
return string.Format("New level: {0}", player.Toon.Level);
|
||||
return $"New level: {player.Toon.Level}";
|
||||
}
|
||||
}
|
||||
|
||||
@ -183,7 +209,8 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
}
|
||||
}
|
||||
|
||||
[CommandGroup("platinum", "Platinum for your character.\nOptionally specify the number of levels: !platinum [count]")]
|
||||
[CommandGroup("platinum",
|
||||
"Platinum for your character.\nOptionally specify the number of levels: !platinum [count]")]
|
||||
public class PlatinumCommand : CommandGroup
|
||||
{
|
||||
[DefaultCommand]
|
||||
@ -260,11 +287,12 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
|
||||
player.Inventory.AddGoldAmount(amount);
|
||||
|
||||
return string.Format("Added Gold {0}", amount);
|
||||
return $"Added Gold {amount}";
|
||||
}
|
||||
}
|
||||
|
||||
[CommandGroup("achiplatinum", "Platinum for your character.\nOptionally specify the number of levels: !platinum [count]")]
|
||||
[CommandGroup("achiplatinum",
|
||||
"Platinum for your character.\nOptionally specify the number of levels: !platinum [count]")]
|
||||
public class PlatinumAchiCommand : CommandGroup
|
||||
{
|
||||
[DefaultCommand]
|
||||
@ -325,7 +353,7 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
|
||||
player.PlayEffectGroup(id);
|
||||
|
||||
return string.Format("PlayEffectGroup {0}", id);
|
||||
return $"PlayEffectGroup {id}";
|
||||
}
|
||||
}
|
||||
|
||||
@ -347,7 +375,7 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
|
||||
|
||||
if (@params == null)
|
||||
return this.Fallback();
|
||||
return Fallback();
|
||||
|
||||
name = @params[0];
|
||||
|
||||
@ -370,7 +398,7 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
item.EnterWorld(position);
|
||||
}
|
||||
|
||||
return string.Format("Spawned {0} items with name: {1}", amount, name);
|
||||
return $"Spawned {amount} items with name: {name}";
|
||||
|
||||
}
|
||||
|
||||
@ -413,7 +441,7 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
item.EnterWorld(position);
|
||||
}
|
||||
|
||||
return string.Format("Spawned {0} items with type: {1}", amount, name);
|
||||
return $"Spawned {amount} items with type: {name}";
|
||||
}
|
||||
|
||||
[Command("dropall", "Drops all items in Backpack.\nUsage: item dropall")]
|
||||
@ -435,7 +463,7 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
var msg = new InventoryDropItemMessage { ItemID = item.DynamicID(player) };
|
||||
player.Inventory.Consume(invokerClient.InGameClient, msg);
|
||||
}
|
||||
return string.Format("Dropped {0} Items for you", bpItems.Count);
|
||||
return $"Dropped {bpItems.Count} Items for you";
|
||||
}
|
||||
}
|
||||
|
||||
@ -469,8 +497,10 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
|
||||
invokerClient.InGameClient.Player.ChangeWorld(world, world.StartingPoints.First().Position);
|
||||
|
||||
var proximity = new System.Drawing.RectangleF(invokerClient.InGameClient.Player.Position.X - 1f, invokerClient.InGameClient.Player.Position.Y - 1f, 2f, 2f);
|
||||
var scenes = invokerClient.InGameClient.Player.World.QuadTree.Query<GSSystem.MapSystem.Scene>(proximity);
|
||||
var proximity = new System.Drawing.RectangleF(invokerClient.InGameClient.Player.Position.X - 1f,
|
||||
invokerClient.InGameClient.Player.Position.Y - 1f, 2f, 2f);
|
||||
var scenes =
|
||||
invokerClient.InGameClient.Player.World.QuadTree.Query<GSSystem.MapSystem.Scene>(proximity);
|
||||
if (scenes.Count == 0) return ""; // cork (is it real?)
|
||||
|
||||
var scene = scenes[0]; // Parent scene /fasbat
|
||||
@ -484,21 +514,26 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
var levelArea = scene.Specification.SNOLevelAreas[0];
|
||||
|
||||
//handling quest triggers
|
||||
if (invokerClient.InGameClient.Player.World.Game.SideQuestProgress.GlobalQuestTriggers.ContainsKey(levelArea)) //EnterLevelArea
|
||||
if (invokerClient.InGameClient.Player.World.Game.SideQuestProgress.GlobalQuestTriggers
|
||||
.ContainsKey(levelArea)) //EnterLevelArea
|
||||
{
|
||||
var trigger = invokerClient.InGameClient.Player.World.Game.SideQuestProgress.GlobalQuestTriggers[levelArea];
|
||||
if (trigger.triggerType == DiIiS_NA.Core.MPQ.FileFormats.QuestStepObjectiveType.EnterLevelArea)
|
||||
var trigger =
|
||||
invokerClient.InGameClient.Player.World.Game.SideQuestProgress.GlobalQuestTriggers[levelArea];
|
||||
if (trigger.triggerType == QuestStepObjectiveType.EnterLevelArea)
|
||||
{
|
||||
try
|
||||
{
|
||||
trigger.questEvent.Execute(invokerClient.InGameClient.Player.World); // launch a questEvent
|
||||
}
|
||||
catch { }
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var bounty in invokerClient.InGameClient.Player.World.Game.QuestManager.Bounties)
|
||||
bounty.CheckLevelArea(levelArea);
|
||||
return string.Format("Teleported to: {0} [id: {1}]", MPQStorage.Data.Assets[SNOGroup.Worlds][worldId].Name, worldId);
|
||||
return $"Teleported to: {MPQStorage.Data.Assets[SNOGroup.Worlds][worldId].Name} [id: {worldId}]";
|
||||
}
|
||||
|
||||
return "Invalid arguments. Type 'help tp' to get help.";
|
||||
@ -524,7 +559,7 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
{
|
||||
var conversation = MPQStorage.Data.Assets[SNOGroup.Conversation][Int32.Parse(@params[0])];
|
||||
invokerClient.InGameClient.Player.Conversations.StartConversation(Int32.Parse(@params[0]));
|
||||
return String.Format("Started conversation {0}", conversation.FileName);
|
||||
return $"Started conversation {conversation.FileName}";
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@ -533,55 +568,51 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
}
|
||||
}
|
||||
|
||||
[CommandGroup("speed", "Modify speed walk of you character.")]
|
||||
[CommandGroup("speed", "Modify speed walk of you character.\nUsage: !speed <value>\nReset: !speed")]
|
||||
public class ModifySpeedCommand : CommandGroup
|
||||
{
|
||||
[DefaultCommand]
|
||||
public string ModifySpeed(string[] @params, BattleClient invokerClient)
|
||||
{
|
||||
if (invokerClient == null)
|
||||
return "You can not invoke this command from console.";
|
||||
|
||||
if (invokerClient.InGameClient == null)
|
||||
return "You can only invoke this command while ingame.";
|
||||
if (invokerClient?.InGameClient == null)
|
||||
return "This command can only be used in-game.";
|
||||
|
||||
if (@params == null)
|
||||
return "Change the movement speed. Min 0 (Base), Max 2.\n You can use decimal values like 1,3 for example.";
|
||||
return
|
||||
"Change the movement speed. Min 0 (Base), Max 2.\n You can use decimal values like 1,3 for example.";
|
||||
float speedValue;
|
||||
|
||||
foreach (char ch in @params[0])
|
||||
const float maxSpeed = 3; // 2;
|
||||
const float baseSpeed = 0.36f;
|
||||
|
||||
if (@params.Any())
|
||||
{
|
||||
if (Char.IsLetter(ch))
|
||||
return "Only Numbers";
|
||||
}
|
||||
|
||||
if (@params[0].Contains(","))
|
||||
return "jojo";
|
||||
|
||||
float SpeedValue = float.Parse(@params[0]);
|
||||
float MaxSpeed = 2;
|
||||
float BaseSpeed = 0.36f;
|
||||
var playerSpeed = invokerClient.InGameClient.Player.Attributes;
|
||||
|
||||
if (SpeedValue <= BaseSpeed) // Base Run Speed [Necrosummon]
|
||||
{
|
||||
playerSpeed[GameAttribute.Running_Rate] = BaseSpeed;
|
||||
return "Speed changed to Base Speed";
|
||||
}
|
||||
|
||||
if (SpeedValue > MaxSpeed)
|
||||
{
|
||||
playerSpeed[GameAttribute.Running_Rate] = MaxSpeed;
|
||||
return string.Format("MaxSpeed {0}", MaxSpeed);
|
||||
if (!float.TryParse(@params[0], out speedValue) || speedValue < 0 || speedValue > maxSpeed)
|
||||
return ("Invalid speed value. Must be a number between 0 and 3.");
|
||||
}
|
||||
else
|
||||
playerSpeed[GameAttribute.Running_Rate] = SpeedValue;
|
||||
{
|
||||
speedValue = 0;
|
||||
}
|
||||
|
||||
var playerSpeed = invokerClient.InGameClient.Player.Attributes;
|
||||
|
||||
if (playerSpeed.FixedMap.Contains(FixedAttribute.Speed))
|
||||
playerSpeed.FixedMap.Remove(FixedAttribute.Speed);
|
||||
|
||||
if (speedValue <= baseSpeed) // Base Run Speed [Necrosummon]
|
||||
{
|
||||
playerSpeed[GameAttribute.Running_Rate] = baseSpeed;
|
||||
return $"Speed reset to Base Speed ({baseSpeed:0.000}).";
|
||||
}
|
||||
|
||||
playerSpeed.FixedMap.Add(FixedAttribute.Speed, attr => attr[GameAttribute.Running_Rate] = speedValue);
|
||||
playerSpeed.BroadcastChangedIfRevealed();
|
||||
return string.Format("Speed changed to {0}", SpeedValue);
|
||||
}
|
||||
return $"Speed changed to {speedValue}";
|
||||
}
|
||||
|
||||
[CommandGroup("quest", "Retrieves information about quest states and manipulates quest progress.\n Usage: quest [triggers | trigger eventType eventValue | advance snoQuest]")]
|
||||
[CommandGroup("quest",
|
||||
"Retrieves information about quest states and manipulates quest progress.\n Usage: quest [triggers | trigger eventType eventValue | advance snoQuest]")]
|
||||
public class QuestCommand : CommandGroup
|
||||
{
|
||||
[DefaultCommand]
|
||||
@ -628,7 +659,7 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
public string Event(string[] @params, BattleClient invokerClient)
|
||||
{
|
||||
if (@params == null)
|
||||
return this.Fallback();
|
||||
return Fallback();
|
||||
|
||||
if (@params.Count() != 1)
|
||||
return "Invalid arguments. Type 'help text public' to get help.";
|
||||
@ -650,7 +681,7 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
public string Timer(string[] @params, BattleClient invokerClient)
|
||||
{
|
||||
if (@params == null)
|
||||
return this.Fallback();
|
||||
return Fallback();
|
||||
|
||||
if (@params.Count() != 2)
|
||||
return "Invalid arguments. Type 'help text public' to get help.";
|
||||
@ -658,20 +689,26 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
int eventId = Int32.Parse(@params[0]);
|
||||
int duration = Int32.Parse(@params[1]);
|
||||
|
||||
invokerClient.InGameClient.Game.QuestManager.LaunchQuestTimer(eventId, (float)duration, new Action<int>((q) => { }));
|
||||
invokerClient.InGameClient.Game.QuestManager.LaunchQuestTimer(eventId, (float)duration,
|
||||
new Action<int>((q) => { }));
|
||||
|
||||
return String.Format("Message sended.");
|
||||
}
|
||||
|
||||
return matches.Aggregate(matches.Count >= 1 ? "Actor Matches:\n" : "No match found.",
|
||||
(current, match) => current +
|
||||
$"[{match.SNOId.ToString("D6")}] {match.Name} ({(match.Data as DiIiS_NA.Core.MPQ.FileFormats.Actor).Type} {(((match.Data as DiIiS_NA.Core.MPQ.FileFormats.Actor).Type == ActorType.Gizmo) ? ((int)(match.Data as DiIiS_NA.Core.MPQ.FileFormats.Actor).TagMap[ActorKeys.GizmoGroup]).ToString() : "")})\n");
|
||||
}
|
||||
|
||||
[CommandGroup("lookup", "Searches in sno databases.\nUsage: lookup [actor|conv|power|scene|la|sp|weather] <pattern>")]
|
||||
[CommandGroup("lookup",
|
||||
"Searches in sno databases.\nUsage: lookup [actor|conv|power|scene|la|sp|weather] <pattern>")]
|
||||
public class LookupCommand : CommandGroup
|
||||
{
|
||||
[DefaultCommand]
|
||||
public string Search(string[] @params, BattleClient invokerClient)
|
||||
{
|
||||
if (@params == null)
|
||||
return this.Fallback();
|
||||
return Fallback();
|
||||
|
||||
var matches = new List<Asset>();
|
||||
|
||||
@ -690,7 +727,8 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
}
|
||||
|
||||
return matches.Aggregate(matches.Count >= 1 ? "Matches:\n" : "No matches found.",
|
||||
(current, match) => current + string.Format("[{0}] [{1}] {2}\n", match.SNOId.ToString("D6"), match.Group, match.Name));
|
||||
(current, match) => current +
|
||||
$"[{match.SNOId.ToString("D6")}] [{match.Group}] {match.Name}\n");
|
||||
}
|
||||
|
||||
[Command("actor", "Allows you to search for an actor.\nUsage: lookup actor <pattern>")]
|
||||
@ -710,12 +748,8 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
}
|
||||
|
||||
return matches.Aggregate(matches.Count >= 1 ? "Actor Matches:\n" : "No match found.",
|
||||
(current, match) => current + string.Format("[{0}] {1} ({2} {3})\n",
|
||||
match.SNOId.ToString("D6"),
|
||||
match.Name,
|
||||
(match.Data as DiIiS_NA.Core.MPQ.FileFormats.Actor).Type,
|
||||
(((match.Data as DiIiS_NA.Core.MPQ.FileFormats.Actor).Type == ActorType.Gizmo) ? ((int)(match.Data as DiIiS_NA.Core.MPQ.FileFormats.Actor).TagMap[ActorKeys.GizmoGroup]).ToString() : "")
|
||||
));
|
||||
(current, match) => current +
|
||||
$"[{match.SNOId.ToString("D6")}] {match.Name} ({(match.Data as DiIiS_NA.Core.MPQ.FileFormats.Actor).Type} {(((match.Data as DiIiS_NA.Core.MPQ.FileFormats.Actor).Type == ActorType.Gizmo) ? ((int)(match.Data as DiIiS_NA.Core.MPQ.FileFormats.Actor).TagMap[ActorKeys.GizmoGroup]).ToString() : "")})\n");
|
||||
}
|
||||
|
||||
[Command("rope", "Allows you to search for an rope.\nUsage: lookup rope <pattern>")]
|
||||
@ -735,7 +769,7 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
}
|
||||
|
||||
return matches.Aggregate(matches.Count >= 1 ? "Rope Matches:\n" : "No match found.",
|
||||
(current, match) => current + string.Format("[{0}] {1}\n", match.SNOId.ToString("D6"), match.Name));
|
||||
(current, match) => current + $"[{match.SNOId.ToString("D6")}] {match.Name}\n");
|
||||
}
|
||||
|
||||
[Command("conv", "Allows you to search for an conversation.\nUsage: lookup conv <pattern>")]
|
||||
@ -755,7 +789,7 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
}
|
||||
|
||||
return matches.Aggregate(matches.Count >= 1 ? "Conversation Matches:\n" : "No match found.",
|
||||
(current, match) => current + string.Format("[{0}] {1}\n", match.SNOId.ToString("D6"), match.Name));
|
||||
(current, match) => current + $"[{match.SNOId.ToString("D6")}] {match.Name}\n");
|
||||
}
|
||||
|
||||
[Command("power", "Allows you to search for a power.\nUsage: lookup power <pattern>")]
|
||||
@ -785,11 +819,13 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
}
|
||||
}
|
||||
|
||||
return matches.Aggregate(matches.Count >= 1 ? "Power Matches:\n" : "No match found.",
|
||||
(current, match) => current + string.Format("[{0}] {1}\n", match.SNOId.ToString("D6"), match.Name));
|
||||
return matches.Aggregate(matches.Count >= 1 ? "World Matches:\n" : "No match found.",
|
||||
(current, match) => current +
|
||||
$"[{match.SNOId.ToString("D6")}] {match.Name} - {(match.Data as World).DynamicWorld}\n");
|
||||
}
|
||||
|
||||
[Command("world", "Allows you to search for a world.\nUsage: lookup world <pattern> OR lookup world id <snoId>")]
|
||||
[Command("world",
|
||||
"Allows you to search for a world.\nUsage: lookup world <pattern> OR lookup world id <snoId>")]
|
||||
public string World(string[] @params, BattleClient invokerClient)
|
||||
{
|
||||
var matches = new List<Asset>();
|
||||
@ -817,7 +853,8 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
}
|
||||
|
||||
return matches.Aggregate(matches.Count >= 1 ? "World Matches:\n" : "No match found.",
|
||||
(current, match) => current + string.Format("[{0}] {1} - {2}\n", match.SNOId.ToString("D6"), match.Name, (match.Data as DiIiS_NA.Core.MPQ.FileFormats.World).DynamicWorld));
|
||||
(current, match) => current +
|
||||
$"[{match.SNOId.ToString("D6")}] {match.Name} - {(match.Data as World).DynamicWorld}\n");
|
||||
}
|
||||
|
||||
[Command("qr", "Show QuestRange of an actor.\nUsage: lookup qr <id>")]
|
||||
@ -840,7 +877,7 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
}
|
||||
}
|
||||
|
||||
return String.Format("[{0}] {1}", qr_id, qr_name);
|
||||
return $"[{qr_id}] {qr_name}";
|
||||
}
|
||||
|
||||
public static int GetExitBits(Asset scene)
|
||||
@ -880,7 +917,7 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
}
|
||||
|
||||
return matches.Aggregate(matches.Count >= 1 ? "LevelArea Matches:\n" : "No match found.",
|
||||
(current, match) => current + string.Format("[{0}] {1}\n", match.SNOId.ToString("D6"), match.Name));
|
||||
(current, match) => current + $"[{match.SNOId.ToString("D6")}] {match.Name}\n");
|
||||
}
|
||||
|
||||
[Command("sp", "List all Starting Points in world.\nUsage: lookup sp")]
|
||||
@ -889,7 +926,8 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
var matches = invokerClient.InGameClient.Player.World.StartingPoints;
|
||||
|
||||
return matches.Aggregate(matches.Count >= 1 ? "Starting Points:\n" : "No match found.",
|
||||
(current, match) => current + string.Format("[{0}] {1} - {2}\n", match.GlobalID.ToString("D6"), match.Name, match.TargetId));
|
||||
(current, match) => current +
|
||||
$"[{match.GlobalID.ToString("D6")}] {match.Name} - {match.TargetId}\n");
|
||||
}
|
||||
|
||||
[Command("weather", "Allows you to search for a Weather.\nUsage: lookup weather <pattern>")]
|
||||
@ -909,7 +947,7 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
}
|
||||
|
||||
return matches.Aggregate(matches.Count >= 1 ? "Weather Matches:\n" : "No match found.",
|
||||
(current, match) => current + string.Format("[{0}] {1}\n", match.SNOId.ToString("D6"), match.Name));
|
||||
(current, match) => current + $"[{match.SNOId.ToString("D6")}] {match.Name}\n");
|
||||
}
|
||||
|
||||
[Command("scene", "Allows you to search for a scene.\nUsage: lookup scene <pattern>")]
|
||||
@ -929,7 +967,8 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
}
|
||||
|
||||
return matches.Aggregate(matches.Count >= 1 ? "Scene Matches:\n" : "No match found.",
|
||||
(current, match) => current + string.Format("[{0}] {1} - {2}\n", match.SNOId.ToString("D6"), match.Name, GetExitBits(match)));
|
||||
(current, match) => current +
|
||||
$"[{match.SNOId.ToString("D6")}] {match.Name} - {GetExitBits(match)}\n");
|
||||
}
|
||||
|
||||
[Command("eg", "Allows you to search for an EffectGroup.\nUsage: lookup eg <pattern>")]
|
||||
@ -949,7 +988,8 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
}
|
||||
|
||||
return matches.Aggregate(matches.Count >= 1 ? "EffectGroup Matches:\n" : "No match found.",
|
||||
(current, match) => current + string.Format("[{0}] {1} - {2}\n", match.SNOId.ToString("D6"), match.Name, GetExitBits(match)));
|
||||
(current, match) => current +
|
||||
$"[{match.SNOId.ToString("D6")}] {match.Name} - {GetExitBits(match)}\n");
|
||||
}
|
||||
|
||||
[Command("item", "Allows you to search for an item.\nUsage: lookup item <pattern>")]
|
||||
@ -973,8 +1013,10 @@ namespace DiIiS_NA.GameServer.CommandManager
|
||||
matches.Add(itemDefinition);
|
||||
}
|
||||
}
|
||||
|
||||
return matches.Aggregate(matches.Count >= 1 ? "Item Matches:\n" : "No match found.",
|
||||
(current, match) => current + string.Format("[{0}] {1}\n", match.SNOActor.ToString("D6"), match.Name));
|
||||
(current, match) => current + $"[{match.SNOActor.ToString("D6")}] {match.Name}\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,27 +13,96 @@ namespace DiIiS_NA.GameServer
|
||||
{
|
||||
public sealed class Config : DiIiS_NA.Core.Config.Config
|
||||
{
|
||||
public bool Enabled { get { return this.GetBoolean("Enabled", true); } set { this.Set("Enabled", value); } }
|
||||
public string BindIP { get { return this.GetString("BindIP", "127.0.0.1"); } set { this.Set("BindIP", value); } }
|
||||
public int WebPort { get { return this.GetInt("WebPort", 9001); } set { this.Set("WebPort", value); } }
|
||||
public int Port { get { return this.GetInt("Port", 1345); } set { this.Set("Port", value); } }
|
||||
public string BindIPv6 { get { return this.GetString("BindIPv6", "::1"); } set { this.Set("BindIPv6", value); } }
|
||||
public bool DRLGemu { get { return this.GetBoolean("DRLGemu", true); } set { this.Set("DRLGemu", value); } }
|
||||
public bool CoreActive { get { return this.GetBoolean("CoreActive", true); } set { this.Set("CoreActive", value); } }
|
||||
public bool Enabled
|
||||
{
|
||||
get => GetBoolean("Enabled", true);
|
||||
set => Set("Enabled", value);
|
||||
}
|
||||
|
||||
public string BindIP
|
||||
{
|
||||
get => GetString("BindIP", "127.0.0.1");
|
||||
set => Set("BindIP", value);
|
||||
}
|
||||
|
||||
public int WebPort
|
||||
{
|
||||
get => GetInt("WebPort", 9001);
|
||||
set => Set("WebPort", value);
|
||||
}
|
||||
|
||||
public int Port
|
||||
{
|
||||
get => GetInt("Port", 1345);
|
||||
set => Set("Port", value);
|
||||
}
|
||||
|
||||
public string BindIPv6
|
||||
{
|
||||
get => GetString("BindIPv6", "::1");
|
||||
set => Set("BindIPv6", value);
|
||||
}
|
||||
|
||||
public bool DRLGemu
|
||||
{
|
||||
get => GetBoolean("DRLGemu", true);
|
||||
set => Set("DRLGemu", value);
|
||||
}
|
||||
|
||||
public bool CoreActive
|
||||
{
|
||||
get => GetBoolean("CoreActive", true);
|
||||
set => Set("CoreActive", value);
|
||||
}
|
||||
|
||||
//Modding of Game-Server
|
||||
public float RateEXP { get { return this.GetFloat("RateExp", 1); } set { this.Set("RateExp", value); } }
|
||||
public float RateMoney { get { return this.GetFloat("RateMoney", 1); } set { this.Set("RateMoney", value); } }
|
||||
public float RateDrop { get { return this.GetFloat("RateDrop", 1); } set { this.Set("RateDrop", value); } }
|
||||
public float RateChangeDrop { get { return this.GetFloat("RateChangeDrop", 1); } set { this.Set("RateChangeDrop", value); } }
|
||||
public float RateMonsterHP { get { return this.GetFloat("RateMonsterHP", 1); } set { this.Set("RateMonsterHP", value); } }
|
||||
public float RateMonsterDMG { get { return this.GetFloat("RateMonsterHP", 1); } set { this.Set("RateMonsterHP", value); } }
|
||||
public float RateEXP
|
||||
{
|
||||
get => GetFloat("RateExp", 1);
|
||||
set => Set("RateExp", value);
|
||||
}
|
||||
|
||||
public float RateMoney
|
||||
{
|
||||
get => GetFloat("RateMoney", 1);
|
||||
set => Set("RateMoney", value);
|
||||
}
|
||||
|
||||
public float RateDrop
|
||||
{
|
||||
get => GetFloat("RateDrop", 1);
|
||||
set => Set("RateDrop", value);
|
||||
}
|
||||
|
||||
public float RateChangeDrop
|
||||
{
|
||||
get => GetFloat("RateChangeDrop", 1);
|
||||
set => Set("RateChangeDrop", value);
|
||||
}
|
||||
|
||||
public float RateMonsterHP
|
||||
{
|
||||
get => GetFloat("RateMonsterHP", 1);
|
||||
set => Set("RateMonsterHP", value);
|
||||
}
|
||||
|
||||
public float RateMonsterDMG
|
||||
{
|
||||
get => GetFloat("RateMonsterHP", 1);
|
||||
set => Set("RateMonsterHP", value);
|
||||
}
|
||||
|
||||
|
||||
public bool IWServer { get { return this.GetBoolean("IWServer", true); } set { this.Set("IWServer", value); } }
|
||||
public bool IWServer
|
||||
{
|
||||
get => GetBoolean("IWServer", true);
|
||||
set => Set("IWServer", value);
|
||||
}
|
||||
|
||||
private static readonly Config _instance = new Config();
|
||||
public static Config Instance { get { return _instance; } }
|
||||
private Config() : base("Game-Server") { }
|
||||
public static Config Instance { get; } = new();
|
||||
|
||||
private Config() : base("Game-Server")
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,10 +45,10 @@ namespace DiIiS_NA.GameServer.Core
|
||||
|
||||
public InventoryGrid(Actor owner, int rows, int columns, int slot = 0)
|
||||
{
|
||||
this._backpack = new uint[rows, columns];
|
||||
this._owner = owner;
|
||||
this.Items = new Dictionary<uint, Item>();
|
||||
this.EquipmentSlot = slot;
|
||||
_backpack = new uint[rows, columns];
|
||||
_owner = owner;
|
||||
Items = new Dictionary<uint, Item>();
|
||||
EquipmentSlot = slot;
|
||||
}
|
||||
|
||||
public void ResizeGrid(int rows, int columns)
|
||||
@ -63,7 +63,7 @@ namespace DiIiS_NA.GameServer.Core
|
||||
Items.Clear();
|
||||
int r = Rows;
|
||||
int c = Columns;
|
||||
this._backpack = new uint[r, c];
|
||||
_backpack = new uint[r, c];
|
||||
}
|
||||
|
||||
// This should be in the database#
|
||||
@ -165,13 +165,13 @@ namespace DiIiS_NA.GameServer.Core
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var plr in this._owner.World.Players.Values)
|
||||
foreach (var plr in _owner.World.Players.Values)
|
||||
item.Unreveal(plr);
|
||||
}
|
||||
|
||||
public bool HaveEnough(int GBid, int count)
|
||||
{
|
||||
List<Item> baseItems = this.Items.Values.Where(i => i.GBHandle.GBID == GBid).ToList();
|
||||
List<Item> baseItems = Items.Values.Where(i => i.GBHandle.GBID == GBid).ToList();
|
||||
int have = 0;
|
||||
foreach (var itm in baseItems)
|
||||
have += itm.Attributes[GameAttribute.ItemStackQuantityLo];
|
||||
@ -183,7 +183,7 @@ namespace DiIiS_NA.GameServer.Core
|
||||
|
||||
public int TotalItemCount(int GBid)
|
||||
{
|
||||
List<Item> baseItems = this.Items.Values.Where(i => i.GBHandle.GBID == GBid).ToList();
|
||||
List<Item> baseItems = Items.Values.Where(i => i.GBHandle.GBID == GBid).ToList();
|
||||
int have = 0;
|
||||
foreach (var itm in baseItems)
|
||||
have += itm.Attributes[GameAttribute.ItemStackQuantityLo];
|
||||
@ -193,7 +193,7 @@ namespace DiIiS_NA.GameServer.Core
|
||||
|
||||
public void GrabSomeItems(int GBid, int count) //only for stackable!
|
||||
{
|
||||
List<Item> baseItems = this.Items.Values.Where(i => i.GBHandle.GBID == GBid).ToList();
|
||||
List<Item> baseItems = Items.Values.Where(i => i.GBHandle.GBID == GBid).ToList();
|
||||
int estimate = count;
|
||||
List<Item> consumed = new List<Item>();
|
||||
foreach (var itm in baseItems)
|
||||
@ -211,7 +211,7 @@ namespace DiIiS_NA.GameServer.Core
|
||||
}
|
||||
foreach (var itm in consumed)
|
||||
{
|
||||
this.RemoveItem(itm);
|
||||
RemoveItem(itm);
|
||||
itm.Unreveal(itm.Owner as Player);
|
||||
//itm.Destroy();
|
||||
}
|
||||
@ -267,7 +267,7 @@ namespace DiIiS_NA.GameServer.Core
|
||||
if (item.IsStackable() && _owner is Player)
|
||||
{
|
||||
// Find items of same type (GBID) and try to add it to one of them
|
||||
List<Item> baseItems = this.Items.Values.Where(i => i.GBHandle.GBID == item.GBHandle.GBID).ToList();
|
||||
List<Item> baseItems = Items.Values.Where(i => i.GBHandle.GBID == item.GBHandle.GBID).ToList();
|
||||
foreach (Item baseItem in baseItems)
|
||||
{
|
||||
if (baseItem.Attributes[GameAttribute.ItemStackQuantityLo] + item.Attributes[GameAttribute.ItemStackQuantityLo] <= baseItem.ItemDefinition.MaxStackSize)
|
||||
@ -361,7 +361,7 @@ namespace DiIiS_NA.GameServer.Core
|
||||
{
|
||||
if (GetItemInventorySize(item).Height > 1)
|
||||
{
|
||||
if (this.EquipmentSlot == 0 && row > 4) return false;
|
||||
if (EquipmentSlot == 0 && row > 4) return false;
|
||||
bool a = (_backpack[row, column] == 0 || _backpack[row, column] == item.GlobalID);
|
||||
bool b = (_backpack[row + 1, column] == 0 || _backpack[row + 1, column] == item.GlobalID);
|
||||
if (!((_backpack[row, column] == 0 || _backpack[row, column] == item.GlobalID) && (_backpack[row + 1, column] == 0 || _backpack[row + 1, column] == item.GlobalID)))
|
||||
@ -410,7 +410,7 @@ namespace DiIiS_NA.GameServer.Core
|
||||
|
||||
public Item GetItem(int row, int column)
|
||||
{
|
||||
return this.GetItem(_backpack[row, column]);
|
||||
return GetItem(_backpack[row, column]);
|
||||
}
|
||||
|
||||
public bool Reveal(Player player)
|
||||
@ -445,8 +445,8 @@ namespace DiIiS_NA.GameServer.Core
|
||||
|
||||
public Item GetItemByDynId(Player plr, uint dynId)
|
||||
{
|
||||
if (this.Items.Values.Where(it => it.IsRevealedToPlayer(plr) && it.DynamicID(plr) == dynId).Count() > 0)
|
||||
return this.Items.Values.Single(it => it.IsRevealedToPlayer(plr) && it.DynamicID(plr) == dynId);
|
||||
if (Items.Values.Where(it => it.IsRevealedToPlayer(plr) && it.DynamicID(plr) == dynId).Count() > 0)
|
||||
return Items.Values.Single(it => it.IsRevealedToPlayer(plr) && it.DynamicID(plr) == dynId);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -36,8 +36,8 @@ namespace DiIiS_NA.GameServer.Core.Types.Collision
|
||||
/// <param name="stream">The MPQFileStream to read from.</param>
|
||||
public AABB(MpqFileStream stream)
|
||||
{
|
||||
this.Min = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32());
|
||||
this.Max = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32());
|
||||
Min = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32());
|
||||
Max = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -64,8 +64,8 @@ namespace DiIiS_NA.GameServer.Core.Types.Collision
|
||||
|
||||
public bool IsWithin(Vector3D v)
|
||||
{
|
||||
if (v >= this.Min &&
|
||||
v <= this.Max)
|
||||
if (v >= Min &&
|
||||
v <= Max)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -75,13 +75,13 @@ namespace DiIiS_NA.GameServer.Core.Types.Collision
|
||||
public bool Intersects(AABB other)
|
||||
{
|
||||
if (// Max < o.Min
|
||||
this.Max.X < other.Min.X ||
|
||||
this.Max.Y < other.Min.Y ||
|
||||
this.Max.Z < other.Min.Z ||
|
||||
Max.X < other.Min.X ||
|
||||
Max.Y < other.Min.Y ||
|
||||
Max.Z < other.Min.Z ||
|
||||
// Min > o.Max
|
||||
this.Min.X > other.Max.X ||
|
||||
this.Min.Y > other.Max.Y ||
|
||||
this.Min.Z > other.Max.Z)
|
||||
Min.X > other.Max.X ||
|
||||
Min.Y > other.Max.Y ||
|
||||
Min.Z > other.Max.Z)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -102,7 +102,7 @@ namespace DiIiS_NA.GameServer.Core.Types.Collision
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("AABB: min:{0} max:{1}", this.Min, this.Max);
|
||||
return string.Format("AABB: min:{0} max:{1}", Min, Max);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,8 +22,8 @@ namespace DiIiS_NA.GameServer.Core.Types.Math
|
||||
|
||||
public Quaternion(Vector3D V, float inW)
|
||||
{
|
||||
this.Vector3D = V;
|
||||
this.W = inW;
|
||||
Vector3D = V;
|
||||
W = inW;
|
||||
}
|
||||
/// <summary>
|
||||
/// Creates an quaternion that rotates along the Z-axis by the specified "facing" angle.
|
||||
@ -45,8 +45,8 @@ namespace DiIiS_NA.GameServer.Core.Types.Math
|
||||
/// <param name="stream">The MPQFileStream to read from.</param>
|
||||
public Quaternion(MpqFileStream stream)
|
||||
{
|
||||
this.Vector3D = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32());
|
||||
this.W = stream.ReadValueF32();
|
||||
Vector3D = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32());
|
||||
W = stream.ReadValueF32();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -33,8 +33,8 @@ namespace DiIiS_NA.GameServer.Core.Types.Math
|
||||
|
||||
public Vector2D(int x, int y)
|
||||
{
|
||||
this.X = x;
|
||||
this.Y = y;
|
||||
X = x;
|
||||
Y = y;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -36,25 +36,25 @@ namespace DiIiS_NA.GameServer.Core.Types.Math
|
||||
|
||||
public Vector2F(float x, float y)
|
||||
{
|
||||
this.X = x;
|
||||
this.Y = y;
|
||||
X = x;
|
||||
Y = y;
|
||||
}
|
||||
|
||||
public Vector2F(float value)
|
||||
{
|
||||
this.X = this.Y = value;
|
||||
X = Y = value;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
CultureInfo currentCulture = CultureInfo.CurrentCulture;
|
||||
return string.Format(currentCulture, "{{X:{0} Y:{1}}}",
|
||||
new object[] { this.X.ToString(currentCulture), this.Y.ToString(currentCulture) });
|
||||
new object[] { X.ToString(currentCulture), Y.ToString(currentCulture) });
|
||||
}
|
||||
|
||||
public bool Equals(Vector2F other)
|
||||
{
|
||||
return ((this.X == other.X) && (this.Y == other.Y));
|
||||
return ((X == other.X) && (Y == other.Y));
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
@ -62,25 +62,25 @@ namespace DiIiS_NA.GameServer.Core.Types.Math
|
||||
bool flag = false;
|
||||
if (obj is Vector2F)
|
||||
{
|
||||
flag = this.Equals((Vector2F)obj);
|
||||
flag = Equals((Vector2F)obj);
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return (this.X.GetHashCode() + this.Y.GetHashCode());
|
||||
return (X.GetHashCode() + Y.GetHashCode());
|
||||
}
|
||||
|
||||
public float Length()
|
||||
{
|
||||
float num = (this.X * this.X) + (this.Y * this.Y);
|
||||
float num = (X * X) + (Y * Y);
|
||||
return (float)System.Math.Sqrt((double)num);
|
||||
}
|
||||
|
||||
public float LengthSquared()
|
||||
{
|
||||
return ((this.X * this.X) + (this.Y * this.Y));
|
||||
return ((X * X) + (Y * Y));
|
||||
}
|
||||
|
||||
public static float Distance(Vector2F value1, Vector2F value2)
|
||||
@ -125,10 +125,10 @@ namespace DiIiS_NA.GameServer.Core.Types.Math
|
||||
|
||||
public void Normalize()
|
||||
{
|
||||
float num2 = (this.X * this.X) + (this.Y * this.Y);
|
||||
float num2 = (X * X) + (Y * Y);
|
||||
float num = 1f / ((float)System.Math.Sqrt((double)num2));
|
||||
this.X *= num;
|
||||
this.Y *= num;
|
||||
X *= num;
|
||||
Y *= num;
|
||||
}
|
||||
|
||||
public static Vector2F Normalize(Vector2F value)
|
||||
@ -166,7 +166,7 @@ namespace DiIiS_NA.GameServer.Core.Types.Math
|
||||
/// <returns></returns>
|
||||
public float Rotation()
|
||||
{
|
||||
return Angle(Vector2F.UnitY) > Angle(-Vector2F.UnitY) ? -Angle(Vector2F.UnitX) : Angle(Vector2F.UnitX);
|
||||
return Angle(UnitY) > Angle(-UnitY) ? -Angle(UnitX) : Angle(UnitX);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -24,16 +24,16 @@ namespace DiIiS_NA.GameServer.Core.Types.Math
|
||||
|
||||
public Vector3D()
|
||||
{
|
||||
this.X = 0;
|
||||
this.Y = 0;
|
||||
this.Z = 0;
|
||||
X = 0;
|
||||
Y = 0;
|
||||
Z = 0;
|
||||
}
|
||||
|
||||
public Vector3D(Vector3D vector)
|
||||
{
|
||||
this.X = vector.X;
|
||||
this.Y = vector.Y;
|
||||
this.Z = vector.Z;
|
||||
X = vector.X;
|
||||
Y = vector.Y;
|
||||
Z = vector.Z;
|
||||
}
|
||||
|
||||
public Vector3D(float x, float y, float z)
|
||||
@ -97,9 +97,9 @@ namespace DiIiS_NA.GameServer.Core.Types.Math
|
||||
|
||||
public void Set(float x, float y, float z)
|
||||
{
|
||||
this.X = x;
|
||||
this.Y = y;
|
||||
this.Z = z;
|
||||
X = x;
|
||||
Y = y;
|
||||
Z = z;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -118,8 +118,8 @@ namespace DiIiS_NA.GameServer.Core.Types.Math
|
||||
|
||||
public static bool operator ==(Vector3D a, Vector3D b)
|
||||
{
|
||||
if (object.ReferenceEquals(null, a))
|
||||
return object.ReferenceEquals(null, b);
|
||||
if (ReferenceEquals(null, a))
|
||||
return ReferenceEquals(null, b);
|
||||
return a.Equals(b);
|
||||
}
|
||||
|
||||
@ -130,8 +130,8 @@ namespace DiIiS_NA.GameServer.Core.Types.Math
|
||||
|
||||
public static bool operator >(Vector3D a, Vector3D b)
|
||||
{
|
||||
if (object.ReferenceEquals(null, a))
|
||||
return !object.ReferenceEquals(null, b);
|
||||
if (ReferenceEquals(null, a))
|
||||
return !ReferenceEquals(null, b);
|
||||
return a.X > b.X
|
||||
&& a.Y > b.Y
|
||||
&& a.Z > b.Z;
|
||||
@ -154,8 +154,8 @@ namespace DiIiS_NA.GameServer.Core.Types.Math
|
||||
|
||||
public static bool operator >=(Vector3D a, Vector3D b)
|
||||
{
|
||||
if (object.ReferenceEquals(null, a))
|
||||
return object.ReferenceEquals(null, b);
|
||||
if (ReferenceEquals(null, a))
|
||||
return ReferenceEquals(null, b);
|
||||
return a.X >= b.X
|
||||
&& a.Y >= b.Y
|
||||
&& a.Z >= b.Z;
|
||||
@ -163,8 +163,8 @@ namespace DiIiS_NA.GameServer.Core.Types.Math
|
||||
|
||||
public static bool operator <=(Vector3D a, Vector3D b)
|
||||
{
|
||||
if (object.ReferenceEquals(null, a))
|
||||
return object.ReferenceEquals(null, b);
|
||||
if (ReferenceEquals(null, a))
|
||||
return ReferenceEquals(null, b);
|
||||
return a.X <= b.X
|
||||
&& a.Y <= b.Y
|
||||
&& a.Z <= b.Z;
|
||||
@ -172,14 +172,14 @@ namespace DiIiS_NA.GameServer.Core.Types.Math
|
||||
|
||||
public override bool Equals(object o)
|
||||
{
|
||||
if (object.ReferenceEquals(this, o))
|
||||
if (ReferenceEquals(this, o))
|
||||
return true;
|
||||
var v = o as Vector3D;
|
||||
if (v != null)
|
||||
{
|
||||
return this.X == v.X
|
||||
&& this.Y == v.Y
|
||||
&& this.Z == v.Z;
|
||||
return X == v.X
|
||||
&& Y == v.Y
|
||||
&& Z == v.Z;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -22,8 +22,8 @@ namespace DiIiS_NA.GameServer.Core.Types.Misc
|
||||
/// </summary>
|
||||
public Circle(Vector2F position, float radius)
|
||||
{
|
||||
this.Center = position;
|
||||
this.Radius = radius;
|
||||
Center = position;
|
||||
Radius = radius;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -40,31 +40,31 @@ namespace DiIiS_NA.GameServer.Core.Types.Misc
|
||||
public bool Intersects(Rectangle rectangle)
|
||||
{
|
||||
// Find the closest point to the circle within the rectangle
|
||||
float closestX = Clamp(this.Center.X, (float)rectangle.Left, (float)rectangle.Right);
|
||||
float closestY = Clamp(this.Center.Y, (float)rectangle.Top, (float)rectangle.Bottom);
|
||||
float closestX = Clamp(Center.X, (float)rectangle.Left, (float)rectangle.Right);
|
||||
float closestY = Clamp(Center.Y, (float)rectangle.Top, (float)rectangle.Bottom);
|
||||
|
||||
// Calculate the distance between the circle's center and this closest point
|
||||
float distanceX = this.Center.X - closestX;
|
||||
float distanceY = this.Center.Y - closestY;
|
||||
float distanceX = Center.X - closestX;
|
||||
float distanceY = Center.Y - closestY;
|
||||
|
||||
// If the distance is less than the circle's radius, an intersection occurs
|
||||
float distanceSquared = (distanceX * distanceX) + (distanceY * distanceY);
|
||||
return distanceSquared < (this.Radius * this.Radius);
|
||||
return distanceSquared < (Radius * Radius);
|
||||
}
|
||||
|
||||
public bool Intersects(RectangleF rectangle)
|
||||
{
|
||||
// Find the closest point to the circle within the rectangle
|
||||
float closestX = Clamp(this.Center.X, (float)rectangle.Left, (float)rectangle.Right);
|
||||
float closestY = Clamp(this.Center.Y, (float)rectangle.Top, (float)rectangle.Bottom);
|
||||
float closestX = Clamp(Center.X, (float)rectangle.Left, (float)rectangle.Right);
|
||||
float closestY = Clamp(Center.Y, (float)rectangle.Top, (float)rectangle.Bottom);
|
||||
|
||||
// Calculate the distance between the circle's center and this closest point
|
||||
float distanceX = this.Center.X - closestX;
|
||||
float distanceY = this.Center.Y - closestY;
|
||||
float distanceX = Center.X - closestX;
|
||||
float distanceY = Center.Y - closestY;
|
||||
|
||||
// If the distance is less than the circle's radius, an intersection occurs
|
||||
float distanceSquared = (distanceX * distanceX) + (distanceY * distanceY);
|
||||
return distanceSquared < (this.Radius * this.Radius);
|
||||
return distanceSquared < (Radius * Radius);
|
||||
}
|
||||
|
||||
public static float Clamp(float value, float min, float max)
|
||||
|
||||
@ -43,9 +43,9 @@ namespace DiIiS_NA.GameServer.Core.Types.QuadTrees
|
||||
/// <param name="maximumObjectsPerLeaf">Maximum number of objects per left before it's forced to split into sub-quadrans.</param>
|
||||
public QuadTree(Size minimumLeafSize, int maximumObjectsPerLeaf)
|
||||
{
|
||||
this.RootNode = null;
|
||||
this.MinimumLeafSize = minimumLeafSize;
|
||||
this.MaximumObjectsPerLeaf = maximumObjectsPerLeaf;
|
||||
RootNode = null;
|
||||
MinimumLeafSize = minimumLeafSize;
|
||||
MaximumObjectsPerLeaf = maximumObjectsPerLeaf;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -65,18 +65,18 @@ namespace DiIiS_NA.GameServer.Core.Types.QuadTrees
|
||||
@object.Bounds.Y + @object.Bounds.Height / 2);
|
||||
var rootOrigin = new PointF(center.X - rootSize.Width / 2, center.Y - rootSize.Height / 2);
|
||||
|
||||
this.RootNode = new QuadNode(new RectangleF(rootOrigin, rootSize));
|
||||
RootNode = new QuadNode(new RectangleF(rootOrigin, rootSize));
|
||||
}
|
||||
int cycle = 0;
|
||||
while (!RootNode.Bounds.Contains(@object.Bounds))
|
||||
// if root-node's bounds does not contain object, expand the root.
|
||||
{
|
||||
this.ExpandRoot(@object.Bounds);
|
||||
ExpandRoot(@object.Bounds);
|
||||
cycle++;
|
||||
if (cycle > 5) break;
|
||||
}
|
||||
|
||||
this.InsertNodeObject(RootNode, @object); // insert the object to rootNode.
|
||||
InsertNodeObject(RootNode, @object); // insert the object to rootNode.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -88,16 +88,16 @@ namespace DiIiS_NA.GameServer.Core.Types.QuadTrees
|
||||
public List<T> Query<T>(RectangleF bounds, bool includeHierarchy = false) where T : WorldObject
|
||||
{
|
||||
var results = new List<T>();
|
||||
if (this.RootNode != null)
|
||||
this.Query(bounds, RootNode, results, includeHierarchy);
|
||||
if (RootNode != null)
|
||||
Query(bounds, RootNode, results, includeHierarchy);
|
||||
return results;
|
||||
}
|
||||
|
||||
public List<T> Query<T>(Circle proximity, bool includeHierarchy = false) where T : WorldObject
|
||||
{
|
||||
var results = new List<T>();
|
||||
if (this.RootNode != null)
|
||||
this.Query(proximity, RootNode, results, includeHierarchy);
|
||||
if (RootNode != null)
|
||||
Query(proximity, RootNode, results, includeHierarchy);
|
||||
return results;
|
||||
}
|
||||
|
||||
@ -128,7 +128,7 @@ namespace DiIiS_NA.GameServer.Core.Types.QuadTrees
|
||||
|
||||
foreach (QuadNode childNode in node.Nodes) // query child-nodes too.
|
||||
{
|
||||
this.Query(bounds, childNode, results);
|
||||
Query(bounds, childNode, results);
|
||||
}
|
||||
}
|
||||
|
||||
@ -152,7 +152,7 @@ namespace DiIiS_NA.GameServer.Core.Types.QuadTrees
|
||||
|
||||
foreach (QuadNode childNode in node.Nodes) // query child-nodes too.
|
||||
{
|
||||
this.Query(proximity, childNode, results);
|
||||
Query(proximity, childNode, results);
|
||||
}
|
||||
}
|
||||
|
||||
@ -179,9 +179,9 @@ namespace DiIiS_NA.GameServer.Core.Types.QuadTrees
|
||||
var newRootBounds = new RectangleF((float)newX, (float)newY, RootNode.Bounds.Width * 2f, RootNode.Bounds.Height * 2f);
|
||||
var newRoot = new QuadNode(newRootBounds);
|
||||
|
||||
this.SetupChildNodes(newRoot);
|
||||
SetupChildNodes(newRoot);
|
||||
newRoot[rootDirection] = RootNode;
|
||||
this.RootNode = newRoot;
|
||||
RootNode = newRoot;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -197,9 +197,9 @@ namespace DiIiS_NA.GameServer.Core.Types.QuadTrees
|
||||
recursionLimit++;
|
||||
if (recursionLimit >= 20) return;
|
||||
// If there's no child-nodes and when new object is insertedi if node's object count will be bigger then MaximumObjectsPerLeaf, force a split.
|
||||
if (!node.HasChildNodes() && node.ContainedObjects.Count + 1 > this.MaximumObjectsPerLeaf)
|
||||
if (!node.HasChildNodes() && node.ContainedObjects.Count + 1 > MaximumObjectsPerLeaf)
|
||||
{
|
||||
this.SetupChildNodes(node);
|
||||
SetupChildNodes(node);
|
||||
|
||||
var childObjects = new List<WorldObject>(node.ContainedObjects.Values); // node's child objects.
|
||||
var childrenToRelocate = new List<WorldObject>(); // child object to be relocated.
|
||||
@ -220,8 +220,8 @@ namespace DiIiS_NA.GameServer.Core.Types.QuadTrees
|
||||
|
||||
foreach (WorldObject childObject in childrenToRelocate) // relocate the child objects we marked.
|
||||
{
|
||||
this.RemoveObjectFromNode(childObject);
|
||||
this.InsertNodeObject(node, childObject, recursionLimit);
|
||||
RemoveObjectFromNode(childObject);
|
||||
InsertNodeObject(node, childObject, recursionLimit);
|
||||
}
|
||||
}
|
||||
|
||||
@ -234,11 +234,11 @@ namespace DiIiS_NA.GameServer.Core.Types.QuadTrees
|
||||
if (!childNode.Bounds.Contains(@object.Bounds))
|
||||
continue;
|
||||
|
||||
this.InsertNodeObject(childNode, @object, recursionLimit);
|
||||
InsertNodeObject(childNode, @object, recursionLimit);
|
||||
return;
|
||||
}
|
||||
|
||||
this.AddObjectToNode(node, @object); // add the object to current node.
|
||||
AddObjectToNode(node, @object); // add the object to current node.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -284,12 +284,12 @@ namespace DiIiS_NA.GameServer.Core.Types.QuadTrees
|
||||
private void ObjectPositionChanged(object sender, EventArgs e)
|
||||
{
|
||||
var @object = sender as WorldObject;
|
||||
if (@object == null || !this._objectToNodeLookup.ContainsKey(@object)) return;
|
||||
if (@object == null || !_objectToNodeLookup.ContainsKey(@object)) return;
|
||||
|
||||
QuadNode node = this._objectToNodeLookup[@object];
|
||||
QuadNode node = _objectToNodeLookup[@object];
|
||||
if (node.Bounds.Contains(@object.Bounds) && !node.HasChildNodes()) return;
|
||||
|
||||
this.RemoveObjectFromNode(@object);
|
||||
RemoveObjectFromNode(@object);
|
||||
Insert(@object);
|
||||
if (node.Parent != null)
|
||||
CheckChildNodes(node.Parent);
|
||||
@ -301,7 +301,7 @@ namespace DiIiS_NA.GameServer.Core.Types.QuadTrees
|
||||
/// <param name="node">The node.</param>
|
||||
private void SetupChildNodes(QuadNode node)
|
||||
{
|
||||
if (this.MinimumLeafSize.Width > node.Bounds.Width / 2 || this.MinimumLeafSize.Height > node.Bounds.Height / 2)
|
||||
if (MinimumLeafSize.Width > node.Bounds.Width / 2 || MinimumLeafSize.Height > node.Bounds.Height / 2)
|
||||
// make sure we obey MinimumLeafSize.
|
||||
return;
|
||||
|
||||
@ -397,7 +397,7 @@ namespace DiIiS_NA.GameServer.Core.Types.QuadTrees
|
||||
childNode.Parent = null;
|
||||
}
|
||||
|
||||
this.RootNode = nodeWithObjects;
|
||||
RootNode = nodeWithObjects;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
15258
src/DiIiS-NA/D3-GameServer/Core/Types/SNO/AnimationSno.cs
Normal file
15258
src/DiIiS-NA/D3-GameServer/Core/Types/SNO/AnimationSno.cs
Normal file
File diff suppressed because it is too large
Load Diff
@ -182,9 +182,9 @@ namespace DiIiS_NA.GameServer.Core.Types.SNO
|
||||
public override string ToString()
|
||||
{
|
||||
if (IsValid)
|
||||
return string.Format("[{0}] {1} - {2}", this.Group, this.Id, this.Name);
|
||||
return string.Format("[{0}] {1} - {2}", Group, Id, Name);
|
||||
else
|
||||
return string.Format("[{0}] {1} - Invalid handle", _group, this.Id);
|
||||
return string.Format("[{0}] {1} - Invalid handle", _group, Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ namespace DiIiS_NA.GameServer.Core.Types.TagMap
|
||||
for (int i = 0; i < TagMapSize; i++)
|
||||
{
|
||||
var entry = new TagMapEntry(stream);
|
||||
this._tagMapEntries.Add(entry.TagID, entry);
|
||||
_tagMapEntries.Add(entry.TagID, entry);
|
||||
}
|
||||
}
|
||||
|
||||
@ -233,49 +233,49 @@ namespace DiIiS_NA.GameServer.Core.Types.TagMap
|
||||
|
||||
public TagMapEntry(MpqFileStream stream)
|
||||
{
|
||||
this.Type = stream.ReadValueS32();
|
||||
this.TagID = stream.ReadValueS32();
|
||||
Type = stream.ReadValueS32();
|
||||
TagID = stream.ReadValueS32();
|
||||
|
||||
switch (this.Type)
|
||||
switch (Type)
|
||||
{
|
||||
case 0:
|
||||
this.Int = stream.ReadValueS32();
|
||||
Int = stream.ReadValueS32();
|
||||
break;
|
||||
case 1:
|
||||
Float = stream.ReadValueF32();
|
||||
break;
|
||||
case 2: // SNO
|
||||
this.Int = stream.ReadValueS32();
|
||||
Int = stream.ReadValueS32();
|
||||
break;
|
||||
|
||||
// TODO: Create strong type for gbid (at least i think they are)
|
||||
case 3:
|
||||
this.Int = stream.ReadValueS32();
|
||||
Int = stream.ReadValueS32();
|
||||
break;
|
||||
|
||||
case 4:
|
||||
this.ScriptFormula = new ScriptFormula(stream);
|
||||
ScriptFormula = new ScriptFormula(stream);
|
||||
break;
|
||||
|
||||
// TODO: Strong type for group hashes
|
||||
case 5:
|
||||
this.Int = stream.ReadValueS32();
|
||||
Int = stream.ReadValueS32();
|
||||
break;
|
||||
|
||||
// Todo: Strong type for ... hmmm.. is that a gameattributeindex?
|
||||
case 6:
|
||||
this.Int = stream.ReadValueS32();
|
||||
Int = stream.ReadValueS32();
|
||||
break;
|
||||
|
||||
// Todo: Strong type fo StartingLocationID
|
||||
case 7:
|
||||
this.Int = stream.ReadValueS32();
|
||||
Int = stream.ReadValueS32();
|
||||
break;
|
||||
|
||||
default:
|
||||
// if this break hits, blizz introduced a new key type and most likey we should have to react to it
|
||||
System.Diagnostics.Debugger.Break();
|
||||
this.Int = stream.ReadValueS32();
|
||||
Int = stream.ReadValueS32();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,23 +43,23 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem
|
||||
|
||||
protected Brain(Actor body)
|
||||
{
|
||||
this.Body = body;
|
||||
this.State = BrainState.Idle;
|
||||
this.Actions = new Queue<ActorAction>();
|
||||
Body = body;
|
||||
State = BrainState.Idle;
|
||||
Actions = new Queue<ActorAction>();
|
||||
}
|
||||
|
||||
protected void QueueAction(ActorAction action)
|
||||
{
|
||||
this.Actions.Enqueue(action);
|
||||
Actions.Enqueue(action);
|
||||
}
|
||||
|
||||
public virtual void Update(int tickCounter)
|
||||
{
|
||||
if (this.State == BrainState.Dead || this.Body == null || this.Body.World == null || this.State == BrainState.Off)
|
||||
if (State == BrainState.Dead || Body == null || Body.World == null || State == BrainState.Off)
|
||||
return;
|
||||
|
||||
this.Think(tickCounter); // let the brain think.
|
||||
this.Perform(tickCounter); // perform any outstanding actions.
|
||||
Think(tickCounter); // let the brain think.
|
||||
Perform(tickCounter); // perform any outstanding actions.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -73,38 +73,38 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem
|
||||
/// </summary>
|
||||
public virtual void Kill()
|
||||
{
|
||||
if (this.CurrentAction != null)
|
||||
if (CurrentAction != null)
|
||||
{
|
||||
this.CurrentAction.Cancel(0);
|
||||
this.CurrentAction = null;
|
||||
CurrentAction.Cancel(0);
|
||||
CurrentAction = null;
|
||||
}
|
||||
this.State = BrainState.Dead;
|
||||
State = BrainState.Dead;
|
||||
}
|
||||
|
||||
public void Activate()
|
||||
{
|
||||
if (this.State == BrainState.Off)
|
||||
this.State = BrainState.Idle;
|
||||
if (State == BrainState.Off)
|
||||
State = BrainState.Idle;
|
||||
}
|
||||
|
||||
public void DeActivate()
|
||||
{
|
||||
this.CurrentAction = null;
|
||||
this.State = BrainState.Off;
|
||||
CurrentAction = null;
|
||||
State = BrainState.Off;
|
||||
}
|
||||
|
||||
private void Perform(int tickCounter)
|
||||
{
|
||||
if (this.CurrentAction == null)
|
||||
if (CurrentAction == null)
|
||||
return;
|
||||
|
||||
if (!this.CurrentAction.Started)
|
||||
this.CurrentAction.Start(tickCounter);
|
||||
if (!CurrentAction.Started)
|
||||
CurrentAction.Start(tickCounter);
|
||||
else
|
||||
this.CurrentAction.Update(tickCounter);
|
||||
CurrentAction.Update(tickCounter);
|
||||
|
||||
if (this.CurrentAction.Done)
|
||||
this.CurrentAction = null;
|
||||
if (CurrentAction.Done)
|
||||
CurrentAction = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
public AggressiveNPCBrain(Actor body)
|
||||
: base(body)
|
||||
{
|
||||
this.PresetPowers = new List<int>();
|
||||
PresetPowers = new List<int>();
|
||||
|
||||
if (body.ActorData.MonsterSNO > 0)
|
||||
{
|
||||
@ -47,7 +47,7 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
{
|
||||
if (monsterSkill.SNOPower > 0)
|
||||
{
|
||||
this.PresetPowers.Add(monsterSkill.SNOPower);
|
||||
PresetPowers.Add(monsterSkill.SNOPower);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -55,31 +55,31 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
|
||||
public override void Think(int tickCounter)
|
||||
{
|
||||
if (this.Body.Attributes[GameAttribute.Frozen] ||
|
||||
this.Body.Attributes[GameAttribute.Stunned] ||
|
||||
this.Body.Attributes[GameAttribute.Blind] ||
|
||||
this.Body.Attributes[GameAttribute.Webbed] ||
|
||||
this.Body.Disable ||
|
||||
this.Body.World.BuffManager.GetFirstBuff<PowerSystem.Implementations.KnockbackBuff>(this.Body) != null)
|
||||
if (Body.Attributes[GameAttribute.Frozen] ||
|
||||
Body.Attributes[GameAttribute.Stunned] ||
|
||||
Body.Attributes[GameAttribute.Blind] ||
|
||||
Body.Attributes[GameAttribute.Webbed] ||
|
||||
Body.Disable ||
|
||||
Body.World.BuffManager.GetFirstBuff<PowerSystem.Implementations.KnockbackBuff>(Body) != null)
|
||||
{
|
||||
if (this.CurrentAction != null)
|
||||
if (CurrentAction != null)
|
||||
{
|
||||
this.CurrentAction.Cancel(tickCounter);
|
||||
this.CurrentAction = null;
|
||||
CurrentAction.Cancel(tickCounter);
|
||||
CurrentAction = null;
|
||||
}
|
||||
_powerDelay = null;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.CurrentAction == null)
|
||||
if (CurrentAction == null)
|
||||
{
|
||||
if (_powerDelay == null)
|
||||
_powerDelay = new SecondsTickTimer(this.Body.World.Game, 1f);
|
||||
_powerDelay = new SecondsTickTimer(Body.World.Game, 1f);
|
||||
|
||||
if (_powerDelay.TimedOut)
|
||||
{
|
||||
var monsters = this.Body.GetObjectsInRange<Monster>(40f).Where(m => m.Visible & !m.Dead).ToList();
|
||||
var monsters = Body.GetObjectsInRange<Monster>(40f).Where(m => m.Visible & !m.Dead).ToList();
|
||||
if (monsters.Count != 0)
|
||||
{
|
||||
_target = monsters[0];
|
||||
@ -87,23 +87,23 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
if (powerToUse > 0)
|
||||
{
|
||||
PowerSystem.PowerScript power = PowerSystem.PowerLoader.CreateImplementationForPowerSNO(powerToUse);
|
||||
power.User = this.Body;
|
||||
float attackRange = this.Body.ActorData.Cylinder.Ax2 + (power.EvalTag(PowerKeys.AttackRadius) > 0f ? (powerToUse == 30592 ? 10f : power.EvalTag(PowerKeys.AttackRadius)) : 35f);
|
||||
float targetDistance = PowerSystem.PowerMath.Distance2D(_target.Position, this.Body.Position);
|
||||
power.User = Body;
|
||||
float attackRange = Body.ActorData.Cylinder.Ax2 + (power.EvalTag(PowerKeys.AttackRadius) > 0f ? (powerToUse == 30592 ? 10f : power.EvalTag(PowerKeys.AttackRadius)) : 35f);
|
||||
float targetDistance = PowerSystem.PowerMath.Distance2D(_target.Position, Body.Position);
|
||||
if (targetDistance < attackRange + _target.ActorData.Cylinder.Ax2)
|
||||
{
|
||||
if (_powerDelay.TimedOut)
|
||||
{
|
||||
_powerDelay = null;
|
||||
this.Body.TranslateFacing(_target.Position, false);
|
||||
Body.TranslateFacing(_target.Position, false);
|
||||
|
||||
this.CurrentAction = new PowerAction(this.Body, powerToUse, _target);
|
||||
CurrentAction = new PowerAction(Body, powerToUse, _target);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.CurrentAction = new MoveToTargetWithPathfindAction(
|
||||
this.Body,
|
||||
CurrentAction = new MoveToTargetWithPathfindAction(
|
||||
Body,
|
||||
_target,
|
||||
attackRange + _target.ActorData.Cylinder.Ax2
|
||||
);
|
||||
@ -112,7 +112,7 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
}
|
||||
else
|
||||
{
|
||||
this.CurrentAction = new MoveToPointAction(this.Body, this.Body.CheckPointPosition);
|
||||
CurrentAction = new MoveToPointAction(Body, Body.CheckPointPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -120,11 +120,11 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
|
||||
protected virtual int PickPowerToUse()
|
||||
{
|
||||
if (this.PresetPowers.Count > 0)
|
||||
if (PresetPowers.Count > 0)
|
||||
{
|
||||
int powerIndex = RandomHelper.Next(this.PresetPowers.Count);
|
||||
if (PowerSystem.PowerLoader.HasImplementationForPowerSNO(this.PresetPowers[powerIndex]))
|
||||
return this.PresetPowers[powerIndex];
|
||||
int powerIndex = RandomHelper.Next(PresetPowers.Count);
|
||||
if (PowerSystem.PowerLoader.HasImplementationForPowerSNO(PresetPowers[powerIndex]))
|
||||
return PresetPowers[powerIndex];
|
||||
}
|
||||
|
||||
return -1;
|
||||
@ -132,7 +132,7 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
|
||||
public void AddPresetPower(int powerSNO)
|
||||
{
|
||||
this.PresetPowers.Add(powerSNO);
|
||||
PresetPowers.Add(powerSNO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -49,75 +49,75 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
public HirelingBrain(Actor body, Player master)
|
||||
: base(body)
|
||||
{
|
||||
this.Owner = master;
|
||||
Owner = master;
|
||||
|
||||
this.PresetPowers = new List<int>();
|
||||
PresetPowers = new List<int>();
|
||||
|
||||
if (body is Templar && body is MalthaelHireling)
|
||||
this.PresetPowers.Add(30592); //melee instant
|
||||
PresetPowers.Add(30592); //melee instant
|
||||
if (body is Scoundrel)
|
||||
this.PresetPowers.Add(99902); //Scoundrel_ranged_Projectile
|
||||
PresetPowers.Add(99902); //Scoundrel_ranged_Projectile
|
||||
if (body is Enchantress)
|
||||
this.PresetPowers.Add(30273); //HirelingMage_MagicMissile
|
||||
PresetPowers.Add(30273); //HirelingMage_MagicMissile
|
||||
if (body is Leah)
|
||||
this.PresetPowers.Add(99902); //Scoundrel_ranged_Projectile
|
||||
PresetPowers.Add(99902); //Scoundrel_ranged_Projectile
|
||||
|
||||
}
|
||||
|
||||
public override void Think(int tickCounter)
|
||||
{
|
||||
if (this.Owner == null) return;
|
||||
if (Owner == null) return;
|
||||
|
||||
if (this.Body.World.Game.Paused) return;
|
||||
if (Body.World.Game.Paused) return;
|
||||
|
||||
// check if in disabled state, if so cancel any action then do nothing
|
||||
if (this.Body.Attributes[GameAttribute.Frozen] ||
|
||||
this.Body.Attributes[GameAttribute.Stunned] ||
|
||||
this.Body.Attributes[GameAttribute.Blind] ||
|
||||
this.Body.Attributes[GameAttribute.Webbed] ||
|
||||
this.Body.Disable ||
|
||||
this.Body.World.BuffManager.GetFirstBuff<PowerSystem.Implementations.KnockbackBuff>(this.Body) != null)
|
||||
if (Body.Attributes[GameAttribute.Frozen] ||
|
||||
Body.Attributes[GameAttribute.Stunned] ||
|
||||
Body.Attributes[GameAttribute.Blind] ||
|
||||
Body.Attributes[GameAttribute.Webbed] ||
|
||||
Body.Disable ||
|
||||
Body.World.BuffManager.GetFirstBuff<KnockbackBuff>(Body) != null)
|
||||
{
|
||||
if (this.CurrentAction != null)
|
||||
if (CurrentAction != null)
|
||||
{
|
||||
this.CurrentAction.Cancel(tickCounter);
|
||||
this.CurrentAction = null;
|
||||
CurrentAction.Cancel(tickCounter);
|
||||
CurrentAction = null;
|
||||
}
|
||||
_powerDelay = null;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.Body.Attributes[GameAttribute.Feared])
|
||||
if (Body.Attributes[GameAttribute.Feared])
|
||||
{
|
||||
if (!this.Feared || this.CurrentAction == null)
|
||||
if (!Feared || CurrentAction == null)
|
||||
{
|
||||
if (this.CurrentAction != null)
|
||||
if (CurrentAction != null)
|
||||
{
|
||||
this.CurrentAction.Cancel(tickCounter);
|
||||
this.CurrentAction = null;
|
||||
CurrentAction.Cancel(tickCounter);
|
||||
CurrentAction = null;
|
||||
}
|
||||
this.Feared = true;
|
||||
this.CurrentAction = new MoveToPointWithPathfindAction(
|
||||
this.Body,
|
||||
PowerContext.RandomDirection(this.Body.Position, 3f, 8f)
|
||||
Feared = true;
|
||||
CurrentAction = new MoveToPointWithPathfindAction(
|
||||
Body,
|
||||
PowerContext.RandomDirection(Body.Position, 3f, 8f)
|
||||
);
|
||||
return;
|
||||
}
|
||||
else return;
|
||||
}
|
||||
else
|
||||
this.Feared = false;
|
||||
Feared = false;
|
||||
|
||||
// select and start executing a power if no active action
|
||||
if (this.CurrentAction == null)
|
||||
if (CurrentAction == null)
|
||||
{
|
||||
// do a little delay so groups of monsters don't all execute at once
|
||||
if (_powerDelay == null)
|
||||
_powerDelay = new SecondsTickTimer(this.Body.World.Game, 1f);
|
||||
_powerDelay = new SecondsTickTimer(Body.World.Game, 1f);
|
||||
|
||||
var targets = this.Owner.GetObjectsInRange<Monster>(40f).Where(p => !p.Dead && p.Visible).OrderBy(m => PowerMath.Distance2D(m.Position, this.Body.Position)).ToList();
|
||||
if (targets.Count != 0 && PowerMath.Distance2D(this.Body.Position, this.Owner.Position) < 80f)
|
||||
var targets = Owner.GetObjectsInRange<Monster>(40f).Where(p => !p.Dead && p.Visible).OrderBy(m => PowerMath.Distance2D(m.Position, Body.Position)).ToList();
|
||||
if (targets.Count != 0 && PowerMath.Distance2D(Body.Position, Owner.Position) < 80f)
|
||||
{
|
||||
int powerToUse = PickPowerToUse();
|
||||
if (powerToUse > 0)
|
||||
@ -129,23 +129,23 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
_target = targets.First();
|
||||
|
||||
PowerScript power = PowerLoader.CreateImplementationForPowerSNO(powerToUse);
|
||||
power.User = this.Body;
|
||||
float attackRange = this.Body.ActorData.Cylinder.Ax2 + (power.EvalTag(PowerKeys.AttackRadius) > 0f ? (powerToUse == 30592 ? 10f : power.EvalTag(PowerKeys.AttackRadius)) : 35f);
|
||||
float targetDistance = PowerMath.Distance2D(_target.Position, this.Body.Position);
|
||||
power.User = Body;
|
||||
float attackRange = Body.ActorData.Cylinder.Ax2 + (power.EvalTag(PowerKeys.AttackRadius) > 0f ? (powerToUse == 30592 ? 10f : power.EvalTag(PowerKeys.AttackRadius)) : 35f);
|
||||
float targetDistance = PowerMath.Distance2D(_target.Position, Body.Position);
|
||||
if (targetDistance < attackRange + _target.ActorData.Cylinder.Ax2)
|
||||
{
|
||||
if (_powerDelay.TimedOut)
|
||||
{
|
||||
_powerDelay = null;
|
||||
this.Body.TranslateFacing(_target.Position, false);
|
||||
Body.TranslateFacing(_target.Position, false);
|
||||
|
||||
this.CurrentAction = new PowerAction(this.Body, powerToUse, _target);
|
||||
CurrentAction = new PowerAction(Body, powerToUse, _target);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.CurrentAction = new MoveToTargetWithPathfindAction(
|
||||
this.Body,
|
||||
CurrentAction = new MoveToTargetWithPathfindAction(
|
||||
Body,
|
||||
_target,
|
||||
attackRange + _target.ActorData.Cylinder.Ax2
|
||||
);
|
||||
@ -154,15 +154,15 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
}
|
||||
else
|
||||
{
|
||||
var distToMaster = PowerMath.Distance2D(this.Body.Position, this.Owner.Position);
|
||||
var distToMaster = PowerMath.Distance2D(Body.Position, Owner.Position);
|
||||
if ((distToMaster > 8f) || (distToMaster < 3f))
|
||||
{
|
||||
var Rand = FastRandom.Instance;
|
||||
var position = this.Owner.Position;
|
||||
var position = Owner.Position;
|
||||
float angle = (float)(Rand.NextDouble() * Math.PI * 2);
|
||||
float radius = 3f + (float)Rand.NextDouble() * (8f - 3f);
|
||||
var near = new Vector3D(position.X + (float)Math.Cos(angle) * radius, position.Y + (float)Math.Sin(angle) * radius, position.Z);
|
||||
this.CurrentAction = new MoveToPointAction(this.Body, near);
|
||||
CurrentAction = new MoveToPointAction(Body, near);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -171,11 +171,11 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
protected virtual int PickPowerToUse()
|
||||
{
|
||||
// randomly used an implemented power
|
||||
if (this.PresetPowers.Count > 0)
|
||||
if (PresetPowers.Count > 0)
|
||||
{
|
||||
int powerIndex = RandomHelper.Next(this.PresetPowers.Count);
|
||||
if (PowerSystem.PowerLoader.HasImplementationForPowerSNO(this.PresetPowers[powerIndex]))
|
||||
return this.PresetPowers[powerIndex];
|
||||
int powerIndex = RandomHelper.Next(PresetPowers.Count);
|
||||
if (PowerLoader.HasImplementationForPowerSNO(PresetPowers[powerIndex]))
|
||||
return PresetPowers[powerIndex];
|
||||
}
|
||||
|
||||
// no usable power
|
||||
@ -184,7 +184,7 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
|
||||
public void AddPresetPower(int powerSNO)
|
||||
{
|
||||
this.PresetPowers.Add(powerSNO);
|
||||
PresetPowers.Add(powerSNO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,8 +61,8 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
public LooterBrain(Actor body, bool lootsLegs)
|
||||
: base(body)
|
||||
{
|
||||
this.LootLegendaries = lootsLegs;
|
||||
this.PresetPowers = new Dictionary<int, Cooldown>();
|
||||
LootLegendaries = lootsLegs;
|
||||
PresetPowers = new Dictionary<int, Cooldown>();
|
||||
|
||||
// build list of powers defined in monster mpq data
|
||||
if (body.ActorData.MonsterSNO > 0)
|
||||
@ -72,7 +72,7 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
{
|
||||
if (monsterSkill.SNOPower > 0)
|
||||
{
|
||||
this.PresetPowers.Add(monsterSkill.SNOPower, new Cooldown { CooldownTimer = null, CooldownTime = 1f });
|
||||
PresetPowers.Add(monsterSkill.SNOPower, new Cooldown { CooldownTimer = null, CooldownTime = 1f });
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -82,52 +82,52 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
{
|
||||
base.Update(tickCounter);
|
||||
|
||||
List<Item> gold = this.Body.GetObjectsInRange<Item>(5f).Where(m => ((this.Body as Minion).Master as Player).GroundItems.ContainsKey(m.GlobalID) && Item.IsGold((m as Item).ItemType)).ToList();
|
||||
List<Item> gold = Body.GetObjectsInRange<Item>(5f).Where(m => ((Body as Minion).Master as Player).GroundItems.ContainsKey(m.GlobalID) && Item.IsGold((m as Item).ItemType)).ToList();
|
||||
foreach (var item in gold)
|
||||
{
|
||||
((this.Body as Minion).Master as Player).InGameClient.SendMessage(new FloatingAmountMessage()
|
||||
((Body as Minion).Master as Player).InGameClient.SendMessage(new FloatingAmountMessage()
|
||||
{
|
||||
Place = new WorldPlace()
|
||||
{
|
||||
Position = this.Body.Position,
|
||||
WorldID = this.Body.World.GlobalID,
|
||||
Position = Body.Position,
|
||||
WorldID = Body.World.GlobalID,
|
||||
},
|
||||
|
||||
Amount = item.Attributes[GameAttribute.ItemStackQuantityLo],
|
||||
Type = FloatingAmountMessage.FloatType.Gold,
|
||||
});
|
||||
|
||||
((this.Body as Minion).Master as Player).Inventory.PickUpGold(item);
|
||||
((this.Body as Minion).Master as Player).GroundItems.Remove(item.GlobalID);
|
||||
((Body as Minion).Master as Player).Inventory.PickUpGold(item);
|
||||
((Body as Minion).Master as Player).GroundItems.Remove(item.GlobalID);
|
||||
item.Destroy();
|
||||
}
|
||||
|
||||
if (this.LootLegendaries)
|
||||
if (LootLegendaries)
|
||||
{
|
||||
List<Item> legendaries = this.Body.GetObjectsInRange<Item>(5f).Where(m => ((this.Body as Minion).Master as Player).GroundItems.ContainsKey(m.GlobalID) && (m as Item).ItemDefinition.Name.Contains("Unique_")).ToList();
|
||||
List<Item> legendaries = Body.GetObjectsInRange<Item>(5f).Where(m => ((Body as Minion).Master as Player).GroundItems.ContainsKey(m.GlobalID) && (m as Item).ItemDefinition.Name.Contains("Unique_")).ToList();
|
||||
foreach (var item in legendaries)
|
||||
{
|
||||
((this.Body as Minion).Master as Player).Inventory.PickUp(item);
|
||||
((Body as Minion).Master as Player).Inventory.PickUp(item);
|
||||
}
|
||||
}
|
||||
|
||||
List<Item> shards = this.Body.GetObjectsInRange<Item>(5f).Where(m => ((this.Body as Minion).Master as Player).GroundItems.ContainsKey(m.GlobalID) && Item.IsBloodShard((m as Item).ItemType)).ToList();
|
||||
List<Item> shards = Body.GetObjectsInRange<Item>(5f).Where(m => ((Body as Minion).Master as Player).GroundItems.ContainsKey(m.GlobalID) && Item.IsBloodShard((m as Item).ItemType)).ToList();
|
||||
foreach (var item in shards)
|
||||
{
|
||||
((this.Body as Minion).Master as Player).InGameClient.SendMessage(new FloatingAmountMessage()
|
||||
((Body as Minion).Master as Player).InGameClient.SendMessage(new FloatingAmountMessage()
|
||||
{
|
||||
Place = new WorldPlace()
|
||||
{
|
||||
Position = this.Body.Position,
|
||||
WorldID = this.Body.World.GlobalID,
|
||||
Position = Body.Position,
|
||||
WorldID = Body.World.GlobalID,
|
||||
},
|
||||
|
||||
Amount = item.Attributes[GameAttribute.ItemStackQuantityLo],
|
||||
Type = FloatingAmountMessage.FloatType.BloodStone,
|
||||
});
|
||||
|
||||
((this.Body as Minion).Master as Player).Inventory.PickUpBloodShard(item);
|
||||
((this.Body as Minion).Master as Player).GroundItems.Remove(item.GlobalID);
|
||||
((Body as Minion).Master as Player).Inventory.PickUpBloodShard(item);
|
||||
((Body as Minion).Master as Player).GroundItems.Remove(item.GlobalID);
|
||||
item.Destroy();
|
||||
}
|
||||
}
|
||||
@ -136,39 +136,39 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
{
|
||||
// this needed? /mdz
|
||||
//if (this.Body is NPC) return;
|
||||
if ((this.Body as Minion).Master == null) return;
|
||||
if ((Body as Minion).Master == null) return;
|
||||
|
||||
if (this.Body.World.Game.Paused) return;
|
||||
if (Body.World.Game.Paused) return;
|
||||
|
||||
// select and start executing a power if no active action
|
||||
if (this.CurrentAction == null)
|
||||
if (CurrentAction == null)
|
||||
{
|
||||
// do a little delay so groups of monsters don't all execute at once
|
||||
if (_powerDelay == null)
|
||||
_powerDelay = new SecondsTickTimer(this.Body.World.Game, (float)RandomHelper.NextDouble());
|
||||
_powerDelay = new SecondsTickTimer(Body.World.Game, (float)RandomHelper.NextDouble());
|
||||
|
||||
if (_powerDelay.TimedOut)
|
||||
{
|
||||
List<Actor> targets = this.Body.GetObjectsInRange<Item>(40f).Where(m => ((this.Body as Minion).Master as Player).GroundItems.ContainsKey(m.GlobalID) && Item.IsGold((m as Item).ItemType)).Cast<Actor>().ToList();
|
||||
if (this.LootLegendaries)
|
||||
targets.Concat(this.Body.GetObjectsInRange<Item>(40f).Where(m => ((this.Body as Minion).Master as Player).GroundItems.ContainsKey(m.GlobalID) && (m as Item).ItemDefinition.Name.Contains("Unique_")).Cast<Actor>().ToList());
|
||||
if (targets.Count != 0 && PowerMath.Distance2D(this.Body.Position, (this.Body as Minion).Master.Position) < 80f)
|
||||
List<Actor> targets = Body.GetObjectsInRange<Item>(40f).Where(m => ((Body as Minion).Master as Player).GroundItems.ContainsKey(m.GlobalID) && Item.IsGold((m as Item).ItemType)).Cast<Actor>().ToList();
|
||||
if (LootLegendaries)
|
||||
targets.Concat(Body.GetObjectsInRange<Item>(40f).Where(m => ((Body as Minion).Master as Player).GroundItems.ContainsKey(m.GlobalID) && (m as Item).ItemDefinition.Name.Contains("Unique_")).Cast<Actor>().ToList());
|
||||
if (targets.Count != 0 && PowerMath.Distance2D(Body.Position, (Body as Minion).Master.Position) < 80f)
|
||||
{
|
||||
_target = targets.First();
|
||||
//Logger.Trace("MoveToTargetWithPathfindAction to target");
|
||||
this.CurrentAction = new MoveToPointAction(this.Body, _target.Position);
|
||||
CurrentAction = new MoveToPointAction(Body, _target.Position);
|
||||
}
|
||||
else
|
||||
{
|
||||
var distToMaster = PowerMath.Distance2D(this.Body.Position, (this.Body as Minion).Master.Position);
|
||||
var distToMaster = PowerMath.Distance2D(Body.Position, (Body as Minion).Master.Position);
|
||||
if ((distToMaster > 8f) || (distToMaster < 3f))
|
||||
{
|
||||
var Rand = FastRandom.Instance;
|
||||
var position = (this.Body as Minion).Master.Position;
|
||||
var position = (Body as Minion).Master.Position;
|
||||
float angle = (float)(Rand.NextDouble() * Math.PI * 2);
|
||||
float radius = 3f + (float)Rand.NextDouble() * (8f - 3f);
|
||||
var near = new Vector3D(position.X + (float)Math.Cos(angle) * radius, position.Y + (float)Math.Sin(angle) * radius, position.Z);
|
||||
this.CurrentAction = new MoveToPointAction(this.Body, near);
|
||||
CurrentAction = new MoveToPointAction(Body, near);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
public MinionBrain(Actor body)
|
||||
: base(body)
|
||||
{
|
||||
this.PresetPowers = new Dictionary<int, Cooldown>();
|
||||
PresetPowers = new Dictionary<int, Cooldown>();
|
||||
|
||||
// build list of powers defined in monster mpq data
|
||||
if (body.ActorData.MonsterSNO > 0)
|
||||
@ -67,7 +67,7 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
{
|
||||
if (monsterSkill.SNOPower > 0)
|
||||
{
|
||||
this.PresetPowers.Add(monsterSkill.SNOPower, new Cooldown { CooldownTimer = null, CooldownTime = 1f });
|
||||
PresetPowers.Add(monsterSkill.SNOPower, new Cooldown { CooldownTimer = null, CooldownTime = 1f });
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -77,70 +77,70 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
{
|
||||
// this needed? /mdz
|
||||
//if (this.Body is NPC) return;
|
||||
if ((this.Body as Minion).Master == null) return;
|
||||
if ((Body as Minion).Master == null) return;
|
||||
|
||||
if (this.Body.World.Game.Paused) return;
|
||||
if (Body.World.Game.Paused) return;
|
||||
|
||||
// check if in disabled state, if so cancel any action then do nothing
|
||||
if (this.Body.Attributes[GameAttribute.Frozen] ||
|
||||
this.Body.Attributes[GameAttribute.Stunned] ||
|
||||
this.Body.Attributes[GameAttribute.Blind] ||
|
||||
this.Body.Attributes[GameAttribute.Webbed] ||
|
||||
this.Body.Disable ||
|
||||
this.Body.World.BuffManager.GetFirstBuff<PowerSystem.Implementations.KnockbackBuff>(this.Body) != null)
|
||||
if (Body.Attributes[GameAttribute.Frozen] ||
|
||||
Body.Attributes[GameAttribute.Stunned] ||
|
||||
Body.Attributes[GameAttribute.Blind] ||
|
||||
Body.Attributes[GameAttribute.Webbed] ||
|
||||
Body.Disable ||
|
||||
Body.World.BuffManager.GetFirstBuff<KnockbackBuff>(Body) != null)
|
||||
{
|
||||
if (this.CurrentAction != null)
|
||||
if (CurrentAction != null)
|
||||
{
|
||||
this.CurrentAction.Cancel(tickCounter);
|
||||
this.CurrentAction = null;
|
||||
CurrentAction.Cancel(tickCounter);
|
||||
CurrentAction = null;
|
||||
}
|
||||
_powerDelay = null;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.Body.Attributes[GameAttribute.Feared])
|
||||
if (Body.Attributes[GameAttribute.Feared])
|
||||
{
|
||||
if (!this.Feared || this.CurrentAction == null)
|
||||
if (!Feared || CurrentAction == null)
|
||||
{
|
||||
if (this.CurrentAction != null)
|
||||
if (CurrentAction != null)
|
||||
{
|
||||
this.CurrentAction.Cancel(tickCounter);
|
||||
this.CurrentAction = null;
|
||||
CurrentAction.Cancel(tickCounter);
|
||||
CurrentAction = null;
|
||||
}
|
||||
this.Feared = true;
|
||||
this.CurrentAction = new MoveToPointWithPathfindAction(
|
||||
this.Body,
|
||||
PowerContext.RandomDirection(this.Body.Position, 3f, 8f)
|
||||
Feared = true;
|
||||
CurrentAction = new MoveToPointWithPathfindAction(
|
||||
Body,
|
||||
PowerContext.RandomDirection(Body.Position, 3f, 8f)
|
||||
);
|
||||
return;
|
||||
}
|
||||
else return;
|
||||
}
|
||||
else
|
||||
this.Feared = false;
|
||||
Feared = false;
|
||||
|
||||
// select and start executing a power if no active action
|
||||
if (this.CurrentAction == null)
|
||||
if (CurrentAction == null)
|
||||
{
|
||||
// do a little delay so groups of monsters don't all execute at once
|
||||
if (_powerDelay == null)
|
||||
_powerDelay = new SecondsTickTimer(this.Body.World.Game, (float)RandomHelper.NextDouble());
|
||||
_powerDelay = new SecondsTickTimer(Body.World.Game, (float)RandomHelper.NextDouble());
|
||||
|
||||
if (_powerDelay.TimedOut)
|
||||
{
|
||||
List<Actor> targets = (this.Body as Minion).Master
|
||||
List<Actor> targets = (Body as Minion).Master
|
||||
.GetObjectsInRange<Monster>(40f)
|
||||
.Where(m => !m.Dead && m.Visible && m.SNO.IsTargetable())
|
||||
.OrderBy(m => PowerMath.Distance2D(m.Position, this.Body.Position))
|
||||
.OrderBy(m => PowerMath.Distance2D(m.Position, Body.Position))
|
||||
.Cast<Actor>()
|
||||
.ToList();
|
||||
if (this.Body.World.Game.PvP)
|
||||
targets = (this.Body as Minion).Master.GetObjectsInRange<Player>(30f).Where(p => p.GlobalID != (this.Body as Minion).Master.GlobalID && p.Attributes[GameAttribute.TeamID] != (this.Body as Minion).Master.Attributes[GameAttribute.TeamID]).Cast<Actor>().ToList();
|
||||
if (this.Body.World.IsPvP)
|
||||
targets = (this.Body as Minion).Master.GetObjectsInRange<Player>(30f).Where(p => p.GlobalID != (this.Body as Minion).Master.GlobalID).Cast<Actor>().ToList();
|
||||
if (Body.World.Game.PvP)
|
||||
targets = (Body as Minion).Master.GetObjectsInRange<Player>(30f).Where(p => p.GlobalID != (Body as Minion).Master.GlobalID && p.Attributes[GameAttribute.TeamID] != (Body as Minion).Master.Attributes[GameAttribute.TeamID]).Cast<Actor>().ToList();
|
||||
if (Body.World.IsPvP)
|
||||
targets = (Body as Minion).Master.GetObjectsInRange<Player>(30f).Where(p => p.GlobalID != (Body as Minion).Master.GlobalID).Cast<Actor>().ToList();
|
||||
|
||||
if (targets.Count != 0 && PowerMath.Distance2D(this.Body.Position, (this.Body as Minion).Master.Position) < 80f)
|
||||
if (targets.Count != 0 && PowerMath.Distance2D(Body.Position, (Body as Minion).Master.Position) < 80f)
|
||||
{
|
||||
var elites = targets.Where(t => t is Champion || t is Rare || t is RareMinion);
|
||||
if (elites.Count() > 0)
|
||||
@ -152,30 +152,30 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
if (powerToUse > 0)
|
||||
{
|
||||
PowerScript power = PowerLoader.CreateImplementationForPowerSNO(powerToUse);
|
||||
power.User = this.Body;
|
||||
float attackRange = this.Body.ActorData.Cylinder.Ax2 + (power.EvalTag(PowerKeys.AttackRadius) > 0f ? (powerToUse == 30592 ? 10f : power.EvalTag(PowerKeys.AttackRadius)) : 35f);
|
||||
float targetDistance = PowerMath.Distance2D(_target.Position, this.Body.Position);
|
||||
power.User = Body;
|
||||
float attackRange = Body.ActorData.Cylinder.Ax2 + (power.EvalTag(PowerKeys.AttackRadius) > 0f ? (powerToUse == 30592 ? 10f : power.EvalTag(PowerKeys.AttackRadius)) : 35f);
|
||||
float targetDistance = PowerMath.Distance2D(_target.Position, Body.Position);
|
||||
if (targetDistance < attackRange + _target.ActorData.Cylinder.Ax2)
|
||||
{
|
||||
if (this.Body.WalkSpeed != 0)
|
||||
this.Body.TranslateFacing(_target.Position, false); //columns and other non-walkable shit can't turn
|
||||
if (Body.WalkSpeed != 0)
|
||||
Body.TranslateFacing(_target.Position, false); //columns and other non-walkable shit can't turn
|
||||
|
||||
float cdReduction = (this.Body as Minion).CooldownReduction;
|
||||
float cdReduction = (Body as Minion).CooldownReduction;
|
||||
|
||||
//Logger.Trace("PowerAction to target");
|
||||
this.CurrentAction = new PowerAction(this.Body, powerToUse, _target);
|
||||
CurrentAction = new PowerAction(Body, powerToUse, _target);
|
||||
|
||||
if (power is SummoningSkill)
|
||||
this.PresetPowers[powerToUse] = new Cooldown { CooldownTimer = null, CooldownTime = (7f * cdReduction) };
|
||||
PresetPowers[powerToUse] = new Cooldown { CooldownTimer = null, CooldownTime = (7f * cdReduction) };
|
||||
|
||||
if (this.PresetPowers[powerToUse].CooldownTime > 0f)
|
||||
this.PresetPowers[powerToUse] = new Cooldown { CooldownTimer = new SecondsTickTimer(this.Body.World.Game, this.PresetPowers[powerToUse].CooldownTime), CooldownTime = (this.PresetPowers[powerToUse].CooldownTime * cdReduction) };
|
||||
if (PresetPowers[powerToUse].CooldownTime > 0f)
|
||||
PresetPowers[powerToUse] = new Cooldown { CooldownTimer = new SecondsTickTimer(Body.World.Game, PresetPowers[powerToUse].CooldownTime), CooldownTime = (PresetPowers[powerToUse].CooldownTime * cdReduction) };
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.Trace("MoveToTargetWithPathfindAction to target");
|
||||
this.CurrentAction = new MoveToTargetWithPathfindAction(
|
||||
this.Body,
|
||||
CurrentAction = new MoveToTargetWithPathfindAction(
|
||||
Body,
|
||||
//(
|
||||
_target,// + MovementHelpers.GetMovementPosition(
|
||||
//new Vector3D(0, 0, 0),
|
||||
@ -191,15 +191,15 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
}
|
||||
else
|
||||
{
|
||||
var distToMaster = PowerMath.Distance2D(this.Body.Position, (this.Body as Minion).Master.Position);
|
||||
var distToMaster = PowerMath.Distance2D(Body.Position, (Body as Minion).Master.Position);
|
||||
if ((distToMaster > 8f) || (distToMaster < 3f))
|
||||
{
|
||||
var Rand = FastRandom.Instance;
|
||||
var position = (this.Body as Minion).Master.Position;
|
||||
var position = (Body as Minion).Master.Position;
|
||||
float angle = (float)(Rand.NextDouble() * Math.PI * 2);
|
||||
float radius = 3f + (float)Rand.NextDouble() * (8f - 3f);
|
||||
var near = new Vector3D(position.X + (float)Math.Cos(angle) * radius, position.Y + (float)Math.Sin(angle) * radius, position.Z);
|
||||
this.CurrentAction = new MoveToPointAction(this.Body, near);
|
||||
CurrentAction = new MoveToPointAction(Body, near);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -208,17 +208,17 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
|
||||
protected virtual int PickPowerToUse()
|
||||
{
|
||||
if (!_warnedNoPowers && this.PresetPowers.Count == 0)
|
||||
if (!_warnedNoPowers && PresetPowers.Count == 0)
|
||||
{
|
||||
Logger.Debug("Minion \"{0}\" has no usable powers. ", this.Body.Name);
|
||||
Logger.Debug("Minion \"{0}\" has no usable powers. ", Body.Name);
|
||||
_warnedNoPowers = true;
|
||||
}
|
||||
|
||||
// randomly used an implemented power
|
||||
if (this.PresetPowers.Count > 0)
|
||||
if (PresetPowers.Count > 0)
|
||||
{
|
||||
//int power = this.PresetPowers[RandomHelper.Next(this.PresetPowers.Count)].Key;
|
||||
List<int> availablePowers = Enumerable.ToList(this.PresetPowers.Where(p => (p.Value.CooldownTimer == null || p.Value.CooldownTimer.TimedOut) && PowerSystem.PowerLoader.HasImplementationForPowerSNO(p.Key)).Select(p => p.Key));
|
||||
List<int> availablePowers = Enumerable.ToList(PresetPowers.Where(p => (p.Value.CooldownTimer == null || p.Value.CooldownTimer.TimedOut) && PowerLoader.HasImplementationForPowerSNO(p.Key)).Select(p => p.Key));
|
||||
if (availablePowers.Where(p => p != 30592).Count() > 0)
|
||||
return availablePowers.Where(p => p != 30592).ToList()[RandomHelper.Next(availablePowers.Where(p => p != 30592).ToList().Count())];
|
||||
else
|
||||
@ -232,23 +232,23 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
|
||||
public void AddPresetPower(int powerSNO)
|
||||
{
|
||||
if (this.PresetPowers.ContainsKey(powerSNO))
|
||||
if (PresetPowers.ContainsKey(powerSNO))
|
||||
{
|
||||
// Logger.Debug("AddPresetPower(): power sno {0} already defined for monster \"{1}\"",
|
||||
//powerSNO, this.Body.ActorSNO.Name);
|
||||
return;
|
||||
}
|
||||
if (this.PresetPowers.ContainsKey(30592)) //if can cast melee
|
||||
this.PresetPowers.Add(powerSNO, new Cooldown { CooldownTimer = null, CooldownTime = 5f });
|
||||
if (PresetPowers.ContainsKey(30592)) //if can cast melee
|
||||
PresetPowers.Add(powerSNO, new Cooldown { CooldownTimer = null, CooldownTime = 5f });
|
||||
else
|
||||
this.PresetPowers.Add(powerSNO, new Cooldown { CooldownTimer = null, CooldownTime = 1f + (float)FastRandom.Instance.NextDouble() });
|
||||
PresetPowers.Add(powerSNO, new Cooldown { CooldownTimer = null, CooldownTime = 1f + (float)FastRandom.Instance.NextDouble() });
|
||||
}
|
||||
|
||||
public void RemovePresetPower(int powerSNO)
|
||||
{
|
||||
if (this.PresetPowers.ContainsKey(powerSNO))
|
||||
if (PresetPowers.ContainsKey(powerSNO))
|
||||
{
|
||||
this.PresetPowers.Remove(powerSNO);
|
||||
PresetPowers.Remove(powerSNO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
public MonsterBrain(Actor body)
|
||||
: base(body)
|
||||
{
|
||||
this.PresetPowers = new Dictionary<int, Cooldown>();
|
||||
PresetPowers = new Dictionary<int, Cooldown>();
|
||||
|
||||
// build list of powers defined in monster mpq data
|
||||
if (body.ActorData.MonsterSNO > 0)
|
||||
@ -72,117 +72,117 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
for (int i = 0; i < monsterData.SkillDeclarations.Count(); i++)
|
||||
{
|
||||
if (monsterData.SkillDeclarations[i].SNOPower == -1) continue;
|
||||
if (PowerSystem.PowerLoader.HasImplementationForPowerSNO(monsterData.SkillDeclarations[i].SNOPower))
|
||||
if (PowerLoader.HasImplementationForPowerSNO(monsterData.SkillDeclarations[i].SNOPower))
|
||||
{
|
||||
var cooldownTime = monsterData.MonsterSkillDeclarations[i].Timer / 10f;
|
||||
this.PresetPowers.Add(monsterData.SkillDeclarations[i].SNOPower, new Cooldown { CooldownTimer = null, CooldownTime = cooldownTime });
|
||||
PresetPowers.Add(monsterData.SkillDeclarations[i].SNOPower, new Cooldown { CooldownTimer = null, CooldownTime = cooldownTime });
|
||||
}
|
||||
}
|
||||
|
||||
if (!monsterData.SkillDeclarations.Any(s => s.SNOPower == 30592))
|
||||
this.PresetPowers.Add(30592, new Cooldown { CooldownTimer = null, CooldownTime = 0f }); //hack for dummy mobs without powers
|
||||
PresetPowers.Add(30592, new Cooldown { CooldownTimer = null, CooldownTime = 0f }); //hack for dummy mobs without powers
|
||||
}
|
||||
}
|
||||
|
||||
public override void Think(int tickCounter)
|
||||
{
|
||||
if (this.Body.SNO == ActorSno._uber_siegebreakerdemon ||
|
||||
this.Body.SNO == ActorSno._a4dun_garden_corruption_monster ||
|
||||
this.Body.SNO == ActorSno._a4dun_garden_hellportal_pillar)
|
||||
if (Body.SNO == ActorSno._uber_siegebreakerdemon ||
|
||||
Body.SNO == ActorSno._a4dun_garden_corruption_monster ||
|
||||
Body.SNO == ActorSno._a4dun_garden_hellportal_pillar)
|
||||
return;
|
||||
if (this.Body.SNO == ActorSno._belialvoiceover) //BelialVoiceover
|
||||
if (Body.SNO == ActorSno._belialvoiceover) //BelialVoiceover
|
||||
return;
|
||||
if (this.Body.Hidden == true)
|
||||
if (Body.Hidden == true)
|
||||
return;
|
||||
|
||||
if (this.CurrentAction != null && this.PriorityTarget != null && this.PriorityTarget.Attributes[GameAttribute.Is_Helper] == true)
|
||||
if (CurrentAction != null && PriorityTarget != null && PriorityTarget.Attributes[GameAttribute.Is_Helper] == true)
|
||||
{
|
||||
this.PriorityTarget = null;
|
||||
this.CurrentAction.Cancel(tickCounter);
|
||||
this.CurrentAction = null;
|
||||
PriorityTarget = null;
|
||||
CurrentAction.Cancel(tickCounter);
|
||||
CurrentAction = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(tickCounter % 60 == 0)) return;
|
||||
|
||||
if (this.Body is NPC) return;
|
||||
if (Body is NPC) return;
|
||||
|
||||
if (!this.Body.Visible || this.Body.Dead) return;
|
||||
if (!Body.Visible || Body.Dead) return;
|
||||
|
||||
if (this.Body.World.Game.Paused) return;
|
||||
if (this.Body.Attributes[GameAttribute.Disabled]) return;
|
||||
if (Body.World.Game.Paused) return;
|
||||
if (Body.Attributes[GameAttribute.Disabled]) return;
|
||||
|
||||
if (this.Body.Attributes[GameAttribute.Frozen] ||
|
||||
this.Body.Attributes[GameAttribute.Stunned] ||
|
||||
this.Body.Attributes[GameAttribute.Blind] ||
|
||||
this.Body.Attributes[GameAttribute.Webbed] ||
|
||||
this.Body.Disable ||
|
||||
this.Body.World.BuffManager.GetFirstBuff<KnockbackBuff>(this.Body) != null ||
|
||||
this.Body.World.BuffManager.GetFirstBuff<SummonedBuff>(this.Body) != null)
|
||||
if (Body.Attributes[GameAttribute.Frozen] ||
|
||||
Body.Attributes[GameAttribute.Stunned] ||
|
||||
Body.Attributes[GameAttribute.Blind] ||
|
||||
Body.Attributes[GameAttribute.Webbed] ||
|
||||
Body.Disable ||
|
||||
Body.World.BuffManager.GetFirstBuff<KnockbackBuff>(Body) != null ||
|
||||
Body.World.BuffManager.GetFirstBuff<SummonedBuff>(Body) != null)
|
||||
{
|
||||
if (this.CurrentAction != null)
|
||||
if (CurrentAction != null)
|
||||
{
|
||||
this.CurrentAction.Cancel(tickCounter);
|
||||
this.CurrentAction = null;
|
||||
CurrentAction.Cancel(tickCounter);
|
||||
CurrentAction = null;
|
||||
}
|
||||
_powerDelay = null;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.Body.Attributes[GameAttribute.Feared])
|
||||
if (Body.Attributes[GameAttribute.Feared])
|
||||
{
|
||||
if (!this.Feared || this.CurrentAction == null)
|
||||
if (!Feared || CurrentAction == null)
|
||||
{
|
||||
if (this.CurrentAction != null)
|
||||
if (CurrentAction != null)
|
||||
{
|
||||
this.CurrentAction.Cancel(tickCounter);
|
||||
this.CurrentAction = null;
|
||||
CurrentAction.Cancel(tickCounter);
|
||||
CurrentAction = null;
|
||||
}
|
||||
this.Feared = true;
|
||||
this.CurrentAction = new MoveToPointWithPathfindAction(
|
||||
this.Body,
|
||||
PowerContext.RandomDirection(this.Body.Position, 3f, 8f)
|
||||
Feared = true;
|
||||
CurrentAction = new MoveToPointWithPathfindAction(
|
||||
Body,
|
||||
PowerContext.RandomDirection(Body.Position, 3f, 8f)
|
||||
);
|
||||
return;
|
||||
}
|
||||
else return;
|
||||
}
|
||||
else
|
||||
this.Feared = false;
|
||||
Feared = false;
|
||||
|
||||
if (this.CurrentAction == null)
|
||||
if (CurrentAction == null)
|
||||
{
|
||||
|
||||
if (_powerDelay == null)
|
||||
_powerDelay = new SecondsTickTimer(this.Body.World.Game, 1.0f);
|
||||
if (AttackedBy != null || this.Body.GetObjectsInRange<Player>(50f).Count != 0)
|
||||
_powerDelay = new SecondsTickTimer(Body.World.Game, 1.0f);
|
||||
if (AttackedBy != null || Body.GetObjectsInRange<Player>(50f).Count != 0)
|
||||
{
|
||||
if (_powerDelay.TimedOut)
|
||||
{
|
||||
_powerDelay = new SecondsTickTimer(this.Body.World.Game, 1.0f);
|
||||
_powerDelay = new SecondsTickTimer(Body.World.Game, 1.0f);
|
||||
|
||||
if (AttackedBy != null)
|
||||
this.PriorityTarget = AttackedBy;
|
||||
PriorityTarget = AttackedBy;
|
||||
|
||||
if (this.PriorityTarget == null)
|
||||
if (PriorityTarget == null)
|
||||
{
|
||||
List<Actor> targets = new List<Actor>();
|
||||
|
||||
if (this.Body.Attributes[GameAttribute.Team_Override] == 1)
|
||||
targets = this.Body.GetObjectsInRange<Monster>(60f)
|
||||
if (Body.Attributes[GameAttribute.Team_Override] == 1)
|
||||
targets = Body.GetObjectsInRange<Monster>(60f)
|
||||
.Where(p => !p.Dead)
|
||||
.OrderBy((monster) => PowerMath.Distance2D(monster.Position, this.Body.Position))
|
||||
.OrderBy((monster) => PowerMath.Distance2D(monster.Position, Body.Position))
|
||||
.Cast<Actor>()
|
||||
.ToList();
|
||||
else
|
||||
targets = this.Body.GetActorsInRange(50f)
|
||||
targets = Body.GetActorsInRange(50f)
|
||||
.Where(p => ((p is Player) && !p.Dead && p.Attributes[GameAttribute.Loading] == false && p.Attributes[GameAttribute.Is_Helper] == false && p.World.BuffManager.GetFirstBuff<ActorGhostedBuff>(p) == null)
|
||||
|| ((p is Minion) && !p.Dead && p.Attributes[GameAttribute.Is_Helper] == false)
|
||||
|| (p is DesctructibleLootContainer && p.SNO.IsDoorOrBarricade())
|
||||
|| ((p is Hireling) && !p.Dead)
|
||||
)
|
||||
.OrderBy((actor) => PowerMath.Distance2D(actor.Position, this.Body.Position))
|
||||
.OrderBy((actor) => PowerMath.Distance2D(actor.Position, Body.Position))
|
||||
.Cast<Actor>()
|
||||
.ToList();
|
||||
|
||||
@ -191,49 +191,49 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
_target = targets.First();
|
||||
}
|
||||
else
|
||||
_target = this.PriorityTarget;
|
||||
_target = PriorityTarget;
|
||||
|
||||
int powerToUse = PickPowerToUse();
|
||||
if (powerToUse > 0)
|
||||
{
|
||||
PowerScript power = PowerLoader.CreateImplementationForPowerSNO(powerToUse);
|
||||
power.User = this.Body;
|
||||
float attackRange = this.Body.ActorData.Cylinder.Ax2 + (power.EvalTag(PowerKeys.AttackRadius) > 0f ? (powerToUse == 30592 ? 10f : Math.Min((float)power.EvalTag(PowerKeys.AttackRadius), 35f)) : 35f);
|
||||
float targetDistance = PowerMath.Distance2D(_target.Position, this.Body.Position);
|
||||
power.User = Body;
|
||||
float attackRange = Body.ActorData.Cylinder.Ax2 + (power.EvalTag(PowerKeys.AttackRadius) > 0f ? (powerToUse == 30592 ? 10f : Math.Min((float)power.EvalTag(PowerKeys.AttackRadius), 35f)) : 35f);
|
||||
float targetDistance = PowerMath.Distance2D(_target.Position, Body.Position);
|
||||
if (targetDistance < attackRange + _target.ActorData.Cylinder.Ax2)
|
||||
{
|
||||
if (this.Body.WalkSpeed != 0)
|
||||
this.Body.TranslateFacing(_target.Position, false);
|
||||
if (Body.WalkSpeed != 0)
|
||||
Body.TranslateFacing(_target.Position, false);
|
||||
|
||||
this.CurrentAction = new PowerAction(this.Body, powerToUse, _target);
|
||||
CurrentAction = new PowerAction(Body, powerToUse, _target);
|
||||
|
||||
if (power is SummoningSkill)
|
||||
this.PresetPowers[powerToUse] = new Cooldown { CooldownTimer = null, CooldownTime = (this.Body is Boss ? 15f : 7f) };
|
||||
PresetPowers[powerToUse] = new Cooldown { CooldownTimer = null, CooldownTime = (Body is Boss ? 15f : 7f) };
|
||||
|
||||
if (power is MonsterAffixSkill)
|
||||
this.PresetPowers[powerToUse] = new Cooldown { CooldownTimer = null, CooldownTime = (power as MonsterAffixSkill).CooldownTime };
|
||||
PresetPowers[powerToUse] = new Cooldown { CooldownTimer = null, CooldownTime = (power as MonsterAffixSkill).CooldownTime };
|
||||
|
||||
if (this.PresetPowers[powerToUse].CooldownTime > 0f)
|
||||
this.PresetPowers[powerToUse] = new Cooldown { CooldownTimer = new SecondsTickTimer(this.Body.World.Game, this.PresetPowers[powerToUse].CooldownTime), CooldownTime = this.PresetPowers[powerToUse].CooldownTime };
|
||||
if (PresetPowers[powerToUse].CooldownTime > 0f)
|
||||
PresetPowers[powerToUse] = new Cooldown { CooldownTimer = new SecondsTickTimer(Body.World.Game, PresetPowers[powerToUse].CooldownTime), CooldownTime = PresetPowers[powerToUse].CooldownTime };
|
||||
|
||||
if (powerToUse == 96925 ||
|
||||
powerToUse == 223284)
|
||||
this.PresetPowers[powerToUse] = new Cooldown { CooldownTimer = new SecondsTickTimer(this.Body.World.Game, 10f), CooldownTime = 10f };
|
||||
PresetPowers[powerToUse] = new Cooldown { CooldownTimer = new SecondsTickTimer(Body.World.Game, 10f), CooldownTime = 10f };
|
||||
}
|
||||
else if (this.Body.WalkSpeed != 0)
|
||||
else if (Body.WalkSpeed != 0)
|
||||
{
|
||||
if (this.Body.SNO.IsWoodwraithOrWasp())
|
||||
if (Body.SNO.IsWoodwraithOrWasp())
|
||||
{
|
||||
Logger.Trace("MoveToPointAction to target");
|
||||
this.CurrentAction = new MoveToPointAction(
|
||||
this.Body, _target.Position
|
||||
CurrentAction = new MoveToPointAction(
|
||||
Body, _target.Position
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.Trace("MoveToTargetWithPathfindAction to target");
|
||||
this.CurrentAction = new MoveToTargetWithPathfindAction(
|
||||
this.Body,
|
||||
CurrentAction = new MoveToTargetWithPathfindAction(
|
||||
Body,
|
||||
_target,
|
||||
attackRange + _target.ActorData.Cylinder.Ax2,
|
||||
powerToUse
|
||||
@ -242,60 +242,60 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (this.Body.SNO)
|
||||
switch (Body.SNO)
|
||||
{
|
||||
case ActorSno._a1dun_leor_firewall2:
|
||||
powerToUse = 223284;
|
||||
break;
|
||||
}
|
||||
this.CurrentAction = new PowerAction(this.Body, powerToUse, _target);
|
||||
CurrentAction = new PowerAction(Body, powerToUse, _target);
|
||||
|
||||
if (power is SummoningSkill)
|
||||
this.PresetPowers[powerToUse] = new Cooldown { CooldownTimer = null, CooldownTime = (this.Body is Boss ? 15f : 7f) };
|
||||
PresetPowers[powerToUse] = new Cooldown { CooldownTimer = null, CooldownTime = (Body is Boss ? 15f : 7f) };
|
||||
|
||||
if (power is MonsterAffixSkill)
|
||||
this.PresetPowers[powerToUse] = new Cooldown { CooldownTimer = null, CooldownTime = (power as MonsterAffixSkill).CooldownTime };
|
||||
PresetPowers[powerToUse] = new Cooldown { CooldownTimer = null, CooldownTime = (power as MonsterAffixSkill).CooldownTime };
|
||||
|
||||
if (this.PresetPowers[powerToUse].CooldownTime > 0f)
|
||||
this.PresetPowers[powerToUse] = new Cooldown { CooldownTimer = new SecondsTickTimer(this.Body.World.Game, this.PresetPowers[powerToUse].CooldownTime), CooldownTime = this.PresetPowers[powerToUse].CooldownTime };
|
||||
if (PresetPowers[powerToUse].CooldownTime > 0f)
|
||||
PresetPowers[powerToUse] = new Cooldown { CooldownTimer = new SecondsTickTimer(Body.World.Game, PresetPowers[powerToUse].CooldownTime), CooldownTime = PresetPowers[powerToUse].CooldownTime };
|
||||
|
||||
if (powerToUse == 96925 ||
|
||||
powerToUse == 223284)
|
||||
this.PresetPowers[powerToUse] = new Cooldown { CooldownTimer = new SecondsTickTimer(this.Body.World.Game, 10f), CooldownTime = 10f };
|
||||
PresetPowers[powerToUse] = new Cooldown { CooldownTimer = new SecondsTickTimer(Body.World.Game, 10f), CooldownTime = 10f };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if (this.Body.GetObjectsInRange<Living>(50f).Count != 0)
|
||||
else if (Body.GetObjectsInRange<Living>(50f).Count != 0)
|
||||
{
|
||||
if (_powerDelay.TimedOut)
|
||||
{
|
||||
_powerDelay = new SecondsTickTimer(this.Body.World.Game, 1.0f);
|
||||
_powerDelay = new SecondsTickTimer(Body.World.Game, 1.0f);
|
||||
|
||||
if (AttackedBy != null)
|
||||
this.PriorityTarget = AttackedBy;
|
||||
PriorityTarget = AttackedBy;
|
||||
|
||||
if (this.PriorityTarget == null)
|
||||
if (PriorityTarget == null)
|
||||
{
|
||||
List<Actor> targets = new List<Actor>();
|
||||
|
||||
targets = this.Body.GetActorsInRange(50f)
|
||||
targets = Body.GetActorsInRange(50f)
|
||||
.Where(p => ((p is LorathNahr_NPC) && !p.Dead)
|
||||
|| ((p is CaptainRumford) && !p.Dead)
|
||||
|| (p is DesctructibleLootContainer && p.SNO.IsDoorOrBarricade())
|
||||
|| ((p is Cain) && !p.Dead))
|
||||
.OrderBy((actor) => PowerMath.Distance2D(actor.Position, this.Body.Position))
|
||||
.OrderBy((actor) => PowerMath.Distance2D(actor.Position, Body.Position))
|
||||
.Cast<Actor>()
|
||||
.ToList();
|
||||
|
||||
if (targets.Count == 0)
|
||||
{
|
||||
targets = this.Body.GetActorsInRange(20f)
|
||||
targets = Body.GetActorsInRange(20f)
|
||||
.Where(p => ((p is Monster) && !p.Dead)
|
||||
|| ((p is CaptainRumford) && !p.Dead)
|
||||
)
|
||||
.OrderBy((actor) => PowerMath.Distance2D(actor.Position, this.Body.Position))
|
||||
.OrderBy((actor) => PowerMath.Distance2D(actor.Position, Body.Position))
|
||||
.Cast<Actor>()
|
||||
.ToList();
|
||||
|
||||
@ -305,7 +305,7 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
|
||||
foreach (var tar in targets)
|
||||
if (_target == null)
|
||||
if (tar is Monster && tar != this.Body)
|
||||
if (tar is Monster && tar != Body)
|
||||
if (((tar as Monster).Brain as MonsterBrain).AttackedBy != null)
|
||||
_target = ((tar as Monster).Brain as MonsterBrain).AttackedBy;
|
||||
}
|
||||
@ -318,13 +318,13 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
{ _target = tar; break; }
|
||||
}
|
||||
else
|
||||
_target = this.PriorityTarget;
|
||||
_target = PriorityTarget;
|
||||
|
||||
int powerToUse = PickPowerToUse();
|
||||
if (powerToUse > 0)
|
||||
{
|
||||
PowerScript power = PowerLoader.CreateImplementationForPowerSNO(powerToUse);
|
||||
power.User = this.Body;
|
||||
power.User = Body;
|
||||
if (_target == null)
|
||||
{
|
||||
/*
|
||||
@ -339,39 +339,39 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
//*/
|
||||
return;
|
||||
}
|
||||
float attackRange = this.Body.ActorData.Cylinder.Ax2 + (power.EvalTag(PowerKeys.AttackRadius) > 0f ? (powerToUse == 30592 ? 10f : Math.Min((float)power.EvalTag(PowerKeys.AttackRadius), 35f)) : 35f);
|
||||
float targetDistance = PowerMath.Distance2D(_target.Position, this.Body.Position);
|
||||
float attackRange = Body.ActorData.Cylinder.Ax2 + (power.EvalTag(PowerKeys.AttackRadius) > 0f ? (powerToUse == 30592 ? 10f : Math.Min((float)power.EvalTag(PowerKeys.AttackRadius), 35f)) : 35f);
|
||||
float targetDistance = PowerMath.Distance2D(_target.Position, Body.Position);
|
||||
if (targetDistance < attackRange + _target.ActorData.Cylinder.Ax2)
|
||||
{
|
||||
if (this.Body.WalkSpeed != 0)
|
||||
this.Body.TranslateFacing(_target.Position, false); //columns and other non-walkable shit can't turn
|
||||
if (Body.WalkSpeed != 0)
|
||||
Body.TranslateFacing(_target.Position, false); //columns and other non-walkable shit can't turn
|
||||
|
||||
//Logger.Trace("PowerAction to target");
|
||||
this.CurrentAction = new PowerAction(this.Body, powerToUse, _target);
|
||||
CurrentAction = new PowerAction(Body, powerToUse, _target);
|
||||
|
||||
if (power is SummoningSkill)
|
||||
this.PresetPowers[powerToUse] = new Cooldown { CooldownTimer = null, CooldownTime = (this.Body is Boss ? 15f : 7f) };
|
||||
PresetPowers[powerToUse] = new Cooldown { CooldownTimer = null, CooldownTime = (Body is Boss ? 15f : 7f) };
|
||||
|
||||
if (power is MonsterAffixSkill)
|
||||
this.PresetPowers[powerToUse] = new Cooldown { CooldownTimer = null, CooldownTime = (power as MonsterAffixSkill).CooldownTime };
|
||||
PresetPowers[powerToUse] = new Cooldown { CooldownTimer = null, CooldownTime = (power as MonsterAffixSkill).CooldownTime };
|
||||
|
||||
if (this.PresetPowers[powerToUse].CooldownTime > 0f)
|
||||
this.PresetPowers[powerToUse] = new Cooldown { CooldownTimer = new SecondsTickTimer(this.Body.World.Game, this.PresetPowers[powerToUse].CooldownTime), CooldownTime = this.PresetPowers[powerToUse].CooldownTime };
|
||||
if (PresetPowers[powerToUse].CooldownTime > 0f)
|
||||
PresetPowers[powerToUse] = new Cooldown { CooldownTimer = new SecondsTickTimer(Body.World.Game, PresetPowers[powerToUse].CooldownTime), CooldownTime = PresetPowers[powerToUse].CooldownTime };
|
||||
}
|
||||
else if (this.Body.WalkSpeed != 0)
|
||||
else if (Body.WalkSpeed != 0)
|
||||
{
|
||||
if (this.Body.SNO.IsWoodwraithOrWasp())
|
||||
if (Body.SNO.IsWoodwraithOrWasp())
|
||||
{
|
||||
Logger.Trace("MoveToPointAction to target");
|
||||
this.CurrentAction = new MoveToPointAction(
|
||||
this.Body, _target.Position
|
||||
CurrentAction = new MoveToPointAction(
|
||||
Body, _target.Position
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.Trace("MoveToTargetWithPathfindAction to target");
|
||||
this.CurrentAction = new MoveToTargetWithPathfindAction(
|
||||
this.Body,
|
||||
CurrentAction = new MoveToTargetWithPathfindAction(
|
||||
Body,
|
||||
//(
|
||||
_target,// + MovementHelpers.GetMovementPosition(
|
||||
//new Vector3D(0, 0, 0),
|
||||
@ -392,8 +392,8 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
else
|
||||
{
|
||||
//Logger.Trace("No enemies in range, return to master");
|
||||
if (this.Body.Position != this.Body.CheckPointPosition)
|
||||
this.CurrentAction = new MoveToPointWithPathfindAction(this.Body, this.Body.CheckPointPosition);
|
||||
if (Body.Position != Body.CheckPointPosition)
|
||||
CurrentAction = new MoveToPointWithPathfindAction(Body, Body.CheckPointPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -419,36 +419,36 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
public void FastAttack(Actor target, int skillSNO)
|
||||
{
|
||||
PowerScript power = PowerLoader.CreateImplementationForPowerSNO(skillSNO);
|
||||
power.User = this.Body;
|
||||
if (this.Body.WalkSpeed != 0)
|
||||
this.Body.TranslateFacing(target.Position, false); //columns and other non-walkable shit can't turn
|
||||
power.User = Body;
|
||||
if (Body.WalkSpeed != 0)
|
||||
Body.TranslateFacing(target.Position, false); //columns and other non-walkable shit can't turn
|
||||
|
||||
//Logger.Trace("Fast PowerAction to target");
|
||||
this.CurrentAction = new PowerAction(this.Body, skillSNO, target);
|
||||
CurrentAction = new PowerAction(Body, skillSNO, target);
|
||||
|
||||
if (power is SummoningSkill)
|
||||
this.PresetPowers[skillSNO] = new Cooldown { CooldownTimer = null, CooldownTime = (this.Body is Boss ? 15f : 7f) };
|
||||
PresetPowers[skillSNO] = new Cooldown { CooldownTimer = null, CooldownTime = (Body is Boss ? 15f : 7f) };
|
||||
|
||||
if (power is MonsterAffixSkill)
|
||||
this.PresetPowers[skillSNO] = new Cooldown { CooldownTimer = null, CooldownTime = (power as MonsterAffixSkill).CooldownTime };
|
||||
PresetPowers[skillSNO] = new Cooldown { CooldownTimer = null, CooldownTime = (power as MonsterAffixSkill).CooldownTime };
|
||||
|
||||
if (this.PresetPowers[skillSNO].CooldownTime > 0f)
|
||||
this.PresetPowers[skillSNO] = new Cooldown { CooldownTimer = new SecondsTickTimer(this.Body.World.Game, this.PresetPowers[skillSNO].CooldownTime), CooldownTime = this.PresetPowers[skillSNO].CooldownTime };
|
||||
if (PresetPowers[skillSNO].CooldownTime > 0f)
|
||||
PresetPowers[skillSNO] = new Cooldown { CooldownTimer = new SecondsTickTimer(Body.World.Game, PresetPowers[skillSNO].CooldownTime), CooldownTime = PresetPowers[skillSNO].CooldownTime };
|
||||
}
|
||||
|
||||
protected virtual int PickPowerToUse()
|
||||
{
|
||||
if (!_warnedNoPowers && this.PresetPowers.Count == 0)
|
||||
if (!_warnedNoPowers && PresetPowers.Count == 0)
|
||||
{
|
||||
Logger.Info("Monster \"{0}\" has no usable powers. {1} are defined in mpq data.", this.Body.Name, _mpqPowerCount);
|
||||
Logger.Info("Monster \"{0}\" has no usable powers. {1} are defined in mpq data.", Body.Name, _mpqPowerCount);
|
||||
_warnedNoPowers = true;
|
||||
}
|
||||
|
||||
// randomly used an implemented power
|
||||
if (this.PresetPowers.Count > 0)
|
||||
if (PresetPowers.Count > 0)
|
||||
{
|
||||
//int power = this.PresetPowers[RandomHelper.Next(this.PresetPowers.Count)].Key;
|
||||
List<int> availablePowers = Enumerable.ToList(this.PresetPowers.Where(p => (p.Value.CooldownTimer == null || p.Value.CooldownTimer.TimedOut) && PowerSystem.PowerLoader.HasImplementationForPowerSNO(p.Key)).Select(p => p.Key));
|
||||
List<int> availablePowers = Enumerable.ToList(PresetPowers.Where(p => (p.Value.CooldownTimer == null || p.Value.CooldownTimer.TimedOut) && PowerLoader.HasImplementationForPowerSNO(p.Key)).Select(p => p.Key));
|
||||
if (availablePowers.Where(p => p != 30592).Count() > 0)
|
||||
{
|
||||
int SelectedPower = availablePowers.Where(p => p != 30592).ToList()[RandomHelper.Next(availablePowers.Where(p => p != 30592).ToList().Count())];
|
||||
@ -467,23 +467,23 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
|
||||
public void AddPresetPower(int powerSNO)
|
||||
{
|
||||
if (this.PresetPowers.ContainsKey(powerSNO))
|
||||
if (PresetPowers.ContainsKey(powerSNO))
|
||||
{
|
||||
// Logger.Debug("AddPresetPower(): power sno {0} already defined for monster \"{1}\"",
|
||||
//powerSNO, this.Body.ActorSNO.Name);
|
||||
return;
|
||||
}
|
||||
if (this.PresetPowers.ContainsKey(30592)) //if can cast melee
|
||||
this.PresetPowers.Add(powerSNO, new Cooldown { CooldownTimer = null, CooldownTime = 5f });
|
||||
if (PresetPowers.ContainsKey(30592)) //if can cast melee
|
||||
PresetPowers.Add(powerSNO, new Cooldown { CooldownTimer = null, CooldownTime = 5f });
|
||||
else
|
||||
this.PresetPowers.Add(powerSNO, new Cooldown { CooldownTimer = null, CooldownTime = 1f + (float)DiIiS_NA.Core.Helpers.Math.FastRandom.Instance.NextDouble() });
|
||||
PresetPowers.Add(powerSNO, new Cooldown { CooldownTimer = null, CooldownTime = 1f + (float)FastRandom.Instance.NextDouble() });
|
||||
}
|
||||
|
||||
public void RemovePresetPower(int powerSNO)
|
||||
{
|
||||
if (this.PresetPowers.ContainsKey(powerSNO))
|
||||
if (PresetPowers.ContainsKey(powerSNO))
|
||||
{
|
||||
this.PresetPowers.Remove(powerSNO);
|
||||
PresetPowers.Remove(powerSNO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
public StayAggressiveNPCBrain(Actor body)
|
||||
: base(body)
|
||||
{
|
||||
this.PresetPowers = new List<int>();
|
||||
PresetPowers = new List<int>();
|
||||
|
||||
|
||||
if (body.ActorData.MonsterSNO > 0)
|
||||
@ -53,7 +53,7 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
{
|
||||
if (monsterSkill.SNOPower > 0)
|
||||
{
|
||||
this.PresetPowers.Add(monsterSkill.SNOPower);
|
||||
PresetPowers.Add(monsterSkill.SNOPower);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -65,17 +65,17 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
//if (this.Body is NPC) return;
|
||||
|
||||
// check if in disabled state, if so cancel any action then do nothing
|
||||
if (this.Body.Attributes[GameAttribute.Frozen] ||
|
||||
this.Body.Attributes[GameAttribute.Stunned] ||
|
||||
this.Body.Attributes[GameAttribute.Blind] ||
|
||||
this.Body.Attributes[GameAttribute.Webbed] ||
|
||||
this.Body.Disable ||
|
||||
this.Body.World.BuffManager.GetFirstBuff<PowerSystem.Implementations.KnockbackBuff>(this.Body) != null)
|
||||
if (Body.Attributes[GameAttribute.Frozen] ||
|
||||
Body.Attributes[GameAttribute.Stunned] ||
|
||||
Body.Attributes[GameAttribute.Blind] ||
|
||||
Body.Attributes[GameAttribute.Webbed] ||
|
||||
Body.Disable ||
|
||||
Body.World.BuffManager.GetFirstBuff<KnockbackBuff>(Body) != null)
|
||||
{
|
||||
if (this.CurrentAction != null)
|
||||
if (CurrentAction != null)
|
||||
{
|
||||
this.CurrentAction.Cancel(tickCounter);
|
||||
this.CurrentAction = null;
|
||||
CurrentAction.Cancel(tickCounter);
|
||||
CurrentAction = null;
|
||||
}
|
||||
_powerDelay = null;
|
||||
|
||||
@ -83,15 +83,15 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
}
|
||||
|
||||
// select and start executing a power if no active action
|
||||
if (this.CurrentAction == null)
|
||||
if (CurrentAction == null)
|
||||
{
|
||||
// do a little delay so groups of monsters don't all execute at once
|
||||
if (_powerDelay == null)
|
||||
_powerDelay = new SecondsTickTimer(this.Body.World.Game, 1f);
|
||||
_powerDelay = new SecondsTickTimer(Body.World.Game, 1f);
|
||||
|
||||
if (_powerDelay.TimedOut)
|
||||
{
|
||||
var monsters = this.Body.GetObjectsInRange<Monster>(40f).Where(m => m.Visible & !m.Dead).ToList();
|
||||
var monsters = Body.GetObjectsInRange<Monster>(40f).Where(m => m.Visible & !m.Dead).ToList();
|
||||
if (monsters.Count != 0)
|
||||
{
|
||||
_target = monsters[0];
|
||||
@ -100,18 +100,18 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
int powerToUse = PickPowerToUse();
|
||||
if (powerToUse > 0)
|
||||
{
|
||||
PowerSystem.PowerScript power = PowerSystem.PowerLoader.CreateImplementationForPowerSNO(powerToUse);
|
||||
power.User = this.Body;
|
||||
float attackRange = this.Body.ActorData.Cylinder.Ax2 + (power.EvalTag(PowerKeys.AttackRadius) > 0f ? (powerToUse == 30592 ? 10f : power.EvalTag(PowerKeys.AttackRadius)) : 35f);
|
||||
float targetDistance = PowerSystem.PowerMath.Distance2D(_target.Position, this.Body.Position);
|
||||
PowerScript power = PowerLoader.CreateImplementationForPowerSNO(powerToUse);
|
||||
power.User = Body;
|
||||
float attackRange = Body.ActorData.Cylinder.Ax2 + (power.EvalTag(PowerKeys.AttackRadius) > 0f ? (powerToUse == 30592 ? 10f : power.EvalTag(PowerKeys.AttackRadius)) : 35f);
|
||||
float targetDistance = PowerMath.Distance2D(_target.Position, Body.Position);
|
||||
if (targetDistance < attackRange + _target.ActorData.Cylinder.Ax2)
|
||||
{
|
||||
if (_powerDelay.TimedOut)
|
||||
{
|
||||
_powerDelay = null;
|
||||
this.Body.TranslateFacing(_target.Position, false);
|
||||
Body.TranslateFacing(_target.Position, false);
|
||||
|
||||
this.CurrentAction = new PowerAction(this.Body, powerToUse, _target);
|
||||
CurrentAction = new PowerAction(Body, powerToUse, _target);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -122,7 +122,7 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
}
|
||||
else
|
||||
{
|
||||
this.CurrentAction = new MoveToPointAction(this.Body, this.Body.CheckPointPosition);
|
||||
CurrentAction = new MoveToPointAction(Body, Body.CheckPointPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -131,11 +131,11 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
protected virtual int PickPowerToUse()
|
||||
{
|
||||
// randomly used an implemented power
|
||||
if (this.PresetPowers.Count > 0)
|
||||
if (PresetPowers.Count > 0)
|
||||
{
|
||||
int powerIndex = RandomHelper.Next(this.PresetPowers.Count);
|
||||
if (PowerSystem.PowerLoader.HasImplementationForPowerSNO(this.PresetPowers[powerIndex]))
|
||||
return this.PresetPowers[powerIndex];
|
||||
int powerIndex = RandomHelper.Next(PresetPowers.Count);
|
||||
if (PowerLoader.HasImplementationForPowerSNO(PresetPowers[powerIndex]))
|
||||
return PresetPowers[powerIndex];
|
||||
}
|
||||
|
||||
// no usable power
|
||||
@ -144,7 +144,7 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
|
||||
|
||||
public void AddPresetPower(int powerSNO)
|
||||
{
|
||||
this.PresetPowers.Add(powerSNO);
|
||||
PresetPowers.Add(powerSNO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,9 +24,9 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Actions
|
||||
|
||||
protected ActorAction(Actor owner)
|
||||
{
|
||||
this.Owner = owner;
|
||||
this.Started = false;
|
||||
this.Done = false;
|
||||
Owner = owner;
|
||||
Started = false;
|
||||
Done = false;
|
||||
}
|
||||
|
||||
public abstract void Start(int tickCounter);
|
||||
|
||||
@ -32,15 +32,15 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Actions
|
||||
_power.World = owner.World;
|
||||
_power.User = owner;
|
||||
_powerRan = false;
|
||||
_baseAttackRadius = this.Owner.ActorData.Cylinder.Ax2 + (_power.EvalTag(PowerKeys.AttackRadius) > 0f ? (powerSNO == 30592 ? 10f : _power.EvalTag(PowerKeys.AttackRadius)) : 35f);
|
||||
_baseAttackRadius = Owner.ActorData.Cylinder.Ax2 + (_power.EvalTag(PowerKeys.AttackRadius) > 0f ? (powerSNO == 30592 ? 10f : _power.EvalTag(PowerKeys.AttackRadius)) : 35f);
|
||||
_ownerMover = new ActorMover(owner);
|
||||
_target = target;
|
||||
}
|
||||
|
||||
public override void Start(int tickCounter)
|
||||
{
|
||||
this.Started = true;
|
||||
this.Update(tickCounter);
|
||||
Started = true;
|
||||
Update(tickCounter);
|
||||
}
|
||||
|
||||
public override void Update(int tickCounter)
|
||||
@ -49,7 +49,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Actions
|
||||
if (_powerRan)
|
||||
{
|
||||
if (_powerFinishTimer.TimedOut)
|
||||
this.Done = true;
|
||||
Done = true;
|
||||
|
||||
return;
|
||||
}
|
||||
@ -57,31 +57,31 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Actions
|
||||
// try to get nearest target if no target yet acquired
|
||||
if (_target == null)
|
||||
{
|
||||
if (this.Owner is Minion || this.Owner is Hireling) // assume minions are player controlled and are targeting monsters
|
||||
if (Owner is Minion || Owner is Hireling) // assume minions are player controlled and are targeting monsters
|
||||
{
|
||||
if ((this.Owner.World.Game.PvP || this.Owner.World.IsPvP) && (this.Owner as Minion).Master != null)
|
||||
_target = this.Owner.GetPlayersInRange(MaxTargetRange)
|
||||
if ((Owner.World.Game.PvP || Owner.World.IsPvP) && (Owner as Minion).Master != null)
|
||||
_target = Owner.GetPlayersInRange(MaxTargetRange)
|
||||
.Where(
|
||||
p => p.GlobalID != (this.Owner as Minion).Master.GlobalID)
|
||||
p => p.GlobalID != (Owner as Minion).Master.GlobalID)
|
||||
.OrderBy(
|
||||
(player) => PowerMath.Distance2D(player.Position, this.Owner.Position))
|
||||
(player) => PowerMath.Distance2D(player.Position, Owner.Position))
|
||||
.FirstOrDefault();
|
||||
else
|
||||
_target = this.Owner.GetMonstersInRange(MaxTargetRange).OrderBy(
|
||||
(monster) => PowerMath.Distance2D(monster.Position, this.Owner.Position))
|
||||
_target = Owner.GetMonstersInRange(MaxTargetRange).OrderBy(
|
||||
(monster) => PowerMath.Distance2D(monster.Position, Owner.Position))
|
||||
.FirstOrDefault();
|
||||
}
|
||||
else // monsters targeting players
|
||||
{
|
||||
_target = this.Owner.GetPlayersInRange(MaxTargetRange).OrderBy(
|
||||
(player) => PowerMath.Distance2D(player.Position, this.Owner.Position))
|
||||
_target = Owner.GetPlayersInRange(MaxTargetRange).OrderBy(
|
||||
(player) => PowerMath.Distance2D(player.Position, Owner.Position))
|
||||
.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
if (_target != null)
|
||||
{
|
||||
float targetDistance = PowerMath.Distance2D(_target.Position, this.Owner.Position);
|
||||
float targetDistance = PowerMath.Distance2D(_target.Position, Owner.Position);
|
||||
|
||||
// if target has moved out of range, deselect it as the target
|
||||
if (targetDistance > MaxTargetRange)
|
||||
@ -91,8 +91,8 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Actions
|
||||
else if (targetDistance < _baseAttackRadius + _target.ActorData.Cylinder.Ax2) // run power if within range
|
||||
{
|
||||
// stop any movement
|
||||
_ownerMover.Move(this.Owner.Position, this.Owner.WalkSpeed);
|
||||
if (this.Owner is Monster)
|
||||
_ownerMover.Move(Owner.Position, Owner.WalkSpeed);
|
||||
if (Owner is Monster)
|
||||
{
|
||||
/*(this.Owner as Monster).CorrectedPosition = new Core.Types.Math.Vector3D(this.Owner.Position.X, this.Owner.Position.Y, _target.Position.Z);
|
||||
//if()
|
||||
@ -116,14 +116,14 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Actions
|
||||
//this.Target.World.BroadcastIfRevealed(plr => new MessageSystem.Message.Definitions.ACD.ACDTranslateSyncMessage() { ActorId = this.Target.DynamicID(plr), Position = this.Target.Position, Snap = false }, this.Target);
|
||||
|
||||
//*/
|
||||
this.Owner.World.PowerManager.RunPower(this.Owner, _power, _target, _target.Position);
|
||||
_powerFinishTimer = new SecondsTickTimer(this.Owner.World.Game,
|
||||
Owner.World.PowerManager.RunPower(Owner, _power, _target, _target.Position);
|
||||
_powerFinishTimer = new SecondsTickTimer(Owner.World.Game,
|
||||
_power.EvalTag(PowerKeys.AttackSpeed));// + _power.EvalTag(PowerKeys.CooldownTime));
|
||||
_powerRan = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Done = true;
|
||||
Done = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -132,9 +132,9 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Actions
|
||||
{
|
||||
// TODO: make this per-power instead?
|
||||
if (_powerRan)
|
||||
this.Owner.World.PowerManager.CancelAllPowers(this.Owner);
|
||||
Owner.World.PowerManager.CancelAllPowers(Owner);
|
||||
|
||||
this.Done = true;
|
||||
Done = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -58,11 +58,11 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem
|
||||
public BossPortal(World world, ActorSno sno, TagMap tags)
|
||||
: base(world, sno, tags)
|
||||
{
|
||||
this.Field2 = 0x9;//16;
|
||||
Field2 = 0x9;//16;
|
||||
|
||||
this.Attributes[GameAttribute.MinimapActive] = true;
|
||||
this.Attributes[GameAttribute.Untargetable] = false;
|
||||
var bossEncounter = ((this.ActorSNO.Target as DiIiS_NA.Core.MPQ.FileFormats.Actor).TagMap[MarkerKeys.BossEncounter].Target as DiIiS_NA.Core.MPQ.FileFormats.BossEncounter);
|
||||
Attributes[GameAttribute.MinimapActive] = true;
|
||||
Attributes[GameAttribute.Untargetable] = false;
|
||||
var bossEncounter = ((ActorSNO.Target as DiIiS_NA.Core.MPQ.FileFormats.Actor).TagMap[MarkerKeys.BossEncounter].Target as DiIiS_NA.Core.MPQ.FileFormats.BossEncounter);
|
||||
DestWorld = bossEncounter.Worlds[0];
|
||||
switch (DestWorld)
|
||||
{
|
||||
@ -73,7 +73,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem
|
||||
case 109143:
|
||||
DestArea = 109149; break;
|
||||
case 182976:
|
||||
DestArea = 62726; this.Scale = 0.75f; break;
|
||||
DestArea = 62726; Scale = 0.75f; break;
|
||||
case 159580:
|
||||
DestArea = 58494; break;
|
||||
case 58493:
|
||||
@ -113,83 +113,83 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem
|
||||
}
|
||||
DestPoint = bossEncounter.I11;
|
||||
//get EncounterSNO
|
||||
switch (this.SNO)
|
||||
switch (SNO)
|
||||
{
|
||||
case ActorSno._boss_portal_cainintro: //CainIntro
|
||||
this.Encounter = 168925;
|
||||
Encounter = 168925;
|
||||
break;
|
||||
case ActorSno._boss_portal_skeletonking: //Leoric
|
||||
this.Encounter = 159592;
|
||||
Encounter = 159592;
|
||||
break;
|
||||
case ActorSno._boss_portal_spiderqueen: //SpiderQueen
|
||||
this.Encounter = 181436;
|
||||
Encounter = 181436;
|
||||
break;
|
||||
case ActorSno._boss_portal_butcher: //Butcher
|
||||
this.Encounter = 158915;
|
||||
Encounter = 158915;
|
||||
break;
|
||||
case ActorSno._boss_portal_maghda: //Maghda
|
||||
this.Encounter = 195226;
|
||||
Encounter = 195226;
|
||||
break;
|
||||
case ActorSno._boss_portal_binkleshulkout: //Cain Death
|
||||
this.Encounter = 159591;
|
||||
Encounter = 159591;
|
||||
break;
|
||||
//case 159578: //Belial Audience
|
||||
//this.Encounter = 162231;
|
||||
//break;
|
||||
case ActorSno._boss_portal_adriasewer: //Adria Rescue
|
||||
this.Encounter = 159584;
|
||||
Encounter = 159584;
|
||||
break;
|
||||
case ActorSno._boss_portal_blacksoulstone: //Zoltun Kulle
|
||||
this.Encounter = 159586;
|
||||
Encounter = 159586;
|
||||
break;
|
||||
case ActorSno._boss_portal_belial: //Belial
|
||||
this.Encounter = 159585;
|
||||
Encounter = 159585;
|
||||
break;
|
||||
case ActorSno._boss_portal_siegebreaker: //SiegeBreaker
|
||||
this.Encounter = 226716;
|
||||
Encounter = 226716;
|
||||
break;
|
||||
case ActorSno._boss_portal_mistressofpain: //Cydaea
|
||||
this.Encounter = 161246;
|
||||
Encounter = 161246;
|
||||
break;
|
||||
case ActorSno._boss_portal_azmodan: //Azmodan
|
||||
this.Encounter = 159582;
|
||||
Encounter = 159582;
|
||||
break;
|
||||
case ActorSno._boss_portal_adriabetrayal: //Adria_Betrayal
|
||||
this.Encounter = 159583;
|
||||
Encounter = 159583;
|
||||
break;
|
||||
case ActorSno._boss_portal_1000monsterfight: //Iskatu
|
||||
this.Encounter = 182960;
|
||||
Encounter = 182960;
|
||||
break;
|
||||
case ActorSno._boss_portal_despair: //Rakanoth
|
||||
this.Encounter = 161247;
|
||||
Encounter = 161247;
|
||||
break;
|
||||
case ActorSno._bossportal_imperius_spirebase: //Imperius_Spire
|
||||
this.Encounter = 220541;
|
||||
Encounter = 220541;
|
||||
break;
|
||||
case ActorSno._boss_portal_diablo: //Diablo
|
||||
this.Encounter = 161280;
|
||||
Encounter = 161280;
|
||||
break;
|
||||
case ActorSno._x1_urzael_bossportal: //Urzael
|
||||
this.Encounter = 298128;
|
||||
Encounter = 298128;
|
||||
break;
|
||||
case ActorSno._x1_boss_portal_adria: //Adria
|
||||
this.Encounter = 293007;
|
||||
Encounter = 293007;
|
||||
break;
|
||||
case ActorSno._x1_boss_portal_batteringram: //BatteringRam
|
||||
this.Encounter = 296315;
|
||||
Encounter = 296315;
|
||||
break;
|
||||
case ActorSno._x1_fortress_malthael_boss_portal: //Malthael
|
||||
this.Encounter = 278965;
|
||||
Encounter = 278965;
|
||||
break;
|
||||
case ActorSno._boss_portal_greed:
|
||||
this.Encounter = 380760;
|
||||
Encounter = 380760;
|
||||
break;
|
||||
default:
|
||||
this.Encounter = 0;
|
||||
Encounter = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
this.Destination = new ResolvedPortalDestination
|
||||
Destination = new ResolvedPortalDestination
|
||||
{
|
||||
WorldSNO = DestWorld,
|
||||
DestLevelAreaSNO = DestArea,
|
||||
@ -215,7 +215,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem
|
||||
}
|
||||
public override bool Reveal(Player player)
|
||||
{
|
||||
if (eventPortals.Contains(this.SNO)) return false;
|
||||
if (eventPortals.Contains(SNO)) return false;
|
||||
if (!base.Reveal(player))
|
||||
return false;
|
||||
/*
|
||||
@ -232,8 +232,8 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem
|
||||
//*/
|
||||
player.InGameClient.SendMessage(new PortalSpecifierMessage()
|
||||
{
|
||||
ActorID = this.DynamicID(player),
|
||||
Destination = this.Destination
|
||||
ActorID = DynamicID(player),
|
||||
Destination = Destination
|
||||
});
|
||||
return true;
|
||||
}
|
||||
@ -245,18 +245,18 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem
|
||||
|
||||
public override void OnTargeted(Player player, TargetMessage message)
|
||||
{
|
||||
Logger.Trace("(OnTargeted) BossPortal has been activated, Id: {0}", this.SNO);
|
||||
if (this.Encounter == 0) return;
|
||||
Logger.Trace("(OnTargeted) BossPortal has been activated, Id: {0}", SNO);
|
||||
if (Encounter == 0) return;
|
||||
//if (this.World.Game.CurrentEncounter.activated) return;
|
||||
|
||||
this.World.Game.CurrentEncounter.activated = true;
|
||||
this.World.Game.CurrentEncounter.SnoId = this.Encounter;
|
||||
World.Game.CurrentEncounter.activated = true;
|
||||
World.Game.CurrentEncounter.SnoId = Encounter;
|
||||
|
||||
foreach (Player plr in this.World.Game.Players.Values)
|
||||
foreach (Player plr in World.Game.Players.Values)
|
||||
plr.InGameClient.SendMessage(new BossEncounterMessage(Opcodes.BossJoinEncounterMessage)
|
||||
{
|
||||
PlayerIndex = plr.PlayerIndex,
|
||||
snoEncounter = this.Encounter
|
||||
snoEncounter = Encounter
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,9 +13,9 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem
|
||||
public Environment(World world, ActorSno sno, TagMap tags)
|
||||
: base(world, sno, tags)
|
||||
{
|
||||
this.Field2 = 0x10;//16;
|
||||
this.Field7 = 0x00000000;
|
||||
this.CollFlags = 1;
|
||||
Field2 = 0x10;//16;
|
||||
Field7 = 0x00000000;
|
||||
CollFlags = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,11 +24,11 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem
|
||||
public Gizmo(World world, ActorSno sno, TagMap tags, bool is_marker = false)
|
||||
: base(world, sno, tags, is_marker)
|
||||
{
|
||||
this.Field2 = 0x9;//16;
|
||||
this.Field7 = 0x00000001;
|
||||
Field2 = 0x9;//16;
|
||||
Field7 = 0x00000001;
|
||||
//this.CollFlags = 1; // this.CollFlags = 0; a hack for passing through blockers /fasbat
|
||||
if (this.Attributes[GameAttribute.TeamID] == 10) this.Attributes[GameAttribute.TeamID] = 1; //fix for bugged gizmos
|
||||
this.Attributes[GameAttribute.Hitpoints_Cur] = 1;
|
||||
if (Attributes[GameAttribute.TeamID] == 10) Attributes[GameAttribute.TeamID] = 1; //fix for bugged gizmos
|
||||
Attributes[GameAttribute.Hitpoints_Cur] = 1;
|
||||
//this.Attributes[GameAttribute.MinimapActive] = true;
|
||||
}
|
||||
|
||||
@ -41,20 +41,20 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem
|
||||
|
||||
public override void OnTargeted(Player player, TargetMessage message)
|
||||
{
|
||||
if (this.Attributes[GameAttribute.Disabled] == true) return;
|
||||
Logger.Trace("(OnTargeted) Gizmo has been activated! Id: {0}, Type: {1}", this.SNO, this.ActorData.TagMap[ActorKeys.GizmoGroup]);
|
||||
if (Attributes[GameAttribute.Disabled] == true) return;
|
||||
Logger.Trace("(OnTargeted) Gizmo has been activated! Id: {0}, Type: {1}", SNO, ActorData.TagMap[ActorKeys.GizmoGroup]);
|
||||
|
||||
//handling quest triggers
|
||||
if (this.World.Game.QuestProgress.QuestTriggers.ContainsKey((int)this.SNO))
|
||||
if (World.Game.QuestProgress.QuestTriggers.ContainsKey((int)SNO))
|
||||
{
|
||||
var trigger = this.World.Game.QuestProgress.QuestTriggers[(int)this.SNO];
|
||||
var trigger = World.Game.QuestProgress.QuestTriggers[(int)SNO];
|
||||
if (trigger.triggerType == DiIiS_NA.Core.MPQ.FileFormats.QuestStepObjectiveType.InteractWithActor)
|
||||
{
|
||||
this.World.Game.QuestProgress.UpdateCounter((int)this.SNO);
|
||||
if (trigger.count == this.World.Game.QuestProgress.QuestTriggers[(int)this.SNO].counter)
|
||||
World.Game.QuestProgress.UpdateCounter((int)SNO);
|
||||
if (trigger.count == World.Game.QuestProgress.QuestTriggers[(int)SNO].counter)
|
||||
try
|
||||
{
|
||||
trigger.questEvent.Execute(this.World); // launch a questEvent
|
||||
trigger.questEvent.Execute(World); // launch a questEvent
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@ -62,27 +62,27 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (this.World.Game.SideQuestProgress.QuestTriggers.ContainsKey((int)this.SNO))
|
||||
else if (World.Game.SideQuestProgress.QuestTriggers.ContainsKey((int)SNO))
|
||||
{
|
||||
var trigger = this.World.Game.SideQuestProgress.QuestTriggers[(int)this.SNO];
|
||||
var trigger = World.Game.SideQuestProgress.QuestTriggers[(int)SNO];
|
||||
if (trigger.triggerType == DiIiS_NA.Core.MPQ.FileFormats.QuestStepObjectiveType.InteractWithActor)
|
||||
{
|
||||
this.World.Game.SideQuestProgress.UpdateSideCounter((int)this.SNO);
|
||||
if (trigger.count == this.World.Game.SideQuestProgress.QuestTriggers[(int)this.SNO].counter)
|
||||
trigger.questEvent.Execute(this.World); // launch a questEvent
|
||||
World.Game.SideQuestProgress.UpdateSideCounter((int)SNO);
|
||||
if (trigger.count == World.Game.SideQuestProgress.QuestTriggers[(int)SNO].counter)
|
||||
trigger.questEvent.Execute(World); // launch a questEvent
|
||||
}
|
||||
}
|
||||
if (this.World.Game.SideQuestProgress.GlobalQuestTriggers.ContainsKey((int)this.SNO))
|
||||
if (World.Game.SideQuestProgress.GlobalQuestTriggers.ContainsKey((int)SNO))
|
||||
{
|
||||
var trigger = this.World.Game.SideQuestProgress.GlobalQuestTriggers[(int)this.SNO];
|
||||
var trigger = World.Game.SideQuestProgress.GlobalQuestTriggers[(int)SNO];
|
||||
if (trigger.triggerType == DiIiS_NA.Core.MPQ.FileFormats.QuestStepObjectiveType.InteractWithActor)
|
||||
{
|
||||
this.World.Game.SideQuestProgress.UpdateGlobalCounter((int)this.SNO);
|
||||
if (trigger.count == this.World.Game.SideQuestProgress.GlobalQuestTriggers[(int)this.SNO].counter)
|
||||
World.Game.SideQuestProgress.UpdateGlobalCounter((int)SNO);
|
||||
if (trigger.count == World.Game.SideQuestProgress.GlobalQuestTriggers[(int)SNO].counter)
|
||||
try
|
||||
{
|
||||
trigger.questEvent.Execute(this.World); // launch a questEvent
|
||||
this.World.Game.SideQuestProgress.GlobalQuestTriggers.Remove((int)this.SNO);
|
||||
trigger.questEvent.Execute(World); // launch a questEvent
|
||||
World.Game.SideQuestProgress.GlobalQuestTriggers.Remove((int)SNO);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@ -13,8 +13,8 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem
|
||||
|
||||
public HandledSNOAttribute(params ActorSno[] snoIds)
|
||||
{
|
||||
this.SNOIds = new List<ActorSno>();
|
||||
this.SNOIds.AddRange(snoIds);
|
||||
SNOIds = new List<ActorSno>();
|
||||
SNOIds.AddRange(snoIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,14 +29,14 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Artisans
|
||||
public Artisan(World world, ActorSno sno, TagMap tags)
|
||||
: base(world, sno, tags)
|
||||
{
|
||||
this.Attributes[GameAttribute.MinimapActive] = true;
|
||||
Attributes[GameAttribute.MinimapActive] = true;
|
||||
Interactions.Add(new CraftInteraction());
|
||||
//Interactions.Add(new IdentifyAllInteraction());
|
||||
}
|
||||
|
||||
public override void OnCraft(Player player)
|
||||
{
|
||||
player.InGameClient.SendMessage(new ANNDataMessage(Opcodes.OpenArtisanWindowMessage) { ActorID = this.DynamicID(player) });
|
||||
player.InGameClient.SendMessage(new ANNDataMessage(Opcodes.OpenArtisanWindowMessage) { ActorID = DynamicID(player) });
|
||||
//player.InGameClient.SendMessage(new OpenArtisanWindowMessage() { ArtisanID = this.DynamicID(player) });
|
||||
}
|
||||
|
||||
|
||||
@ -53,8 +53,8 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Artisans
|
||||
|
||||
public override void OnTargeted(Player player, TargetMessage message)
|
||||
{
|
||||
player.InGameClient.SendMessage(new MessageSystem.Message.Definitions.Misc.ANNDataMessage(Opcodes.OpenArtisanWindowMessage) { ActorID = this.DynamicID(player) });
|
||||
switch (this.SNO)
|
||||
player.InGameClient.SendMessage(new MessageSystem.Message.Definitions.Misc.ANNDataMessage(Opcodes.OpenArtisanWindowMessage) { ActorID = DynamicID(player) });
|
||||
switch (SNO)
|
||||
{
|
||||
case ActorSno._pt_blacksmith_repairshortcut:
|
||||
case ActorSno._pt_blacksmith_forgeweaponshortcut:
|
||||
@ -74,9 +74,9 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Artisans
|
||||
}
|
||||
public override bool Reveal(Player player)
|
||||
{
|
||||
if (this.World.Game.CurrentAct != 3000)
|
||||
if (World.Game.CurrentAct != 3000)
|
||||
{
|
||||
switch (this.SNO)
|
||||
switch (SNO)
|
||||
{
|
||||
case ActorSno._pt_blacksmith_repairshortcut:
|
||||
case ActorSno._pt_blacksmith_forgeweaponshortcut:
|
||||
|
||||
@ -35,7 +35,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Artisans
|
||||
|
||||
public override void OnCraft(Player player)
|
||||
{
|
||||
player.InGameClient.SendMessage(new ANNDataMessage(Opcodes.OpenArtisanWindowMessage) { ActorID = this.DynamicID(player) });
|
||||
player.InGameClient.SendMessage(new ANNDataMessage(Opcodes.OpenArtisanWindowMessage) { ActorID = DynamicID(player) });
|
||||
player.ArtisanInteraction = "Blacksmith";
|
||||
}
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Artisans
|
||||
{
|
||||
}
|
||||
|
||||
public void OnAddSocket(PlayerSystem.Player player, Item item)
|
||||
public void OnAddSocket(Player player, Item item)
|
||||
{
|
||||
// TODO: Animate Jeweler? Who knows. /fasbat
|
||||
item.Attributes[GameAttribute.Sockets] += 1;
|
||||
@ -32,7 +32,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Artisans
|
||||
|
||||
public override void OnCraft(Player player)
|
||||
{
|
||||
player.InGameClient.SendMessage(new ANNDataMessage(Opcodes.OpenArtisanWindowMessage) { ActorID = this.DynamicID(player) });
|
||||
player.InGameClient.SendMessage(new ANNDataMessage(Opcodes.OpenArtisanWindowMessage) { ActorID = DynamicID(player) });
|
||||
player.ArtisanInteraction = "Jeweler";
|
||||
}
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Artisans
|
||||
|
||||
public override void OnCraft(Player player)
|
||||
{
|
||||
player.InGameClient.SendMessage(new ANNDataMessage(Opcodes.OpenArtisanWindowMessage) { ActorID = this.DynamicID(player) });
|
||||
player.InGameClient.SendMessage(new ANNDataMessage(Opcodes.OpenArtisanWindowMessage) { ActorID = DynamicID(player) });
|
||||
player.ArtisanInteraction = "Mystic";
|
||||
}
|
||||
|
||||
|
||||
@ -22,24 +22,24 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Artisans
|
||||
public Nephalem(World world, ActorSno sno, TagMap tags)
|
||||
: base(world, sno, tags)
|
||||
{
|
||||
this.Attributes[GameAttribute.NPC_Is_Operatable] = true;
|
||||
this.Attributes[GameAttribute.Is_NPC] = true;
|
||||
this.Attributes[GameAttribute.In_Tiered_Loot_Run_Level] = 0;
|
||||
this.Attributes[GameAttribute.MinimapActive] = true;
|
||||
this.Attributes[GameAttribute.NPC_Has_Interact_Options, 0] = true;
|
||||
this.Attributes[GameAttribute.NPC_Has_Interact_Options, 1] = true;
|
||||
this.Attributes[GameAttribute.NPC_Has_Interact_Options, 2] = true;
|
||||
this.Attributes[GameAttribute.NPC_Has_Interact_Options, 3] = true;
|
||||
Attributes[GameAttribute.NPC_Is_Operatable] = true;
|
||||
Attributes[GameAttribute.Is_NPC] = true;
|
||||
Attributes[GameAttribute.In_Tiered_Loot_Run_Level] = 0;
|
||||
Attributes[GameAttribute.MinimapActive] = true;
|
||||
Attributes[GameAttribute.NPC_Has_Interact_Options, 0] = true;
|
||||
Attributes[GameAttribute.NPC_Has_Interact_Options, 1] = true;
|
||||
Attributes[GameAttribute.NPC_Has_Interact_Options, 2] = true;
|
||||
Attributes[GameAttribute.NPC_Has_Interact_Options, 3] = true;
|
||||
//this.Attributes[GameAttribute.Conversation_Icon] = 2;
|
||||
//this.ForceConversationSNO =
|
||||
}
|
||||
|
||||
public override void OnCraft(Player player)
|
||||
{
|
||||
if (this.World.Game.ActiveNephalemKilledBoss == true)
|
||||
if (World.Game.ActiveNephalemKilledBoss == true)
|
||||
{
|
||||
this.World.Game.ActiveNephalemKilledBoss = false;
|
||||
foreach (var plr in this.World.Game.Players.Values)
|
||||
World.Game.ActiveNephalemKilledBoss = false;
|
||||
foreach (var plr in World.Game.Players.Values)
|
||||
{
|
||||
plr.InGameClient.SendMessage(new QuestCounterMessage()
|
||||
{
|
||||
@ -62,7 +62,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Artisans
|
||||
}
|
||||
}
|
||||
|
||||
player.InGameClient.SendMessage(new ANNDataMessage(Opcodes.OpenArtisanWindowMessage) { ActorID = this.DynamicID(player) });
|
||||
player.InGameClient.SendMessage(new ANNDataMessage(Opcodes.OpenArtisanWindowMessage) { ActorID = DynamicID(player) });
|
||||
player.ArtisanInteraction = "Mystic";
|
||||
}
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Artisans
|
||||
if (world.Game.CurrentAct == 3000)
|
||||
{
|
||||
|
||||
this.Conversations.Add(new ConversationInteraction(430146));
|
||||
Conversations.Add(new ConversationInteraction(430146));
|
||||
//[430335] [Worlds] a3dun_ruins_frost_city_a_02
|
||||
//[428493] [Worlds] a3dun_ruins_frost_city_a_01
|
||||
//this.Attributes[GameAttribute.Conversation_Icon, 0] = 1;
|
||||
@ -48,7 +48,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Artisans
|
||||
|
||||
public override bool Reveal(Player player)
|
||||
{
|
||||
if (this.SNO == ActorSno._kanaicube_stand)
|
||||
if (SNO == ActorSno._kanaicube_stand)
|
||||
if (!player.KanaiUnlocked)
|
||||
Interactions.Clear();
|
||||
else
|
||||
@ -72,7 +72,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Artisans
|
||||
|
||||
public override void OnTargeted(Player player, MessageSystem.Message.Definitions.World.TargetMessage message)
|
||||
{
|
||||
player.InGameClient.SendMessage(new MessageSystem.Message.Definitions.Misc.ANNDataMessage(Opcodes.OpenArtisanWindowMessage) { ActorID = this.DynamicID(player) });
|
||||
player.InGameClient.SendMessage(new MessageSystem.Message.Definitions.Misc.ANNDataMessage(Opcodes.OpenArtisanWindowMessage) { ActorID = DynamicID(player) });
|
||||
player.ArtisanInteraction = "Cube";
|
||||
}
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
public Banner(World world, ActorSno sno, TagMap tags)
|
||||
: base(world, sno, tags)
|
||||
{
|
||||
this.BannerPlayerIndex = bannerActors.FirstOrDefault(x => x.Value.Contains(this.SNO)).Key;
|
||||
BannerPlayerIndex = bannerActors.FirstOrDefault(x => x.Value.Contains(SNO)).Key;
|
||||
}
|
||||
|
||||
public int BannerPlayerIndex = 0;
|
||||
@ -63,13 +63,13 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
{
|
||||
Logger.Trace("(OnTargeted) Banner has been activated ");
|
||||
|
||||
if (this.World.Game.Players.Count == 1 || this.BannerPlayerIndex == 0)
|
||||
if (World.Game.Players.Count == 1 || BannerPlayerIndex == 0)
|
||||
{
|
||||
player.InGameClient.SendMessage(new MessageSystem.Message.Definitions.Base.SimpleMessage(Opcodes.OpenBannerCustomizationMessage));
|
||||
return;
|
||||
}
|
||||
|
||||
var banner_player = this.World.Game.Players.Values.Single(p => p.PlayerIndex == this.BannerPlayerIndex);
|
||||
var banner_player = World.Game.Players.Values.Single(p => p.PlayerIndex == BannerPlayerIndex);
|
||||
|
||||
if (banner_player == null || banner_player.World == null)
|
||||
{
|
||||
@ -78,23 +78,23 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
}
|
||||
|
||||
//if banner has been disabled for events like active greater active swarm /advocaite
|
||||
if(!player.Attributes[GameAttributeB.Banner_Usable])
|
||||
if(!player.Attributes[GameAttribute.Banner_Usable])
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
player.ShowConfirmation(this.DynamicID(player), (() => {
|
||||
player.ShowConfirmation(DynamicID(player), (() => {
|
||||
player.StartCasting(150, new Action(() => {
|
||||
if (banner_player.PlayerDirectBanner == null)
|
||||
{
|
||||
if (banner_player.World == this.World)
|
||||
if (banner_player.World == World)
|
||||
player.Teleport(banner_player.Position);
|
||||
else
|
||||
player.ChangeWorld(banner_player.World, banner_player.Position);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (banner_player.PlayerDirectBanner.World == this.World)
|
||||
if (banner_player.PlayerDirectBanner.World == World)
|
||||
player.Teleport(banner_player.PlayerDirectBanner.Position);
|
||||
else
|
||||
player.ChangeWorld(banner_player.PlayerDirectBanner.World, banner_player.PlayerDirectBanner.Position);
|
||||
|
||||
@ -77,19 +77,19 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
public Boss(MapSystem.World world, ActorSno sno, TagMap tags)
|
||||
: base(world, sno, tags)
|
||||
{
|
||||
if (sno == ActorSno._zoltunkulle && world.SNO == WorldSno.a2dun_zolt_lobby) this.SetVisible(false);
|
||||
this.Attributes[GameAttribute.MinimapActive] = true;
|
||||
if (sno == ActorSno._zoltunkulle && world.SNO == WorldSno.a2dun_zolt_lobby) SetVisible(false);
|
||||
Attributes[GameAttribute.MinimapActive] = true;
|
||||
//this.Attributes[GameAttribute.Immune_To_Charm] = true;
|
||||
this.Attributes[GameAttribute.//Blizzless Project 2022
|
||||
Attributes[GameAttribute.//Blizzless Project 2022
|
||||
using_Bossbar] = true;
|
||||
this.Attributes[GameAttribute.InBossEncounter] = true;
|
||||
this.Attributes[GameAttribute.Hitpoints_Max] *= 10.0f;
|
||||
this.Attributes[GameAttribute.Damage_Weapon_Min, 0] *= 7.8f;
|
||||
this.Attributes[GameAttribute.Damage_Weapon_Delta, 0] *= 7.8f;
|
||||
this.Attributes[GameAttribute.Hitpoints_Cur] = this.Attributes[GameAttribute.Hitpoints_Max_Total];
|
||||
this.Attributes[GameAttribute.TeamID] = 10;
|
||||
Attributes[GameAttribute.InBossEncounter] = true;
|
||||
Attributes[GameAttribute.Hitpoints_Max] *= 10.0f;
|
||||
Attributes[GameAttribute.Damage_Weapon_Min, 0] *= 7.8f;
|
||||
Attributes[GameAttribute.Damage_Weapon_Delta, 0] *= 7.8f;
|
||||
Attributes[GameAttribute.Hitpoints_Cur] = Attributes[GameAttribute.Hitpoints_Max_Total];
|
||||
Attributes[GameAttribute.TeamID] = 10;
|
||||
|
||||
this.WalkSpeed *= 0.5f;
|
||||
WalkSpeed *= 0.5f;
|
||||
MonsterBrain monsterBrain = (Brain as MonsterBrain);
|
||||
switch (sno)
|
||||
{
|
||||
@ -167,7 +167,7 @@ using_Bossbar] = true;
|
||||
monsterBrain.AddPresetPower(83008);
|
||||
break;
|
||||
case ActorSno._belial_trueform://Belial (small)
|
||||
this.HasLoot = false;
|
||||
HasLoot = false;
|
||||
break;
|
||||
case ActorSno._belial://Belial (big)
|
||||
monsterBrain.AddPresetPower(152540);
|
||||
@ -203,9 +203,9 @@ using_Bossbar] = true;
|
||||
|
||||
public override bool Reveal(PlayerSystem.Player player)
|
||||
{
|
||||
if (this.SNO == ActorSno._terrordemon_a_unique_1000monster)
|
||||
if (SNO == ActorSno._terrordemon_a_unique_1000monster)
|
||||
{
|
||||
this.Destroy();
|
||||
Destroy();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -18,16 +18,16 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
public CR_Glass(MapSystem.World world, ActorSno sno, TagMap tags)
|
||||
: base(world, sno, tags)
|
||||
{
|
||||
this.Attributes[GameAttribute.TeamID] = 2;
|
||||
this.Attributes[GameAttribute.MinimapActive] = true;
|
||||
this.Attributes.BroadcastChangedIfRevealed();
|
||||
Attributes[GameAttribute.TeamID] = 2;
|
||||
Attributes[GameAttribute.MinimapActive] = true;
|
||||
Attributes.BroadcastChangedIfRevealed();
|
||||
}
|
||||
|
||||
public override void OnTargeted(Player player, TargetMessage message)
|
||||
{
|
||||
player.InGameClient.SendMessage(new ANNDataMessage(Opcodes.ANNDataMessage46)
|
||||
{
|
||||
ActorID = this.DynamicID(player)
|
||||
ActorID = DynamicID(player)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,19 +36,19 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
|
||||
public void ReceiveDamage(Actor source, float damage)
|
||||
{
|
||||
if (this.SNO == ActorSno._trout_highlands_goatman_totem_gharbad && this.World.Game.CurrentSideQuest != 225253) return;
|
||||
if (SNO == ActorSno._trout_highlands_goatman_totem_gharbad && World.Game.CurrentSideQuest != 225253) return;
|
||||
|
||||
World.BroadcastIfRevealed(plr => new FloatingNumberMessage
|
||||
{
|
||||
Number = damage,
|
||||
ActorID = this.DynamicID(plr),
|
||||
ActorID = DynamicID(plr),
|
||||
Type = FloatingNumberMessage.FloatType.White
|
||||
}, this);
|
||||
|
||||
Attributes[GameAttribute.Hitpoints_Cur] = Math.Max(Attributes[GameAttribute.Hitpoints_Cur] - damage, 0);
|
||||
Attributes.BroadcastChangedIfRevealed();
|
||||
|
||||
if (Attributes[GameAttribute.Hitpoints_Cur] == 0 && !this.SNO.IsUndestroyable())
|
||||
if (Attributes[GameAttribute.Hitpoints_Cur] == 0 && !SNO.IsUndestroyable())
|
||||
Die(source);
|
||||
}
|
||||
|
||||
@ -56,12 +56,12 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
{
|
||||
base.OnTargeted(null, null);
|
||||
|
||||
Logger.Trace("Breaked barricade, id: {0}", this.SNO);
|
||||
Logger.Trace("Breaked barricade, id: {0}", SNO);
|
||||
|
||||
if (this.AnimationSet.TagMapAnimDefault.ContainsKey(AnimationSetKeys.DeathDefault))
|
||||
if (AnimationSet.Animations.ContainsKey(AnimationSetKeys.DeathDefault.ID))
|
||||
World.BroadcastIfRevealed(plr => new PlayAnimationMessage
|
||||
{
|
||||
ActorID = this.DynamicID(plr),
|
||||
ActorID = DynamicID(plr),
|
||||
AnimReason = 11,
|
||||
UnitAniimStartTime = 0,
|
||||
tAnim = new PlayAnimationMessageSpec[]
|
||||
@ -69,7 +69,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
new PlayAnimationMessageSpec()
|
||||
{
|
||||
Duration = 10,
|
||||
AnimationSNO = AnimationSet.TagMapAnimDefault[AnimationSetKeys.DeathDefault], //{DeathDefault = 10217}
|
||||
AnimationSNO = (int)AnimationSet.Animations[AnimationSetKeys.DeathDefault.ID], //{DeathDefault = 10217}
|
||||
PermutationIndex = 0,
|
||||
AnimationTag = 0,
|
||||
Speed = 1
|
||||
@ -78,19 +78,19 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
|
||||
}, this);
|
||||
|
||||
this.Attributes[GameAttribute.Deleted_On_Server] = true;
|
||||
this.Attributes[GameAttribute.Could_Have_Ragdolled] = true;
|
||||
this.Attributes[GameAttribute.Attacks_Per_Second] = 1.0f;
|
||||
this.Attributes[GameAttribute.Damage_Weapon_Min, 0] = 5f;
|
||||
this.Attributes[GameAttribute.Damage_Weapon_Delta, 0] = 5f;
|
||||
Attributes[GameAttribute.Deleted_On_Server] = true;
|
||||
Attributes[GameAttribute.Could_Have_Ragdolled] = true;
|
||||
Attributes[GameAttribute.Attacks_Per_Second] = 1.0f;
|
||||
Attributes[GameAttribute.Damage_Weapon_Min, 0] = 5f;
|
||||
Attributes[GameAttribute.Damage_Weapon_Delta, 0] = 5f;
|
||||
Attributes.BroadcastChangedIfRevealed();
|
||||
|
||||
Task.Delay(1500).ContinueWith(delegate
|
||||
{
|
||||
this.World.PowerManager.RunPower(this, 30209);
|
||||
var DataOfSkill = DiIiS_NA.Core.MPQ.MPQStorage.Data.Assets[GameServer.Core.Types.SNO.SNOGroup.Anim][10217].Data;
|
||||
World.PowerManager.RunPower(this, 30209);
|
||||
var DataOfSkill = DiIiS_NA.Core.MPQ.MPQStorage.Data.Assets[Core.Types.SNO.SNOGroup.Anim][10217].Data;
|
||||
|
||||
this.Destroy();
|
||||
Destroy();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@ -35,19 +35,19 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
|
||||
public void ReceiveDamage(Actor source, float damage)
|
||||
{
|
||||
if (this.SNO == ActorSno._trout_highlands_goatman_totem_gharbad && this.World.Game.CurrentSideQuest != 225253) return;
|
||||
if (SNO == ActorSno._trout_highlands_goatman_totem_gharbad && World.Game.CurrentSideQuest != 225253) return;
|
||||
|
||||
World.BroadcastIfRevealed(plr => new FloatingNumberMessage
|
||||
{
|
||||
Number = damage,
|
||||
ActorID = this.DynamicID(plr),
|
||||
ActorID = DynamicID(plr),
|
||||
Type = FloatingNumberMessage.FloatType.White
|
||||
}, this);
|
||||
|
||||
Attributes[GameAttribute.Hitpoints_Cur] = Math.Max(Attributes[GameAttribute.Hitpoints_Cur] - damage, 0);
|
||||
Attributes.BroadcastChangedIfRevealed();
|
||||
|
||||
if (Attributes[GameAttribute.Hitpoints_Cur] == 0 && !this.SNO.IsUndestroyable())
|
||||
if (Attributes[GameAttribute.Hitpoints_Cur] == 0 && !SNO.IsUndestroyable())
|
||||
Die(source);
|
||||
}
|
||||
|
||||
@ -55,12 +55,12 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
{
|
||||
base.OnTargeted(null, null);
|
||||
|
||||
Logger.Trace("Breaked barricade, id: {0}", this.SNO);
|
||||
Logger.Trace("Breaked barricade, id: {0}", SNO);
|
||||
|
||||
if (this.AnimationSet.TagMapAnimDefault.ContainsKey(AnimationSetKeys.DeathDefault))
|
||||
if (this.AnimationSet.Animations.ContainsKey(AnimationSetKeys.DeathDefault.ID))
|
||||
World.BroadcastIfRevealed(plr => new PlayAnimationMessage
|
||||
{
|
||||
ActorID = this.DynamicID(plr),
|
||||
ActorID = DynamicID(plr),
|
||||
AnimReason = 11,
|
||||
UnitAniimStartTime = 0,
|
||||
tAnim = new PlayAnimationMessageSpec[]
|
||||
@ -68,7 +68,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
new PlayAnimationMessageSpec()
|
||||
{
|
||||
Duration = 10,
|
||||
AnimationSNO = AnimationSet.TagMapAnimDefault[AnimationSetKeys.DeathDefault],
|
||||
AnimationSNO = (int)AnimationSet.Animations[AnimationSetKeys.DeathDefault.ID],
|
||||
PermutationIndex = 0,
|
||||
AnimationTag = 0,
|
||||
Speed = 1
|
||||
@ -77,17 +77,17 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
|
||||
}, this);
|
||||
|
||||
this.Attributes[GameAttribute.Deleted_On_Server] = true;
|
||||
this.Attributes[GameAttribute.Could_Have_Ragdolled] = true;
|
||||
this.Attributes[GameAttribute.Attacks_Per_Second] = 1.0f;
|
||||
this.Attributes[GameAttribute.Damage_Weapon_Min, 0] = 5f;
|
||||
this.Attributes[GameAttribute.Damage_Weapon_Delta, 0] = 5f;
|
||||
Attributes[GameAttribute.Deleted_On_Server] = true;
|
||||
Attributes[GameAttribute.Could_Have_Ragdolled] = true;
|
||||
Attributes[GameAttribute.Attacks_Per_Second] = 1.0f;
|
||||
Attributes[GameAttribute.Damage_Weapon_Min, 0] = 5f;
|
||||
Attributes[GameAttribute.Damage_Weapon_Delta, 0] = 5f;
|
||||
Attributes.BroadcastChangedIfRevealed();
|
||||
|
||||
Task.Delay(1400).ContinueWith(delegate
|
||||
{
|
||||
this.World.PowerManager.RunPower(this, 186216);
|
||||
this.Destroy();
|
||||
World.PowerManager.RunPower(this, 186216);
|
||||
Destroy();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -32,16 +32,16 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
public ChallengeObelisk(World world, ActorSno sno, TagMap tags)
|
||||
: base(world, sno, tags)
|
||||
{
|
||||
this.Attributes[GameAttribute.TeamID] = 2;
|
||||
this.Attributes[GameAttribute.MinimapActive] = true;
|
||||
this.Attributes.BroadcastChangedIfRevealed();
|
||||
Attributes[GameAttribute.TeamID] = 2;
|
||||
Attributes[GameAttribute.MinimapActive] = true;
|
||||
Attributes.BroadcastChangedIfRevealed();
|
||||
}
|
||||
|
||||
public override void OnTargeted(Player player, TargetMessage message)
|
||||
{
|
||||
bool Activated = false;
|
||||
|
||||
this.PlayAnimation(5, AnimationSet.TagMapAnimDefault[AnimationSetKeys.Opening]);
|
||||
this.PlayAnimation(5, AnimationSet.Animations[AnimationSetKeys.Opening.ID]);
|
||||
Attributes[GameAttribute.Team_Override] = (Activated ? -1 : 2);
|
||||
Attributes[GameAttribute.Untargetable] = !Activated;
|
||||
Attributes[GameAttribute.NPC_Is_Operatable] = Activated;
|
||||
@ -52,11 +52,11 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
Attributes.BroadcastChangedIfRevealed();
|
||||
CollFlags = 0;
|
||||
|
||||
TickTimer Timeout = new SecondsTickTimer(this.World.Game, 3.5f);
|
||||
TickTimer Timeout = new SecondsTickTimer(World.Game, 3.5f);
|
||||
var Boom = Task<bool>.Factory.StartNew(() => WaitToSpawn(Timeout));
|
||||
Boom.ContinueWith(delegate
|
||||
{
|
||||
var actor = this.World.GetActorBySNO(ActorSno._x1_openworld_challenge_rifts_portal);
|
||||
var actor = World.GetActorBySNO(ActorSno._x1_openworld_challenge_rifts_portal);
|
||||
actor.SetVisible(true);
|
||||
actor.Reveal(player);
|
||||
|
||||
@ -75,13 +75,13 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
return false;
|
||||
if (!Attributes[GameAttribute.Operatable])
|
||||
{
|
||||
var actor = this.World.GetActorBySNO(ActorSno._x1_openworld_challenge_rifts_portal);
|
||||
var actor = World.GetActorBySNO(ActorSno._x1_openworld_challenge_rifts_portal);
|
||||
actor.SetVisible(false);
|
||||
actor.Unreveal(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.PlayAnimation(5, AnimationSet.TagMapAnimDefault[AnimationSetKeys.Opening]);
|
||||
this.PlayAnimation(5, AnimationSet.Animations[AnimationSetKeys.Opening.ID]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -23,18 +23,18 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
public Champion(MapSystem.World world, ActorSno sno, TagMap tags)
|
||||
: base(world, sno, tags)
|
||||
{
|
||||
this.Attributes[GameAttribute.Hitpoints_Max] *= 4.0f;
|
||||
this.Attributes[GameAttribute.Immune_To_Charm] = true;
|
||||
this.Attributes[GameAttribute.Damage_Weapon_Min, 0] *= 2.5f;
|
||||
this.Attributes[GameAttribute.Damage_Weapon_Delta, 0] *= 2.5f;
|
||||
this.Attributes[GameAttribute.Hitpoints_Cur] = this.Attributes[GameAttribute.Hitpoints_Max_Total];
|
||||
Attributes[GameAttribute.Hitpoints_Max] *= 4.0f;
|
||||
Attributes[GameAttribute.Immune_To_Charm] = true;
|
||||
Attributes[GameAttribute.Damage_Weapon_Min, 0] *= 2.5f;
|
||||
Attributes[GameAttribute.Damage_Weapon_Delta, 0] *= 2.5f;
|
||||
Attributes[GameAttribute.Hitpoints_Cur] = Attributes[GameAttribute.Hitpoints_Max_Total];
|
||||
//MonsterAffixGenerator.Generate(this, this.World.Game.Difficulty + 1);
|
||||
this.Attributes[GameAttribute.Movement_Scalar] = this.Attributes[GameAttribute.Movement_Scalar] * 0.5f;
|
||||
this.Attributes[GameAttribute.Run_Speed_Granted] = this.Attributes[GameAttribute.Run_Speed_Granted] * 0.5f;
|
||||
this.Attributes[GameAttribute.Movement_Scalar_Reduction_Percent] -= 20f;
|
||||
this.WalkSpeed = 0.3f;
|
||||
this.NamePrefix = MonsterAffixGenerator.GeneratePrefixName();
|
||||
this.NameSuffix = MonsterAffixGenerator.GenerateSuffixName();
|
||||
Attributes[GameAttribute.Movement_Scalar] = Attributes[GameAttribute.Movement_Scalar] * 0.5f;
|
||||
Attributes[GameAttribute.Run_Speed_Granted] = Attributes[GameAttribute.Run_Speed_Granted] * 0.5f;
|
||||
Attributes[GameAttribute.Movement_Scalar_Reduction_Percent] -= 20f;
|
||||
WalkSpeed = 0.3f;
|
||||
NamePrefix = MonsterAffixGenerator.GeneratePrefixName();
|
||||
NameSuffix = MonsterAffixGenerator.GenerateSuffixName();
|
||||
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
player.InGameClient.SendMessage(new RareMonsterNamesMessage()
|
||||
{
|
||||
ann = DynamicID(player),
|
||||
RareNames = new int[2] { this.NamePrefix, this.NameSuffix },
|
||||
RareNames = new int[2] { NamePrefix, NameSuffix },
|
||||
MonsterAffixes = affixGbids
|
||||
});
|
||||
|
||||
|
||||
@ -22,8 +22,8 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
|
||||
public override void OnPlayerApproaching(PlayerSystem.Player player)
|
||||
{
|
||||
if (this.World.Game.PvP) return;
|
||||
if (player.Position.DistanceSquared(ref _position) < ActorData.Sphere.Radius * ActorData.Sphere.Radius * this.Scale * this.Scale && !_checkpointReached)
|
||||
if (World.Game.PvP) return;
|
||||
if (player.Position.DistanceSquared(ref _position) < ActorData.Sphere.Radius * ActorData.Sphere.Radius * Scale * Scale && !_checkpointReached)
|
||||
{
|
||||
_checkpointReached = true;
|
||||
|
||||
@ -33,7 +33,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
Effect = Effect.Checkpoint
|
||||
});
|
||||
|
||||
player.CheckPointPosition = this.Position;
|
||||
player.CheckPointPosition = Position;
|
||||
player.Attributes[GameAttribute.Corpse_Resurrection_Charges] = 3; // Reset corpse resurrection charges
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,12 +33,12 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
{
|
||||
try
|
||||
{
|
||||
if (player.Position.DistanceSquared(ref _position) < 225f && !_collapsed && this.Randomed)
|
||||
if (player.Position.DistanceSquared(ref _position) < 225f && !_collapsed && Randomed)
|
||||
{
|
||||
_collapsed = true;
|
||||
|
||||
this.World.Game.SideQuestGizmo = this;
|
||||
this.World.Game.QuestManager.LaunchSideQuest(eventIds[DiIiS_NA.Core.Helpers.Math.FastRandom.Instance.Next(0, eventIds.Count())], true);
|
||||
World.Game.SideQuestGizmo = this;
|
||||
World.Game.QuestManager.LaunchSideQuest(eventIds[DiIiS_NA.Core.Helpers.Math.FastRandom.Instance.Next(0, eventIds.Count())], true);
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
@ -56,7 +56,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
|
||||
public void Activate()
|
||||
{
|
||||
var rewardChests = this.GetActorsInRange<LootContainer>(20f).Where(c => c.rewardChestAvailable == false).ToList();
|
||||
var rewardChests = GetActorsInRange<LootContainer>(20f).Where(c => c.rewardChestAvailable == false).ToList();
|
||||
|
||||
foreach (var chest in rewardChests)
|
||||
{
|
||||
@ -65,7 +65,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
chest.Reveal(plr);
|
||||
}
|
||||
|
||||
this.Destroy();
|
||||
Destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,12 +37,12 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
{
|
||||
try
|
||||
{
|
||||
if (player.Position.DistanceSquared(ref _position) < 225f && !_collapsed && this.Randomed)
|
||||
if (player.Position.DistanceSquared(ref _position) < 225f && !_collapsed && Randomed)
|
||||
{
|
||||
_collapsed = true;
|
||||
|
||||
this.World.Game.SideQuestGizmo = this;
|
||||
this.World.Game.QuestManager.LaunchSideQuest(eventIds[DiIiS_NA.Core.Helpers.Math.FastRandom.Instance.Next(0, eventIds.Count())], true);
|
||||
World.Game.SideQuestGizmo = this;
|
||||
World.Game.QuestManager.LaunchSideQuest(eventIds[DiIiS_NA.Core.Helpers.Math.FastRandom.Instance.Next(0, eventIds.Count())], true);
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
@ -60,51 +60,51 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
|
||||
public void Activate()
|
||||
{
|
||||
this.World.BroadcastIfRevealed(plr => new ANNDataMessage(Opcodes.ShrineActivatedMessage) { ActorID = this.DynamicID(plr) }, this);
|
||||
World.BroadcastIfRevealed(plr => new ANNDataMessage(Opcodes.ShrineActivatedMessage) { ActorID = DynamicID(plr) }, this);
|
||||
var type = DiIiS_NA.Core.Helpers.Math.FastRandom.Instance.Next(0, 4);
|
||||
switch (type)
|
||||
{
|
||||
case 0: //blessed
|
||||
foreach (var plr in this.GetPlayersInRange(100f))
|
||||
foreach (var plr in GetPlayersInRange(100f))
|
||||
{
|
||||
this.World.BuffManager.AddBuff(this, plr, new PowerSystem.Implementations.ShrineBlessedBuff(TickTimer.WaitSeconds(this.World.Game, 120.0f)));
|
||||
World.BuffManager.AddBuff(this, plr, new PowerSystem.Implementations.ShrineBlessedBuff(TickTimer.WaitSeconds(World.Game, 120.0f)));
|
||||
plr.GrantCriteria(74987243307423);
|
||||
}
|
||||
break;
|
||||
case 1: //enlightened
|
||||
foreach (var plr in this.GetPlayersInRange(100f))
|
||||
foreach (var plr in GetPlayersInRange(100f))
|
||||
{
|
||||
this.World.BuffManager.AddBuff(this, plr, new PowerSystem.Implementations.ShrineEnlightenedBuff(TickTimer.WaitSeconds(this.World.Game, 120.0f)));
|
||||
World.BuffManager.AddBuff(this, plr, new PowerSystem.Implementations.ShrineEnlightenedBuff(TickTimer.WaitSeconds(World.Game, 120.0f)));
|
||||
plr.GrantCriteria(74987243307424);
|
||||
}
|
||||
break;
|
||||
case 2: //fortune
|
||||
foreach (var plr in this.GetPlayersInRange(100f))
|
||||
foreach (var plr in GetPlayersInRange(100f))
|
||||
{
|
||||
this.World.BuffManager.AddBuff(this, plr, new PowerSystem.Implementations.ShrineFortuneBuff(TickTimer.WaitSeconds(this.World.Game, 120.0f)));
|
||||
World.BuffManager.AddBuff(this, plr, new PowerSystem.Implementations.ShrineFortuneBuff(TickTimer.WaitSeconds(World.Game, 120.0f)));
|
||||
plr.GrantCriteria(74987243307425);
|
||||
}
|
||||
break;
|
||||
case 3: //frenzied
|
||||
foreach (var plr in this.GetPlayersInRange(100f))
|
||||
foreach (var plr in GetPlayersInRange(100f))
|
||||
{
|
||||
this.World.BuffManager.AddBuff(this, plr, new PowerSystem.Implementations.ShrineFrenziedBuff(TickTimer.WaitSeconds(this.World.Game, 120.0f)));
|
||||
World.BuffManager.AddBuff(this, plr, new PowerSystem.Implementations.ShrineFrenziedBuff(TickTimer.WaitSeconds(World.Game, 120.0f)));
|
||||
plr.GrantCriteria(74987243307426);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
foreach (var plr in this.GetPlayersInRange(100f))
|
||||
foreach (var plr in GetPlayersInRange(100f))
|
||||
{
|
||||
this.World.BuffManager.AddBuff(this, plr, new PowerSystem.Implementations.ShrineEnlightenedBuff(TickTimer.WaitSeconds(this.World.Game, 120.0f)));
|
||||
World.BuffManager.AddBuff(this, plr, new PowerSystem.Implementations.ShrineEnlightenedBuff(TickTimer.WaitSeconds(World.Game, 120.0f)));
|
||||
}
|
||||
break;
|
||||
}
|
||||
this.Attributes[GameAttribute.Gizmo_Has_Been_Operated] = true;
|
||||
Attributes[GameAttribute.Gizmo_Has_Been_Operated] = true;
|
||||
//this.Attributes[GameAttribute.Gizmo_Operator_ACDID] = unchecked((int)player.DynamicID);
|
||||
this.Attributes[GameAttribute.Gizmo_State] = 1;
|
||||
Attributes[GameAttribute.Gizmo_State] = 1;
|
||||
Attributes.BroadcastChangedIfRevealed();
|
||||
|
||||
var rewardChests = this.GetActorsInRange<LootContainer>(20f).Where(c => c.rewardChestAvailable == false).ToList();
|
||||
var rewardChests = GetActorsInRange<LootContainer>(20f).Where(c => c.rewardChestAvailable == false).ToList();
|
||||
|
||||
foreach (var chest in rewardChests)
|
||||
{
|
||||
|
||||
@ -51,12 +51,12 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
|
||||
public void ReceiveDamage(Actor source, float damage /* critical, type */)
|
||||
{
|
||||
if (this.SNO == ActorSno._trout_highlands_goatman_totem_gharbad && this.World.Game.CurrentSideQuest != 225253) return;
|
||||
if (SNO == ActorSno._trout_highlands_goatman_totem_gharbad && World.Game.CurrentSideQuest != 225253) return;
|
||||
|
||||
World.BroadcastIfRevealed(plr => new FloatingNumberMessage
|
||||
{
|
||||
Number = damage,
|
||||
ActorID = this.DynamicID(plr),
|
||||
ActorID = DynamicID(plr),
|
||||
Type = FloatingNumberMessage.FloatType.White
|
||||
}, this);
|
||||
|
||||
@ -65,7 +65,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
|
||||
Attributes.BroadcastChangedIfRevealed();
|
||||
|
||||
if (Attributes[GameAttribute.Hitpoints_Cur] == 0 && !this.SNO.IsUndestroyable())
|
||||
if (Attributes[GameAttribute.Hitpoints_Cur] == 0 && !SNO.IsUndestroyable())
|
||||
{
|
||||
Die(source);
|
||||
}
|
||||
@ -76,40 +76,40 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
base.OnTargeted(null, null);
|
||||
if (haveDrop)
|
||||
{
|
||||
var dropRates = this.World.Game.IsHardcore ? LootManager.GetSeasonalDropRates((int)this.Quality, 70) : LootManager.GetDropRates((int)this.Quality, 70);
|
||||
var dropRates = World.Game.IsHardcore ? LootManager.GetSeasonalDropRates((int)Quality, 70) : LootManager.GetDropRates((int)Quality, 70);
|
||||
foreach (var rate in dropRates)
|
||||
foreach (var plr in this.GetPlayersInRange(30))
|
||||
foreach (var plr in GetPlayersInRange(30))
|
||||
{
|
||||
float seed = (float)FastRandom.Instance.NextDouble();
|
||||
if (seed < 0.95f)
|
||||
this.World.SpawnGold(this, plr);
|
||||
World.SpawnGold(this, plr);
|
||||
if (seed < 0.06f)
|
||||
this.World.SpawnRandomCraftItem(this, plr);
|
||||
World.SpawnRandomCraftItem(this, plr);
|
||||
if (seed < 0.04f)
|
||||
this.World.SpawnRandomGem(this, plr);
|
||||
World.SpawnRandomGem(this, plr);
|
||||
if (seed < 0.10f)
|
||||
this.World.SpawnRandomPotion(this, plr);
|
||||
World.SpawnRandomPotion(this, plr);
|
||||
if (seed < (rate * (1f + plr.Attributes[GameAttribute.Magic_Find])))
|
||||
{
|
||||
var lootQuality = this.World.Game.IsHardcore ? LootManager.GetSeasonalLootQuality((int)this.Quality, this.World.Game.Difficulty) : LootManager.GetLootQuality((int)this.Quality, this.World.Game.Difficulty);
|
||||
this.World.SpawnRandomEquip(plr, plr, lootQuality);
|
||||
var lootQuality = World.Game.IsHardcore ? LootManager.GetSeasonalLootQuality((int)Quality, World.Game.Difficulty) : LootManager.GetLootQuality((int)Quality, World.Game.Difficulty);
|
||||
World.SpawnRandomEquip(plr, plr, lootQuality);
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Logger.Trace("Breaked barricade, id: {0}", this.SNO);
|
||||
Logger.Trace("Breaked barricade, id: {0}", SNO);
|
||||
|
||||
if (source != null && source is Player && tombs.Contains(this.SNO))
|
||||
if (source != null && source is Player && tombs.Contains(SNO))
|
||||
{
|
||||
(source as Player).AddAchievementCounter(74987243307171, 1);
|
||||
}
|
||||
|
||||
if (this.AnimationSet.TagMapAnimDefault.ContainsKey(AnimationSetKeys.DeathDefault))
|
||||
if (this.AnimationSet.Animations.ContainsKey(AnimationSetKeys.DeathDefault.ID))
|
||||
World.BroadcastIfRevealed(plr => new PlayAnimationMessage
|
||||
{
|
||||
ActorID = this.DynamicID(plr),
|
||||
ActorID = DynamicID(plr),
|
||||
AnimReason = 11,
|
||||
UnitAniimStartTime = 0,
|
||||
tAnim = new PlayAnimationMessageSpec[]
|
||||
@ -117,7 +117,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
new PlayAnimationMessageSpec()
|
||||
{
|
||||
Duration = 10,
|
||||
AnimationSNO = AnimationSet.TagMapAnimDefault[AnimationSetKeys.DeathDefault],
|
||||
AnimationSNO = (int)AnimationSet.Animations[AnimationSetKeys.DeathDefault.ID],
|
||||
PermutationIndex = 0,
|
||||
AnimationTag = 0,
|
||||
Speed = 1
|
||||
@ -126,38 +126,38 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
|
||||
}, this);
|
||||
|
||||
this.Attributes[GameAttribute.Deleted_On_Server] = true;
|
||||
this.Attributes[GameAttribute.Could_Have_Ragdolled] = true;
|
||||
Attributes[GameAttribute.Deleted_On_Server] = true;
|
||||
Attributes[GameAttribute.Could_Have_Ragdolled] = true;
|
||||
Attributes.BroadcastChangedIfRevealed();
|
||||
|
||||
//handling quest triggers
|
||||
if (this.World.Game.QuestProgress.QuestTriggers.ContainsKey((int)this.SNO))
|
||||
if (World.Game.QuestProgress.QuestTriggers.ContainsKey((int)SNO))
|
||||
{
|
||||
var trigger = this.World.Game.QuestProgress.QuestTriggers[(int)this.SNO];
|
||||
var trigger = World.Game.QuestProgress.QuestTriggers[(int)SNO];
|
||||
if (trigger.triggerType == DiIiS_NA.Core.MPQ.FileFormats.QuestStepObjectiveType.KillMonster)
|
||||
{
|
||||
this.World.Game.QuestProgress.UpdateCounter((int)this.SNO);
|
||||
if (trigger.count == this.World.Game.QuestProgress.QuestTriggers[(int)this.SNO].counter)
|
||||
trigger.questEvent.Execute(this.World); // launch a questEvent
|
||||
World.Game.QuestProgress.UpdateCounter((int)SNO);
|
||||
if (trigger.count == World.Game.QuestProgress.QuestTriggers[(int)SNO].counter)
|
||||
trigger.questEvent.Execute(World); // launch a questEvent
|
||||
}
|
||||
else
|
||||
if (trigger.triggerType == DiIiS_NA.Core.MPQ.FileFormats.QuestStepObjectiveType.MonsterFromGroup)
|
||||
{
|
||||
this.World.Game.QuestProgress.UpdateCounter((int)this.SNO);
|
||||
World.Game.QuestProgress.UpdateCounter((int)SNO);
|
||||
}
|
||||
}
|
||||
else if (this.World.Game.SideQuestProgress.QuestTriggers.ContainsKey((int)this.SNO))
|
||||
else if (World.Game.SideQuestProgress.QuestTriggers.ContainsKey((int)SNO))
|
||||
{
|
||||
var trigger = this.World.Game.SideQuestProgress.QuestTriggers[(int)this.SNO];
|
||||
var trigger = World.Game.SideQuestProgress.QuestTriggers[(int)SNO];
|
||||
if (trigger.triggerType == DiIiS_NA.Core.MPQ.FileFormats.QuestStepObjectiveType.KillMonster)
|
||||
{
|
||||
this.World.Game.SideQuestProgress.UpdateSideCounter((int)this.SNO);
|
||||
if (trigger.count == this.World.Game.SideQuestProgress.QuestTriggers[(int)this.SNO].counter)
|
||||
trigger.questEvent.Execute(this.World); // launch a questEvent
|
||||
World.Game.SideQuestProgress.UpdateSideCounter((int)SNO);
|
||||
if (trigger.count == World.Game.SideQuestProgress.QuestTriggers[(int)SNO].counter)
|
||||
trigger.questEvent.Execute(World); // launch a questEvent
|
||||
}
|
||||
}
|
||||
|
||||
this.Destroy();
|
||||
Destroy();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -42,31 +42,31 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
if (NearestPortal != null)
|
||||
{
|
||||
NearestPortal.SetVisible(false);
|
||||
foreach (var plr in this.World.Players.Values)
|
||||
foreach (var plr in World.Players.Values)
|
||||
NearestPortal.Unreveal(plr);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool Reveal(Player player)
|
||||
{
|
||||
if (this.SNO == ActorSno._trout_cultists_summoning_portal_b) return false;
|
||||
if (this.SNO == ActorSno._a2dun_aqd_godhead_door_largepuzzle && this.World.SNO != WorldSno.a2dun_aqd_oasis_randomfacepuzzle_large) return false; //dakab door
|
||||
if (this.SNO == ActorSno._a2dun_aqd_godhead_door && this.World.SNO == WorldSno.a2dun_aqd_oasis_randomfacepuzzle_large) return false; //not dakab door
|
||||
if (SNO == ActorSno._trout_cultists_summoning_portal_b) return false;
|
||||
if (SNO == ActorSno._a2dun_aqd_godhead_door_largepuzzle && World.SNO != WorldSno.a2dun_aqd_oasis_randomfacepuzzle_large) return false; //dakab door
|
||||
if (SNO == ActorSno._a2dun_aqd_godhead_door && World.SNO == WorldSno.a2dun_aqd_oasis_randomfacepuzzle_large) return false; //not dakab door
|
||||
|
||||
if (this.SNO == ActorSno._a2dun_zolt_random_portal_timed) //Treasure Room door
|
||||
this.isOpened = true;
|
||||
if (SNO == ActorSno._a2dun_zolt_random_portal_timed) //Treasure Room door
|
||||
isOpened = true;
|
||||
|
||||
if (this.SNO == ActorSno._caout_oasis_mine_entrance_a && (float)DiIiS_NA.Core.Helpers.Math.FastRandom.Instance.NextDouble() < 0.3f) //Mysterious Cave door
|
||||
this.isOpened = true;
|
||||
if (SNO == ActorSno._caout_oasis_mine_entrance_a && (float)DiIiS_NA.Core.Helpers.Math.FastRandom.Instance.NextDouble() < 0.3f) //Mysterious Cave door
|
||||
isOpened = true;
|
||||
|
||||
if (!base.Reveal(player))
|
||||
return false;
|
||||
|
||||
if (this.isOpened == true)
|
||||
if (isOpened == true)
|
||||
{
|
||||
player.InGameClient.SendMessage(new SetIdleAnimationMessage
|
||||
{
|
||||
ActorID = this.DynamicID(player),
|
||||
ActorID = DynamicID(player),
|
||||
AnimationSNO = AnimationSetKeys.Open.ID
|
||||
});
|
||||
}
|
||||
@ -79,7 +79,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
if (NearestPortal != null)
|
||||
{
|
||||
NearestPortal.SetVisible(false);
|
||||
foreach (var plr in this.World.Players.Values)
|
||||
foreach (var plr in World.Players.Values)
|
||||
NearestPortal.Unreveal(plr);
|
||||
}
|
||||
}
|
||||
@ -90,7 +90,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
{
|
||||
World.BroadcastIfRevealed(plr => new PlayAnimationMessage
|
||||
{
|
||||
ActorID = this.DynamicID(plr),
|
||||
ActorID = DynamicID(plr),
|
||||
AnimReason = 5,
|
||||
UnitAniimStartTime = 0,
|
||||
tAnim = new PlayAnimationMessageSpec[]
|
||||
@ -98,7 +98,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
new PlayAnimationMessageSpec()
|
||||
{
|
||||
Duration = 500,
|
||||
AnimationSNO = AnimationSet.TagMapAnimDefault[AnimationSetKeys.Opening],
|
||||
AnimationSNO = (int)AnimationSet.Animations[AnimationSetKeys.Opening.ID],
|
||||
PermutationIndex = 0,
|
||||
AnimationTag = 0,
|
||||
Speed = 1
|
||||
@ -115,24 +115,24 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
|
||||
World.BroadcastIfRevealed(plr => new SetIdleAnimationMessage
|
||||
{
|
||||
ActorID = this.DynamicID(plr),
|
||||
ActorID = DynamicID(plr),
|
||||
AnimationSNO = AnimationSetKeys.Open.ID
|
||||
}, this);
|
||||
|
||||
this.Attributes[GameAttribute.Gizmo_Has_Been_Operated] = true;
|
||||
Attributes[GameAttribute.Gizmo_Has_Been_Operated] = true;
|
||||
//this.Attributes[GameAttribute.Gizmo_Operator_ACDID] = unchecked((int)player.DynamicID);
|
||||
this.Attributes[GameAttribute.Gizmo_State] = 1;
|
||||
this.CollFlags = 0;
|
||||
this.isOpened = true;
|
||||
Attributes[GameAttribute.Gizmo_State] = 1;
|
||||
CollFlags = 0;
|
||||
isOpened = true;
|
||||
|
||||
TickerSystem.TickTimer Timeout = new TickerSystem.SecondsTickTimer(this.World.Game, 1.8f);
|
||||
TickerSystem.TickTimer Timeout = new TickerSystem.SecondsTickTimer(World.Game, 1.8f);
|
||||
if (NearestPortal != null)
|
||||
{
|
||||
var Boom = System.Threading.Tasks.Task<bool>.Factory.StartNew(() => WaitToSpawn(Timeout));
|
||||
var Boom = Task<bool>.Factory.StartNew(() => WaitToSpawn(Timeout));
|
||||
Boom.ContinueWith(delegate
|
||||
{
|
||||
NearestPortal.SetVisible(true);
|
||||
foreach (var plr in this.World.Players.Values)
|
||||
foreach (var plr in World.Players.Values)
|
||||
NearestPortal.Unreveal(plr);
|
||||
});
|
||||
}
|
||||
@ -142,11 +142,11 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
|
||||
public override void OnTargeted(Player player, TargetMessage message)
|
||||
{
|
||||
if (this.Attributes[GameAttribute.Disabled]) return;
|
||||
this.Open();
|
||||
if (Attributes[GameAttribute.Disabled]) return;
|
||||
Open();
|
||||
|
||||
base.OnTargeted(player, message);
|
||||
this.Attributes[GameAttribute.Disabled] = true;
|
||||
Attributes[GameAttribute.Disabled] = true;
|
||||
}
|
||||
|
||||
private bool WaitToSpawn(TickerSystem.TickTimer timer)
|
||||
|
||||
@ -35,11 +35,11 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
{
|
||||
|
||||
//this.Field2 = 0x9;//16;
|
||||
this.Attributes[GameAttribute.MinimapActive] = true;
|
||||
Attributes[GameAttribute.MinimapActive] = true;
|
||||
//this.Attributes[GameAttribute.MinimapIconOverride] = 218394;
|
||||
if (this.World.SNO.IsDungeon())
|
||||
if (World.SNO.IsDungeon())
|
||||
{
|
||||
this.Destination = new ResolvedPortalDestination()
|
||||
Destination = new ResolvedPortalDestination()
|
||||
{
|
||||
DestLevelAreaSNO = 332339,
|
||||
WorldSNO = (int)WorldSno.x1_tristram_adventure_mode_hub,
|
||||
@ -60,29 +60,29 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
if (actor is Portal)
|
||||
Exit = actor as Portal;
|
||||
if (Exit != null)
|
||||
this.Destination = Exit.Destination;
|
||||
Destination = Exit.Destination;
|
||||
}
|
||||
else if (Destination == null)
|
||||
this.Destination = this.World.PrevLocation;
|
||||
Destination = World.PrevLocation;
|
||||
|
||||
player.InGameClient.SendMessage(new PortalSpecifierMessage()
|
||||
{
|
||||
ActorID = this.DynamicID(player),
|
||||
Destination = this.Destination
|
||||
ActorID = DynamicID(player),
|
||||
Destination = Destination
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
public StartingPoint GetSmartStartingPoint(World world)
|
||||
{
|
||||
if (this.Destination.StartingPointActorTag != 0)
|
||||
if (Destination.StartingPointActorTag != 0)
|
||||
{
|
||||
StartingPoint NeededStartingPoint = world.GetStartingPointById(this.Destination.StartingPointActorTag);
|
||||
var DestWorld = world.Game.GetWorld((WorldSno)this.Destination.WorldSNO);
|
||||
StartingPoint NeededStartingPoint = world.GetStartingPointById(Destination.StartingPointActorTag);
|
||||
var DestWorld = world.Game.GetWorld((WorldSno)Destination.WorldSNO);
|
||||
var StartingPoints = DestWorld.GetActorsBySNO(ActorSno._start_location_0);
|
||||
foreach (var ST in StartingPoints)
|
||||
{
|
||||
if (ST.CurrentScene.SceneSNO.Id == this.Destination.StartingPointActorTag)
|
||||
if (ST.CurrentScene.SceneSNO.Id == Destination.StartingPointActorTag)
|
||||
NeededStartingPoint = (ST as StartingPoint);
|
||||
}
|
||||
if (NeededStartingPoint != null)
|
||||
@ -97,22 +97,22 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
{
|
||||
Logger.Debug("(OnTargeted) Portal has been activated ");
|
||||
|
||||
if (this.World.SNO.IsDungeon())
|
||||
if (World.SNO.IsDungeon())
|
||||
{
|
||||
this.Destination.DestLevelAreaSNO = 332339;
|
||||
this.Destination.WorldSNO = (int)WorldSno.x1_tristram_adventure_mode_hub;
|
||||
this.Destination.StartingPointActorTag = 24;
|
||||
Destination.DestLevelAreaSNO = 332339;
|
||||
Destination.WorldSNO = (int)WorldSno.x1_tristram_adventure_mode_hub;
|
||||
Destination.StartingPointActorTag = 24;
|
||||
}
|
||||
|
||||
var world = this.World.Game.GetWorld((WorldSno)this.Destination.WorldSNO);
|
||||
var world = World.Game.GetWorld((WorldSno)Destination.WorldSNO);
|
||||
|
||||
if (world == null)
|
||||
{
|
||||
Logger.Warn("Portal's destination world does not exist (WorldSNO = {0})", this.Destination.WorldSNO);
|
||||
Logger.Warn("Portal's destination world does not exist (WorldSNO = {0})", Destination.WorldSNO);
|
||||
return;
|
||||
}
|
||||
|
||||
var startingPoint = world.GetStartingPointById(this.Destination.StartingPointActorTag);
|
||||
var startingPoint = world.GetStartingPointById(Destination.StartingPointActorTag);
|
||||
|
||||
if (startingPoint == null)
|
||||
startingPoint = GetSmartStartingPoint(world);
|
||||
@ -120,9 +120,9 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
if (startingPoint != null)
|
||||
{
|
||||
|
||||
player.ShowConfirmation(this.DynamicID(player), (() => {
|
||||
player.ShowConfirmation(DynamicID(player), (() => {
|
||||
player.StartCasting(150, new Action(() => {
|
||||
if (world == this.World)
|
||||
if (world == World)
|
||||
player.Teleport(startingPoint.Position);
|
||||
else
|
||||
player.ChangeWorld(world, startingPoint);
|
||||
@ -131,7 +131,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
|
||||
}
|
||||
else
|
||||
Logger.Warn("Portal's tagged starting point does not exist (Tag = {0})", this.Destination.StartingPointActorTag);
|
||||
Logger.Warn("Portal's tagged starting point does not exist (Tag = {0})", Destination.StartingPointActorTag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
public EquipmentManager(MapSystem.World world, ActorSno sno, TagMap tags)
|
||||
: base(world, sno, tags)
|
||||
{
|
||||
this.Attributes[GameAttribute.MinimapActive] = true;
|
||||
Attributes[GameAttribute.MinimapActive] = true;
|
||||
}
|
||||
|
||||
public override void OnTargeted(Player player, TargetMessage message)
|
||||
@ -36,7 +36,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
// player.InGameClient.SendMessage(new ANNDataMessage(Opcodes.ANNDataMessage23) - Бафф (шрайн)
|
||||
player.InGameClient.SendMessage(new ANNDataMessage(Opcodes.ANNDataMessage45)
|
||||
{
|
||||
ActorID = this.DynamicID(player)
|
||||
ActorID = DynamicID(player)
|
||||
});
|
||||
}
|
||||
|
||||
@ -45,7 +45,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
player.InGameClient.SendMessage(new MessageSystem.Message.Definitions.Map.MapMarkerInfoMessage()
|
||||
{
|
||||
HashedName = DiIiS_NA.Core.Helpers.Hash.StringHashHelper.HashItemName("EquipmentManagerTest"),
|
||||
Place = new MessageSystem.Message.Fields.WorldPlace { Position = this.Position, WorldID = this.World.GlobalID },
|
||||
Place = new MessageSystem.Message.Fields.WorldPlace { Position = Position, WorldID = World.GlobalID },
|
||||
ImageInfo = -1,
|
||||
Label = -1,
|
||||
snoStringList = -1,
|
||||
|
||||
@ -24,9 +24,9 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
public Ghost(World world, ActorSno sno, TagMap tags)
|
||||
: base(world, sno, tags)
|
||||
{
|
||||
this.CollFlags = 0;
|
||||
this.WalkSpeed = 0;
|
||||
this.Attributes[GameAttribute.Invulnerable] = true;
|
||||
CollFlags = 0;
|
||||
WalkSpeed = 0;
|
||||
Attributes[GameAttribute.Invulnerable] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,24 +29,24 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
: base(world, sno, tags)
|
||||
{
|
||||
// Override minimap icon in markerset tags
|
||||
this.WalkSpeed = 0;
|
||||
this.Brain = new MonsterBrain(this);
|
||||
this.Attributes[GameAttribute.MinimapActive] = true;
|
||||
WalkSpeed = 0;
|
||||
Brain = new MonsterBrain(this);
|
||||
Attributes[GameAttribute.MinimapActive] = true;
|
||||
//this.Attributes[GameAttribute.MinimapIconOverride] = 123152;
|
||||
this.Attributes[GameAttribute.Hitpoints_Max] *= 3f;
|
||||
this.Attributes[GameAttribute.Hitpoints_Cur] = this.Attributes[GameAttribute.Hitpoints_Max_Total];
|
||||
Attributes[GameAttribute.Hitpoints_Max] *= 3f;
|
||||
Attributes[GameAttribute.Hitpoints_Cur] = Attributes[GameAttribute.Hitpoints_Max_Total];
|
||||
//this.Attributes[GameAttribute.Immune_To_Charm] = true;
|
||||
this.Attributes[GameAttribute.Damage_Weapon_Min, 0] = 0f;
|
||||
this.Attributes[GameAttribute.Damage_Weapon_Delta, 0] = 0f;
|
||||
Attributes[GameAttribute.Damage_Weapon_Min, 0] = 0f;
|
||||
Attributes[GameAttribute.Damage_Weapon_Delta, 0] = 0f;
|
||||
//(this.Brain as MonsterBrain).AddPresetPower(54055); //TreasureGoblinPause
|
||||
(this.Brain as MonsterBrain).AddPresetPower(105371); //TreasureGoblin_Escape
|
||||
(Brain as MonsterBrain).AddPresetPower(105371); //TreasureGoblin_Escape
|
||||
}
|
||||
|
||||
public override bool Reveal(Player player)
|
||||
{
|
||||
if (this.World.SNO == WorldSno.a1dun_spidercave_01 || this.World.SNO == WorldSno.trout_oldtistram_cellar_3)
|
||||
if (World.SNO == WorldSno.a1dun_spidercave_01 || World.SNO == WorldSno.trout_oldtistram_cellar_3)
|
||||
{
|
||||
this.Destroy();
|
||||
Destroy();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -22,10 +22,10 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
: base(world, sno, tags)
|
||||
{
|
||||
this.playerIndex = playerIndex;
|
||||
this.Attributes[GameAttribute.MinimapActive] = true;
|
||||
this.Attributes[GameAttribute.Headstone_Player_ANN] = 1;
|
||||
this.Attributes[GameAttribute.TeamID] = 1;
|
||||
if (this.World.Game.PvP) this.Attributes[GameAttribute.Disabled] = true;
|
||||
Attributes[GameAttribute.MinimapActive] = true;
|
||||
Attributes[GameAttribute.Headstone_Player_ANN] = 1;
|
||||
Attributes[GameAttribute.TeamID] = 1;
|
||||
if (World.Game.PvP) Attributes[GameAttribute.Disabled] = true;
|
||||
}
|
||||
|
||||
|
||||
@ -39,8 +39,8 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
public override void OnTargeted(PlayerSystem.Player player, TargetMessage message)
|
||||
{
|
||||
base.OnTargeted(player, message);
|
||||
if (this.playerIndex > -1)
|
||||
this.GetPlayersInRange(100f).Where(p => p.PlayerIndex == this.playerIndex).First().Resurrect();
|
||||
if (playerIndex > -1)
|
||||
GetPlayersInRange(100f).Where(p => p.PlayerIndex == playerIndex).First().Resurrect();
|
||||
//this.Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,8 +23,8 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
public Healer(World world, ActorSno sno, TagMap tags)
|
||||
: base(world, sno, tags)
|
||||
{
|
||||
this.Attributes[GameAttribute.TeamID] = 0;
|
||||
this.Attributes[GameAttribute.MinimapActive] = true;
|
||||
Attributes[GameAttribute.TeamID] = 0;
|
||||
Attributes[GameAttribute.MinimapActive] = true;
|
||||
}
|
||||
|
||||
public override void OnTargeted(PlayerSystem.Player player, TargetMessage message)
|
||||
|
||||
@ -34,9 +34,9 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
{
|
||||
//Logger.Warn("Healthwell has no function, Powers not implemented");
|
||||
|
||||
this.Attributes[GameAttribute.Gizmo_Has_Been_Operated] = true;
|
||||
Attributes[GameAttribute.Gizmo_Has_Been_Operated] = true;
|
||||
//this.Attributes[GameAttribute.Gizmo_Operator_ACDID] = unchecked((int)player.DynamicID);
|
||||
this.Attributes[GameAttribute.Gizmo_State] = 1;
|
||||
Attributes[GameAttribute.Gizmo_State] = 1;
|
||||
Attributes.BroadcastChangedIfRevealed();
|
||||
player.AddPercentageHP(50);
|
||||
player.AddAchievementCounter(74987243307169, 1);
|
||||
@ -47,7 +47,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
player.InGameClient.SendMessage(new MessageSystem.Message.Definitions.Map.MapMarkerInfoMessage()
|
||||
{
|
||||
HashedName = DiIiS_NA.Core.Helpers.Hash.StringHashHelper.HashItemName("x1_OpenWorld_LootRunObelisk_B"),
|
||||
Place = new MessageSystem.Message.Fields.WorldPlace { Position = this.Position, WorldID = this.World.GlobalID },
|
||||
Place = new MessageSystem.Message.Fields.WorldPlace { Position = Position, WorldID = World.GlobalID },
|
||||
ImageInfo = 218234,
|
||||
Label = -1,
|
||||
snoStringList = -1,
|
||||
|
||||
@ -35,38 +35,38 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
public HearthPortal(World world, ActorSno sno, TagMap tags)
|
||||
: base(world, sno, tags)
|
||||
{
|
||||
this.Attributes[GameAttribute.MinimapActive] = true;
|
||||
this.SetVisible(false);
|
||||
Attributes[GameAttribute.MinimapActive] = true;
|
||||
SetVisible(false);
|
||||
}
|
||||
|
||||
public override void OnTargeted(Player player, TargetMessage message)
|
||||
{
|
||||
Logger.Trace("(OnTargeted) HearthPortal has been activated ");
|
||||
|
||||
var world = this.World.Game.GetWorld(this.ReturnWorld);
|
||||
var world = World.Game.GetWorld(ReturnWorld);
|
||||
|
||||
if (world == null)
|
||||
{
|
||||
Logger.Warn("HearthPortal's world does not exist (WorldSNO = {0})", this.ReturnWorld);
|
||||
Logger.Warn("HearthPortal's world does not exist (WorldSNO = {0})", ReturnWorld);
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.World.Game.QuestManager.SideQuests.ContainsKey(120396) && this.World.Game.QuestManager.SideQuests[120396].Completed && this.ReturnWorld == WorldSno.a2dun_zolt_timed01_level01) return;
|
||||
if (World.Game.QuestManager.SideQuests.ContainsKey(120396) && World.Game.QuestManager.SideQuests[120396].Completed && ReturnWorld == WorldSno.a2dun_zolt_timed01_level01) return;
|
||||
|
||||
Vector3D exCheckpoint = player.CheckPointPosition;
|
||||
|
||||
if (world == this.World)
|
||||
if (world == World)
|
||||
player.Teleport(ReturnPosition);
|
||||
else
|
||||
player.ChangeWorld(world, ReturnPosition);
|
||||
|
||||
player.CheckPointPosition = exCheckpoint;
|
||||
this.SetVisible(false);
|
||||
SetVisible(false);
|
||||
}
|
||||
|
||||
public override bool Reveal(Player player)
|
||||
{
|
||||
if (player != this.Owner) return false;
|
||||
if (player != Owner) return false;
|
||||
return base.Reveal(player);
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
public HiddenVendor(World world, ActorSno sno, TagMap tags)
|
||||
: base(world, sno, tags)
|
||||
{
|
||||
this.Enabled = (FastRandom.Instance.Next(100) < 40);
|
||||
Enabled = (FastRandom.Instance.Next(100) < 40);
|
||||
}
|
||||
|
||||
protected override List<Item> GetVendorItems()
|
||||
@ -62,7 +62,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
|
||||
for (int i = 0; i < 9; i++)
|
||||
{
|
||||
var itm = ItemGenerator.GenerateRandomEquip(this, this.level, 6, 7);
|
||||
var itm = ItemGenerator.GenerateRandomEquip(this, level, 6, 7);
|
||||
itm.Attributes[GameAttribute.Item_Cost_Percent_Bonus] = 3f;
|
||||
list.Add(itm);
|
||||
}
|
||||
@ -72,7 +72,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
|
||||
public override bool Reveal(PlayerSystem.Player player)
|
||||
{
|
||||
if (!this.Enabled) return false;
|
||||
if (!Enabled) return false;
|
||||
return base.Reveal(player);
|
||||
}
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
proxySNO = ActorSno._hireling_enchantress_proxy;
|
||||
skillKit = 484938;
|
||||
hirelingGBID = StringHashHelper.HashItemName("Enchantress");
|
||||
this.Attributes[GameAttribute.Hireling_Class] = 3;
|
||||
Attributes[GameAttribute.Hireling_Class] = 3;
|
||||
}
|
||||
|
||||
public override Hireling CreateHireling(MapSystem.World world, ActorSno sno, TagMap tags)
|
||||
@ -41,9 +41,9 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
case 102057:
|
||||
case 101969:
|
||||
player.HirelingInfo[3].Skill1SNOId = SkillSNOId;
|
||||
this.Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
this.Attributes[GameAttribute.Skill, (SkillSNOId == 102057 ? 101969 : 102057)] = 0;
|
||||
this.Attributes.BroadcastChangedIfRevealed();
|
||||
Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
Attributes[GameAttribute.Skill, (SkillSNOId == 102057 ? 101969 : 102057)] = 0;
|
||||
Attributes.BroadcastChangedIfRevealed();
|
||||
|
||||
dbhireling.Skill1SNOId = SkillSNOId;
|
||||
player.World.Game.GameDBSession.SessionUpdate(dbhireling);
|
||||
@ -51,9 +51,9 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
case 102133:
|
||||
case 101461:
|
||||
player.HirelingInfo[3].Skill2SNOId = SkillSNOId;
|
||||
this.Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
this.Attributes[GameAttribute.Skill, (SkillSNOId == 102133 ? 101461 : 102133)] = 0;
|
||||
this.Attributes.BroadcastChangedIfRevealed();
|
||||
Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
Attributes[GameAttribute.Skill, (SkillSNOId == 102133 ? 101461 : 102133)] = 0;
|
||||
Attributes.BroadcastChangedIfRevealed();
|
||||
|
||||
dbhireling.Skill2SNOId = SkillSNOId;
|
||||
player.World.Game.GameDBSession.SessionUpdate(dbhireling);
|
||||
@ -61,9 +61,9 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
case 101990:
|
||||
case 220872:
|
||||
player.HirelingInfo[3].Skill3SNOId = SkillSNOId;
|
||||
this.Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
this.Attributes[GameAttribute.Skill, (SkillSNOId == 101990 ? 220872 : 101990)] = 0;
|
||||
this.Attributes.BroadcastChangedIfRevealed();
|
||||
Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
Attributes[GameAttribute.Skill, (SkillSNOId == 101990 ? 220872 : 101990)] = 0;
|
||||
Attributes.BroadcastChangedIfRevealed();
|
||||
|
||||
dbhireling.Skill3SNOId = SkillSNOId;
|
||||
player.World.Game.GameDBSession.SessionUpdate(dbhireling);
|
||||
@ -71,9 +71,9 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
case 101425:
|
||||
case 201524:
|
||||
player.HirelingInfo[3].Skill4SNOId = SkillSNOId;
|
||||
this.Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
this.Attributes[GameAttribute.Skill, (SkillSNOId == 101425 ? 201524 : 101425)] = 0;
|
||||
this.Attributes.BroadcastChangedIfRevealed();
|
||||
Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
Attributes[GameAttribute.Skill, (SkillSNOId == 101425 ? 201524 : 101425)] = 0;
|
||||
Attributes.BroadcastChangedIfRevealed();
|
||||
|
||||
dbhireling.Skill4SNOId = SkillSNOId;
|
||||
player.World.Game.GameDBSession.SessionUpdate(dbhireling);
|
||||
@ -97,15 +97,15 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
player.HirelingInfo[3].Skill3SNOId = -1;
|
||||
player.HirelingInfo[3].Skill4SNOId = -1;
|
||||
|
||||
this.Attributes[GameAttribute.Skill, 102057] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 101969] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 102133] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 101461] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 101990] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 220872] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 101425] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 201524] = 0;
|
||||
this.Attributes.SendChangedMessage(player.InGameClient);
|
||||
Attributes[GameAttribute.Skill, 102057] = 0;
|
||||
Attributes[GameAttribute.Skill, 101969] = 0;
|
||||
Attributes[GameAttribute.Skill, 102133] = 0;
|
||||
Attributes[GameAttribute.Skill, 101461] = 0;
|
||||
Attributes[GameAttribute.Skill, 101990] = 0;
|
||||
Attributes[GameAttribute.Skill, 220872] = 0;
|
||||
Attributes[GameAttribute.Skill, 101425] = 0;
|
||||
Attributes[GameAttribute.Skill, 201524] = 0;
|
||||
Attributes.SendChangedMessage(player.InGameClient);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -54,33 +54,33 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
|
||||
public bool IsProxy { get { return SNO == proxySNO; } }
|
||||
public bool IsHireling { get { return SNO == hirelingSNO; } }
|
||||
public bool HasHireling { get { return this.hirelingSNO != ActorSno.__NONE; } }
|
||||
public bool HasProxy { get { return this.proxySNO != ActorSno.__NONE; } }
|
||||
public bool HasHireling { get { return hirelingSNO != ActorSno.__NONE; } }
|
||||
public bool HasProxy { get { return proxySNO != ActorSno.__NONE; } }
|
||||
public int PetType { get { return IsProxy ? 22 : 0; } }
|
||||
private Dictionary<Player, Dictionary<int, Item>> _equipment = new Dictionary<Player, Dictionary<int, Item>>();
|
||||
|
||||
public Hireling(MapSystem.World world, ActorSno sno, TagMap tags)
|
||||
: base(world, sno, tags)
|
||||
{
|
||||
this.Attributes[GameAttribute.TeamID] = 2;
|
||||
Attributes[GameAttribute.TeamID] = 2;
|
||||
Interactions.Add(new HireInteraction());
|
||||
Interactions.Add(new InventoryInteraction());
|
||||
if (skillKit != -1)
|
||||
this.Attributes[GameAttribute.SkillKit] = skillKit;
|
||||
Attributes[GameAttribute.SkillKit] = skillKit;
|
||||
}
|
||||
|
||||
public void SetUpAttributes(Player player)
|
||||
{
|
||||
this.owner = player;
|
||||
owner = player;
|
||||
|
||||
var info = player.HirelingInfo[this.Attributes[GameAttribute.Hireling_Class]];
|
||||
var info = player.HirelingInfo[Attributes[GameAttribute.Hireling_Class]];
|
||||
//*
|
||||
// TODO: fix this hardcoded crap
|
||||
if (!IsProxy)
|
||||
this.Attributes[GameAttribute.Buff_Visual_Effect, 0x000FFFFF] = true;
|
||||
Attributes[GameAttribute.Buff_Visual_Effect, 0x000FFFFF] = true;
|
||||
|
||||
this.Attributes[GameAttribute.Level] = player.Level;
|
||||
this.Attributes[GameAttribute.Experience_Next_Lo] = 0;
|
||||
Attributes[GameAttribute.Level] = player.Level;
|
||||
Attributes[GameAttribute.Experience_Next_Lo] = 0;
|
||||
|
||||
if (!IsHireling && !IsProxy) // original doesn't need more attribs
|
||||
return;
|
||||
@ -88,70 +88,70 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
if (info.Skill1SNOId != -1)
|
||||
{
|
||||
//scripted //this.Attributes[GameAttribute.Skill_Total, info.Skill1SNOId] = 1;
|
||||
this.Attributes[GameAttribute.Skill, info.Skill1SNOId] = 1;
|
||||
Attributes[GameAttribute.Skill, info.Skill1SNOId] = 1;
|
||||
}
|
||||
|
||||
if (info.Skill2SNOId != -1)
|
||||
{
|
||||
//scripted //this.Attributes[GameAttribute.Skill_Total, info.Skill2SNOId] = 1;
|
||||
this.Attributes[GameAttribute.Skill, info.Skill2SNOId] = 1;
|
||||
Attributes[GameAttribute.Skill, info.Skill2SNOId] = 1;
|
||||
}
|
||||
|
||||
if (info.Skill3SNOId != -1)
|
||||
{
|
||||
//scripted //this.Attributes[GameAttribute.Skill_Total, info.Skill3SNOId] = 1;
|
||||
this.Attributes[GameAttribute.Skill, info.Skill3SNOId] = 1;
|
||||
Attributes[GameAttribute.Skill, info.Skill3SNOId] = 1;
|
||||
}
|
||||
|
||||
if (info.Skill4SNOId != -1)
|
||||
{
|
||||
//scripted //this.Attributes[GameAttribute.Skill_Total, info.Skill4SNOId] = 1;
|
||||
this.Attributes[GameAttribute.Skill, info.Skill4SNOId] = 1;
|
||||
Attributes[GameAttribute.Skill, info.Skill4SNOId] = 1;
|
||||
}
|
||||
|
||||
/**/
|
||||
this._lastResourceUpdateTick = 0;
|
||||
this.Attributes[GameAttribute.SkillKit] = skillKit;
|
||||
this.WalkSpeed = 0.45f;
|
||||
_lastResourceUpdateTick = 0;
|
||||
Attributes[GameAttribute.SkillKit] = skillKit;
|
||||
WalkSpeed = 0.45f;
|
||||
|
||||
#region hardcoded attribs :/
|
||||
//*
|
||||
this.Attributes[GameAttribute.Attacks_Per_Second] = 1f;
|
||||
this.Attributes[GameAttribute.Attacks_Per_Second_Item] = 1.199219f;
|
||||
this.Attributes[GameAttribute.Casting_Speed] = 1;
|
||||
this.Attributes[GameAttribute.Damage_Delta, 0] = 1f;
|
||||
this.Attributes[GameAttribute.Damage_Min, 0] = 1f;
|
||||
this.Attributes[GameAttribute.Damage_Weapon_Delta, 0] = 2f;
|
||||
this.Attributes[GameAttribute.Damage_Weapon_Min, 0] = 6f;
|
||||
this.Attributes[GameAttribute.General_Cooldown] = 0;
|
||||
this.Attributes[GameAttribute.Hit_Chance] = 1;
|
||||
this.Attributes[GameAttribute.Hitpoints_Factor_Vitality] = 10f + Math.Max(this.Attributes[GameAttribute.Level] - 35, 0);
|
||||
this.Attributes[GameAttribute.Hitpoints_Max] = 276f;
|
||||
this.Attributes[GameAttribute.Hitpoints_Cur] = 1f;
|
||||
this.Attributes[GameAttribute.Level_Cap] = 70;
|
||||
this.Attributes[GameAttribute.Movement_Scalar] = 1;
|
||||
this.Attributes[GameAttribute.Resource_Max, 0] = 1.0f;
|
||||
this.Attributes[GameAttribute.Resource_Cur, 0] = 1.0f;
|
||||
this.Attributes[GameAttribute.Resource_Type_Primary] = 0;
|
||||
this.Attributes[GameAttribute.Running_Rate] = 0.3598633f;
|
||||
this.Attributes[GameAttribute.Sprinting_Rate] = 0.3598633f;
|
||||
this.Attributes[GameAttribute.Strafing_Rate] = 0.1799316f;
|
||||
this.Attributes[GameAttribute.Walking_Rate] = 0.3598633f;
|
||||
Attributes[GameAttribute.Attacks_Per_Second] = 1f;
|
||||
Attributes[GameAttribute.Attacks_Per_Second_Item] = 1.199219f;
|
||||
Attributes[GameAttribute.Casting_Speed] = 1;
|
||||
Attributes[GameAttribute.Damage_Delta, 0] = 1f;
|
||||
Attributes[GameAttribute.Damage_Min, 0] = 1f;
|
||||
Attributes[GameAttribute.Damage_Weapon_Delta, 0] = 2f;
|
||||
Attributes[GameAttribute.Damage_Weapon_Min, 0] = 6f;
|
||||
Attributes[GameAttribute.General_Cooldown] = 0;
|
||||
Attributes[GameAttribute.Hit_Chance] = 1;
|
||||
Attributes[GameAttribute.Hitpoints_Factor_Vitality] = 10f + Math.Max(Attributes[GameAttribute.Level] - 35, 0);
|
||||
Attributes[GameAttribute.Hitpoints_Max] = 276f;
|
||||
Attributes[GameAttribute.Hitpoints_Cur] = 1f;
|
||||
Attributes[GameAttribute.Level_Cap] = 70;
|
||||
Attributes[GameAttribute.Movement_Scalar] = 1;
|
||||
Attributes[GameAttribute.Resource_Max, 0] = 1.0f;
|
||||
Attributes[GameAttribute.Resource_Cur, 0] = 1.0f;
|
||||
Attributes[GameAttribute.Resource_Type_Primary] = 0;
|
||||
Attributes[GameAttribute.Running_Rate] = 0.3598633f;
|
||||
Attributes[GameAttribute.Sprinting_Rate] = 0.3598633f;
|
||||
Attributes[GameAttribute.Strafing_Rate] = 0.1799316f;
|
||||
Attributes[GameAttribute.Walking_Rate] = 0.3598633f;
|
||||
|
||||
if (IsProxy)
|
||||
return;
|
||||
|
||||
this.Attributes[GameAttribute.Callout_Cooldown, 0x000FFFFF] = 0x00000797;
|
||||
this.Attributes[GameAttribute.Buff_Visual_Effect, 0x000FFFFF] = true;
|
||||
this.Attributes[GameAttribute.Buff_Icon_Count0, 0x000075C1] = 1;
|
||||
this.Attributes[GameAttribute.Buff_Exclusive_Type_Active, 0x000075C1] = true;
|
||||
this.Attributes[GameAttribute.Conversation_Icon, 0] = 1;
|
||||
this.Attributes[GameAttribute.Buff_Exclusive_Type_Active, 0x20c51] = true;
|
||||
this.Attributes[GameAttribute.Buff_Icon_End_Tick0, 0x00020C51] = 0x00000A75;
|
||||
this.Attributes[GameAttribute.Buff_Icon_Start_Tick0, 0x00020C51] = 0x00000375;
|
||||
this.Attributes[GameAttribute.Buff_Icon_Count0, 0x00020C51] = 3;
|
||||
this.Attributes[GameAttribute.Callout_Cooldown, 0x1618a] = 743;
|
||||
this.Attributes[GameAttribute.Callout_Cooldown, 0x01CAB6] = 743;
|
||||
Attributes[GameAttribute.Callout_Cooldown, 0x000FFFFF] = 0x00000797;
|
||||
Attributes[GameAttribute.Buff_Visual_Effect, 0x000FFFFF] = true;
|
||||
Attributes[GameAttribute.Buff_Icon_Count0, 0x000075C1] = 1;
|
||||
Attributes[GameAttribute.Buff_Exclusive_Type_Active, 0x000075C1] = true;
|
||||
Attributes[GameAttribute.Conversation_Icon, 0] = 1;
|
||||
Attributes[GameAttribute.Buff_Exclusive_Type_Active, 0x20c51] = true;
|
||||
Attributes[GameAttribute.Buff_Icon_End_Tick0, 0x00020C51] = 0x00000A75;
|
||||
Attributes[GameAttribute.Buff_Icon_Start_Tick0, 0x00020C51] = 0x00000375;
|
||||
Attributes[GameAttribute.Buff_Icon_Count0, 0x00020C51] = 3;
|
||||
Attributes[GameAttribute.Callout_Cooldown, 0x1618a] = 743;
|
||||
Attributes[GameAttribute.Callout_Cooldown, 0x01CAB6] = 743;
|
||||
//*/
|
||||
#endregion
|
||||
|
||||
@ -164,69 +164,69 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
|
||||
public void UpdateAttributes()
|
||||
{
|
||||
if (!this.IsHireling || this.owner == null)
|
||||
if (!IsHireling || owner == null)
|
||||
return;
|
||||
//*
|
||||
try
|
||||
{
|
||||
this.Attributes[GameAttribute.Vitality] = 5f + (this.Attributes[GameAttribute.Level] * 2) + (this.GetItemBonus(GameAttribute.Vitality_Item));// * 2.5f);
|
||||
this.Attributes[GameAttribute.Strength] = 5f + (this.Attributes[GameAttribute.Level] * (this is Templar ? 3 : 1)) + (this.GetItemBonus(GameAttribute.Strength_Item));// * 2.5f);
|
||||
this.Attributes[GameAttribute.Dexterity] = 5f + (this.Attributes[GameAttribute.Level] * (this is Scoundrel ? 3 : 1)) + (this.GetItemBonus(GameAttribute.Dexterity_Item));// * 2.5f);
|
||||
this.Attributes[GameAttribute.Intelligence] = 5f + (this.Attributes[GameAttribute.Level] * (this is Enchantress ? 3 : 1)) + (this.GetItemBonus(GameAttribute.Intelligence_Item));// * 2.5f);
|
||||
Attributes[GameAttribute.Vitality] = 5f + (Attributes[GameAttribute.Level] * 2) + (GetItemBonus(GameAttribute.Vitality_Item));// * 2.5f);
|
||||
Attributes[GameAttribute.Strength] = 5f + (Attributes[GameAttribute.Level] * (this is Templar ? 3 : 1)) + (GetItemBonus(GameAttribute.Strength_Item));// * 2.5f);
|
||||
Attributes[GameAttribute.Dexterity] = 5f + (Attributes[GameAttribute.Level] * (this is Scoundrel ? 3 : 1)) + (GetItemBonus(GameAttribute.Dexterity_Item));// * 2.5f);
|
||||
Attributes[GameAttribute.Intelligence] = 5f + (Attributes[GameAttribute.Level] * (this is Enchantress ? 3 : 1)) + (GetItemBonus(GameAttribute.Intelligence_Item));// * 2.5f);
|
||||
|
||||
this.Attributes[GameAttribute.Attacks_Per_Second_Item] = this.GetItemBonus(GameAttribute.Attacks_Per_Second_Item);
|
||||
Attributes[GameAttribute.Attacks_Per_Second_Item] = GetItemBonus(GameAttribute.Attacks_Per_Second_Item);
|
||||
//*
|
||||
this.Attributes[GameAttribute.Crit_Percent_Bonus_Capped] = this.GetItemBonus(GameAttribute.Crit_Percent_Bonus_Capped);
|
||||
this.Attributes[GameAttribute.Weapon_Crit_Chance] = this.GetItemBonus(GameAttribute.Weapon_Crit_Chance);
|
||||
this.Attributes[GameAttribute.Crit_Damage_Percent] = 0.5f + this.GetItemBonus(GameAttribute.Crit_Damage_Percent);
|
||||
this.Attributes[GameAttribute.Crit_Percent_Bonus_Uncapped] = this.GetItemBonus(GameAttribute.Crit_Percent_Bonus_Uncapped);
|
||||
Attributes[GameAttribute.Crit_Percent_Bonus_Capped] = GetItemBonus(GameAttribute.Crit_Percent_Bonus_Capped);
|
||||
Attributes[GameAttribute.Weapon_Crit_Chance] = GetItemBonus(GameAttribute.Weapon_Crit_Chance);
|
||||
Attributes[GameAttribute.Crit_Damage_Percent] = 0.5f + GetItemBonus(GameAttribute.Crit_Damage_Percent);
|
||||
Attributes[GameAttribute.Crit_Percent_Bonus_Uncapped] = GetItemBonus(GameAttribute.Crit_Percent_Bonus_Uncapped);
|
||||
|
||||
this.Attributes[GameAttribute.Armor_Item] = this.GetItemBonus(GameAttribute.Armor_Item);
|
||||
Attributes[GameAttribute.Armor_Item] = GetItemBonus(GameAttribute.Armor_Item);
|
||||
//*
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
this.Attributes[GameAttribute.Damage_Weapon_Min, i] = Math.Max(this.GetItemBonus(GameAttribute.Damage_Weapon_Min, i), 2f) + this.GetItemBonus(GameAttribute.Damage_Min, i);
|
||||
this.Attributes[GameAttribute.Damage_Weapon_Delta, i] = Math.Max(this.GetItemBonus(GameAttribute.Damage_Weapon_Delta_Total, i), 2f) + this.GetItemBonus(GameAttribute.Damage_Delta, i);
|
||||
this.Attributes[GameAttribute.Damage_Weapon_Bonus_Min, i] = this.GetItemBonus(GameAttribute.Damage_Weapon_Bonus_Min, i);
|
||||
this.Attributes[GameAttribute.Damage_Weapon_Bonus_Delta, i] = this.GetItemBonus(GameAttribute.Damage_Weapon_Bonus_Delta, i);
|
||||
this.Attributes[GameAttribute.Resistance, i] = this.GetItemBonus(GameAttribute.Resistance, i);
|
||||
Attributes[GameAttribute.Damage_Weapon_Min, i] = Math.Max(GetItemBonus(GameAttribute.Damage_Weapon_Min, i), 2f) + GetItemBonus(GameAttribute.Damage_Min, i);
|
||||
Attributes[GameAttribute.Damage_Weapon_Delta, i] = Math.Max(GetItemBonus(GameAttribute.Damage_Weapon_Delta_Total, i), 2f) + GetItemBonus(GameAttribute.Damage_Delta, i);
|
||||
Attributes[GameAttribute.Damage_Weapon_Bonus_Min, i] = GetItemBonus(GameAttribute.Damage_Weapon_Bonus_Min, i);
|
||||
Attributes[GameAttribute.Damage_Weapon_Bonus_Delta, i] = GetItemBonus(GameAttribute.Damage_Weapon_Bonus_Delta, i);
|
||||
Attributes[GameAttribute.Resistance, i] = GetItemBonus(GameAttribute.Resistance, i);
|
||||
}
|
||||
//*/
|
||||
this.Attributes[GameAttribute.Resistance_All] = this.GetItemBonus(GameAttribute.Resistance_All);
|
||||
this.Attributes[GameAttribute.Resistance_Percent_All] = this.GetItemBonus(GameAttribute.Resistance_Percent_All);
|
||||
this.Attributes[GameAttribute.Damage_Percent_Reduction_From_Melee] = this.GetItemBonus(GameAttribute.Damage_Percent_Reduction_From_Melee);
|
||||
this.Attributes[GameAttribute.Damage_Percent_Reduction_From_Ranged] = this.GetItemBonus(GameAttribute.Damage_Percent_Reduction_From_Ranged);
|
||||
Attributes[GameAttribute.Resistance_All] = GetItemBonus(GameAttribute.Resistance_All);
|
||||
Attributes[GameAttribute.Resistance_Percent_All] = GetItemBonus(GameAttribute.Resistance_Percent_All);
|
||||
Attributes[GameAttribute.Damage_Percent_Reduction_From_Melee] = GetItemBonus(GameAttribute.Damage_Percent_Reduction_From_Melee);
|
||||
Attributes[GameAttribute.Damage_Percent_Reduction_From_Ranged] = GetItemBonus(GameAttribute.Damage_Percent_Reduction_From_Ranged);
|
||||
|
||||
this.Attributes[GameAttribute.Thorns_Fixed] = this.GetItemBonus(GameAttribute.Thorns_Fixed, 0);
|
||||
Attributes[GameAttribute.Thorns_Fixed] = GetItemBonus(GameAttribute.Thorns_Fixed, 0);
|
||||
|
||||
this.Attributes[GameAttribute.Steal_Health_Percent] = this.GetItemBonus(GameAttribute.Steal_Health_Percent);
|
||||
this.Attributes[GameAttribute.Hitpoints_On_Hit] = this.GetItemBonus(GameAttribute.Hitpoints_On_Hit);
|
||||
this.Attributes[GameAttribute.Hitpoints_On_Kill] = this.GetItemBonus(GameAttribute.Hitpoints_On_Kill);
|
||||
Attributes[GameAttribute.Steal_Health_Percent] = GetItemBonus(GameAttribute.Steal_Health_Percent);
|
||||
Attributes[GameAttribute.Hitpoints_On_Hit] = GetItemBonus(GameAttribute.Hitpoints_On_Hit);
|
||||
Attributes[GameAttribute.Hitpoints_On_Kill] = GetItemBonus(GameAttribute.Hitpoints_On_Kill);
|
||||
|
||||
this.Attributes[GameAttribute.Magic_Find] = this.GetItemBonus(GameAttribute.Magic_Find);
|
||||
this.Attributes[GameAttribute.Gold_Find] = this.GetItemBonus(GameAttribute.Gold_Find);
|
||||
Attributes[GameAttribute.Magic_Find] = GetItemBonus(GameAttribute.Magic_Find);
|
||||
Attributes[GameAttribute.Gold_Find] = GetItemBonus(GameAttribute.Gold_Find);
|
||||
|
||||
this.Attributes[GameAttribute.Dodge_Chance_Bonus] = this.GetItemBonus(GameAttribute.Dodge_Chance_Bonus);
|
||||
Attributes[GameAttribute.Dodge_Chance_Bonus] = GetItemBonus(GameAttribute.Dodge_Chance_Bonus);
|
||||
|
||||
this.Attributes[GameAttribute.Block_Amount_Item_Min] = this.GetItemBonus(GameAttribute.Block_Amount_Item_Min);
|
||||
this.Attributes[GameAttribute.Block_Amount_Item_Delta] = this.GetItemBonus(GameAttribute.Block_Amount_Item_Delta);
|
||||
this.Attributes[GameAttribute.Block_Amount_Bonus_Percent] = this.GetItemBonus(GameAttribute.Block_Amount_Bonus_Percent);
|
||||
this.Attributes[GameAttribute.Block_Chance] = this.GetItemBonus(GameAttribute.Block_Chance_Item_Total);
|
||||
Attributes[GameAttribute.Block_Amount_Item_Min] = GetItemBonus(GameAttribute.Block_Amount_Item_Min);
|
||||
Attributes[GameAttribute.Block_Amount_Item_Delta] = GetItemBonus(GameAttribute.Block_Amount_Item_Delta);
|
||||
Attributes[GameAttribute.Block_Amount_Bonus_Percent] = GetItemBonus(GameAttribute.Block_Amount_Bonus_Percent);
|
||||
Attributes[GameAttribute.Block_Chance] = GetItemBonus(GameAttribute.Block_Chance_Item_Total);
|
||||
//*/
|
||||
this.Attributes[GameAttribute.Hitpoints_Max_Percent_Bonus_Item] = this.GetItemBonus(GameAttribute.Hitpoints_Max_Percent_Bonus_Item);
|
||||
this.Attributes[GameAttribute.Hitpoints_Max_Bonus] = this.GetItemBonus(GameAttribute.Hitpoints_Max_Bonus);
|
||||
this.Attributes[GameAttribute.Hitpoints_Factor_Vitality] = 10f + Math.Max(this.Attributes[GameAttribute.Level] - 35, 0);
|
||||
this.Attributes[GameAttribute.Hitpoints_Regen_Per_Second] = this.GetItemBonus(GameAttribute.Hitpoints_Regen_Per_Second) + 10f + (10f * this.Attributes[GameAttribute.Level]);
|
||||
Attributes[GameAttribute.Hitpoints_Max_Percent_Bonus_Item] = GetItemBonus(GameAttribute.Hitpoints_Max_Percent_Bonus_Item);
|
||||
Attributes[GameAttribute.Hitpoints_Max_Bonus] = GetItemBonus(GameAttribute.Hitpoints_Max_Bonus);
|
||||
Attributes[GameAttribute.Hitpoints_Factor_Vitality] = 10f + Math.Max(Attributes[GameAttribute.Level] - 35, 0);
|
||||
Attributes[GameAttribute.Hitpoints_Regen_Per_Second] = GetItemBonus(GameAttribute.Hitpoints_Regen_Per_Second) + 10f + (10f * Attributes[GameAttribute.Level]);
|
||||
|
||||
this.Attributes[GameAttribute.Core_Attributes_From_Item_Bonus_Multiplier] = 1;
|
||||
this.Attributes[GameAttribute.Hitpoints_Max_Percent_Bonus_Multiplicative] = 1;
|
||||
this.Attributes[GameAttribute.Hitpoints_Max] = 276f; //+ (this.Attributes[GameAttribute.Vitality] * (10f + Math.Max(this.Attributes[GameAttribute.Level] - 35, 0)));
|
||||
this.Attributes[GameAttribute.Hitpoints_Cur] = this.Attributes[GameAttribute.Hitpoints_Max_Total];
|
||||
Attributes[GameAttribute.Core_Attributes_From_Item_Bonus_Multiplier] = 1;
|
||||
Attributes[GameAttribute.Hitpoints_Max_Percent_Bonus_Multiplicative] = 1;
|
||||
Attributes[GameAttribute.Hitpoints_Max] = 276f; //+ (this.Attributes[GameAttribute.Vitality] * (10f + Math.Max(this.Attributes[GameAttribute.Level] - 35, 0)));
|
||||
Attributes[GameAttribute.Hitpoints_Cur] = Attributes[GameAttribute.Hitpoints_Max_Total];
|
||||
/**/
|
||||
}
|
||||
catch { }
|
||||
|
||||
this.Attributes.BroadcastChangedIfRevealed();
|
||||
Attributes.BroadcastChangedIfRevealed();
|
||||
/**/
|
||||
}
|
||||
|
||||
@ -235,13 +235,13 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
if (hirelingSNO == ActorSno.__NONE)
|
||||
return;
|
||||
|
||||
if (this.World.Game.Players.Count > 1) return;
|
||||
if (World.Game.Players.Count > 1) return;
|
||||
|
||||
if (IsHireling || IsProxy)
|
||||
return; // This really shouldn't happen.. /fasbat
|
||||
|
||||
this.Unreveal(player);
|
||||
var hireling = CreateHireling(this.World, hirelingSNO, this.Tags);
|
||||
Unreveal(player);
|
||||
var hireling = CreateHireling(World, hirelingSNO, Tags);
|
||||
hireling.SetUpAttributes(player);
|
||||
hireling.GBHandle.Type = 4;
|
||||
hireling.GBHandle.GBID = hirelingGBID;
|
||||
@ -252,11 +252,11 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
hireling.Attributes[GameAttribute.Untargetable] = false;
|
||||
hireling.Attributes[GameAttribute.NPC_Is_Escorting] = true;
|
||||
|
||||
hireling.RotationW = this.RotationW;
|
||||
hireling.RotationAxis = this.RotationAxis;
|
||||
hireling.RotationW = RotationW;
|
||||
hireling.RotationAxis = RotationAxis;
|
||||
|
||||
//hireling.Brain.DeActivate();
|
||||
hireling.EnterWorld(this.Position);
|
||||
hireling.EnterWorld(Position);
|
||||
hireling.Brain = new HirelingBrain(hireling, player);
|
||||
//(hireling.Brain as HirelingBrain).Activate();
|
||||
player.ActiveHireling = hireling;
|
||||
@ -281,10 +281,10 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
if (IsHireling || IsProxy)
|
||||
return;
|
||||
|
||||
if (player.ActiveHireling.Attributes[GameAttribute.Hireling_Class] == this.Attributes[GameAttribute.Hireling_Class])
|
||||
if (player.ActiveHireling.Attributes[GameAttribute.Hireling_Class] == Attributes[GameAttribute.Hireling_Class])
|
||||
return;
|
||||
|
||||
var hireling = CreateHireling(this.World, proxySNO, this.Tags);
|
||||
var hireling = CreateHireling(World, proxySNO, Tags);
|
||||
hireling.SetUpAttributes(player);
|
||||
hireling.GBHandle.Type = 4;
|
||||
hireling.GBHandle.GBID = hirelingGBID;
|
||||
@ -297,48 +297,48 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
hireling.Attributes[GameAttribute.Pet_Type] = 1;
|
||||
hireling.Attributes[GameAttribute.Pet_Owner] = player.PlayerIndex + 1;
|
||||
|
||||
hireling.RotationW = this.RotationW;
|
||||
hireling.RotationAxis = this.RotationAxis;
|
||||
hireling.RotationW = RotationW;
|
||||
hireling.RotationAxis = RotationAxis;
|
||||
|
||||
hireling.EnterWorld(this.Position);
|
||||
hireling.EnterWorld(Position);
|
||||
}
|
||||
|
||||
public void Dismiss()
|
||||
{
|
||||
this.Destroy();
|
||||
Destroy();
|
||||
}
|
||||
|
||||
public void Update(int tickCounter)
|
||||
{
|
||||
if (this.Brain == null)
|
||||
if (Brain == null)
|
||||
return;
|
||||
|
||||
if (!this.Dead)
|
||||
this.Brain.Update(tickCounter);
|
||||
if (!Dead)
|
||||
Brain.Update(tickCounter);
|
||||
|
||||
if (this.World.Game.TickCounter % 30 == 0 && !this.Dead)
|
||||
if (World.Game.TickCounter % 30 == 0 && !Dead)
|
||||
{
|
||||
float tickSeconds = 1f / 60f * (this.World.Game.TickCounter - _lastResourceUpdateTick);
|
||||
_lastResourceUpdateTick = this.World.Game.TickCounter;
|
||||
float quantity = tickSeconds * this.Attributes[GameAttribute.Hitpoints_Regen_Per_Second];
|
||||
float tickSeconds = 1f / 60f * (World.Game.TickCounter - _lastResourceUpdateTick);
|
||||
_lastResourceUpdateTick = World.Game.TickCounter;
|
||||
float quantity = tickSeconds * Attributes[GameAttribute.Hitpoints_Regen_Per_Second];
|
||||
|
||||
this.AddHP(quantity);
|
||||
AddHP(quantity);
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddHP(float quantity, bool GuidingLight = false)
|
||||
{
|
||||
if (this.Dead) return;
|
||||
if (Dead) return;
|
||||
if (quantity == 0) return;
|
||||
if (quantity > 0)
|
||||
{
|
||||
if (this.Attributes[GameAttribute.Hitpoints_Cur] < this.Attributes[GameAttribute.Hitpoints_Max_Total])
|
||||
if (Attributes[GameAttribute.Hitpoints_Cur] < Attributes[GameAttribute.Hitpoints_Max_Total])
|
||||
{
|
||||
this.Attributes[GameAttribute.Hitpoints_Cur] = Math.Min(
|
||||
this.Attributes[GameAttribute.Hitpoints_Cur] + quantity,
|
||||
this.Attributes[GameAttribute.Hitpoints_Max_Total]);
|
||||
Attributes[GameAttribute.Hitpoints_Cur] = Math.Min(
|
||||
Attributes[GameAttribute.Hitpoints_Cur] + quantity,
|
||||
Attributes[GameAttribute.Hitpoints_Max_Total]);
|
||||
|
||||
this.Attributes.BroadcastChangedIfRevealed();
|
||||
Attributes.BroadcastChangedIfRevealed();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -347,7 +347,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
{
|
||||
return new VisualInventoryMessage()
|
||||
{
|
||||
ActorID = this.DynamicID(player),
|
||||
ActorID = DynamicID(player),
|
||||
EquipmentList = new VisualEquipment()
|
||||
{
|
||||
Equipment = new VisualItem[]
|
||||
@ -415,13 +415,13 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
|
||||
public override bool Reveal(Player player)
|
||||
{
|
||||
if (this.World.Game.PvP)
|
||||
if (World.Game.PvP)
|
||||
return false;
|
||||
|
||||
if (this.World.Game.Players.Count > 1)
|
||||
if (World.Game.Players.Count > 1)
|
||||
return false;
|
||||
|
||||
if (!IsHireling && ((player.ActiveHireling != null && this.Attributes[GameAttribute.Hireling_Class] == player.ActiveHireling.Attributes[GameAttribute.Hireling_Class])))// || (player.HirelingId != null && this.Attributes[GameAttribute.Hireling_Class] == player.HirelingId)))
|
||||
if (!IsHireling && ((player.ActiveHireling != null && Attributes[GameAttribute.Hireling_Class] == player.ActiveHireling.Attributes[GameAttribute.Hireling_Class])))// || (player.HirelingId != null && this.Attributes[GameAttribute.Hireling_Class] == player.HirelingId)))
|
||||
return false;
|
||||
|
||||
if (owner == null)
|
||||
@ -434,21 +434,21 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
|
||||
if (!_equipment.ContainsKey(player))
|
||||
{
|
||||
this.LoadInventory(player);
|
||||
LoadInventory(player);
|
||||
}
|
||||
|
||||
foreach (var item in this._equipment[player].Values)
|
||||
foreach (var item in _equipment[player].Values)
|
||||
item.Reveal(player);
|
||||
|
||||
player.InGameClient.SendMessage(GetVisualEquipment(player));
|
||||
|
||||
if (this.IsHireling && owner != null && owner == player)
|
||||
if (IsHireling && owner != null && owner == player)
|
||||
player.InGameClient.SendMessage(new PetMessage() //70-77
|
||||
{
|
||||
Owner = player.PlayerIndex,
|
||||
Index = 10,
|
||||
PetId = this.DynamicID(player),
|
||||
Type = this.SNO == ActorSno._x1_malthael_npc ? 29 : 0,
|
||||
PetId = DynamicID(player),
|
||||
Type = SNO == ActorSno._x1_malthael_npc ? 29 : 0,
|
||||
});
|
||||
|
||||
return true;
|
||||
@ -459,49 +459,49 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
if (!base.Unreveal(player))
|
||||
return false;
|
||||
|
||||
foreach (var item in this._equipment[player].Values)
|
||||
foreach (var item in _equipment[player].Values)
|
||||
item.Unreveal(player);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void LoadInventory(Player player)
|
||||
{
|
||||
this._equipment.Add(player, new Dictionary<int, Item>());
|
||||
var inventory_list = this.World.Game.GameDBSession.SessionQueryWhere<DBInventory>(dbi => dbi.DBToon.Id == player.Toon.PersistentID && dbi.HirelingId != 0 && dbi.HirelingId == this.Attributes[GameAttribute.Hireling_Class]);
|
||||
_equipment.Add(player, new Dictionary<int, Item>());
|
||||
var inventory_list = World.Game.GameDBSession.SessionQueryWhere<DBInventory>(dbi => dbi.DBToon.Id == player.Toon.PersistentID && dbi.HirelingId != 0 && dbi.HirelingId == Attributes[GameAttribute.Hireling_Class]);
|
||||
foreach (var inv_item in inventory_list)
|
||||
{
|
||||
Item item = ItemGenerator.LoadFromDB(player, inv_item);
|
||||
item.Owner = this;
|
||||
item.Attributes[GameAttribute.Item_Equipped] = true;
|
||||
item.SetInventoryLocation(inv_item.EquipmentSlot, 0, 0);
|
||||
if (!this._equipment[player].ContainsKey(inv_item.EquipmentSlot))
|
||||
this._equipment[player].Add(inv_item.EquipmentSlot, item);
|
||||
if (!_equipment[player].ContainsKey(inv_item.EquipmentSlot))
|
||||
_equipment[player].Add(inv_item.EquipmentSlot, item);
|
||||
//Logger.Info("Item {0} added to hireling equipment", inv_item.GbId);
|
||||
}
|
||||
|
||||
this.UpdateAttributes();
|
||||
UpdateAttributes();
|
||||
}
|
||||
|
||||
public void EquipItem(Player owner, int slot, Item item)
|
||||
{
|
||||
if (item.DBInventory == null) return;
|
||||
|
||||
if (this._equipment[owner].ContainsKey(slot))
|
||||
this.UnequipItem(owner, slot, item);
|
||||
if (_equipment[owner].ContainsKey(slot))
|
||||
UnequipItem(owner, slot, item);
|
||||
|
||||
item.Owner = this;
|
||||
item.SetInventoryLocation(slot, 0, 0);
|
||||
item.DBInventory.HirelingId = this.Attributes[GameAttribute.Hireling_Class];
|
||||
item.DBInventory.HirelingId = Attributes[GameAttribute.Hireling_Class];
|
||||
item.DBInventory.EquipmentSlot = slot;
|
||||
item.DBInventory.LocationX = 0;
|
||||
item.DBInventory.LocationY = 0;
|
||||
this.World.Game.GameDBSession.SessionUpdate(item.DBInventory);
|
||||
World.Game.GameDBSession.SessionUpdate(item.DBInventory);
|
||||
item.Attributes[GameAttribute.Item_Equipped] = true;
|
||||
this._equipment[owner].Add(slot, item);
|
||||
this.RefreshEquipment(owner);
|
||||
this.UpdateAttributes();
|
||||
_equipment[owner].Add(slot, item);
|
||||
RefreshEquipment(owner);
|
||||
UpdateAttributes();
|
||||
|
||||
if (this._equipment[owner].Count >= 6)
|
||||
if (_equipment[owner].Count >= 6)
|
||||
owner.GrantAchievement(74987243307149);
|
||||
}
|
||||
|
||||
@ -509,39 +509,39 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
{
|
||||
if (item.DBInventory == null) return;
|
||||
|
||||
if (!this._equipment[owner].ContainsKey(slot)) return;
|
||||
if (!_equipment[owner].ContainsKey(slot)) return;
|
||||
|
||||
item.Owner = owner;
|
||||
this._equipment[owner].Remove(slot);
|
||||
this.World.Game.GameDBSession.SessionDelete(item.DBInventory);
|
||||
_equipment[owner].Remove(slot);
|
||||
World.Game.GameDBSession.SessionDelete(item.DBInventory);
|
||||
owner.Inventory.PickUp(item);
|
||||
item.Unreveal(owner);
|
||||
item.Attributes[GameAttribute.Item_Equipped] = false;
|
||||
item.Reveal(owner);
|
||||
this.RefreshEquipment(owner);
|
||||
this.UpdateAttributes();
|
||||
RefreshEquipment(owner);
|
||||
UpdateAttributes();
|
||||
}
|
||||
|
||||
public void UnequipItemFromSlot(Player owner, int slot)
|
||||
{
|
||||
if (!this._equipment[owner].ContainsKey(slot)) return;
|
||||
var item = this._equipment[owner][slot];
|
||||
this.UnequipItem(owner, slot, item);
|
||||
if (!_equipment[owner].ContainsKey(slot)) return;
|
||||
var item = _equipment[owner][slot];
|
||||
UnequipItem(owner, slot, item);
|
||||
}
|
||||
|
||||
public Item GetItemByDynId(Player player, uint DynamicId)
|
||||
{
|
||||
if (this._equipment[player].Values.Where(it => it.IsRevealedToPlayer(player) && it.DynamicID(player) == DynamicId).Count() > 0)
|
||||
return this._equipment[player].Values.Single(it => it.IsRevealedToPlayer(player) && it.DynamicID(player) == DynamicId);
|
||||
if (_equipment[player].Values.Where(it => it.IsRevealedToPlayer(player) && it.DynamicID(player) == DynamicId).Count() > 0)
|
||||
return _equipment[player].Values.Single(it => it.IsRevealedToPlayer(player) && it.DynamicID(player) == DynamicId);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
public void RefreshEquipment(Player player)
|
||||
{
|
||||
foreach (var item in this._equipment[player].Values)
|
||||
foreach (var item in _equipment[player].Values)
|
||||
item.Unreveal(player);
|
||||
foreach (var item in this._equipment[player].Values)
|
||||
foreach (var item in _equipment[player].Values)
|
||||
item.Reveal(player);
|
||||
|
||||
player.InGameClient.SendMessage(GetVisualEquipment(player));
|
||||
@ -551,12 +551,12 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
|
||||
public List<Item> GetEquippedItems(Player player)
|
||||
{
|
||||
return this._equipment[player].Values.ToList();
|
||||
return _equipment[player].Values.ToList();
|
||||
}
|
||||
|
||||
public float GetItemBonus(GameAttributeF attributeF)
|
||||
{
|
||||
var stats = this.GetEquippedItems(this.owner).Where(item => item.Attributes[GameAttribute.Durability_Cur] > 0 || item.Attributes[GameAttribute.Durability_Max] == 0);
|
||||
var stats = GetEquippedItems(owner).Where(item => item.Attributes[GameAttribute.Durability_Cur] > 0 || item.Attributes[GameAttribute.Durability_Max] == 0);
|
||||
|
||||
if (attributeF == GameAttribute.Attacks_Per_Second_Item)
|
||||
return stats.Count() > 0 ? stats.Select(item => item.Attributes[attributeF]).Where(a => a > 0f).Aggregate(1f, (x, y) => x * y) : 0f;
|
||||
@ -566,22 +566,22 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
|
||||
public int GetItemBonus(GameAttributeI attributeI)
|
||||
{
|
||||
return this.GetEquippedItems(this.owner).Where(item => item.Attributes[GameAttribute.Durability_Cur] > 0 || item.Attributes[GameAttribute.Durability_Max] == 0).Sum(item => item.Attributes[attributeI]);
|
||||
return GetEquippedItems(owner).Where(item => item.Attributes[GameAttribute.Durability_Cur] > 0 || item.Attributes[GameAttribute.Durability_Max] == 0).Sum(item => item.Attributes[attributeI]);
|
||||
}
|
||||
|
||||
public bool GetItemBonus(GameAttributeB attributeB)
|
||||
{
|
||||
return this.GetEquippedItems(this.owner).Where(item => item.Attributes[attributeB] == true).Count() > 0;
|
||||
return GetEquippedItems(owner).Where(item => item.Attributes[attributeB] == true).Count() > 0;
|
||||
}
|
||||
|
||||
public float GetItemBonus(GameAttributeF attributeF, int attributeKey)
|
||||
{
|
||||
return this.GetEquippedItems(this.owner).Where(item => item.Attributes[GameAttribute.Durability_Cur] > 0 || item.Attributes[GameAttribute.Durability_Max] == 0).Sum(item => item.Attributes[attributeF, attributeKey]);
|
||||
return GetEquippedItems(owner).Where(item => item.Attributes[GameAttribute.Durability_Cur] > 0 || item.Attributes[GameAttribute.Durability_Max] == 0).Sum(item => item.Attributes[attributeF, attributeKey]);
|
||||
}
|
||||
|
||||
public int GetItemBonus(GameAttributeI attributeI, int attributeKey)
|
||||
{
|
||||
return this.GetEquippedItems(this.owner).Where(item => item.Attributes[GameAttribute.Durability_Cur] > 0 || item.Attributes[GameAttribute.Durability_Max] == 0).Sum(item => item.Attributes[attributeI, attributeKey]);
|
||||
return GetEquippedItems(owner).Where(item => item.Attributes[GameAttribute.Durability_Cur] > 0 || item.Attributes[GameAttribute.Durability_Max] == 0).Sum(item => item.Attributes[attributeI, attributeKey]);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
@ -35,19 +35,19 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
skillKit = 0x8AFE;
|
||||
hirelingGBID = StringHashHelper.HashItemName("Scoundrel");
|
||||
Attributes[GameAttribute.Hireling_Class] = 4;
|
||||
var MS = this.Attributes[GameAttribute.Movement_Scalar];
|
||||
var RS = this.Attributes[GameAttribute.Run_Speed_Granted];
|
||||
var MSRP = this.Attributes[GameAttribute.Movement_Scalar_Reduction_Percent];
|
||||
this.Attributes[GameAttribute.Movement_Scalar] = 3f;
|
||||
this.Attributes[GameAttribute.Run_Speed_Granted] = 3f;
|
||||
var MS = Attributes[GameAttribute.Movement_Scalar];
|
||||
var RS = Attributes[GameAttribute.Run_Speed_Granted];
|
||||
var MSRP = Attributes[GameAttribute.Movement_Scalar_Reduction_Percent];
|
||||
Attributes[GameAttribute.Movement_Scalar] = 3f;
|
||||
Attributes[GameAttribute.Run_Speed_Granted] = 3f;
|
||||
//this.Attributes[GameAttribute.Movement_Scalar_Reduction_Percent] -= 20f;
|
||||
this.WalkSpeed = 0.3f; Attributes[GameAttribute.Hitpoints_Max] = 9999f;
|
||||
var HPM = this.Attributes[GameAttribute.Hitpoints_Max];
|
||||
var HPMT = this.Attributes[GameAttribute.Hitpoints_Max_Total];
|
||||
WalkSpeed = 0.3f; Attributes[GameAttribute.Hitpoints_Max] = 9999f;
|
||||
var HPM = Attributes[GameAttribute.Hitpoints_Max];
|
||||
var HPMT = Attributes[GameAttribute.Hitpoints_Max_Total];
|
||||
|
||||
Attributes[GameAttribute.Hitpoints_Max_Percent_Bonus_Multiplicative] = 1;
|
||||
|
||||
Attributes[GameAttribute.Hitpoints_Max] = this.Attributes[GameAttribute.Hitpoints_Max_Total];
|
||||
Attributes[GameAttribute.Hitpoints_Max] = Attributes[GameAttribute.Hitpoints_Max_Total];
|
||||
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
|
||||
player.InGameClient.SendMessage(new MessageSystem.Message.Definitions.Inventory.VisualInventoryMessage()
|
||||
{
|
||||
ActorID = this.DynamicID(player),
|
||||
ActorID = DynamicID(player),
|
||||
EquipmentList = new MessageSystem.Message.Fields.VisualEquipment()
|
||||
{
|
||||
Equipment = new MessageSystem.Message.Fields.VisualItem[]
|
||||
|
||||
@ -25,9 +25,9 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
proxySNO = ActorSno._hireling_templar_proxy;
|
||||
skillKit = 484941;
|
||||
hirelingGBID = StringHashHelper.HashItemName("Templar");
|
||||
this.Attributes[GameAttribute.Hireling_Class] = 0;
|
||||
this.Attributes[GameAttribute.TeamID] = 2;
|
||||
this.Attributes[GameAttribute.Team_Override] = 2;
|
||||
Attributes[GameAttribute.Hireling_Class] = 0;
|
||||
Attributes[GameAttribute.TeamID] = 2;
|
||||
Attributes[GameAttribute.Team_Override] = 2;
|
||||
}
|
||||
|
||||
public override Hireling CreateHireling(MapSystem.World world, ActorSno sno, TagMap tags)
|
||||
@ -43,9 +43,9 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
case 102057:
|
||||
case 101969:
|
||||
player.HirelingInfo[3].Skill1SNOId = SkillSNOId;
|
||||
this.Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
this.Attributes[GameAttribute.Skill, (SkillSNOId == 102057 ? 101969 : 102057)] = 0;
|
||||
this.Attributes.BroadcastChangedIfRevealed();
|
||||
Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
Attributes[GameAttribute.Skill, (SkillSNOId == 102057 ? 101969 : 102057)] = 0;
|
||||
Attributes.BroadcastChangedIfRevealed();
|
||||
|
||||
dbhireling.Skill1SNOId = SkillSNOId;
|
||||
player.World.Game.GameDBSession.SessionUpdate(dbhireling);
|
||||
@ -53,9 +53,9 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
case 102133:
|
||||
case 101461:
|
||||
player.HirelingInfo[3].Skill2SNOId = SkillSNOId;
|
||||
this.Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
this.Attributes[GameAttribute.Skill, (SkillSNOId == 102133 ? 101461 : 102133)] = 0;
|
||||
this.Attributes.BroadcastChangedIfRevealed();
|
||||
Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
Attributes[GameAttribute.Skill, (SkillSNOId == 102133 ? 101461 : 102133)] = 0;
|
||||
Attributes.BroadcastChangedIfRevealed();
|
||||
|
||||
dbhireling.Skill2SNOId = SkillSNOId;
|
||||
player.World.Game.GameDBSession.SessionUpdate(dbhireling);
|
||||
@ -63,9 +63,9 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
case 101990:
|
||||
case 220872:
|
||||
player.HirelingInfo[3].Skill3SNOId = SkillSNOId;
|
||||
this.Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
this.Attributes[GameAttribute.Skill, (SkillSNOId == 101990 ? 220872 : 101990)] = 0;
|
||||
this.Attributes.BroadcastChangedIfRevealed();
|
||||
Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
Attributes[GameAttribute.Skill, (SkillSNOId == 101990 ? 220872 : 101990)] = 0;
|
||||
Attributes.BroadcastChangedIfRevealed();
|
||||
|
||||
dbhireling.Skill3SNOId = SkillSNOId;
|
||||
player.World.Game.GameDBSession.SessionUpdate(dbhireling);
|
||||
@ -73,9 +73,9 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
case 101425:
|
||||
case 201524:
|
||||
player.HirelingInfo[3].Skill4SNOId = SkillSNOId;
|
||||
this.Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
this.Attributes[GameAttribute.Skill, (SkillSNOId == 101425 ? 201524 : 101425)] = 0;
|
||||
this.Attributes.BroadcastChangedIfRevealed();
|
||||
Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
Attributes[GameAttribute.Skill, (SkillSNOId == 101425 ? 201524 : 101425)] = 0;
|
||||
Attributes.BroadcastChangedIfRevealed();
|
||||
|
||||
dbhireling.Skill4SNOId = SkillSNOId;
|
||||
player.World.Game.GameDBSession.SessionUpdate(dbhireling);
|
||||
@ -99,15 +99,15 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
player.HirelingInfo[3].Skill3SNOId = -1;
|
||||
player.HirelingInfo[3].Skill4SNOId = -1;
|
||||
|
||||
this.Attributes[GameAttribute.Skill, 102057] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 101969] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 102133] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 101461] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 101990] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 220872] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 101425] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 201524] = 0;
|
||||
this.Attributes.SendChangedMessage(player.InGameClient);
|
||||
Attributes[GameAttribute.Skill, 102057] = 0;
|
||||
Attributes[GameAttribute.Skill, 101969] = 0;
|
||||
Attributes[GameAttribute.Skill, 102133] = 0;
|
||||
Attributes[GameAttribute.Skill, 101461] = 0;
|
||||
Attributes[GameAttribute.Skill, 101990] = 0;
|
||||
Attributes[GameAttribute.Skill, 220872] = 0;
|
||||
Attributes[GameAttribute.Skill, 101425] = 0;
|
||||
Attributes[GameAttribute.Skill, 201524] = 0;
|
||||
Attributes.SendChangedMessage(player.InGameClient);
|
||||
}
|
||||
|
||||
public override bool Reveal(Player player)
|
||||
|
||||
@ -41,9 +41,9 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
case 95675:
|
||||
case 30460:
|
||||
player.HirelingInfo[2].Skill1SNOId = SkillSNOId;
|
||||
this.Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
this.Attributes[GameAttribute.Skill, (SkillSNOId == 95675 ? 30460 : 95675)] = 0;
|
||||
this.Attributes.SendChangedMessage(player.InGameClient);
|
||||
Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
Attributes[GameAttribute.Skill, (SkillSNOId == 95675 ? 30460 : 95675)] = 0;
|
||||
Attributes.SendChangedMessage(player.InGameClient);
|
||||
|
||||
dbhireling.Skill1SNOId = SkillSNOId;
|
||||
player.World.Game.GameDBSession.SessionUpdate(dbhireling);
|
||||
@ -51,9 +51,9 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
case 97436:
|
||||
case 30464:
|
||||
player.HirelingInfo[2].Skill2SNOId = SkillSNOId;
|
||||
this.Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
this.Attributes[GameAttribute.Skill, (SkillSNOId == 97436 ? 30464 : 97436)] = 0;
|
||||
this.Attributes.SendChangedMessage(player.InGameClient);
|
||||
Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
Attributes[GameAttribute.Skill, (SkillSNOId == 97436 ? 30464 : 97436)] = 0;
|
||||
Attributes.SendChangedMessage(player.InGameClient);
|
||||
|
||||
dbhireling.Skill2SNOId = SkillSNOId;
|
||||
player.World.Game.GameDBSession.SessionUpdate(dbhireling);
|
||||
@ -61,9 +61,9 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
case 95690:
|
||||
case 30458:
|
||||
player.HirelingInfo[2].Skill3SNOId = SkillSNOId;
|
||||
this.Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
this.Attributes[GameAttribute.Skill, (SkillSNOId == 95690 ? 30458 : 95690)] = 0;
|
||||
this.Attributes.SendChangedMessage(player.InGameClient);
|
||||
Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
Attributes[GameAttribute.Skill, (SkillSNOId == 95690 ? 30458 : 95690)] = 0;
|
||||
Attributes.SendChangedMessage(player.InGameClient);
|
||||
|
||||
dbhireling.Skill3SNOId = SkillSNOId;
|
||||
player.World.Game.GameDBSession.SessionUpdate(dbhireling);
|
||||
@ -71,9 +71,9 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
case 200169:
|
||||
case 30454:
|
||||
player.HirelingInfo[2].Skill4SNOId = SkillSNOId;
|
||||
this.Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
this.Attributes[GameAttribute.Skill, (SkillSNOId == 200169 ? 30454 : 200169)] = 0;
|
||||
this.Attributes.SendChangedMessage(player.InGameClient);
|
||||
Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
Attributes[GameAttribute.Skill, (SkillSNOId == 200169 ? 30454 : 200169)] = 0;
|
||||
Attributes.SendChangedMessage(player.InGameClient);
|
||||
|
||||
dbhireling.Skill4SNOId = SkillSNOId;
|
||||
player.World.Game.GameDBSession.SessionUpdate(dbhireling);
|
||||
@ -97,15 +97,15 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
player.HirelingInfo[2].Skill3SNOId = -1;
|
||||
player.HirelingInfo[2].Skill4SNOId = -1;
|
||||
|
||||
this.Attributes[GameAttribute.Skill, 95675] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 30460] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 97436] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 30464] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 95690] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 30458] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 200169] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 30454] = 0;
|
||||
this.Attributes.SendChangedMessage(player.InGameClient);
|
||||
Attributes[GameAttribute.Skill, 95675] = 0;
|
||||
Attributes[GameAttribute.Skill, 30460] = 0;
|
||||
Attributes[GameAttribute.Skill, 97436] = 0;
|
||||
Attributes[GameAttribute.Skill, 30464] = 0;
|
||||
Attributes[GameAttribute.Skill, 95690] = 0;
|
||||
Attributes[GameAttribute.Skill, 30458] = 0;
|
||||
Attributes[GameAttribute.Skill, 200169] = 0;
|
||||
Attributes[GameAttribute.Skill, 30454] = 0;
|
||||
Attributes.SendChangedMessage(player.InGameClient);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
proxySNO = ActorSno._hireling_templar_proxy;
|
||||
skillKit = 484941;
|
||||
hirelingGBID = StringHashHelper.HashItemName("Templar");
|
||||
this.Attributes[GameAttribute.Hireling_Class] = 1;
|
||||
Attributes[GameAttribute.Hireling_Class] = 1;
|
||||
}
|
||||
|
||||
public override Hireling CreateHireling(MapSystem.World world, ActorSno sno, TagMap tags)
|
||||
@ -41,9 +41,9 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
case 1747:
|
||||
case 93938:
|
||||
player.HirelingInfo[1].Skill1SNOId = SkillSNOId;
|
||||
this.Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
this.Attributes[GameAttribute.Skill, (SkillSNOId == 1747 ? 93938 : 1747)] = 0;
|
||||
this.Attributes.SendChangedMessage(player.InGameClient);
|
||||
Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
Attributes[GameAttribute.Skill, (SkillSNOId == 1747 ? 93938 : 1747)] = 0;
|
||||
Attributes.SendChangedMessage(player.InGameClient);
|
||||
|
||||
dbhireling.Skill1SNOId = SkillSNOId;
|
||||
player.World.Game.GameDBSession.SessionUpdate(dbhireling);
|
||||
@ -51,9 +51,9 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
case 30357:
|
||||
case 93901:
|
||||
player.HirelingInfo[1].Skill2SNOId = SkillSNOId;
|
||||
this.Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
this.Attributes[GameAttribute.Skill, (SkillSNOId == 30357 ? 93901 : 30357)] = 0;
|
||||
this.Attributes.SendChangedMessage(player.InGameClient);
|
||||
Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
Attributes[GameAttribute.Skill, (SkillSNOId == 30357 ? 93901 : 30357)] = 0;
|
||||
Attributes.SendChangedMessage(player.InGameClient);
|
||||
|
||||
dbhireling.Skill2SNOId = SkillSNOId;
|
||||
player.World.Game.GameDBSession.SessionUpdate(dbhireling);
|
||||
@ -61,9 +61,9 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
case 30360:
|
||||
case 93888:
|
||||
player.HirelingInfo[1].Skill3SNOId = SkillSNOId;
|
||||
this.Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
this.Attributes[GameAttribute.Skill, (SkillSNOId == 30360 ? 93888 : 30360)] = 0;
|
||||
this.Attributes.SendChangedMessage(player.InGameClient);
|
||||
Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
Attributes[GameAttribute.Skill, (SkillSNOId == 30360 ? 93888 : 30360)] = 0;
|
||||
Attributes.SendChangedMessage(player.InGameClient);
|
||||
|
||||
dbhireling.Skill3SNOId = SkillSNOId;
|
||||
player.World.Game.GameDBSession.SessionUpdate(dbhireling);
|
||||
@ -71,9 +71,9 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
case 30356:
|
||||
case 30359:
|
||||
player.HirelingInfo[1].Skill4SNOId = SkillSNOId;
|
||||
this.Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
this.Attributes[GameAttribute.Skill, (SkillSNOId == 30356 ? 30359 : 30356)] = 0;
|
||||
this.Attributes.SendChangedMessage(player.InGameClient);
|
||||
Attributes[GameAttribute.Skill, SkillSNOId] = 1;
|
||||
Attributes[GameAttribute.Skill, (SkillSNOId == 30356 ? 30359 : 30356)] = 0;
|
||||
Attributes.SendChangedMessage(player.InGameClient);
|
||||
|
||||
dbhireling.Skill4SNOId = SkillSNOId;
|
||||
player.World.Game.GameDBSession.SessionUpdate(dbhireling);
|
||||
@ -97,15 +97,15 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Hirelings
|
||||
player.HirelingInfo[1].Skill3SNOId = -1;
|
||||
player.HirelingInfo[1].Skill4SNOId = -1;
|
||||
|
||||
this.Attributes[GameAttribute.Skill, 1747] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 93938] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 30357] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 93901] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 30360] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 93888] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 30356] = 0;
|
||||
this.Attributes[GameAttribute.Skill, 30359] = 0;
|
||||
this.Attributes.SendChangedMessage(player.InGameClient);
|
||||
Attributes[GameAttribute.Skill, 1747] = 0;
|
||||
Attributes[GameAttribute.Skill, 93938] = 0;
|
||||
Attributes[GameAttribute.Skill, 30357] = 0;
|
||||
Attributes[GameAttribute.Skill, 93901] = 0;
|
||||
Attributes[GameAttribute.Skill, 30360] = 0;
|
||||
Attributes[GameAttribute.Skill, 93888] = 0;
|
||||
Attributes[GameAttribute.Skill, 30356] = 0;
|
||||
Attributes[GameAttribute.Skill, 30359] = 0;
|
||||
Attributes.SendChangedMessage(player.InGameClient);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
{
|
||||
var list = new List<ItemsSystem.Item>
|
||||
{
|
||||
ItemsSystem.ItemGenerator.CookFromDefinition(this.World, ItemsSystem.ItemGenerator.GetItemDefinition(DiIiS_NA.Core.Helpers.Hash.StringHashHelper.HashItemName("HealthPotionBottomless")), 1, false) //HealthPotionConsole
|
||||
ItemsSystem.ItemGenerator.CookFromDefinition(World, ItemsSystem.ItemGenerator.GetItemDefinition(DiIiS_NA.Core.Helpers.Hash.StringHashHelper.HashItemName("HealthPotionBottomless")), 1, false) //HealthPotionConsole
|
||||
};
|
||||
|
||||
return list;
|
||||
|
||||
@ -43,12 +43,12 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
|
||||
protected override List<ItemsSystem.Item> GetVendorItems()
|
||||
{
|
||||
return itemGbIds.Select(x => ItemsSystem.ItemGenerator.CookFromDefinition(this.World, ItemsSystem.ItemGenerator.GetItemDefinition(x), 1, false)).ToList();
|
||||
return itemGbIds.Select(x => ItemsSystem.ItemGenerator.CookFromDefinition(World, ItemsSystem.ItemGenerator.GetItemDefinition(x), 1, false)).ToList();
|
||||
}
|
||||
|
||||
public override bool Reveal(PlayerSystem.Player player)
|
||||
{
|
||||
if (this.World.Game.CurrentAct != 3000) return false;
|
||||
if (World.Game.CurrentAct != 3000) return false;
|
||||
return base.Reveal(player);
|
||||
}
|
||||
|
||||
|
||||
@ -40,22 +40,22 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
public LegendaryChest(World world, ActorSno sno, TagMap tags)
|
||||
: base(world, sno, tags)
|
||||
{
|
||||
this.NameSNO = ActorSno._caout_stingingwinds_chest;
|
||||
this.Field7 = 1;
|
||||
NameSNO = ActorSno._caout_stingingwinds_chest;
|
||||
Field7 = 1;
|
||||
}
|
||||
|
||||
public override bool Reveal(Player player)
|
||||
{
|
||||
if (!this.ChestActive) return false;
|
||||
if (!ChestActive) return false;
|
||||
return base.Reveal(player);
|
||||
}
|
||||
|
||||
|
||||
public override void OnTargeted(Player player, TargetMessage message)
|
||||
{
|
||||
if (this.Attributes[GameAttribute.Disabled]) return;
|
||||
if (Attributes[GameAttribute.Disabled]) return;
|
||||
|
||||
int chance = this.World.Game.IsHardcore ? 99 : 25; //S4 special
|
||||
int chance = World.Game.IsHardcore ? 99 : 25; //S4 special
|
||||
/*
|
||||
if (!player.Inventory.HasItem(-110888638) || (!this.World.Game.IsHardcore && !player.Inventory.HasGold(250000)))
|
||||
{
|
||||
@ -68,16 +68,16 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
//player.InGameClient.SendMessage(new BroadcastTextMessage() { Field0 = string.Format("Legendary Chest has been opened. 1 Chain Key {0}consumed.", (this.World.Game.IsHardcore ? "" : "and 250k gold ")) });
|
||||
|
||||
player.Inventory.GetBag().GrabSomeItems(-110888638, 1);
|
||||
if (!this.World.Game.IsHardcore)
|
||||
if (!World.Game.IsHardcore)
|
||||
player.Inventory.RemoveGoldAmount(250000);
|
||||
if (FastRandom.Instance.Next(100) < chance)
|
||||
this.World.SpawnRandomEquip(player, player, LootManager.Epic, player.Level);
|
||||
World.SpawnRandomEquip(player, player, LootManager.Epic, player.Level);
|
||||
else
|
||||
this.World.SpawnRandomEquip(player, player, LootManager.Rare, player.Level);
|
||||
World.SpawnRandomEquip(player, player, LootManager.Rare, player.Level);
|
||||
|
||||
var toon = player.Toon.DBToon;
|
||||
toon.ChestsOpened++;
|
||||
this.World.Game.GameDBSession.SessionUpdate(toon);
|
||||
World.Game.GameDBSession.SessionUpdate(toon);
|
||||
}
|
||||
|
||||
base.OnTargeted(player, message);
|
||||
|
||||
@ -38,19 +38,19 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
public LootContainer(World world, ActorSno sno, TagMap tags)
|
||||
: base(world, sno, tags)
|
||||
{
|
||||
if (this.SNO == ActorSno._a3dunrmpt_interactives_signal_fire_a_prop) this.Attributes[GameAttribute.MinimapActive] = true;
|
||||
if (SNO == ActorSno._a3dunrmpt_interactives_signal_fire_a_prop) Attributes[GameAttribute.MinimapActive] = true;
|
||||
|
||||
if (this.SNO.IsChest() || this.SNO.IsCorpse()) haveDrop = true;
|
||||
if (SNO.IsChest() || SNO.IsCorpse()) haveDrop = true;
|
||||
|
||||
switch (sno)
|
||||
{
|
||||
case ActorSno._trout_highlands_chest_bloody: //bloody
|
||||
this.Quality = 1;
|
||||
Quality = 1;
|
||||
break;
|
||||
case ActorSno._trout_fields_chest_rare: //rare
|
||||
case ActorSno._a2dun_zolt_chest_rare: //Zolt_rare
|
||||
case ActorSno._x1_global_chest_startsclean: //event
|
||||
this.Quality = 2;
|
||||
Quality = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -59,18 +59,18 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
|
||||
public override bool Reveal(Player player)
|
||||
{
|
||||
if (this.SNO == ActorSno._a2dun_aqd_chest_special_facepuzzle_large && this.World.SNO != WorldSno.a2dun_aqd_oasis_randomfacepuzzle_large) return false; //dakab chest
|
||||
if (this.SNO == ActorSno._a2dun_aqd_chest_rare_facepuzzlesmall && this.World.SNO == WorldSno.a2dun_aqd_oasis_randomfacepuzzle_large) return false; //not dakab chest
|
||||
if (SNO == ActorSno._a2dun_aqd_chest_special_facepuzzle_large && World.SNO != WorldSno.a2dun_aqd_oasis_randomfacepuzzle_large) return false; //dakab chest
|
||||
if (SNO == ActorSno._a2dun_aqd_chest_rare_facepuzzlesmall && World.SNO == WorldSno.a2dun_aqd_oasis_randomfacepuzzle_large) return false; //not dakab chest
|
||||
|
||||
if (!rewardChestAvailable) return false; //event reward chest
|
||||
|
||||
if (!base.Reveal(player))
|
||||
return false;
|
||||
if (this.Attributes[GameAttribute.Disabled])
|
||||
if (Attributes[GameAttribute.Disabled])
|
||||
{
|
||||
player.InGameClient.SendMessage(new SetIdleAnimationMessage
|
||||
{
|
||||
ActorID = this.DynamicID(player),
|
||||
ActorID = DynamicID(player),
|
||||
AnimationSNO = AnimationSetKeys.Open.ID
|
||||
});
|
||||
}
|
||||
@ -81,10 +81,10 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
|
||||
public override void OnTargeted(Player player, TargetMessage message)
|
||||
{
|
||||
if (this.SNO == ActorSno._p4_setdung_totem_cru_thorns)
|
||||
if (SNO == ActorSno._p4_setdung_totem_cru_thorns)
|
||||
return;
|
||||
|
||||
if (this.Attributes[GameAttribute.Disabled]) return;
|
||||
if (Attributes[GameAttribute.Disabled]) return;
|
||||
|
||||
base.OnTargeted(player, message);
|
||||
|
||||
@ -93,56 +93,56 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
if (ActorData.TagMap.ContainsKey(ActorKeys.Lore))
|
||||
Logger.Debug("Lore detected: {0}", ActorData.TagMap[ActorKeys.Lore].Id);
|
||||
|
||||
if (this.SNO == ActorSno._trout_highlands_manor_firewood) //Leor bone
|
||||
if (SNO == ActorSno._trout_highlands_manor_firewood) //Leor bone
|
||||
{
|
||||
foreach (var plr in this.GetPlayersInRange(30))
|
||||
this.World.SpawnItem(this, plr, -629520052);
|
||||
foreach (var plr in GetPlayersInRange(30))
|
||||
World.SpawnItem(this, plr, -629520052);
|
||||
}
|
||||
if (this.SNO == ActorSno._trout_newtristram_adria_blackmushroom) //Black Mushroom
|
||||
if (SNO == ActorSno._trout_newtristram_adria_blackmushroom) //Black Mushroom
|
||||
{
|
||||
foreach (var plr in this.GetPlayersInRange(30))
|
||||
this.World.SpawnItem(this, plr, -1993550104);
|
||||
foreach (var plr in GetPlayersInRange(30))
|
||||
World.SpawnItem(this, plr, -1993550104);
|
||||
}
|
||||
if (this.SNO == ActorSno._caout_oasis_chest_rare_mapvendorcave) //Rainbow Chest
|
||||
if (SNO == ActorSno._caout_oasis_chest_rare_mapvendorcave) //Rainbow Chest
|
||||
{
|
||||
foreach (var plr in this.GetPlayersInRange(30))
|
||||
this.World.SpawnItem(this, plr, 725082635);
|
||||
foreach (var plr in GetPlayersInRange(30))
|
||||
World.SpawnItem(this, plr, 725082635);
|
||||
}
|
||||
|
||||
if (haveDrop)
|
||||
{
|
||||
var dropRates = this.World.Game.IsHardcore ? LootManager.GetSeasonalDropRates((int)this.Quality, Program.MaxLevel) : LootManager.GetDropRates((int)this.Quality, Program.MaxLevel);
|
||||
var dropRates = World.Game.IsHardcore ? LootManager.GetSeasonalDropRates((int)Quality, Program.MaxLevel) : LootManager.GetDropRates((int)Quality, Program.MaxLevel);
|
||||
foreach (var rate in dropRates)
|
||||
foreach (var plr in this.GetPlayersInRange(30))
|
||||
foreach (var plr in GetPlayersInRange(30))
|
||||
{
|
||||
float seed = (float)FastRandom.Instance.NextDouble();
|
||||
if (seed < 0.8f)
|
||||
this.World.SpawnGold(this, plr);
|
||||
World.SpawnGold(this, plr);
|
||||
if (seed < 0.6f)
|
||||
this.World.SpawnGold(this, plr);
|
||||
World.SpawnGold(this, plr);
|
||||
if (seed < 0.5f)
|
||||
this.World.SpawnRandomCraftItem(this, plr);
|
||||
World.SpawnRandomCraftItem(this, plr);
|
||||
if (seed < 0.2f)
|
||||
this.World.SpawnRandomCraftItem(this, plr);
|
||||
World.SpawnRandomCraftItem(this, plr);
|
||||
if (seed < 0.07f)
|
||||
this.World.SpawnRandomGem(this, plr);
|
||||
World.SpawnRandomGem(this, plr);
|
||||
if (seed < 0.04f)
|
||||
this.World.SpawnRandomGem(this, plr);
|
||||
World.SpawnRandomGem(this, plr);
|
||||
if (seed < 0.10f)
|
||||
this.World.SpawnRandomPotion(this, plr);
|
||||
World.SpawnRandomPotion(this, plr);
|
||||
if (seed < (rate * (1f + plr.Attributes[GameAttribute.Magic_Find])))
|
||||
{
|
||||
var lootQuality = this.World.Game.IsHardcore ? LootManager.GetSeasonalLootQuality((int)this.Quality, this.World.Game.Difficulty) : LootManager.GetLootQuality((int)this.Quality, this.World.Game.Difficulty);
|
||||
this.World.SpawnRandomEquip(plr, plr, lootQuality);
|
||||
var lootQuality = World.Game.IsHardcore ? LootManager.GetSeasonalLootQuality((int)Quality, World.Game.Difficulty) : LootManager.GetLootQuality((int)Quality, World.Game.Difficulty);
|
||||
World.SpawnRandomEquip(plr, plr, lootQuality);
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (GeneratorsSystem.LoreRegistry.Lore.ContainsKey(this.World.SNO) && GeneratorsSystem.LoreRegistry.Lore[this.World.SNO].chests_lore.ContainsKey(this.SNO))
|
||||
foreach (var p in this.GetPlayersInRange(30))
|
||||
foreach (int loreId in GeneratorsSystem.LoreRegistry.Lore[this.World.SNO].chests_lore[this.SNO])
|
||||
if (GeneratorsSystem.LoreRegistry.Lore.ContainsKey(World.SNO) && GeneratorsSystem.LoreRegistry.Lore[World.SNO].chests_lore.ContainsKey(SNO))
|
||||
foreach (var p in GetPlayersInRange(30))
|
||||
foreach (int loreId in GeneratorsSystem.LoreRegistry.Lore[World.SNO].chests_lore[SNO])
|
||||
if (!p.HasLore(loreId))
|
||||
{
|
||||
World.DropItem(this, null, ItemGenerator.CreateLore(p, loreId));
|
||||
@ -151,7 +151,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
|
||||
World.BroadcastIfRevealed(plr => new PlayAnimationMessage
|
||||
{
|
||||
ActorID = this.DynamicID(plr),
|
||||
ActorID = DynamicID(plr),
|
||||
AnimReason = 5,
|
||||
UnitAniimStartTime = 0,
|
||||
tAnim = new PlayAnimationMessageSpec[]
|
||||
@ -159,7 +159,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
new PlayAnimationMessageSpec()
|
||||
{
|
||||
Duration = 50,
|
||||
AnimationSNO = AnimationSet.TagMapAnimDefault[AnimationSetKeys.Opening],
|
||||
AnimationSNO = (int)AnimationSet.Animations[AnimationSetKeys.Opening.ID],
|
||||
PermutationIndex = 0,
|
||||
AnimationTag = 0,
|
||||
Speed = 1
|
||||
@ -170,28 +170,28 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
|
||||
World.BroadcastIfRevealed(plr => new SetIdleAnimationMessage
|
||||
{
|
||||
ActorID = this.DynamicID(plr),
|
||||
ActorID = DynamicID(plr),
|
||||
AnimationSNO = AnimationSetKeys.Open.ID
|
||||
}, this);
|
||||
|
||||
this.Attributes[GameAttribute.Gizmo_Has_Been_Operated] = true;
|
||||
Attributes[GameAttribute.Gizmo_Has_Been_Operated] = true;
|
||||
//this.Attributes[GameAttribute.Gizmo_Operator_ACDID] = unchecked((int)player.DynamicID);
|
||||
this.Attributes[GameAttribute.Chest_Open, 0xFFFFFF] = true;
|
||||
Attributes[GameAttribute.Chest_Open, 0xFFFFFF] = true;
|
||||
Attributes.BroadcastChangedIfRevealed();
|
||||
|
||||
this.Attributes[GameAttribute.Disabled] = true;
|
||||
Attributes[GameAttribute.Disabled] = true;
|
||||
|
||||
if (this.SNO == ActorSno._trdun_cath_chandelier_trap_switch2)
|
||||
if (SNO == ActorSno._trdun_cath_chandelier_trap_switch2)
|
||||
{
|
||||
var lamp = this.GetActorsInRange(50f).Where(x => x.SNO == ActorSno._trdun_cath_chandelier_trap || x.SNO == ActorSno._trdun_cath_braizer_trap).First();
|
||||
var lamp = GetActorsInRange(50f).Where(x => x.SNO == ActorSno._trdun_cath_chandelier_trap || x.SNO == ActorSno._trdun_cath_braizer_trap).First();
|
||||
if (lamp != null)
|
||||
(lamp as CathedralLamp).Die();
|
||||
}
|
||||
|
||||
if (this.SNO == ActorSno._a2dun_zolt_centerpiece_a)
|
||||
if (SNO == ActorSno._a2dun_zolt_centerpiece_a)
|
||||
{
|
||||
if (this.World.SNO == WorldSno.a2dun_zolt_level01)
|
||||
foreach (var plr in this.World.Game.Players.Values)
|
||||
if (World.SNO == WorldSno.a2dun_zolt_level01)
|
||||
foreach (var plr in World.Game.Players.Values)
|
||||
plr.InGameClient.SendMessage(new QuestCounterMessage()
|
||||
{
|
||||
snoQuest = 57337,
|
||||
@ -202,7 +202,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
Checked = 1,
|
||||
});
|
||||
else
|
||||
foreach (var plr in this.World.Game.Players.Values)
|
||||
foreach (var plr in World.Game.Players.Values)
|
||||
plr.InGameClient.SendMessage(new QuestCounterMessage()
|
||||
{
|
||||
snoQuest = 57337,
|
||||
|
||||
@ -41,7 +41,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
public LootRunPortal(World world, ActorSno sno, TagMap tags)
|
||||
: base(world, sno, tags)
|
||||
{
|
||||
this.Destination = new ResolvedPortalDestination
|
||||
Destination = new ResolvedPortalDestination
|
||||
{
|
||||
WorldSNO = (int)WorldSno.x1_westm_graveyard_deathorb,
|
||||
DestLevelAreaSNO = 338946,
|
||||
@ -58,7 +58,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
MinimapIcon = ActorData.TagMap[ActorKeys.MinimapMarker].Id;
|
||||
}
|
||||
|
||||
this.Field2 = 0x9;//16;
|
||||
Field2 = 0x9;//16;
|
||||
}
|
||||
|
||||
public override bool Reveal(Player player)
|
||||
@ -79,43 +79,43 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
|
||||
public override void OnTargeted(Player player, TargetMessage message)
|
||||
{
|
||||
Logger.Debug("(OnTargeted) Portal has been activated, Id: {0}, LevelArea: {1}, World: {2}", (int)this.SNO, this.Destination.DestLevelAreaSNO, this.Destination.WorldSNO);
|
||||
Logger.Debug("(OnTargeted) Portal has been activated, Id: {0}, LevelArea: {1}, World: {2}", (int)SNO, Destination.DestLevelAreaSNO, Destination.WorldSNO);
|
||||
|
||||
var world = this.World.Game.GetWorld((WorldSno)this.Destination.WorldSNO);
|
||||
var world = World.Game.GetWorld((WorldSno)Destination.WorldSNO);
|
||||
|
||||
if (world == null)
|
||||
{
|
||||
Logger.Warn("Portal's destination world does not exist (WorldSNO = {0})", this.Destination.WorldSNO);
|
||||
Logger.Warn("Portal's destination world does not exist (WorldSNO = {0})", Destination.WorldSNO);
|
||||
return;
|
||||
}
|
||||
|
||||
var startingPoint = world.GetStartingPointById(this.Destination.StartingPointActorTag);
|
||||
var startingPoint = world.GetStartingPointById(Destination.StartingPointActorTag);
|
||||
|
||||
if (startingPoint != null)
|
||||
{
|
||||
if (this.SNO == ActorSno._a2dun_zolt_portal_timedevent) //a2 timed event
|
||||
if (SNO == ActorSno._a2dun_zolt_portal_timedevent) //a2 timed event
|
||||
{
|
||||
if (!this.World.Game.QuestManager.SideQuests[120396].Completed)
|
||||
player.ShowConfirmation(this.DynamicID(player), (() => {
|
||||
if (!World.Game.QuestManager.SideQuests[120396].Completed)
|
||||
player.ShowConfirmation(DynamicID(player), (() => {
|
||||
player.ChangeWorld(world, startingPoint);
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (world == this.World)
|
||||
if (world == World)
|
||||
player.Teleport(startingPoint.Position);
|
||||
else
|
||||
player.ChangeWorld(world, startingPoint);
|
||||
}
|
||||
|
||||
if (this.World.Game.QuestProgress.QuestTriggers.ContainsKey(this.Destination.DestLevelAreaSNO)) //EnterLevelArea
|
||||
if (World.Game.QuestProgress.QuestTriggers.ContainsKey(Destination.DestLevelAreaSNO)) //EnterLevelArea
|
||||
{
|
||||
var trigger = this.World.Game.QuestProgress.QuestTriggers[this.Destination.DestLevelAreaSNO];
|
||||
var trigger = World.Game.QuestProgress.QuestTriggers[Destination.DestLevelAreaSNO];
|
||||
if (trigger.triggerType == DiIiS_NA.Core.MPQ.FileFormats.QuestStepObjectiveType.EnterLevelArea)
|
||||
{
|
||||
try
|
||||
{
|
||||
trigger.questEvent.Execute(this.World); // launch a questEvent
|
||||
trigger.questEvent.Execute(World); // launch a questEvent
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@ -123,14 +123,14 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.World.Game.SideQuestProgress.QuestTriggers.ContainsKey(this.Destination.DestLevelAreaSNO)) //EnterLevelArea
|
||||
if (World.Game.SideQuestProgress.QuestTriggers.ContainsKey(Destination.DestLevelAreaSNO)) //EnterLevelArea
|
||||
{
|
||||
var trigger = this.World.Game.SideQuestProgress.QuestTriggers[this.Destination.DestLevelAreaSNO];
|
||||
var trigger = World.Game.SideQuestProgress.QuestTriggers[Destination.DestLevelAreaSNO];
|
||||
if (trigger.triggerType == DiIiS_NA.Core.MPQ.FileFormats.QuestStepObjectiveType.EnterLevelArea)
|
||||
{
|
||||
try
|
||||
{
|
||||
trigger.questEvent.Execute(this.World); // launch a questEvent
|
||||
trigger.questEvent.Execute(World); // launch a questEvent
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@ -138,15 +138,15 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.World.Game.SideQuestProgress.GlobalQuestTriggers.ContainsKey(this.Destination.DestLevelAreaSNO)) //EnterLevelArea
|
||||
if (World.Game.SideQuestProgress.GlobalQuestTriggers.ContainsKey(Destination.DestLevelAreaSNO)) //EnterLevelArea
|
||||
{
|
||||
var trigger = this.World.Game.SideQuestProgress.GlobalQuestTriggers[this.Destination.DestLevelAreaSNO];
|
||||
var trigger = World.Game.SideQuestProgress.GlobalQuestTriggers[Destination.DestLevelAreaSNO];
|
||||
if (trigger.triggerType == DiIiS_NA.Core.MPQ.FileFormats.QuestStepObjectiveType.EnterLevelArea)
|
||||
{
|
||||
try
|
||||
{
|
||||
trigger.questEvent.Execute(this.World); // launch a questEvent
|
||||
this.World.Game.SideQuestProgress.GlobalQuestTriggers.Remove(this.Destination.DestLevelAreaSNO);
|
||||
trigger.questEvent.Execute(World); // launch a questEvent
|
||||
World.Game.SideQuestProgress.GlobalQuestTriggers.Remove(Destination.DestLevelAreaSNO);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@ -154,11 +154,11 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach (var bounty in this.World.Game.QuestManager.Bounties)
|
||||
bounty.CheckLevelArea(this.Destination.DestLevelAreaSNO);
|
||||
foreach (var bounty in World.Game.QuestManager.Bounties)
|
||||
bounty.CheckLevelArea(Destination.DestLevelAreaSNO);
|
||||
}
|
||||
else
|
||||
Logger.Warn("Portal's tagged starting point does not exist (Tag = {0})", this.Destination.StartingPointActorTag);
|
||||
Logger.Warn("Portal's tagged starting point does not exist (Tag = {0})", Destination.StartingPointActorTag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,51 @@
|
||||
using System.Linq;
|
||||
using DiIiS_NA.D3_GameServer.Core.Types.SNO;
|
||||
using DiIiS_NA.GameServer.GSSystem.ActorSystem;
|
||||
using DiIiS_NA.GameServer.GSSystem.AISystem.Brains;
|
||||
using DiIiS_NA.GameServer.GSSystem.MapSystem;
|
||||
using DiIiS_NA.GameServer.GSSystem.PlayerSystem;
|
||||
using DiIiS_NA.GameServer.GSSystem.PowerSystem;
|
||||
using DiIiS_NA.GameServer.GSSystem.TickerSystem;
|
||||
using DiIiS_NA.GameServer.MessageSystem;
|
||||
|
||||
namespace DiIiS_NA.D3_GameServer.GSSystem.ActorSystem.Implementations.Minions
|
||||
{
|
||||
abstract class AncientBarbarian : Minion
|
||||
{
|
||||
protected abstract int[] Powers { get; }
|
||||
public abstract AnimationSno IntroAnimation { get; }
|
||||
|
||||
public AncientBarbarian(World world, ActorSno actorSno, PowerContext context) : base(world, actorSno, context.User, null)
|
||||
{
|
||||
Scale = 1.2f; //they look cooler bigger :)
|
||||
//TODO: get a proper value for this.
|
||||
this.WalkSpeed *= 5;
|
||||
this.DamageCoefficient = context.ScriptFormula(11);
|
||||
var brain = new MinionBrain(this);
|
||||
foreach (var power in Powers)
|
||||
{
|
||||
brain.AddPresetPower(power);
|
||||
}
|
||||
SetBrain(brain);
|
||||
Attributes[GameAttribute.Summoned_By_SNO] = context.PowerSNO;
|
||||
Attributes[GameAttribute.Attacks_Per_Second] = 1.0f;
|
||||
|
||||
Attributes[GameAttribute.Damage_Weapon_Min, 0] = context.ScriptFormula(11) * context.User.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0];
|
||||
Attributes[GameAttribute.Damage_Weapon_Delta, 0] = context.ScriptFormula(11) * context.User.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0];
|
||||
|
||||
Attributes[GameAttribute.Pet_Type] = 0x8;
|
||||
//Pet_Owner and Pet_Creator seems to be 0
|
||||
|
||||
if (this.Master != null)
|
||||
{
|
||||
if (this.Master is Player)
|
||||
{
|
||||
if ((this.Master as Player).Followers.Values.Count(a => a == SNO) > 1)
|
||||
(this.Master as Player).DestroyFollower(SNO);
|
||||
}
|
||||
}
|
||||
|
||||
LifeTime = TickTimer.WaitSeconds(world.Game, 30f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,59 +1,26 @@
|
||||
//Blizzless Project 2022
|
||||
using System.Linq;
|
||||
//Blizzless Project 2022
|
||||
using DiIiS_NA.GameServer.MessageSystem;
|
||||
//Blizzless Project 2022
|
||||
using DiIiS_NA.GameServer.GSSystem.AISystem.Brains;
|
||||
//Blizzless Project 2022
|
||||
using DiIiS_NA.GameServer.GSSystem.PowerSystem;
|
||||
//Blizzless Project 2022
|
||||
using DiIiS_NA.GameServer.GSSystem.TickerSystem;
|
||||
//Blizzless Project 2022
|
||||
using DiIiS_NA.GameServer.GSSystem.PlayerSystem;
|
||||
//Blizzless Project 2022
|
||||
using DiIiS_NA.GameServer.GSSystem.MapSystem;
|
||||
using DiIiS_NA.D3_GameServer.Core.Types.SNO;
|
||||
|
||||
namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Minions
|
||||
namespace DiIiS_NA.D3_GameServer.GSSystem.ActorSystem.Implementations.Minions
|
||||
{
|
||||
class AncientKorlic : Minion
|
||||
class AncientKorlic : AncientBarbarian
|
||||
{
|
||||
public new int SummonLimit = 1;
|
||||
|
||||
public AncientKorlic(World world, PowerContext context, int AncientsID)
|
||||
: base(world, ActorSno._barbarian_calloftheancients_1, context.User, null)
|
||||
private static readonly int[] powers = new int[]
|
||||
{
|
||||
Scale = 1.2f; //they look cooler bigger :)
|
||||
//TODO: get a proper value for this.
|
||||
this.WalkSpeed *= 5;
|
||||
this.DamageCoefficient = context.ScriptFormula(11);
|
||||
SetBrain(new MinionBrain(this));
|
||||
this.Attributes[GameAttribute.Summoned_By_SNO] = context.PowerSNO;
|
||||
(Brain as MinionBrain).AddPresetPower(30592); //Weapon_Instant
|
||||
(Brain as MinionBrain).AddPresetPower(187092); //basic melee
|
||||
(Brain as MinionBrain).AddPresetPower(168823); //cleave
|
||||
(Brain as MinionBrain).AddPresetPower(168824); //furious charge //Only Active with Rune_A
|
||||
//TODO: These values should most likely scale, but we don't know how yet, so just temporary values.
|
||||
//Attributes[GameAttribute.Hitpoints_Max] = 20f;
|
||||
//Attributes[GameAttribute.Hitpoints_Cur] = 20f;
|
||||
Attributes[GameAttribute.Attacks_Per_Second] = 1.0f;
|
||||
|
||||
Attributes[GameAttribute.Damage_Weapon_Min, 0] = context.ScriptFormula(11) * context.User.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0];
|
||||
Attributes[GameAttribute.Damage_Weapon_Delta, 0] = context.ScriptFormula(11) * context.User.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0];
|
||||
|
||||
Attributes[GameAttribute.Pet_Type] = 0x8;
|
||||
//Pet_Owner and Pet_Creator seems to be 0
|
||||
|
||||
if (this.Master != null)
|
||||
30592, //Weapon_Instant
|
||||
187092, //basic melee
|
||||
168823, //cleave
|
||||
168824 //furious charge //Only Active with Rune_A
|
||||
};
|
||||
public AncientKorlic(World world, PowerContext context) : base(world, ActorSno._barbarian_calloftheancients_1, context)
|
||||
{
|
||||
if (this.Master is Player)
|
||||
{
|
||||
if ((this.Master as Player).Followers.Values.Count(a => a == SNO) > 1)
|
||||
(this.Master as Player).DestroyFollower(SNO);
|
||||
}
|
||||
}
|
||||
|
||||
LifeTime = TickTimer.WaitSeconds(world.Game, 30f);
|
||||
}
|
||||
public override AnimationSno IntroAnimation => AnimationSno.barbarian_male_ancients_korlic_intro;
|
||||
|
||||
protected override int[] Powers => powers;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,59 +1,26 @@
|
||||
//Blizzless Project 2022
|
||||
using System.Linq;
|
||||
//Blizzless Project 2022
|
||||
using DiIiS_NA.GameServer.MessageSystem;
|
||||
//Blizzless Project 2022
|
||||
using DiIiS_NA.GameServer.GSSystem.AISystem.Brains;
|
||||
//Blizzless Project 2022
|
||||
using DiIiS_NA.GameServer.GSSystem.PowerSystem;
|
||||
//Blizzless Project 2022
|
||||
using DiIiS_NA.GameServer.GSSystem.TickerSystem;
|
||||
//Blizzless Project 2022
|
||||
using DiIiS_NA.GameServer.GSSystem.PlayerSystem;
|
||||
//Blizzless Project 2022
|
||||
using DiIiS_NA.GameServer.GSSystem.MapSystem;
|
||||
using DiIiS_NA.D3_GameServer.Core.Types.SNO;
|
||||
|
||||
namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Minions
|
||||
namespace DiIiS_NA.D3_GameServer.GSSystem.ActorSystem.Implementations.Minions
|
||||
{
|
||||
class AncientMawdawc : Minion
|
||||
class AncientMawdawc : AncientBarbarian
|
||||
{
|
||||
public new int SummonLimit = 1;
|
||||
|
||||
public AncientMawdawc(World world, PowerContext context, int AncientsID)
|
||||
: base(world, ActorSno._barbarian_calloftheancients_3, context.User, null)
|
||||
private static readonly int[] powers = new int[]
|
||||
{
|
||||
Scale = 1.2f; //they look cooler bigger :)
|
||||
//TODO: get a proper value for this.
|
||||
this.WalkSpeed *= 5;
|
||||
this.DamageCoefficient = context.ScriptFormula(11);
|
||||
SetBrain(new MinionBrain(this));
|
||||
this.Attributes[GameAttribute.Summoned_By_SNO] = context.PowerSNO;
|
||||
(Brain as MinionBrain).AddPresetPower(30592); //Weapon_Instant
|
||||
(Brain as MinionBrain).AddPresetPower(187092); //basic melee
|
||||
(Brain as MinionBrain).AddPresetPower(168827); //Seismic Slam //Only Active with Rune_C
|
||||
(Brain as MinionBrain).AddPresetPower(168828); //Weapon Throw
|
||||
//TODO: These values should most likely scale, but we don't know how yet, so just temporary values.
|
||||
//Attributes[GameAttribute.Hitpoints_Max] = 20f;
|
||||
//Attributes[GameAttribute.Hitpoints_Cur] = 20f;
|
||||
Attributes[GameAttribute.Attacks_Per_Second] = 1.0f;
|
||||
|
||||
Attributes[GameAttribute.Damage_Weapon_Min, 0] = context.ScriptFormula(11) * context.User.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0];
|
||||
Attributes[GameAttribute.Damage_Weapon_Delta, 0] = context.ScriptFormula(11) * context.User.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0];
|
||||
|
||||
Attributes[GameAttribute.Pet_Type] = 0x8;
|
||||
//Pet_Owner and Pet_Creator seems to be 0
|
||||
|
||||
if (this.Master != null)
|
||||
30592, //Weapon_Instant
|
||||
187092, //basic melee
|
||||
168827, //Seismic Slam //Only Active with Rune_C
|
||||
168828 //Weapon Throw
|
||||
};
|
||||
public AncientMawdawc(World world, PowerContext context) : base(world, ActorSno._barbarian_calloftheancients_3, context)
|
||||
{
|
||||
if (this.Master is Player)
|
||||
{
|
||||
if ((this.Master as Player).Followers.Values.Count(a => a == SNO) > 1)
|
||||
(this.Master as Player).DestroyFollower(SNO);
|
||||
}
|
||||
}
|
||||
|
||||
LifeTime = TickTimer.WaitSeconds(world.Game, 30f);
|
||||
}
|
||||
public override AnimationSno IntroAnimation => AnimationSno.barbarian_male_ancients_mawdawc_intro;
|
||||
|
||||
protected override int[] Powers => powers;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,59 +1,26 @@
|
||||
//Blizzless Project 2022
|
||||
using System.Linq;
|
||||
//Blizzless Project 2022
|
||||
using DiIiS_NA.GameServer.MessageSystem;
|
||||
//Blizzless Project 2022
|
||||
using DiIiS_NA.GameServer.GSSystem.AISystem.Brains;
|
||||
//Blizzless Project 2022
|
||||
using DiIiS_NA.GameServer.GSSystem.PowerSystem;
|
||||
//Blizzless Project 2022
|
||||
using DiIiS_NA.GameServer.GSSystem.TickerSystem;
|
||||
//Blizzless Project 2022
|
||||
using DiIiS_NA.GameServer.GSSystem.PlayerSystem;
|
||||
//Blizzless Project 2022
|
||||
using DiIiS_NA.GameServer.GSSystem.MapSystem;
|
||||
using DiIiS_NA.D3_GameServer.Core.Types.SNO;
|
||||
|
||||
namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Minions
|
||||
namespace DiIiS_NA.D3_GameServer.GSSystem.ActorSystem.Implementations.Minions
|
||||
{
|
||||
class AncientTalic : Minion
|
||||
class AncientTalic : AncientBarbarian
|
||||
{
|
||||
public new int SummonLimit = 1;
|
||||
|
||||
public AncientTalic(World world, PowerContext context, int AncientsID)
|
||||
: base(world, ActorSno._barbarian_calloftheancients_2, context.User, null)
|
||||
private static readonly int[] powers = new int[]
|
||||
{
|
||||
Scale = 1.2f; //they look cooler bigger :)
|
||||
//TODO: get a proper value for this.
|
||||
this.WalkSpeed *= 5;
|
||||
this.DamageCoefficient = context.ScriptFormula(11);
|
||||
SetBrain(new MinionBrain(this));
|
||||
this.Attributes[GameAttribute.Summoned_By_SNO] = context.PowerSNO;
|
||||
(Brain as MinionBrain).AddPresetPower(30592); //Weapon_Instant
|
||||
(Brain as MinionBrain).AddPresetPower(187092); //basic melee
|
||||
(Brain as MinionBrain).AddPresetPower(168825); //Leap //Only Active with Rune_E
|
||||
(Brain as MinionBrain).AddPresetPower(168830); //WhirlWind
|
||||
//TODO: These values should most likely scale, but we don't know how yet, so just temporary values.
|
||||
//Attributes[GameAttribute.Hitpoints_Max] = 20f;
|
||||
//Attributes[GameAttribute.Hitpoints_Cur] = 20f;
|
||||
Attributes[GameAttribute.Attacks_Per_Second] = 1.0f;
|
||||
|
||||
Attributes[GameAttribute.Damage_Weapon_Min, 0] = context.ScriptFormula(11) * context.User.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0];
|
||||
Attributes[GameAttribute.Damage_Weapon_Delta, 0] = context.ScriptFormula(11) * context.User.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0];
|
||||
|
||||
Attributes[GameAttribute.Pet_Type] = 0x8;
|
||||
//Pet_Owner and Pet_Creator seems to be 0
|
||||
|
||||
if (this.Master != null)
|
||||
30592, //Weapon_Instant
|
||||
187092, //basic melee
|
||||
168825, //Leap //Only Active with Rune_E
|
||||
168830 //WhirlWind
|
||||
};
|
||||
public AncientTalic(World world, PowerContext context) : base(world, ActorSno._barbarian_calloftheancients_2, context)
|
||||
{
|
||||
if (this.Master is Player)
|
||||
{
|
||||
if ((this.Master as Player).Followers.Values.Count(a => a == SNO) > 1)
|
||||
(this.Master as Player).DestroyFollower(SNO);
|
||||
}
|
||||
}
|
||||
|
||||
LifeTime = TickTimer.WaitSeconds(world.Game, 30f);
|
||||
}
|
||||
public override AnimationSno IntroAnimation => AnimationSno.barbarian_male_ancients_talic_intro;
|
||||
|
||||
protected override int[] Powers => powers;
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,11 +41,11 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Minions
|
||||
if (context.User.Attributes[GameAttribute.Rune_B, 0x000592ff] > 0) Scale = 2f; //Boar
|
||||
if (context.User.Attributes[GameAttribute.Rune_C, 0x000592ff] > 0) Scale = 2f; //Wolf
|
||||
//TODO: get a proper value for this.
|
||||
this.WalkSpeed *= 5;
|
||||
this.DamageCoefficient = context.ScriptFormula(0);
|
||||
this.Attributes[GameAttribute.Invulnerable] = true;
|
||||
this.Attributes[GameAttribute.Is_Helper] = true;
|
||||
this.Attributes[GameAttribute.Summoned_By_SNO] = context.PowerSNO;
|
||||
WalkSpeed *= 5;
|
||||
DamageCoefficient = context.ScriptFormula(0);
|
||||
Attributes[GameAttribute.Invulnerable] = true;
|
||||
Attributes[GameAttribute.Is_Helper] = true;
|
||||
Attributes[GameAttribute.Summoned_By_SNO] = context.PowerSNO;
|
||||
if (CompanionSNO == ActorSno._dh_companion_ferret)
|
||||
SetBrain(new LooterBrain(this, false));
|
||||
else
|
||||
|
||||
@ -25,10 +25,10 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Minions
|
||||
{
|
||||
Scale = 0.7f; //they look cooler bigger :)
|
||||
//TODO: get a proper value for this.
|
||||
this.WalkSpeed *= 5;
|
||||
this.DamageCoefficient = context.ScriptFormula(16) * 2f;
|
||||
WalkSpeed *= 5;
|
||||
DamageCoefficient = context.ScriptFormula(16) * 2f;
|
||||
SetBrain(new MinionBrain(this));
|
||||
this.Attributes[GameAttribute.Summoned_By_SNO] = context.PowerSNO;
|
||||
Attributes[GameAttribute.Summoned_By_SNO] = context.PowerSNO;
|
||||
(Brain as MinionBrain).AddPresetPower(30592); //melee_instant
|
||||
//(Brain as MinionBrain).AddPresetPower(30005); //AINearby
|
||||
if (context.Rune_C > 0)
|
||||
|
||||
@ -29,10 +29,10 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Minions
|
||||
{
|
||||
Scale = 0.7f; //they look cooler bigger :)
|
||||
//TODO: get a proper value for this.
|
||||
this.WalkSpeed *= 5;
|
||||
this.DamageCoefficient = context.ScriptFormula(16) * 2f;
|
||||
WalkSpeed *= 5;
|
||||
DamageCoefficient = context.ScriptFormula(16) * 2f;
|
||||
SetBrain(new MinionBrain(this));
|
||||
this.Attributes[GameAttribute.Summoned_By_SNO] = context.PowerSNO;
|
||||
Attributes[GameAttribute.Summoned_By_SNO] = context.PowerSNO;
|
||||
(Brain as MinionBrain).AddPresetPower(30592); //melee_instant
|
||||
//(Brain as MinionBrain).AddPresetPower(30005); //AINearby
|
||||
if (context.Rune_C > 0)
|
||||
@ -49,16 +49,16 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Minions
|
||||
Attributes[GameAttribute.Pet_Type] = 0x8;
|
||||
//Pet_Owner and Pet_Creator seems to be 0
|
||||
|
||||
if (this.Master != null)
|
||||
if (Master != null)
|
||||
{
|
||||
if (this.Master is Player)
|
||||
if (Master is Player)
|
||||
{
|
||||
var rem = new List<uint>();
|
||||
foreach (var fol in (this.Master as Player).Followers)
|
||||
if (fol.Value == SNO && fol.Key != this.GlobalID)
|
||||
foreach (var fol in (Master as Player).Followers)
|
||||
if (fol.Value == SNO && fol.Key != GlobalID)
|
||||
rem.Add(fol.Key);
|
||||
foreach (var rm in rem)
|
||||
(this.Master as Player).DestroyFollowerById(rm);
|
||||
(Master as Player).DestroyFollowerById(rm);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -26,10 +26,10 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Minions
|
||||
{
|
||||
Scale = 1.2f; //they look cooler bigger :)
|
||||
//TODO: get a proper value for this.
|
||||
this.WalkSpeed *= 5;
|
||||
this.DamageCoefficient = context.ScriptFormula(14) * 2f;
|
||||
WalkSpeed *= 5;
|
||||
DamageCoefficient = context.ScriptFormula(14) * 2f;
|
||||
SetBrain(new MinionBrain(this));
|
||||
this.Attributes[GameAttribute.Summoned_By_SNO] = context.PowerSNO;
|
||||
Attributes[GameAttribute.Summoned_By_SNO] = context.PowerSNO;
|
||||
(Brain as MinionBrain).AddPresetPower(119166); //fetisharmy_hunter.pow
|
||||
//TODO: These values should most likely scale, but we don't know how yet, so just temporary values.
|
||||
//Attributes[GameAttribute.Hitpoints_Max] = 20f;
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
//Blizzless Project 2022
|
||||
using System.Linq;
|
||||
//Blizzless Project 2022
|
||||
using DiIiS_NA.GameServer.MessageSystem;
|
||||
//Blizzless Project 2022
|
||||
using DiIiS_NA.GameServer.GSSystem.AISystem.Brains;
|
||||
@ -9,11 +7,8 @@ using DiIiS_NA.GameServer.GSSystem.PowerSystem;
|
||||
//Blizzless Project 2022
|
||||
using DiIiS_NA.GameServer.GSSystem.TickerSystem;
|
||||
//Blizzless Project 2022
|
||||
using DiIiS_NA.GameServer.GSSystem.PlayerSystem;
|
||||
//Blizzless Project 2022
|
||||
using DiIiS_NA.GameServer.GSSystem.MapSystem;
|
||||
//Blizzless Project 2022
|
||||
using System.Collections.Generic;
|
||||
using DiIiS_NA.D3_GameServer.Core.Types.SNO;
|
||||
|
||||
namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Minions
|
||||
@ -26,10 +21,10 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations.Minions
|
||||
{
|
||||
Scale = 1.2f; //they look cooler bigger :)
|
||||
//TODO: get a proper value for this.
|
||||
this.WalkSpeed *= 5;
|
||||
this.DamageCoefficient = context.ScriptFormula(22) * 2f;
|
||||
WalkSpeed *= 5;
|
||||
DamageCoefficient = context.ScriptFormula(22) * 2f;
|
||||
SetBrain(new MinionBrain(this));
|
||||
this.Attributes[GameAttribute.Summoned_By_SNO] = context.PowerSNO;
|
||||
Attributes[GameAttribute.Summoned_By_SNO] = context.PowerSNO;
|
||||
//TODO: These values should most likely scale, but we don't know how yet, so just temporary values.
|
||||
//Attributes[GameAttribute.Hitpoints_Max] = 20f;
|
||||
//Attributes[GameAttribute.Hitpoints_Cur] = 20f;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
user.block.title