Skip to content

Commit

Permalink
[Game] Combat, Items, Doodads, Boats and more (#230)
Browse files Browse the repository at this point in the history
* [Items] Set Bonuses Implemented

* [Effects] FIx Bonus Calculation

* [Doodad] Prevent crash from happening

* [Skills] Combat buffs start

* [Skill] Optional GCD Bypass

* [Skills] GlobalCooldownMul(Attack Speed) Implemented

* [Items] Added Wield Buffs & Fixed GCDMul

* [Misc] Add safeguards to not go above level 55

* [Genesis] Add CI

* [Misc] Demo loading of Buff Modifiers

* [Buffs] Fixed Buff Durations

* [Buffs]RemoveOn Enum Created

* [Skills] Fix for SkillController animation

* [Skills] Forgot to write ActorFlags..

* Fix boats

* [Boats] Basic boat movement

* [Boats] Cleanup

* [Combat] Added Hostility Checks for Safe Zones

* [Combat] Initialize hostilePlayers

* [Boat] Fix position issue

* [Combat] SafeZone Fixes

* [Combat] SafeZone & Flagging Fixes

* [Commands] ClearCombat QOL

* [Skills] Fix charge count server side, proper use of charge for damage & heals

* [Unit] Attributes Cleanup / Fix HitRate Gems

* [Buffs] Some Weird Stuff With Triggers/Combat Buffs

god help us

* [Boats] Attempt to fix the doodad issue, MySlave ping, drag/steer fix

* [Doodads] Add nullcheck on attach

* [Boats] Broadcast the attach/deattach packets

* [Boats] Fix attachment reason & bond kind

* [Boats] Spawn attached slaves (cannons)

* [Boats] Fix cannon skills not dealing dmg

* [Buffs] Triggers & Combat Buff Changes

* [Buffs] Fix combat buff targetting (hack)

* [Targeting] Fix raid targeting

* [TickManager] Implemented & Added Combat Ticks

* [Targeting] Fix raid targeting

* [Combat] Defense Penetration Added

* [Combat] Added Immunity to Combat Roll

* [Combat] Fix Immune Hopefully

* [Genesis] Add basic Discord bot

* Fix build

* [Skills] Fix damage increase combos

* [AreaTrigger] Fix exceptions, make cuboid "spheres" fitting their size

* [Skills]Add mana burning

* [Skills] Fixes for damage popups

* [Skills]Add immune buffs

* [TickManager] Custom EventHandler

* [Unit] Buff Modifiers (Untested)

* [GameData] Fix loading to use singletons

* [Buffs] Use Duration & InDuration modifiers

* [Skills] Fix server crash related to Area Triggers

* [Slave] Move vehicles (non boats) server side

* [Buffs] Send modified duration in packet

* [Combat] BuffsRemoveOn Started & Attempted to fix channeling plots

* [Plots] Fixed Channeled Buff Removal

* [Plots] Vicious Implosion Fixed

* [Skills] Mana cost

* [Skills] Try to fix FX getting stuck

* [Skills] Add skill interruption (on death, on cc)

* [Items] Fix some enums

* [Skill] CSStartSkill Packet Bug Fix

* [IdManager] Add release queue

* [Skills] Compute normal skills delay properly SCSkillFired

* Fix tests

* [Test] Disable Tl release

* [Test] Release ids

* [Skills] Fix negative GetDistanceTo values

* [Skills] Skill Ids Moved to SkillManager

* [Merge] Fix Merge Conflict

* [TickManager] Added Optional Tickrate

* [Buffs] Rewrite Effects into Buffs

Remove dumb inheriting, remove need to cast to a billion fucking classes every god damn time

* [Various] Fixed HDPS & Minor Fixes

* [Buffs] Subscribe to death event, area trigger tick fix

* [DamageEffect] Added DE Modifiers (HackFix)

* [DE] Precision Strike Hackfix

* [DE] Fix Killing Dead Players

* [Buffs] Add PVP duration reduction

* [Buffs] Area Tick Started

* [Buffs] Fixed TickEffect -> TickEffects

* [Buffs] Add tolerance steps

* [Buffs] Timeout trigger, stack rule refresh, cancellation

* [Unit] CastTimeMul Attr Implemented

* [Healing] Added Critical Healing

* [Character] Remove Testing Line

* [Character] Fix Block Rate From Buffs

* [Stats] Tempering [Skills] Raid targetting for ATs

* [Character] Fall Damage Started

* [Items] Add lunastoning

* [Attribs]Add Melee,Ranged,SpellDamageMul

* [Items] Fix untempered items having 0 stats

* [Items] Armor Grade Buff will only update when moving armor items

* [World]Add model dist to GetAround

* [Doodads] Fix potential crash with AT

* [Unit]Disable unit hp regen, enable proper character hp regen

* [Unit] Add heal multipliers [AT]Fix AT crashing with too many triggers

* [Items/Buffs] ItemGradeBuffs Implemented

* [Items] ItemBuffs Cleanup

* [Buffs] Combat buff update 1

* [Buffs]Fix AreaTick list casting

* [Doodad] Fix SummonDoodad caster pos clone

* [Skills] Fix healing from potions, mana consumption, range calc, self targetting

And armor grade buff on login

* [Buffs] Stop refresh from reducing duration

* [ItemSets] Set Procs & GHA Fixed

* [Buffs]Basic ChargeRefresh stack rule

* [Items]Add armor type set buff

* [Housing] Add /build

* Fix doodad crash

* Doodad crash fix

* [Dispell] Cure/Dispell Correct Targets

* [Combat] Heals Proc Zeal & Float CD Fix

* [Skills]Fix reset 'forgetting' skill points, CB not removing

* [Other] Add dominion declare effect (TODO: save)

* [Misc]Add fall damage popup

* Use backpack with dominion

* [DE] Fix Piercing Shot Damage

* [Buffs] Fix Deaths Vengeance

* [CombatBuffs] IsHeal Arg Implemented

* [Skills]Fix Health/Mana steal

* [Misc] Faction command

* [Buffs] Fix glider buffs staying when landing [Misc] Fix Revive

* [Cmd] Add /kick_player

* [AccessLevels] Default Set To 100

* [Commands] Fix Empty Command Crash

* [Kits] Tentative linux loading fix

* [Unit] IncomingDamageMul Implemented & Update Kits

* [Unit] Fix Spell Dmg Reduc

* [DE] Fix Tick Damage to not be additive

* [Logging] Reduce log spam for very common stuff

* [Procs] Add proc CD [Skills] Fix UseFixedDamage

* Suppress logs

* [Skills] Stop healing dead people, DD04 effects plots

* [World] Reduce Neighborhood size to 2

Makes render distance ~150m, saves up on 2x regions

* [Buffs] Switch to ".ToList()" instead of "new List"

* [Buffs] Fix Ezi's Glider buff staying on after glider removal

* [Skills] Fix Telekinesis

* [Skills] Fix Heal amount on buff ticks

* [AT] Add AreaTrigger try/catch to avoid server crashes

* [Doodad] Log potential infinite loops

* Logging

* [Log] Doodad func exceptions

* Logging

* Add unhandled exception

* Add unhandled exception

* [Boats] Basic physics, need collision testing

* [Plots] Fixed Glider Nitros & Created FallDamageMul Attr

* [Boats]Move via delta

* [Plots] Fix More Glider SkillControllers

* [Buffs] Timeout Buff Trigger Fixed & Limited Duration Times

* [Boats] Collisions... kinda working ?

* Cleanup boat physx

* [Boats] Add ship models

* [Game]Add TowerDef packets & data loading

* [CS] Separate Read & Logic

* Cleanup CSMoveUnit

* [Doodads] Trees now fall

* [Game] Added drowning (#2)

* [Skills] Fix Packet Error after targetting a mailbox & using self skill

* Revert "[IdManager] Add release queue"

This reverts commit ed8f9f0a71a492eddb1e5e6862bf66f83ee4db42.

* [Task] Release TaskId properly

* Task manager catch exception

* [Character] Fix Spell Criticals for Zeal

* Fix boat related crash

Co-authored-by: Hexlulz <[email protected]>
Co-authored-by: Nick Messer <[email protected]>
  • Loading branch information
3 people authored Dec 9, 2020
1 parent c09a150 commit bd90e0b
Show file tree
Hide file tree
Showing 205 changed files with 6,977 additions and 2,162 deletions.
32 changes: 32 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
image: mcr.microsoft.com/dotnet/core/sdk:3.1

stages:
- build
- artifacts

variables:
test: "AAEmu.Test"

build:
stage: build
script:
- dotnet restore
- dotnet build

game_artifacts:
stage: artifacts
artifacts:
paths:
- publish/
script:
- dotnet publish -c Release -o ../publish AAEmu.Game/AAEmu.Game.csproj
- cp -r /builds/genesis/publish/ /host/game

login_artifacts:
stage: artifacts
artifacts:
paths:
- publish/
script:
- dotnet publish -c Release -o ../publish AAEmu.Login/AAEmu.Login.csproj
- cp -r /builds/genesis/publish/ /host/login
9 changes: 7 additions & 2 deletions AAEmu.Game/AAEmu.Game.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Discord.Net" Version="2.2.0" />
<PackageReference Include="Jace" Version="0.9.2" />
<PackageReference Include="JitterPhysics" Version="0.2.0.20" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="2.10.0" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.2.0" />
Expand All @@ -63,6 +65,9 @@
<None Update="Scripts\Commands\ReloadConfigs.cs">
<LinkBase>$([MSBuild]::EnsureTrailingSlash(%(LinkBase)))</LinkBase>
</None>
<None Update="Scripts\Commands\ClearCombat.cs">
<LinkBase>$([MSBuild]::EnsureTrailingSlash(%(LinkBase)))</LinkBase>
</None>
<None Update="Scripts\Commands\TestFSets.cs">
<LinkBase>$([MSBuild]::EnsureTrailingSlash(%(LinkBase)))</LinkBase>
</None>
Expand Down Expand Up @@ -96,8 +101,8 @@
<None Update="Scripts\Commands\TestEcho.cs">
<LinkBase>$([MSBuild]::EnsureTrailingSlash(%(LinkBase)))</LinkBase>
</None>
<None Update="Scripts\Commands\GetAttribute.cs">
<LinkBase>$([MSBuild]::EnsureTrailingSlash(%(LinkBase)))</LinkBase>
<None Update="Scripts\Commands\GetAttribute.cs">
<LinkBase>$([MSBuild]::EnsureTrailingSlash(%(LinkBase)))</LinkBase>
</None>
</ItemGroup>
</Project>
2 changes: 2 additions & 0 deletions AAEmu.Game/Core/Managers/CommandManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ public bool Handle(Character character, string text)

var words = SplitCommandString(text);
// var words = text.Split(' ');
if (words == null || words.Count() == 0)
return false;
var thisCommand = words[0].ToLower();

// Only enable the force_scripts_reload when we don't have anything loaded, this is simply a failsafe function in case
Expand Down
6 changes: 3 additions & 3 deletions AAEmu.Game/Core/Managers/EffectTaskManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ public class EffectTaskManager : Singleton<EffectTaskManager>
/// <summary>
/// Pre-Variant of dispel effects...
/// </summary>
/// <param name="effect"></param>
/// <param name="buff"></param>
/// <param name="interval">milliseconds</param>
public void AddDispelTask(Effect effect, double interval)
public void AddDispelTask(Buff buff, double interval)
{
var task = new DispelTask(effect);
var task = new DispelTask(buff);
TaskManager.Instance.Schedule(task, TimeSpan.FromMilliseconds(interval)); // TODO create normal effect schedule
}
}
Expand Down
95 changes: 67 additions & 28 deletions AAEmu.Game/Core/Managers/ItemManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public class ItemManager : Singleton<ItemManager>

private Dictionary<uint, ItemProcTemplate> _itemProcTemplates;
private Dictionary<ArmorType, Dictionary<ItemGrade, ArmorGradeBuff>> _armorGradeBuffs;
private Dictionary<uint, EquipItemSet> _equipItemSets;

// Events
public event EventHandler OnItemsLoaded;
Expand All @@ -76,6 +77,14 @@ public ItemTemplate GetTemplate(uint id)
return _templates.ContainsKey(id) ? _templates[id] : null;
}

