125 Commits

Author SHA1 Message Date
Chris Miles
5b4aeaa457
[Code Cleanup] Remove this-> in code where its implied (#2088) 2022-05-01 10:22:09 -04:00
Natedog2012
25c0416f1e
[Bug Fix] Force NPCs to respect special ability 24 and 50 when set on player pets (#2059)
* Force NPCs to respect special ability 24 and 50 when set on player pets

* Fix error in logic

* Remove this
2022-03-15 19:28:36 -05:00
KayenEQ
a208801d1f
[Spells] Major update to Bard song pulsing, Bard item clicks while singing, and spell casting restriction logic. (#1954)
* test

* complete

* Update effects.cpp

* Update spells.cpp

* Update effects.cpp

* [Spells] Support for bards using Disciplines while casting or /melody.

Support for spell field 'cast not standing' not allow casting from divine aura

* [Spells] Support for bards using Disciplines while casting or /melody.

DA bypass logic for spells with field 'cast_not_standing'

* updates

* stun and mez bypass

* Update spdat.cpp

* Update spdat.cpp

* Update spells.cpp

* clean

* requirement messages

* update

* pct

* save work

* Reform code 1_22_22

* updated

* update id to pointer

* Update spells.cpp

* rework 2

* update 1_23_22

* Update spells.cpp

* updates

* msg string works

* fix disc timers not be set

* more optimization

* update 1_23_22 PM

moved stop casting out
charm and harmony moved in

* update 1_25_22

rework of functions

* updates 1_26_22

* remove old checks

* gm override added for some

* update bard AA casting checks

* updates

* addbuff exception for bard

* debugs

* charm working

* update

* moved skill check here

* cast from item while singing

* lets not attack mounts

* instant cast items click

* aug clicks working

* aug tests

Bug? Cast time not display on aug clicks for bards

* aug recast from items semi ok

* added item timer function

* unified setting item recast timer

* clean up time

* update

* bard AA cast updates

* debugs removed

* debugs removed

* clean up

* clean up

* better placement of bindsight and numhits fix

* move and rename function

* Update spells.cpp

* add logs

* delete old DoCastingChecks

* Removed old bard pulse functions

* remove AEBardPulse and GroupPulse

* removed Raid::GroupBardPulse

* Pulse Restriction: Divine Aura

* Pulse Restrictions : Fear behavior

* Update spells.cpp

* Update spells.cpp

* [Spells] Major update to Bard song pulsing, Bard item clicks while singing, and spell casting restriction logic.

bots...

* [Spells] Major update to Bard song pulsing, Bard item clicks while singing, and spell casting restriction logic.

added recommended isvalidspell check

* [Spells] Major update to Bard song pulsing, Bard item clicks while singing, and spell casting restriction logic.

merged

* [Spells] Major update to Bard song pulsing, Bard item clicks while singing, and spell casting restriction logic.

removed defines since we have them as constants
2022-02-07 07:48:52 -05:00
KayenEQ
00c41dda8c
[Spells] Support for 'HateAdded' spell field to apply negative values to reduce hate. (#1953)
* HateAdded field can be negative

* [Spells] Support for 'HateAdded' spell field to apply negative values to reduce hate.
2022-02-02 21:43:17 -05:00
KayenEQ
323b35989c
[Spells] Implemented SPA 281 SE_PetFeignMinion (#1900)
* start

* update

* debugs in

* test

* clean up

* debugs removed

* Update mob_ai.cpp

* Update spdat.h

* [Spells] Implemented SPA 281 SE_PetFeignMinion

debug remoevd

* [Spells] Implemented SPA 281 SE_PetFeignMinion

npc forget timer

* [Spells] Implemented SPA 281 SE_PetFeignMinion
2021-12-27 11:33:57 -05:00
Kinglykrab
b9214bfdee
[Commands] Cleanup #aggro Command. (#1799)
- Cleanup messages and logic.
- Cleanup constant names and references.
- Cleanup aggro description methods.
2021-11-21 10:12:12 -05:00
Kinglykrab
17aaab1f9d
[Quest API] Add Spell methods to Perl. (#1631)
* [Quest API] Add Spell methods to Perl.
- Add quest::getspell(spell_id) to Perl.
- Add eq.get_spell(spell_id) to Lua.
These methods return a spell object.

Exports $spell object references to spell events.

* Formatting.

* Remove comment.

* Update spdat.cpp

* Amplication typo.

* Fix conflicts.

* Remove repository changes.

* Fix typing.

* Update spell_effects.cpp
2021-11-03 17:47:15 -04:00
Noudess
1155673642 Hack to fix melee chasing fleeing mobs "too far" issues. 2021-09-09 08:42:14 -04:00
KayenEQ
9c62bf3c2f
[Spells] Fix SPA 209 SE_DispelBeneficial not causing aggro (#1495)
Fix SPA 209 SE_DispelBeneficial not causing aggro.
2021-08-13 15:01:29 -05:00
KayenEQ
2b74d71ff5
[Feature] New SPAs pass 2 (#1459)
* Implemented SPA Duration Pct

Implemented new spell effects
SE_Duration_HP_Pct 			524
SE_Duration_Mana_Pct			525
SE_Duration_Endurance_Pct		526

Consumes 'base1' % of your maximum health/mana/endurance every 6 seconds. 'max' is maximum amount that can be consumed per tic.

Additional Functionality
Can be used as a heal/gain % by setting the base1 value to a positive.

* Implemented SPA Instant Mana/End pct

Fixes for SPA 524-526
Implemented
SE_Instant_Mana_Pct			522
SE_Instant_Endurance_Pct		523

Extracts 'base1' percent of your maximum mana/endurance, or 'max', whichever is lower.

* Implemented: SPA 521 EndAbsorbPctDmg

Implemented
SE_Endurance_Absorb_Pct_Damage 521

Absorb Damage using Endurance: base1 % (base2 End per 1 HP)
Note: Both base1 and base2 need to be divided by 100 for actually value

* Implemented SE_HealthTransfer 509

Implemented
SE_Health_Transfer			509
'life burn'
Consume base2 % of Hit Points to Damage for base % of Hit Points

Can be used for heal
Act of Valor

* Implemented SPA 515,516,518,496

Implemented
SE_AC_Avoidance_Max_Percent 515
SE_AC_Mitigation_Max_Percent	516
SE_Attack_Accuracy_Max_Percent	518
Above are stackable defense and offensive mods

SE_Critical_Melee_Damage_Mod_Max	496 - This is a non stackable melee critical modifier

* Implemented SPA 503 , 505

SE_Melee_Damage_Position_Mod	503
define SE_Damage_Taken_Position_Mod	505

SPA 503 increase/decreases melee damage by percent base1 based on your position base2 0=back 1=front

SPA 504 increase/decreases melee damage taken by percent base1 based on your position base2 0=back 1=front

* Implemented 467,468

Implemented
SE_DS_Mitigation_Amount		467
SE_DS_Mitigation_Percentage	468

Reduce incoming DS by amt or percentage. base1 is value, if a reduction is desired it should be set to negative for both.

* Fixes

Formula fixes

* Update spdat.h

Added spa descriptions.

* Implemented SPA 469, 470

Implemented
SE_Chance_Best_in_Spell_Grp     469  Chance to cast highest scribed spell within a spell group. All base2 spells share roll chance, only 1 cast.

SE_Trigger_Best_in_Spell_Grp	470

Chance to cast highest scribed spell within a spell group. Each spell has own chance.

Additional Changes:
Rewrote TrySpellTrigger function used for SPA 340 since it incorporates SPA 469. Improved code so that chance of spell being triggered should be more accurate statistically.

* Implemented SPA 474, 494

Implemented
 SE_Pet_Crit_Melee_Damage_Pct_Owner	474 - Gives pets a critical melee damage modifier from the owner

SE_Pet_Add_Atk	494 - Gives pet a ATK bonus from the owner

Fixed SE_PetMeleeMitigation 397 - The bonus was not being calculated

* Implemented SPA 465,477,478

Implemented

SE_PC_Pet_AE_Rampage			465
Chance for pet to AE rampage with a damage modifier

SE_Hatelist_To_Top_Index		477
Chance to be put on top of RAMPAGE list

SE_Hatelist_To_Tail_Index		478
Chance to be put on bottom of RAMPAGE list

* Implemented

Implemented

SE_Fearstun 	502
Stun with a max level limit. Normal stun restrictions don't apply. Base1 duration, base2 PC duration, max is level limit

SE_TwinCastBlocker 39
Previously unused spell effect that is now used on live. Simply, if this effect is present in a spell then the spell can not be twin cast.

* Implemented SPA 483

Implemented
Fc_Spell_Damage_Pct_IncomingPC	483
- Focus effect that modifies iby percent incoming spell damage on the target.
Base1= min Base2= max. Final percent is random between max and min each time focus is applied from a spell cast.

Note: Written to stack with similar functioning focus SPA 269 SE_FcSpellVulnerability.

* Implemented SPA 484

Implemented

SE_Fc_Spell_Damage_Amt_IncomingPC	484 // focus effect that modifies incoming spell damage by flat amount. Consider it a debuff that adds damage to incoming spells. Positive value to add additional damage.

* Implemented SPA 481, 485,486,512

Implemented

SE_Fc_Cast_Spell_On_Land 481
Focus effect that is checked when a spell is cast on a target, if target has this focus effect and all limiting criteria are met, then the target will cast a spell as specified by the focus. Can be given a roll chance for success. Base1=Chance, Base2=Spellid

Note: This spell has a huge amount of potential applications. See 'Alliance' type spells on live. (ie live spell 50247)

Implemented associated focus limits seen in live spells.

SE_Ff_CasterClass	485
- Caster of spell on target with a focus effect that is checked by incoming spells must be specified class or classes.

SE_Ff_Same_Caster	 486 -Caster of spell on target with a focus effect that is checked by incoming spells 0=Must be different caster 1=Must be same caster

The following is an associated effect seen with SPA 481

SE_Proc_Timer_Modifier 			512
This provides a way to rate limit the amount of spell triggers generated by SPA 481. For example after 1 successful spell trigger no additional spells can be triggered for 1.5 seconds. Ie. Base=1 and Base2 1500.
Written in a flexible format to allow scaling of multiple different buffs with this effect at same time.

* Stacking fixes for new effects

Stacking fixes for new effects.

* merge with upstream master

merge and update up spdat.h

* Update spdat.h

* Fix for bolt spell targeting self if target zone/died while casting.

Fix for bolt spell targeting self if target zone/died while casting. Despite the name being "ST_TargetOptional", this target type is reserved for projectile spells which all require a target, thus should be treated like any other targeted spell.
2021-07-20 11:06:20 -04:00
Natedog2012
36e009a5bd
Allow NPCs to aggro player pets with NPCAggro field set in database and new rule AggroPlayerPets set to true (#1450)
Co-authored-by: Natedog2012 <joewalters2012@gmail.com>
2021-07-08 11:38:57 -05:00
Kinglykrab
d30593c35e Add 4 new special attacks to Perl/Lua.
- IMMUNE_DAMAGE_CLIENT (47)
Immune to all damage except NPC damage.

- IMMUNE_DAMAGE_NPC (48)
Immune to all damage except Client damage.

- IMMUNE_AGGRO_CLIENT (49)
Immune to aggro by a Client.

- IMMUNE_AGGRO_NPC (50)
Immune to aggro by an NPC, clients must attack directly to gain aggro, allows pet only boss mechanics and stuff.
2021-01-23 21:36:07 -05:00
Trust
bd4810351d [Aggro] PercentalHeal should be included in aggro generation
Per January 15th 2003 Patch Notes:
"NPCs will now notice Druid and Shaman Percentage Heal spells in a manner similar to traditional healing spells."

Added SE_PercetalHeal to the same CheckHealAggroAmount as SE_CurrentHP to be similar to traditional healing spells.
2020-08-16 18:32:26 -04:00
Trust
3245fa6123 [Combat] AE Ramp now allows Max Melee Range
RuleR AERampageSafeZone - Reduce AE Ramp range by this amount to allow for a small safe zone on AE Ramp.
2020-08-09 14:04:03 -04:00
Akkadius
a0f8bbb3b9 Merge branch 'master' of https://github.com/EQEmu/Server into integration/multi-tenancy-expansions-repository 2020-04-18 02:31:43 -05:00
Paul Coene
a898a1d07b
Update aggro.cpp 2020-04-02 11:55:05 -04:00
Paul Coene
15dde4778a
Update aggro.cpp 2020-04-02 11:52:27 -04:00
Akkadius
63eca22aac Get factions fully moved over [skip ci] 2020-03-31 02:49:42 -05:00
JJ
4915e86aba Slight tweak (field name) to #983 "Override LEVEL and INT aggro blocking".
If you already ran the previous SQL, use this instead:
ALTER TABLE `npc_types` CHANGE `always_aggros_foes` `always_aggro` TINYINT(1) NOT NULL DEFAULT '0';
2020-03-05 22:31:54 -05:00
Noudess
ac3b4ade10 Implement new always_aggro_foes field and functionality for mobs. 2020-03-05 10:44:01 -05:00
Akkadius
8cb51eb253 Scanning optimization work from over a year ago from EZ - cleaned up a bit 2019-12-25 03:16:14 -06:00
Akkadius
1acb76bc74 More Logs::None to LogDebug 2019-09-02 03:18:12 -05:00
Akkadius
bfd0752c4d Logs::None added to LogDebug 2019-09-01 23:54:24 -05:00
Akkadius
05e7c473df Simplified the use of roamboxes and improved the AI for roambox pathing 2019-08-16 03:25:34 -05:00
Akkadius
665efe09f3 Fill function calls using magic numbers 2019-08-11 00:27:04 -05:00
Uleat
e903b06c22 Added const cast Entity::CastToBot() 2019-06-21 06:00:58 -04:00
Akkadius
86ed2c1e76 Pets shouldn't be scanning for aggro 2019-06-12 01:50:01 -05:00
Akkadius
d817f08373 Fix issue with pets causing players to be aggroed and ignoring distance checks 2019-06-12 01:27:55 -05:00
KimLS
8f0051db8d Changes to various path finding behavior 2018-11-09 00:54:51 -08:00
KimLS
cd6fd2d2dc Merge master to movement_manager, fix for merge failure 2018-10-14 17:23:11 -07:00
Michael Cook (mackal)
d8c6c62809
Merge pull request #779 from noudess/master
Allow UseLevelAggro rule to be configurable.
2018-10-05 17:21:41 -04:00
Paul Coene
e6d3210b1f Allow UseLevelAggro rule to be configurable. 2018-10-05 17:01:12 -04:00
KimLS
7278c6294d Movement will now be handled by the movement manager instead of mob 2018-09-20 16:14:47 -07:00
chase
add25eb617 converting some remaining abs & fabs to use std::abs, fixing some warnings 2018-09-10 00:23:09 -07:00
Trust
6b02d50a8c Allow Separate GrayCon Flee rate.
Added following Rules:

Combat:FleeGray - If true FleeGrayHPRatio will be used.
Combat:FleeGrayHPRatio - HP % when a Gray NPC begins to flee.
2018-07-22 18:22:07 -04:00
KimLS
f46e4f9aa4 Some tweaks so its harder to get npcs intentionally stuck 2018-05-20 17:24:00 -07:00
Uleat
8805021960 Re-worked Bot::AI_Process(); Added 'leash,' 'main assist' and 'combat abort' features 2018-01-31 19:31:09 -05:00
Michael Cook (mackal)
aa1114c387 Rename Client::zoning to Client::bZoning 2018-01-17 21:37:24 -05:00
Michael Cook (mackal)
4e9c3e19d2 Fix some XTarget FD issues 2017-10-16 01:25:14 -04:00
E Spause
cb8c3595b7 SoF-era con system. New rule, UseOldConSystem to disable this functionality. 2017-04-15 13:06:46 -04:00
Akkadius
d7dfc18c54 Cleaned up some of the NPC to NPC aggro code, only do aggro checks to other NPC's when the NPC is flagged for it 2017-04-01 23:16:27 -05:00
Akkadius
7aa1d243b0 [Performance] Reworked how all log calls are made in the source, see changelog.txt for more details 2017-04-01 03:51:46 -05:00
Akkadius
4b6ce1c19e [Performance] Reworked how client to NPC aggro checks are made
- Before when reverse aggro checks were done (client to NPC), checks would happen every 750 millseconds where a client would
		check an entire entity list with distance calcs and other checks for aggro, with many clients in a zone and many NPC's this would
		add a lot of unecessary overhead. A temporary adjustment on 3/25 was made and upped the check to 6 seconds.
	- Now, there is a new methodology to scanning. The client will build a cache list of NPC's within close range as defined in new rule:
		RULE_INT(Range, ClientNPCScan, 300) and will also get any NPC that has an aggro range beyond that defined range to use in
		the frequent checks for aggro, the result is far less overhead
	- Client scanning changes when moving versus not moving, the client will scan aggro every 500 milliseconds while moving, and
		3000 millseconds aggro check when not moving, with a 6000ms re-fetch for close NPC's
	- A demo of these changes can be found here:
		https://youtu.be/aGroiwLSTVU
2017-03-28 01:30:42 -05:00
Uleat
f77f996c3f Pass through zone code to fix uninitialized pointer declarations 2017-03-23 04:35:36 -04:00
Michael Cook (mackal)
31907382c8 Lets not aggro zonign clients 2017-02-25 02:21:48 -05:00
Michael Cook (mackal)
5a08e0ffd9 Adjust Rogue Evade drop
Live seems to be inconsistent with how much hate is dropped, but I parsed
~69% drop on the highest and ~39% for the lowest. So round to 70 and 40.

It was also fairly obvious there was a min hate it could drop you to,
which parsed out to ~100 hate.
2016-11-16 02:36:20 -05:00
Michael Cook (mackal)
1d12f92934 Level 50+ NPCs will now respond to yells for help regardless of con color 2016-08-04 20:36:15 -04:00
Michael Cook (mackal)
e89fa01d89 Port Aggro:UseLevelAggro from EQMacEmu
This will make level 18+ mobs braver
2016-08-04 20:33:29 -04:00
Michael Cook (mackal)
60da544d3a clang-tidy modernize-use-auto 2016-05-25 16:10:28 -04:00
Michael Cook (mackal)
03592e58f9 Port EQMacEmu's Assist Aggro code
This code also allows you to toggle on Tick Pulling (Aggro:AllowTickPulling)
which was a pulling technique (exploit) fixed sometime in 2006

This code also implements assist caps to cut down on trains (5 by default)
Unsure if live what this number is (it exists) or if it's a per NPC basis

An NPC with Assist Aggro will not call for help, only NPCs with Primary Aggro will
2015-12-18 17:41:57 -05:00