Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.x] WIP: Initial Action and StatusEffect implementation #958

Merged
merged 56 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
7f70248
Check statuses to determine valid lut entry
arieshi255 Mar 6, 2023
114bd28
Add duration field to statuses
arieshi255 Mar 6, 2023
65ad14a
Rename buildEffects to make more sense
arieshi255 Mar 6, 2023
0cd43df
Add basic generic handler for applying statuseffects
arieshi255 Mar 6, 2023
ed4104c
Add more modifiers
arieshi255 Mar 6, 2023
dd20478
Add basic modifier impl for Chara
arieshi255 Mar 6, 2023
c15ac90
Apply/remove modifiers for statuseffects
arieshi255 Mar 6, 2023
5386f13
Add some example statuses to lut
arieshi255 Feb 21, 2023
b94e7f4
Fix windows build error
arieshi255 Mar 6, 2023
b3098fe
Don't clear tick effect
arieshi255 Feb 21, 2023
b525495
Add status entry for Maim
arieshi255 Mar 7, 2023
bfaec90
Apply status effects properly for self when having a target
arieshi255 Mar 7, 2023
7ad9f96
Fix hasStatusEffect to prevent duplicates
arieshi255 Mar 7, 2023
51b7740
Basic dot/hot ticks implemented
arieshi255 Mar 7, 2023
78acb58
Update HP on tick effects
arieshi255 Mar 7, 2023
6fce046
Apply effect to correct target
arieshi255 Mar 7, 2023
6cbf94d
Add method to simplify applying statuses to self
arieshi255 Mar 7, 2023
801fc9d
Merge pull request #915 from Skyliegirl33/actions
SapphireMordred Mar 8, 2023
aaad18b
Add job actions for warrior
arieshi255 Mar 8, 2023
b56aab7
Add some actions and statuses for war
arieshi255 Mar 8, 2023
995bce4
Add even more modifiers
arieshi255 Mar 8, 2023
390a53a
Add statuseffect cost type
arieshi255 Mar 8, 2023
b5c603a
Add option to not send statusremove order
arieshi255 Mar 8, 2023
ec3c109
Change delModifier assert to return early instead
arieshi255 Mar 8, 2023
9daf224
Add option for scripts to enable the generic/lut handler
arieshi255 Mar 8, 2023
ade5cfa
Add enums for common action values
arieshi255 Mar 8, 2023
b4cd677
fix indentation
arieshi255 Mar 8, 2023
8d08234
Fix modifier name for Defiance
arieshi255 Mar 8, 2023
df4977c
Remove status tick logging
arieshi255 Mar 8, 2023
4870b0b
Merge pull request #919 from Skyliegirl33/actions-war
SapphireMordred Mar 8, 2023
38a0cd1
Move modifiers to statuseffect
arieshi255 Mar 8, 2023
f12e7ec
Add ParryPercent modifier
arieshi255 Mar 8, 2023
df9c51f
Remove wrath when Defiance ends
arieshi255 Mar 8, 2023
ff0a1c8
Apply modifiers in applyStatus
arieshi255 Mar 8, 2023
cf32d4f
Remove unused method
arieshi255 Mar 9, 2023
f4a3c94
Persistence for cross-class skills
arieshi255 Mar 9, 2023
5bb8f11
Add flags to StatusEffects
arieshi255 Mar 12, 2023
293c281
Some exd struct fixes
arieshi255 Mar 12, 2023
49486f5
Some aoe work
arieshi255 Mar 12, 2023
63d9ce5
Add flags to lut
arieshi255 Mar 12, 2023
3f30027
Add missing changeclass
arieshi255 Mar 12, 2023
fb65f72
Merge branch 'master' of https://github.com/SapphireServer/Sapphire i…
arieshi255 Mar 12, 2023
a92076b
Add SET_STATUS_ME to ActionIntegrity
arieshi255 Mar 12, 2023
6e30be3
Merge branch 'master' of https://github.com/SapphireServer/Sapphire i…
arieshi255 Mar 12, 2023
8337d5d
Merge branch 'master' of https://github.com/SapphireServer/Sapphire i…
arieshi255 Mar 12, 2023
8bd74ba
Merge branch 'master' of https://github.com/SapphireServer/Sapphire i…
arieshi255 Mar 12, 2023
f001ee1
Improve offensive action check
arieshi255 Mar 12, 2023
a612516
Merge branch 'master' of https://github.com/SapphireServer/Sapphire i…
arieshi255 Mar 13, 2023
12f289e
Merge branch 'master' of https://github.com/SapphireServer/Sapphire i…
arieshi255 Mar 13, 2023
db9d106
Add flag to overloaded applyStatusEffectSelf
arieshi255 Mar 13, 2023
434eaa6
indentation fix
arieshi255 Mar 13, 2023
9b3e793
Merge pull request #920 from Skyliegirl33/actions-war
SapphireMordred Mar 15, 2023
83590fc
Some calculation work
arieshi255 Jul 23, 2023
97e1772
Merge upstream
arieshi255 Jul 23, 2023
cc63ac1
Null-check ActionResultBuilder
arieshi255 Jun 20, 2024
390426a
Merge branch 'master' of https://github.com/SapphireServer/Sapphire i…
arieshi255 Jun 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
163 changes: 152 additions & 11 deletions data/actions/player.json
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,18 @@
"restorePercentage": 0,
"nextCombo": [],
"statuses": {
"caster": [],
"caster": [
{
"id": 83,
"duration": 20000,
"modifiers": [
{
"modifier": "DefensePercent",
"value": 20
}
]
}
],
"target": []
}
},
Expand All @@ -414,7 +425,18 @@
"nextCombo": [],
"statuses": {
"caster": [],
"target": []
"target": [
{
"id": 244,
"duration": 30000,
"modifiers": [
{
"modifier": "TickDamage",
"value": 20
}
]
}
]
}
},
"34": {
Expand Down Expand Up @@ -478,7 +500,18 @@
45
],
"statuses": {
"caster": [],
"caster": [
{
"id": 85,
"duration": 24000,
"modifiers": [
{
"modifier": "DamageDealtPercent",
"value": 20
}
]
}
],
"target": []
}
},
Expand All @@ -493,7 +526,18 @@
"restorePercentage": 0,
"nextCombo": [],
"statuses": {
"caster": [],
"caster": [
{
"id": 86,
"duration": 20000,
"modifiers": [
{
"modifier": "AttackPowerPercent",
"value": 50
}
]
}
],
"target": []
}
},
Expand Down Expand Up @@ -523,7 +567,18 @@
"restorePercentage": 0,
"nextCombo": [],
"statuses": {
"caster": [],
"caster": [
{
"id": 87,
"duration": 20000,
"modifiers": [
{
"modifier": "HPPercent",
"value": 20
}
]
}
],
"target": []
}
},
Expand Down Expand Up @@ -574,7 +629,7 @@
},
"44": {
"name": "Vengeance",
"potency": 50,
"potency": 0,
"comboPotency": 0,
"flankPotency": 0,
"frontPotency": 0,
Expand All @@ -583,7 +638,18 @@
"restorePercentage": 0,
"nextCombo": [],
"statuses": {
"caster": [],
"caster": [
{
"id": 89,
"duration": 20000,
"modifiers": [
{
"modifier": "ReflectPhysical",
"value": 50
}
]
}
],
"target": []
}
},
Expand Down Expand Up @@ -643,7 +709,34 @@
"restorePercentage": 0,
"nextCombo": [],
"statuses": {
"caster": [],
"caster": [
{
"id": 91,
"duration": 0,
"modifiers": [
{
"modifier": "HPPercent",
"value": 25
},
{
"modifier": "DamageDealtPercent",
"value": -25
},
{
"modifier": "HealingMagicRecoveryPercent",
"value": 20
},
{
"modifier": "AccuracyPercent",
"value": 5
},
{
"modifier": "EnmityPercent",
"value": 20
}
]
}
],
"target": []
}
},
Expand Down Expand Up @@ -703,7 +796,12 @@
"restorePercentage": 0,
"nextCombo": [],
"statuses": {
"caster": [],
"caster": [
{
"id": 97,
"duration": 30000
}
],
"target": []
}
},
Expand Down Expand Up @@ -1176,7 +1274,19 @@
"restorePercentage": 0,
"nextCombo": [],
"statuses": {
"caster": [],
"caster": [
{
"id": 116,
"duration": 10000,
"flag": 4096,
"modifiers": [
{
"modifier": "CriticalHitPercent",
"value": 100
}
]
}
],
"target": []
}
},
Expand Down Expand Up @@ -2454,7 +2564,38 @@
"nextCombo": [],
"statuses": {
"caster": [],
"target": []
"target": [
{
"id": 180,
"duration": 24000,
"modifiers": [
{
"modifier": "TickDamage",
"value": 35
}
]
},
{
"id": 191,
"duration": 24000,
"modifiers": [
{
"modifier": "HealingRecoveryPercent",
"value": -20
}
]
},
{
"id": 240,
"duration": 24000,
"modifiers": [
{
"modifier": "HeavyPercent",
"value": 40
}
]
}
]
}
},
"169": {
Expand Down
13 changes: 7 additions & 6 deletions deps/datReader/Exd/Structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,14 +391,14 @@ namespace Excel
uint8_t EffectWidth;
uint8_t CostType;
uint8_t Cond;
uint8_t RecastGroup;
uint8_t Element;
uint8_t ProcStatus;
uint8_t UseClassJob;
uint8_t ClassJobCategory;
uint8_t RecastGroup;
uint8_t Init;
uint8_t Omen;
uint8_t Unknown;
int8_t Learn;
uint8_t Learn;
int8_t UseClassJob;
int8_t SelectRange;
int8_t SelectCorpse;
int8_t AttackType;
Expand Down Expand Up @@ -430,7 +430,7 @@ namespace Excel
uint8_t HideCastBar : 1;
uint8_t IsTargetLine : 1;

int8_t padding0;
int8_t unknown : 8;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why : 8 ? it is already an 8 bit value.

};

