Merge remote-tracking branch 'origin/community' into community
This commit is contained in:
commit
9750e23e24
@ -460,25 +460,25 @@ namespace DiIiS_NA.GameServer.AchievementSystem
|
||||
|
||||
public static void CheckLevelCap(BattleClient client)
|
||||
{
|
||||
var capped_toons = DBSessions.SessionQueryWhere<DBToon>(dbt =>
|
||||
var cappedToons = DBSessions.SessionQueryWhere<DBToon>(dbt =>
|
||||
dbt.DBGameAccount.Id == client.Account.GameAccount.PersistentID &&
|
||||
dbt.Level == 60);
|
||||
if (capped_toons.Count() >= 2)
|
||||
if (cappedToons.Count >= 2)
|
||||
GrantAchievement(client, 74987243307116);
|
||||
if (capped_toons.Count() >= 5)
|
||||
if (cappedToons.Count >= 5)
|
||||
GrantAchievement(client, 74987243307118);
|
||||
if (capped_toons.Count() >= 10)
|
||||
if (cappedToons.Count >= 10)
|
||||
GrantAchievement(client, 74987243307120);
|
||||
|
||||
int different_classes = 0;
|
||||
int differentClasses = 0;
|
||||
|
||||
foreach (ToonClass toon_class in (ToonClass[])Enum.GetValues(typeof(ToonClass)))
|
||||
foreach (ToonClass toonClass in Enum.GetValues<ToonClass>())
|
||||
{
|
||||
var toons = capped_toons.Where(t => t.Class == toon_class);
|
||||
if (toons.Count() > 0) different_classes++;
|
||||
if (toons.Count() >= 2)
|
||||
var toons = cappedToons.Where(t => t.Class == toonClass).ToArray();
|
||||
if (toons.Length > 0) differentClasses++;
|
||||
if (toons.Length >= 2)
|
||||
{
|
||||
switch (toon_class)
|
||||
switch (toonClass)
|
||||
{
|
||||
case ToonClass.Barbarian:
|
||||
GrantAchievement(client, 74987243307044);
|
||||
@ -499,10 +499,10 @@ namespace DiIiS_NA.GameServer.AchievementSystem
|
||||
}
|
||||
}
|
||||
|
||||
if (different_classes >= 2)
|
||||
if (differentClasses >= 2)
|
||||
GrantAchievement(client, 74987243307121);
|
||||
|
||||
if (different_classes >= 5)
|
||||
if (differentClasses >= 5)
|
||||
GrantAchievement(client, 74987243307362);
|
||||
}
|
||||
|
||||
|
||||
@ -100,20 +100,18 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem
|
||||
|
||||
// Find a childnode with a matching class id, that one holds information about how long the speaker talks
|
||||
// If there is no matching childnode, there must be one with -1 which only combines all class specific into one
|
||||
private int duration
|
||||
private int GetDuration()
|
||||
{
|
||||
get
|
||||
{
|
||||
var node = from a in currentLineNode.ChildNodes
|
||||
where a.ClassFilter == player.Toon.VoiceClassID
|
||||
select a;
|
||||
if (node.Count() == 0)
|
||||
node = from a in currentLineNode.ChildNodes where a.ClassFilter == -1 select a;
|
||||
if (node.Count() == 0) return 1;
|
||||
var node = currentLineNode.ChildNodes.FirstOrDefault(a => a.ClassFilter == player.Toon.VoiceClassID);
|
||||
node ??= currentLineNode.ChildNodes.FirstOrDefault(a => a.ClassFilter == -1);
|
||||
|
||||
return node.First().CompressedDisplayTimes.ElementAt((int)manager.ClientLanguage)
|
||||
.Languages[player.Toon.VoiceClassID * 2 + (player.Toon.Gender == 0 ? 0 : 1)];
|
||||
if (node == null)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
return node.CompressedDisplayTimes[(int)manager.ClientLanguage]
|
||||
.Languages[player.Toon.VoiceClassID * 2 + (player.Toon.Gender == 0 ? 0 : 1)];
|
||||
}
|
||||
|
||||
// This returns the dynamicID of other conversation partners. The client uses its position to identify where you can hear the conversation.
|
||||
@ -564,26 +562,27 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem
|
||||
/// <summary>
|
||||
/// Starts readout and display of a certain conversation line
|
||||
/// </summary>
|
||||
/// <param name="LineIndex">index of the line withing the rootnodes</param>
|
||||
private void PlayLine(int LineIndex)
|
||||
/// <param name="lineIndex">index of the line withing the rootnodes</param>
|
||||
private void PlayLine(int lineIndex)
|
||||
{
|
||||
if (asset.RootTreeNodes[LineIndex].ConvNodeType == 6)
|
||||
if (asset.RootTreeNodes[lineIndex].ConvNodeType == 6)
|
||||
{
|
||||
currentLineNode = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (asset.RootTreeNodes[LineIndex].ConvNodeType == 4)
|
||||
currentLineNode = asset.RootTreeNodes[LineIndex]
|
||||
.ChildNodes[RandomHelper.Next(asset.RootTreeNodes[LineIndex].ChildNodes.Count)];
|
||||
if (asset.RootTreeNodes[lineIndex].ConvNodeType == 4)
|
||||
currentLineNode = asset.RootTreeNodes[lineIndex]
|
||||
.ChildNodes[RandomHelper.Next(asset.RootTreeNodes[lineIndex].ChildNodes.Count)];
|
||||
else
|
||||
currentLineNode = asset.RootTreeNodes[LineIndex];
|
||||
currentLineNode = asset.RootTreeNodes[lineIndex];
|
||||
|
||||
currentUniqueLineID = manager.GetNextUniqueLineID();
|
||||
|
||||
if (!GetSpeaker(currentLineNode.LineSpeaker).IsRevealedToPlayer(player))
|
||||
GetSpeaker(currentLineNode.LineSpeaker).Reveal(player);
|
||||
|
||||
var duration = GetDuration();
|
||||
startTick = player.World.Game.TickCounter;
|
||||
endTick = startTick + duration;
|
||||
|
||||
@ -592,7 +591,7 @@ namespace DiIiS_NA.GameServer.GSSystem.PlayerSystem
|
||||
{
|
||||
ActorID = GetSpeaker(currentLineNode.LineSpeaker)
|
||||
.DynamicID(player), // GetActorBySNO(asset.SNOPrimaryNpc).DynamicID,
|
||||
Field1 = new uint[9]
|
||||
Field1 = new[]
|
||||
{
|
||||
player.DynamicID(player),
|
||||
asset.SNOPrimaryNpc != -1
|
||||
|
||||
@ -286,18 +286,21 @@ namespace DiIiS_NA.GameServer.GSSystem.PowerSystem.Implementations
|
||||
|
||||
yield return WaitSeconds(0.2f);
|
||||
|
||||
var additional_targets = GetEnemiesInRadius(User.Position, ScriptFormula(3)).Actors.OrderBy(actor => PowerMath.Distance2D(actor.Position, User.Position)).Take((int)ScriptFormula(4));
|
||||
var additionalTargets = GetEnemiesInRadius(User.Position, ScriptFormula(3)).Actors
|
||||
.OrderBy(actor => PowerMath.Distance2D(actor.Position, User.Position))
|
||||
.Take((int)ScriptFormula(4))
|
||||
.ToArray();
|
||||
|
||||
foreach (var target in additional_targets)
|
||||
foreach (var target in additionalTargets)
|
||||
{
|
||||
target.PlayEffectGroup(RuneSelect(336292, 338256, 338255, 338254, 343105, 336292));
|
||||
AttackPayload additional_attack = new AttackPayload(this);
|
||||
additional_attack.SetSingleTarget(target);
|
||||
additional_attack.AddWeaponDamage(ScriptFormula(9), DamageType.Holy);
|
||||
additional_attack.Apply();
|
||||
AttackPayload additionalAttack = new AttackPayload(this);
|
||||
additionalAttack.SetSingleTarget(target);
|
||||
additionalAttack.AddWeaponDamage(ScriptFormula(9), DamageType.Holy);
|
||||
additionalAttack.Apply();
|
||||
if (Rune_A > 0) //Shared fates (buff slot 0)
|
||||
foreach (var otherTarget in additional_targets)
|
||||
if (!(otherTarget == target))
|
||||
foreach (var otherTarget in additionalTargets)
|
||||
if (otherTarget != target)
|
||||
if (PowerMath.Distance2D(otherTarget.Position, target.Position) > 10f) //for now
|
||||
if (!HasBuff<DebuffStunned>(otherTarget))
|
||||
AddBuff(otherTarget, new DebuffStunned(WaitSeconds(ScriptFormula(32))));
|
||||
@ -308,14 +311,12 @@ namespace DiIiS_NA.GameServer.GSSystem.PowerSystem.Implementations
|
||||
|
||||
if (Rune_C > 0) //Shatter
|
||||
{
|
||||
AttackPayload explosion_attack = new AttackPayload(this);
|
||||
explosion_attack.Targets = GetEnemiesInRadius(target.Position, ScriptFormula(23));
|
||||
explosion_attack.AddWeaponDamage(ScriptFormula(6), DamageType.Holy);
|
||||
explosion_attack.Apply();
|
||||
AttackPayload explosionAttack = new AttackPayload(this);
|
||||
explosionAttack.Targets = GetEnemiesInRadius(target.Position, ScriptFormula(23));
|
||||
explosionAttack.AddWeaponDamage(ScriptFormula(6), DamageType.Holy);
|
||||
explosionAttack.Apply();
|
||||
}
|
||||
}
|
||||
|
||||
yield break;
|
||||
}
|
||||
|
||||
[ImplementsPowerBuff(1, true)]
|
||||
|
||||
@ -1274,30 +1274,33 @@ namespace DiIiS_NA.GameServer.GSSystem.PowerSystem.Implementations
|
||||
|
||||
if (Rune_B > 0) //Raging Storm
|
||||
{
|
||||
var twisters = Twister.GetActorsInRange<EffectActor>(5f).Where(i => ((i.SNO == ActorSno._wizard_tornado) && (i != Twister)));
|
||||
if (twisters.Count() > 0)
|
||||
var twisters = Twister.GetActorsInRange<EffectActor>(5f)
|
||||
.Where(i => i.SNO == ActorSno._wizard_tornado && i != Twister)
|
||||
.ToArray();
|
||||
|
||||
if (twisters.Length > 0)
|
||||
{
|
||||
foreach (var twist in twisters)
|
||||
twist.Destroy();
|
||||
|
||||
var bigMultiplier = ScriptFormula(2) * 0.5f / ScriptFormula(4);
|
||||
|
||||
var BigTwister = new EffectActor(this, ActorSno._wizard_tornado_big, Twister.Position);
|
||||
BigTwister.Timeout = WaitSeconds(ScriptFormula(4));
|
||||
BigTwister.Scale = 1f;
|
||||
BigTwister.Spawn();
|
||||
var bigTwister = new EffectActor(this, ActorSno._wizard_tornado_big, Twister.Position);
|
||||
bigTwister.Timeout = WaitSeconds(ScriptFormula(4));
|
||||
bigTwister.Scale = 1f;
|
||||
bigTwister.Spawn();
|
||||
|
||||
BigTwister.UpdateDelay = 0.5f;
|
||||
BigTwister.OnUpdate = () =>
|
||||
bigTwister.UpdateDelay = 0.5f;
|
||||
bigTwister.OnUpdate = () =>
|
||||
{
|
||||
ActorMover _bigTwisterMover = new ActorMover(BigTwister);
|
||||
_bigTwisterMover.Move(TargetPosition, ScriptFormula(18), new ACDTranslateNormalMessage
|
||||
ActorMover bigTwisterMover = new ActorMover(bigTwister);
|
||||
bigTwisterMover.Move(TargetPosition, ScriptFormula(18), new ACDTranslateNormalMessage
|
||||
{
|
||||
SnapFacing = true,
|
||||
AnimationTag = 69728,
|
||||
});
|
||||
TargetPosition = PowerMath.GenerateSpreadPositions(BigTwister.Position, TargetPosition, 20f, 3)[FastRandom.Instance.Next(0, 3)];
|
||||
WeaponDamage(GetEnemiesInRadius(BigTwister.Position, 12f), bigMultiplier, DamageType.Arcane);
|
||||
TargetPosition = PowerMath.GenerateSpreadPositions(bigTwister.Position, TargetPosition, 20f, 3)[FastRandom.Instance.Next(0, 3)];
|
||||
WeaponDamage(GetEnemiesInRadius(bigTwister.Position, 12f), bigMultiplier, DamageType.Arcane);
|
||||
};
|
||||
Twister.Destroy();
|
||||
}
|
||||
@ -1861,8 +1864,11 @@ namespace DiIiS_NA.GameServer.GSSystem.PowerSystem.Implementations
|
||||
}
|
||||
if (Rune_B > 0 && Rand.NextDouble() < ScriptFormula(12)) //Cascade
|
||||
{
|
||||
var cascadeTargets = GetEnemiesInRadius(hitPayload.Target.Position, ScriptFormula(24)).Actors.Where(i => i != hitPayload.Target);
|
||||
if (cascadeTargets.Count() == 0) return;
|
||||
var cascadeTarget = GetEnemiesInRadius(hitPayload.Target.Position, ScriptFormula(24)).Actors.FirstOrDefault(i => i != hitPayload.Target);
|
||||
if (cascadeTarget == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var proj = new Projectile(this, ActorSno._wizard_arcanetorrent_projectile_indigo_spawner, hitPayload.Target.Position);
|
||||
proj.Position.Z += 5f;
|
||||
@ -1873,7 +1879,7 @@ namespace DiIiS_NA.GameServer.GSSystem.PowerSystem.Implementations
|
||||
WeaponDamage(GetEnemiesInRadius(hit.Position, 5f), ScriptFormula(13) * EffectsPerSecond * User.Attributes[GameAttribute.Attacks_Per_Second_Total], DamageType.Arcane);
|
||||
proj.Destroy();
|
||||
};
|
||||
proj.Launch(cascadeTargets.FirstOrDefault().Position, ScriptFormula(23));
|
||||
proj.Launch(cascadeTarget.Position, ScriptFormula(23));
|
||||
}
|
||||
if (Rune_D > 0) //Power Stone
|
||||
{
|
||||
@ -3150,14 +3156,15 @@ namespace DiIiS_NA.GameServer.GSSystem.PowerSystem.Implementations
|
||||
}
|
||||
}
|
||||
|
||||
var projectiles_around = TimeWarp.GetObjectsInRange<Projectile>(40f).Where(p => PowerMath.Distance2D(p.Position, TimeWarp.Position) > 20f);
|
||||
if (projectiles_around.Count() > 0)
|
||||
foreach (Projectile actor in projectiles_around)
|
||||
var projectilesAround = TimeWarp.GetObjectsInRange<Projectile>(40f).Where(p => PowerMath.Distance2D(p.Position, TimeWarp.Position) > 20f);
|
||||
foreach (Projectile actor in projectilesAround)
|
||||
{
|
||||
if (actor.Slowed)
|
||||
{
|
||||
actor.Slowed = false;
|
||||
actor.Attributes[GameAttribute.Projectile_Speed] *= 10f;
|
||||
}
|
||||
}
|
||||
|
||||
var projectiles = TimeWarp.GetObjectsInRange<Projectile>(20f);
|
||||
if (projectiles.Count > 0)
|
||||
@ -3925,17 +3932,18 @@ namespace DiIiS_NA.GameServer.GSSystem.PowerSystem.Implementations
|
||||
AddBuff(actor, new SlowTimeDebuff(ScriptFormula(3), WaitSeconds(0.2f + ScriptFormula(1))));
|
||||
}
|
||||
|
||||
var projectiles_around = User.GetObjectsInRange<Projectile>(40f).Where(p => PowerMath.Distance2D(p.Position, User.Position) > 20f);
|
||||
if (projectiles_around.Count() > 0)
|
||||
foreach (Projectile actor in projectiles_around)
|
||||
var projectilesAround = User.GetObjectsInRange<Projectile>(40f).Where(p => PowerMath.Distance2D(p.Position, User.Position) > 20f);
|
||||
foreach (Projectile actor in projectilesAround)
|
||||
{
|
||||
if (actor.Slowed)
|
||||
{
|
||||
actor.Slowed = false;
|
||||
actor.Attributes[GameAttribute.Projectile_Speed] *= 10f;
|
||||
}
|
||||
}
|
||||
|
||||
var projectiles = User.GetObjectsInRange<Projectile>(20f);
|
||||
if (projectiles.Count() > 0)
|
||||
if (projectiles.Count > 0)
|
||||
foreach (Projectile actor in projectiles)
|
||||
if (!actor.Slowed)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
user.block.title