public EquipItemSet GetEquiptItemSet(uint id)
{
if (_equipItemSets.TryGetValue(id, out var value))
return value;
else
return null;
}

public GradeTemplate GetGradeTemplate(int grade)
{
return _grades.ContainsKey(grade) ? _grades[grade] : null;
Expand Down Expand Up @@ -454,6 +463,7 @@ public void Load()
_itemProcTemplates = new Dictionary<uint, ItemProcTemplate>();
_armorGradeBuffs = new Dictionary<ArmorType, Dictionary<ItemGrade, ArmorGradeBuff>>();
_itemUnitModifiers = new Dictionary<uint, List<BonusTemplate>>();
_equipItemSets = new Dictionary<uint, EquipItemSet>();
_config = new ItemConfig();

SkillManager.Instance.OnSkillsLoaded += OnSkillsLoaded;
Expand Down Expand Up @@ -706,6 +716,57 @@ public void Load()
}
}

using (var command = connection.CreateCommand())
{
command.CommandText = "SELECT * FROM item_procs";
command.Prepare();
using (var reader = new SQLiteWrapperReader(command.ExecuteReader()))
{
while (reader.Read())
{
var template = new ItemProcTemplate()
{
Id = reader.GetUInt32("id"),
SkillId = reader.GetUInt32("skill_id"),
ChanceKind = (ProcChanceKind)reader.GetUInt32("chance_kind_id"),
ChanceRate = reader.GetUInt32("chance_rate"),
ChanceParam = reader.GetUInt32("chance_param"),
CooldownSec = reader.GetUInt32("cooldown_sec"),
Finisher = reader.GetBoolean("finisher", true),
ItemLevelBasedChanceBonus = reader.GetUInt32("item_level_based_chance_bonus"),
};

_itemProcTemplates.Add(template.Id, template);
}
}
}


