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
[Spells] Implemented SPA 476 SE_Weapons_Stance and Live-like AA Enable/Disable Toggle #1477
Conversation
defines
bonus structure set up
updates spa476
spell bonus working well.
aa, item and spell now working
working for AA, spells, items, all checked for stacking issues.
removed debug messages
spdat description added
zone/aa.cpp
Outdated
Since this spell does not exist on our current database (7/29/21) and we don't have innate AA yet who would naturally use it. Will hold off on implementation using it. | ||
*/ | ||
|
||
if (spell_id == 46164) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we create a constant for this spell and reference it please
zone/bonuses.cpp
Outdated
@@ -173,6 +174,9 @@ void Client::CalcItemBonuses(StatBonuses* newbon) { | |||
} | |||
else if (i == EQ::invslot::slotPrimary && (item && (item->ItemType == EQ::item::ItemType2HSlash || item->ItemType == EQ::item::ItemType2HPiercing))) | |||
SetTwoHanderEquipped(true); | |||
|
|||
if (CanThisClassDualWield()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Close these out bracket wise please
zone/bonuses.cpp
Outdated
case SE_Weapon_Stance: | ||
{ | ||
if (IsValidSpell(base1)) { //base1 is the spell_id of buff | ||
if (base2 < 3){ //0=2H, 1=Shield, 2=DW |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could benefit from a constant or enum here
zone/client.cpp
Outdated
rank value from the spells table. AA's on live for this effect naturally do this. Be awere of this if making custom spells/worn effects/AA. | ||
*/ | ||
|
||
if (!IsWeaponStanceEnabled()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Close out
zone/client.cpp
Outdated
|
||
if (weaponstance.spellbonus_enabled) { | ||
|
||
if (spellbonuses.WeaponStance[0] || spellbonuses.WeaponStance[1] || spellbonuses.WeaponStance[2]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace array accessors with enums
zone/client.cpp
Outdated
if (!HasTwoHanderEquipped() && IsBuffSpell(spellbonuses.WeaponStance[0]) && FindBuff(spellbonuses.WeaponStance[0])) { | ||
BuffFadeBySpellID(spellbonuses.WeaponStance[0]); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra newline between if blocks
syntax updates, minor fixes
syntax fixes
mackal is referring to the way the AA Hotkey toggle is implemented. I acknowledge mackal did a good job of informing me how live accomplishes that affect. |
My feedback is more syntax and form than it is implementation details. I look to you and others familiar with intended spell functionality to comment and review |
Hold off on merge at the moment. Decided I want to try to get the AA toggle and structure accurate. |
moved function to check at swap item. Easier to manage and more live like behavior. Required minor adjustment Still working on AA toggle.
Made tweaks, pending merge per @KayenEQ request |
Main function check moved to when items are swapped and out of when ever bonus are recalculated. AA Toggle and data structure now more accurate to live.
Updated the AA toggle function to be more live like. Included full custom AA now at the bottom of the PR description for testing purposes. Also update the behavior to be more live like. If you manually click off a buff given by weapon stance it will no longer automatically reapply. You will need to move an item in your inventory to reapply it. |
Figured out some more mechanics to the AA toggle. Hold on merge while implementing. |
Closer to live.
broadening AA toggle to be more general use.
HOLDING! |
aa toggle is now broadly implemented to be usable with any passive effect.
This should be final iteration for now. Unless anyone else has comments or suggestions it should be ready for merge. All relevant information on updates is in the PR summary above. |
UPDATED ON 8/3/21 - Toggle system now implemented very close to live using new spell effect SE_Buy_AA_Rank (472). This
spell effect must be placed on the spell you place in the Disabled rank. Again, the SQL is updated on bottom for testing. Two spells SQL used in the AA are also added, can insert into default PEQ spell table without any issues.
Please note! The new toggle system can be used to Enable or Disable ANY type of passive AA effect you want. You obviously
need to customize your AA to do this though. Follow the example here.
Implementation testing for SPA 476 SE_Weapon_Stance
Allows for automatic application of specific buffs depending on if you have a 2hander, shield or duel wield equipped. The buff will change depending on what is equipped.
Base1: spell id base2 weapon type (0=2handed, 1=Shield, 2=dual wield)
Can be applied as a Spell Buff, Item worn effect, AA passive ability
You can have 1 of each of these types active at a time. Resulting in up to 3 buffs per weapon type.
Note: At the bottom you will find SQL you can run to test all the examples given here. These SQL are ONLY
FOR TESTING PURPOSES.
Example for Spell Buff.
I edit the Charisma Buff - Alluring Aura to contain the weapon stance effect.
I want it to buff me with a shaman 'Strength buff' if I have a 2handed weapon, 'Agility buff' if I have a Shield, and 'Dexterity buff' if Dual wield
So I set effectid2,3,4 are all 476
I chose to use Spirit of Strength, Spirit of Cat and Spirit of Monkey as my spells
then Set effect_base_value1,2,3 to spellids 147 (Spirit of Strength),148(Spirit of Cat),146 Spirit of Monkey) respectively
then set effect_limit_value1,2,3 to 0(2H), 1(Shield), 2(Duel wield) respectively.
Now when I cast Alluring Aura (SPELL ID 150) it will give me the charisma buff, AND depending on which weapons/shield I have it will give me a different stat buff.
If you want an upgraded version with improved stat buffs, try casting Charisma (SPELL ID 156)
Example for item buff.
Run script bellow to add to your database two test items. Weaponstance Earring Rank 1 (150000) Weaponstance Earring Rank 2 (150002)
I edit the HP buff - Skin like Wood to contain the weapon stance effect. Place Skin like Wood as a worn effect on 'Weaponstance Earring Rank 1'
I want it to buff me with Fire resist if I have a 2handed weapon, Cold resist if I have a Shield, and Magic resist if Dualweild
So I set effectid2,3,4 are all 476
I chose to use endure fire, cold and magic as my spells
then Set effect_base_value1,2,3 to spellids 224 (endure fire),225(endure cold),228(endure magic) respectively
then set effect_limit_value1,2,3 to 0(2H), 1(Shield), 2(Duelweild) respectively.
Simply equip the item to get the new effects.
If you want to see upgraded version with better resist buffs. Equip Weaponstance Earring Rank 2 (150001).
Note, you should always get the best buff even if both are equiped at the same time.
Example for AA passive effects. (Live uses this only in AA passive effects)
Run SQL scripts below to generate a new AA, ability ID will be 1600 called 'Weapon Stance TEST ONLY'
In game will appear for RANGERS, under class tab, with name 'BETA ONLY Destructive Force Test'
AA Toggle effect is coded to resemble lives. When you buy the AA it will give you a hotkey called 'Reactive'(best I could find,
can always make better custom hotkeys)
-Where first rank you buy is the DISABLED version, in game it will look like BETA ONLY Destructive Force Test' 1/4
-When you click the hotkey it will buy the next rank and this is the ENABLED version and you should get buff effects.
In gave it will look like 'BETA ONLY Destructive Force Test' 2/4
If you click the hotkey now, it will disable the ability and put your rank back to 'BETA ONLY Destructive Force Test' 1/4.
AA will work as follows
I want it to buff me with Regen if I have a 2handed weapon, Breeze resist if I have a Shield, and Celerity if Dualweild
So I added in 'aa_rank_effets slot 1,2,3 for aa_rank_id 1345 and set 'effect_id' for each slot to 476
then Set base1 for slots 1,2,3 to spellids 144 (regen),697(breeze),171(celerity) respectively
then set base2 1, 2,3 to 0(2H), 1(Shield), 2(Duelweild) respectively.
You can upgrade the focus buy purchasing a new rank when your at 'BETA ONLY Destructive Force Test' 2/4. The pattern
will then continue with 3/4 and 4/4 ect.
DETAILS ON HOW TO SET UP THE AA - again full example SQL at bottom (This information is in source code)
WARNING BEFORE YOU RUN THESE SQLs
Best way to test:
-Create a new RANGER.
-Summon a shield, two handed weapon and two swords.
-Try casting example spell. Try equipping example items. Try learning example AA.