/* 75653 */
Expand Down Expand Up @@ -2054,7 +2054,8 @@ namespace Excel
uint8_t NotControl : 1;
uint8_t NotAction : 1;
uint8_t NotMove : 1;
uint8_t padding0 : 6;
uint8_t padding0 : 5;
uint8_t CanOff : 1;
uint8_t SemiTransparent : 1;
uint8_t FcAction : 1;
int8_t padding1[2];
Expand Down
1 change: 1 addition & 0 deletions sql/migrations/20230309164293_AddBorrowAction.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE `characlass` ADD `BorrowAction` binary(40) DEFAULT NULL NULL AFTER `Lvl`;
4 changes: 3 additions & 1 deletion src/api/PlayerMinimal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,14 @@ void PlayerMinimal::saveAsNew()
break;
}

// CharacterId, ClassIdx, Exp, Lvl
// CharacterId, ClassIdx, Exp, Lvl, BorrowAction
auto stmtClass = g_charaDb.getPreparedStatement( Db::ZoneDbStatements::CHARA_CLASS_INS );
stmtClass->setUInt64( 1, m_characterId );
stmtClass->setInt( 2, g_exdData.getRow< Excel::ClassJob >( m_class )->data().WorkIndex );
stmtClass->setInt( 3, 0 );
stmtClass->setInt( 4, 1 );
std::vector< uint8_t > borrowActionVec( Common::ARRSIZE_BORROWACTION * 4 );
stmtClass->setBinary( 5, borrowActionVec );
g_charaDb.directExecute( stmtClass );