using (var command = connection.CreateCommand())
{
command.CommandText = "SELECT * FROM equip_item_set_bonuses";
command.Prepare();
using (var reader = new SQLiteWrapperReader(command.ExecuteReader()))
{
while (reader.Read())
{
uint id = reader.GetUInt32("equip_item_set_id");
if (!_equipItemSets.ContainsKey(id))
_equipItemSets.Add(id, new EquipItemSet { Id = id });

var bonus = new EquipItemSetBonus()
{
NumPieces = reader.GetInt32("num_pieces"),
BuffId = reader.GetUInt32("buff_id", 0),
ItemProcId = reader.GetUInt32("proc_id", 0)
};

if (bonus.BuffId != 0 || bonus.ItemProcId != 0)
_equipItemSets[id].Bonuses.Add(bonus);
}
}
}

using (var command = connection.CreateCommand())
{
command.CommandText = "SELECT * FROM item_armors";
Expand All @@ -732,7 +793,8 @@ public void Load()
RechargeBuffId = reader.GetUInt32("recharge_buff_id", 0),
ChargeLifetime = reader.GetInt32("charge_lifetime"),
ChargeCount = reader.GetInt32("charge_count"),
ItemLookConvert = GetWearableItemLookConvert(slotTypeId)
ItemLookConvert = GetWearableItemLookConvert(slotTypeId),
EquipItemSetId = reader.GetUInt32("eiset_id", 0)
};
_templates.Add(template.Id, template);
}
Expand Down Expand Up @@ -761,7 +823,8 @@ public void Load()
RechargeBuffId = reader.GetUInt32("recharge_buff_id", 0),
ChargeLifetime = reader.GetInt32("charge_lifetime"),
ChargeCount = reader.GetInt32("charge_count"),
ItemLookConvert = GetHoldableItemLookConvert(holdableId)
ItemLookConvert = GetHoldableItemLookConvert(holdableId),
EquipItemSetId = reader.GetUInt32("eiset_id", 0)
};
_templates.Add(template.Id, template);
}
Expand Down Expand Up @@ -791,7 +854,8 @@ public void Load()
DurabilityMultiplier = reader.GetInt32("durability_multiplier"),
RechargeBuffId = reader.GetUInt32("recharge_buff_id", 0),
ChargeLifetime = reader.GetInt32("charge_lifetime"),
ChargeCount = reader.GetInt32("charge_count")
ChargeCount = reader.GetInt32("charge_count"),
EquipItemSetId = reader.GetUInt32("eiset_id", 0)
};
_templates.Add(template.Id, template);
}
Expand Down Expand Up @@ -1187,31 +1251,6 @@ public void Load()
}
}