auto stmtSearchInfo = g_charaDb.getPreparedStatement( Db::ZoneDbStatements::CHARA_SEARCHINFO_INS );
Expand Down
71 changes: 53 additions & 18 deletions src/common/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ namespace Sapphire::Common
const uint16_t ARRSIZE_UNLOCKS = 64u;
const uint16_t ARRSIZE_ORCHESTRION = 40u;
const uint16_t ARRSIZE_MONSTERNOTE = 12u;
const uint16_t ARRSIZE_BORROWACTION = 10u;

const uint8_t TOWN_COUNT = 6;

Expand Down Expand Up @@ -887,22 +888,55 @@ namespace Sapphire::Common
Perception = 73,

// Unique modifiers
HPPercent = 1000,
MPPercent = 1001,
TPPercent = 1002,
GPPercent = 1003,
CPPercent = 1004,
PhysicalDamagePercent = 1005,
MagicDamagePercent = 1006,
AttackPowerPercent = 1007,
DefensePercent = 1008,
AccuracyPercent = 1009,
EvasionPercent = 1010,
MagicDefensePercent = 1011,
CriticalHitPowerPercent = 1012,
CriticalHitResiliencePercent = 1013,
CriticalHitPercent = 1014,
EnmityPercent = 1015
TickHeal = 1000,
TickDamage = 1001,
StrengthPercent = 1002,
DexterityPercent = 1003,
VitalityPercent = 1004,
IntelligencePercent = 1005,
MindPercent = 1006,
PietyPercent = 1007,
HPPercent = 1008,
MPPercent = 1009,
TPPercent = 1010,
GPPercent = 1011,
CPPercent = 1012,
PhysicalDamagePercent = 1013,
MagicDamagePercent = 1014,
AttackPowerPercent = 1015,
DefensePercent = 1016,
AccuracyPercent = 1017,
EvasionPercent = 1018,
MagicDefensePercent = 1019,
CriticalHitPowerPercent = 1020,
CriticalHitResiliencePercent = 1021,
CriticalHitPercent = 1022,
EnmityPercent = 1023,
DamageDealtPercent = 1024,
DamageTakenPercent = 1025,
HealingMagicRecoveryPercent = 1026,
SlashingResistancePercent = 1027,
PiercingResistancePercent = 1028,
BluntResistancePercent = 1029,
ProjectileResistancePercent = 1030,
ParryPercent = 1031
};

enum class StatusEffectFlag : uint32_t
{
BuffCategory = 1,
DebuffCategory = 2,
Permanent = 4,
IsGaze = 8,
Transfiguration = 16,
CanDispel = 32,
LockActions = 64,
LockControl = 128,
LockMovement = 256,
Invisibilty = 512,
CanStatusOff = 1024,
FcBuff = 2048,
RemoveOnSuccessfulHit = 4096
};

enum struct ActionAspect : uint8_t
Expand All @@ -923,6 +957,7 @@ namespace Sapphire::Common
MagicPoints = 3,
TacticsPoints = 5,
TacticsPoints1 = 6,
StatusEffect = 10,
Sprint = 18,
// WARGauge = 22,
// DRKGauge = 25,
Expand Down Expand Up @@ -1830,8 +1865,8 @@ namespace Sapphire::Common
{
SingleTarget = 1,
CircularAOE = 2,
Type3 = 3, // another single target? no idea how to call it
RectangularAOE = 4,
RectangularAOE = 3,
ConeAOE = 4,
CircularAoEPlaced = 7
};

Expand Down
Loading
Loading