using (var command = connection.CreateCommand())
{
command.CommandText = "SELECT * FROM item_procs";
command.Prepare();
using (var reader = new SQLiteWrapperReader(command.ExecuteReader()))
{
while (reader.Read())
{
var template = new ItemProcTemplate()
{
Id = reader.GetUInt32("id"),
SkillId = reader.GetUInt32("skill_id"),
ChanceKind = (ProcChanceKind)reader.GetUInt32("chance_kind_id"),
ChanceRate = reader.GetUInt32("chance_rate"),
ChanceParam = reader.GetUInt32("chance_param"),
CooldownSec = reader.GetUInt32("cooldown_sec"),
Finisher = reader.GetBoolean("finisher", true),
ItemLevelBasedChanceBonus = reader.GetUInt32("item_level_based_chance_bonus"),
};

_itemProcTemplates.Add(template.Id, template);
}
}
}

using(var command = connection.CreateCommand())
{
command.CommandText = "SELECT * FROM unit_modifiers WHERE owner_type='Item'";
Expand Down
4 changes: 3 additions & 1 deletion AAEmu.Game/Core/Managers/MateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using AAEmu.Game.Models.Game.Items;
using AAEmu.Game.Models.Game.Items.Actions;
using AAEmu.Game.Models.Game.Mate;
using AAEmu.Game.Models.Game.Skills.Buffs;
using AAEmu.Game.Models.Game.Units;
using AAEmu.Game.Utils.DB;
using NLog;
Expand Down Expand Up @@ -111,7 +112,7 @@ public void MountMate(GameConnection connection, uint tlId, byte ap, byte reason
mateInfo.Att1 = character.ObjId;
mateInfo.Reason1 = reason;
}

character.Buffs.TriggerRemoveOn(BuffRemoveOn.Mount);
_log.Debug("MountMate. mountTlId: {0}, att1: {1}, att2 {2}, reason: {3}", mateInfo.TlId, mateInfo.Att1, mateInfo.Att2, reason);
}

Expand Down Expand Up @@ -143,6 +144,7 @@ public void UnMountMate(Character character, uint tlId, byte ap, byte reason)

character.Events.OnUnmount(character, new OnUnmountArgs { });

character.Buffs.TriggerRemoveOn(BuffRemoveOn.Unmount);
_log.Debug("UnMountMate. mountTlId: {0}, objId: {1}, att: {2}, reason: {3}", mateInfo.TlId, targetObj.ObjId, unMounted, reason);
}

Expand Down
49 changes: 47 additions & 2 deletions AAEmu.Game/Core/Managers/ModelManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,33 @@ public ActorModel GetActorModel(uint modelId)

var modelType = _modelTypes[modelId];

if (!_models[modelType.SubType].ContainsKey(modelType.SubId))
if (!_models.ContainsKey(modelType.SubType) || !_models[modelType.SubType].ContainsKey(modelType.SubId))
return null;

return (ActorModel) _models[modelType.SubType][modelType.SubId];
}

public ShipModel GetShipModel(uint modelId)
{
if (!_modelTypes.ContainsKey(modelId))
return null;

var modelType = _modelTypes[modelId];

if (!_models.ContainsKey(modelType.SubType) || !_models[modelType.SubType].ContainsKey(modelType.SubId))
return null;

return (ShipModel) _models[modelType.SubType][modelType.SubId];
}

public void Load()
{
_models = new Dictionary<string, Dictionary<uint, Model>>
{
{"ActorModel", new Dictionary<uint, Model>()},
{"VehicleModel", new Dictionary<uint, Model>()},
{"PrefabModel", new Dictionary<uint, Model>()}
{"PrefabModel", new Dictionary<uint, Model>()},
{"ShipModel", new Dictionary<uint, Model>()}
};

_modelTypes = new Dictionary<uint, ModelType>();
Expand All @@ -60,6 +74,37 @@ public void Load()
}
}

using (var command = connection.CreateCommand())
{
command.CommandText = "SELECT * FROM ship_models";
command.Prepare();
using (var reader = new SQLiteWrapperReader(command.ExecuteReader()))
{
while (reader.Read())
{
var model = new ShipModel()
{
Id = reader.GetUInt32("id"),
Velocity = reader.GetFloat("velocity"),
Mass = reader.GetFloat("mass"),
MassCenterX = reader.GetFloat("mass_center_x"),
MassCenterY = reader.GetFloat("mass_center_y"),
MassCenterZ = reader.GetFloat("mass_center_z"),
MassBoxSizeX = reader.GetFloat("mass_box_size_x"),
MassBoxSizeY = reader.GetFloat("mass_box_size_y"),
MassBoxSizeZ = reader.GetFloat("mass_box_size_z"),
SteerVel = reader.GetFloat("steer_vel"),
Accel = reader.GetFloat("accel"),
ReverseAccel = reader.GetFloat("reverse_accel"),
ReverseVelocity = reader.GetFloat("reverse_velocity"),
TurnAccel = reader.GetFloat("turn_accel")
};

_models["ShipModel"].TryAdd(model.Id, model);
}
}
}

using (var command = connection.CreateCommand())
{
command.CommandText = "SELECT * FROM models";
Expand Down
Loading

0 comments on commit bd90e0b

Please sign in to comment.