34 Commits

Author SHA1 Message Date
Alex King
b7a1fc6644
[Cleanup] Remove IsEntityInFrenzyMode() from hate_list.cpp/hate_list.h (#3352)
# Notes
- This is unused.
2023-05-17 08:58:27 -04:00
Alex King
6bfb8fca2e
[Cleanup] Remove GetEscapingEntOnHateList() from hate_list.cpp/hate_list.h (#3353)
# Notes
- This is unused.
2023-05-17 08:58:13 -04:00
RekkasGit
32f7dc3d1b
[Quest API] Add GetHateListClosest(), GetHateListClosestBot(), GetHateListClosestClient(), and GetHateListClosestNPC() methods/overloads to Perl/Lua (#3359)
* Add HateListClosestClient available for scripting.

* Add other methods.

* Use pre-existing constants.

* Typos

* Update mob.h

---------

Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
2023-05-15 21:23:19 -04:00
Alex King
3335cacac1
[Bots] Cleanup and remove preprocessors. (#2757)
* [Bots] Cleanup and remove preprocessors.

- Removes every `#ifdef BOTS` we have and locks bots behind `Bots:AllowBots` rule.
- Bot updates are now done by default similar to regular database updates.
- Modify `CMakeLists.txt`, `.drone.yml`, and `BUILD.md` to match the removal of `EQEMU_ENABLE_BOTS`.

* Cleanup

- Add SQL for enabling bots for servers with bots.
- Add message that tells players/operators bots are disabled.

* Suggested changes.

* Bot injection stuff

* Change SQL to bot SQL.

* Tweaks

* Remove `is_bot`

* Update version.h

* Update main.cpp

* Update database.cpp

* Fix name availability crash

* Remove bots from update script

Co-authored-by: Akkadius <akkadius1@gmail.com>
2023-01-20 12:35:33 -06:00
Kinglykrab
0c56586f3b
[Quest API] Add Client Spell Methods to Perl/Lua. (#2550)
* [Quest API] Add Client Spell Methods to Perl/Lua.

# Perl
- Add `$client->ApplySpell(spell_id)`.
- Add `$client->ApplySpell(spell_id, duration)`.
- Add `$client->ApplySpell(spell_id, duration, allow_pets)`.
- Add `$client->ApplySpell(spell_id, duration, allow_pets, is_raid_group_only)`.
- Add `$client->ApplySpell(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`.
- Add `$client->ApplySpellGroup(spell_id)`.
- Add `$client->ApplySpellGroup(spell_id, duration)`.
- Add `$client->ApplySpellGroup(spell_id, duration, allow_pets)`.
- Add `$client->ApplySpellGroup(spell_id, duration, allow_pets, is_raid_group_only)`.
- Add `$client->ApplySpellGroup(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`.
- Add `$client->ApplySpellRaid(spell_id)`.
- Add `$client->ApplySpellRaid(spell_id, duration)`.
- Add `$client->ApplySpellRaid(spell_id, duration, allow_pets)`.
- Add `$client->ApplySpellRaid(spell_id, duration, allow_pets, is_raid_group_only)`.
- Add `$client->ApplySpellRaid(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`.
- Add `$client->SetSpellDuration(spell_id)`.
- Add `$client->SetSpellDuration(spell_id, duration)`.
- Add `$client->SetSpellDuration(spell_id, duration, allow_pets)`.
- Add `$client->SetSpellDuration(spell_id, duration, allow_pets, is_raid_group_only)`.
- Add `$client->SetSpellDuration(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`.
- Add `$client->SetSpellDurationGroup(spell_id)`.
- Add `$client->SetSpellDurationGroup(spell_id, duration)`.
- Add `$client->SetSpellDurationGroup(spell_id, duration, allow_pets)`.
- Add `$client->SetSpellDurationGroup(spell_id, duration, allow_pets, is_raid_group_only)`.
- Add `$client->SetSpellDurationGroup(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`.
- Add `$client->SetSpellDurationRaid(spell_id)`.
- Add `$client->SetSpellDurationRaid(spell_id, duration)`.
- Add `$client->SetSpellDurationRaid(spell_id, duration, allow_pets)`.
- Add `$client->SetSpellDurationRaid(spell_id, duration, allow_pets, is_raid_group_only)`.
- Add `$client->SetSpellDurationRaid(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`.

# Lua
- Add `client:ApplySpell(spell_id)`.
- Add `client:ApplySpell(spell_id, duration)`.
- Add `client:ApplySpell(spell_id, duration, allow_pets)`.
- Add `client:ApplySpell(spell_id, duration, allow_pets, is_raid_group_only)`.
- Add `client:ApplySpell(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`.
- Add `client:ApplySpellGroup(spell_id)`.
- Add `client:ApplySpellGroup(spell_id, duration)`.
- Add `client:ApplySpellGroup(spell_id, duration, allow_pets)`.
- Add `client:ApplySpellGroup(spell_id, duration, allow_pets, is_raid_group_only)`.
- Add `client:ApplySpellGroup(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`.
- Add `client:ApplySpellRaid(spell_id)`.
- Add `client:ApplySpellRaid(spell_id, duration)`.
- Add `client:ApplySpellRaid(spell_id, duration, allow_pets)`.
- Add `client:ApplySpellRaid(spell_id, duration, allow_pets, is_raid_group_only)`.
- Add `client:ApplySpellRaid(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`.
- Add `client:SetSpellDuration(spell_id)`.
- Add `client:SetSpellDuration(spell_id, duration)`.
- Add `client:SetSpellDuration(spell_id, duration, allow_pets)`.
- Add `client:SetSpellDuration(spell_id, duration, allow_pets, is_raid_group_only)`.
- Add `client:SetSpellDuration(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`.
- Add `client:SetSpellDurationGroup(spell_id)`.
- Add `client:SetSpellDurationGroup(spell_id, duration)`.
- Add `client:SetSpellDurationGroup(spell_id, duration, allow_pets)`.
- Add `client:SetSpellDurationGroup(spell_id, duration, allow_pets, is_raid_group_only)`.
- Add `client:SetSpellDurationGroup(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`.
- Add `client:SetSpellDurationRaid(spell_id)`.
- Add `client:SetSpellDurationRaid(spell_id, duration)`.
- Add `client:SetSpellDurationRaid(spell_id, duration, allow_pets)`.
- Add `client:SetSpellDurationRaid(spell_id, duration, allow_pets, is_raid_group_only)`.
- Add `client:SetSpellDurationRaid(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`.

# Notes
- Allows operators extremely easy shorthands to cast on entire groups and raid groups and optionally include their bots and pets.
- Default functionality for Raid is that it only casts on your group, set `is_raid_group_only` to `false` to cast on the entire Raid.

* Cleanup.

* Remove Raid parameter from Solo/Group methods.
2022-11-22 09:11:36 -05:00
Kinglykrab
0003f6f863
[Quest API] Add Area Damage Methods to Perl/Lua. (#2549)
* [Quest API] Add Area Damage Methods to Perl/Lua.

# Perl
- Add `$mob->DamageArea(damage)`.
- Add `$mob->DamageArea(damage, distance)`.
- Add `$mob->DamageAreaBots(damage)`.
- Add `$mob->DamageAreaBots(damage, distance)`.
- Add `$mob->DamageAreaClients(damage)`.
- Add `$mob->DamageAreaClients(damage, distance)`.
- Add `$mob->DamageAreaNPCs(damage)`.
- Add `$mob->DamageAreaNPCs(damage, distance)`.
- Add `$mob->DamageAreaPercentage(damage)`.
- Add `$mob->DamageAreaPercentage(damage, distance)`.
- Add `$mob->DamageAreaBotsPercentage(damage)`.
- Add `$mob->DamageAreaBotsPercentage(damage, distance)`.
- Add `$mob->DamageAreaClientsPercentage(damage)`.
- Add `$mob->DamageAreaClientsPercentage(damage, distance)`.
- Add `$mob->DamageAreaNPCsPercentage(damage)`.
- Add `$mob->DamageAreaNPCsPercentage(damage, distance)`.

# Lua
- Add `mob:DamageArea(damage)`.
- Add `mob:DamageArea(damage, distance)`.
- Add `mob:DamageAreaBots(damage)`.
- Add `mob:DamageAreaBots(damage, distance)`.
- Add `mob:DamageAreaClients(damage)`.
- Add `mob:DamageAreaClients(damage, distance)`.
- Add `mob:DamageAreaNPCs(damage)`.
- Add `mob:DamageAreaNPCs(damage, distance)`.
- Add `mob:DamageAreaPercentage(damage)`.
- Add `mob:DamageAreaPercentage(damage, distance)`.
- Add `mob:DamageAreaBotsPercentage(damage)`.
- Add `mob:DamageAreaBotsPercentage(damage, distance)`.
- Add `mob:DamageAreaClientsPercentage(damage)`.
- Add `mob:DamageAreaClientsPercentage(damage, distance)`.
- Add `mob:DamageAreaNPCsPercentage(damage)`.
- Add `mob:DamageAreaNPCsPercentage(damage, distance)`.

# Notes
- Cleanup parameter order of damage methods.
- These methods allow you to damage all Bots, Clients, Mobs, or NPCs in a zone or by distance from the Mob.
- Fix math with percentage damage.

* Update entity.cpp
2022-11-16 21:11:01 -06:00
Kinglykrab
8c994fef97
[Quest API] Add Mob Hate Methods to Perl/Lua. (#2548)
* [Quest API] Add Mob Hate Methods to Perl/Lua.

# Perl
- Add `$mob->DamageHateList(damage)` to Perl.
- Add `$mob->DamageHateList(damage, distance)` to Perl.
- Add `$mob->DamageHateListPercentage(damage)` to Perl.
- Add `$mob->DamageHateListPercentage(damage, distance)` to Perl.
- Add `$mob->DamageHateListBots(damage)` to Perl.
- Add `$mob->DamageHateListBots(damage, distance)` to Perl.
- Add `$mob->DamageHateListBotsPercentage(damage)` to Perl.
- Add `$mob->DamageHateListBotsPercentage(damage, distance)` to Perl.
- Add `$mob->DamageHateListClients(damage)` to Perl.
- Add `$mob->DamageHateListClients(damage, distance)` to Perl.
- Add `$mob->DamageHateListClientsPercentage(damage)` to Perl.
- Add `$mob->DamageHateListClientsPercentage(damage, distance)` to Perl.
- Add `$mob->DamageHateListNPCs(damage)` to Perl.
- Add `$mob->DamageHateListNPCs(damage, distance)` to Perl.
- Add `$mob->DamageHateListNPCsPercentage(damage)` to Perl.
- Add `$mob->DamageHateListNPCsPercentage(damage, distance)` to Perl.
- Add `$mob->GetHateListBots()` to Perl.
- Add `$mob->GetHateListBots(distance)` to Perl.
- Add `$mob->GetHateListClients()` to Perl.
- Add `$mob->GetHateListClients(distance)` to Perl.
- Add `$mob->GetHateListNPCs()` to Perl.
- Add `$mob->GetHateListNPCs(distance)` to Perl.

# Lua
- Add `mob:DamageHateList(damage)` to Lua.
- Add `mob:DamageHateList(damage, distance)` to Lua.
- Add `mob:DamageHateListPercentage(damage)` to Lua.
- Add `mob:DamageHateListPercentage(damage, distance)` to Lua.
- Add `mob:DamageHateListBots(damage)` to Lua.
- Add `mob:DamageHateListBots(damage, distance)` to Lua.
- Add `mob:DamageHateListBotsPercentage(damage)` to Lua.
- Add `mob:DamageHateListBotsPercentage(damage, distance)` to Lua.
- Add `mob:DamageHateListClients(damage)` to Lua.
- Add `mob:DamageHateListClients(damage, distance)` to Lua.
- Add `mob:DamageHateListClientsPercentage(damage)` to Lua.
- Add `mob:DamageHateListClientsPercentage(damage, distance)` to Lua.
- Add `mob:DamageHateListNPCs(damage)` to Lua.
- Add `mob:DamageHateListNPCs(damage, distance)` to Lua.
- Add `mob:DamageHateListNPCsPercentage(damage)` to Lua.
- Add `mob:DamageHateListNPCsPercentage(damage, distance)` to Lua.
- Add `mob:GetHateListBots()` to Lua.
- Add `mob:GetHateListBots(distance)` to Lua.
- Add `mob:GetHateListClients()` to Lua.
- Add `mob:GetHateListClients(distance)` to Lua.
- Add `mob:GetHateListNPCs()` to Lua.
- Add `mob:GetHateListNPCs(distance)` to Lua.

# Notes
- Offers an extreme amount of short hands when grabbing hate list entities by a specific type or damaging a specific type of entity on an NPC's hatelist.
- Should save operators having to use `GetHateList()` then loop it to get the entries they want to do something.

* Cleanup.
2022-11-16 07:16:47 -06:00
Michael Cook (mackal)
2b4e555eae
[Feature] Faction Association (#2408)
* Add faction logging category

Probably should use this for more things

* Add FactionAssociation struct

This is simply just a struct that contains an array of faction ids and
multiplier. This can hold a maximum of 10 entries (Seru hit is 8, so 2
extra) this can be raised if need be.

* Add database changes and other data point changes

This is all the database changes and loading changes

Included is an optional SQL that will be used as a starting point, there
is likely errors or typos, but we will fix those as they are discovered.

* Add Client::RewardFaction function

This just takes the faction ID and the magnitude of the primary faction
hit and calculates the rest.

The minimum change will be either 1 or -1. We stop processing after we
see an ID of 0 and assume there will be no later entries.

The primary faction ID will always receive a hit even if there is no
faction association entries

* Add users of RewardFaction to NPC death, tasks, and QuestRewards

This will only use the new system if the magnitude is set, otherwise we
will just use the old system still

* Add quest system calls and lua QuestReward support

* Add #factionassociation command

This just calls RewardFaction, mostly useful for debugging
2022-09-03 10:57:55 -04:00
Chris Miles
209b0eb273
[int64] Hate Fixes (#2163)
* Hate fixes

* Update perl_hateentry.cpp

* Update perl_hateentry.cpp
2022-05-09 20:49:43 -05:00
Chris Miles
f201d4c999
[int64] Support for HP / Mana / End / Damage / Hate (#2091)
* Initial int64 work

* Hate 64 bit

* Update special_attacks.cpp

* Aggro / Damage / Hate int64

* NPC edit adjustments

* Fix bot compile

* More int64 adjustments

* More int64 references

* npcedit references

* aggrozone

* More int64 changes

* More int64 changes for damage

* Many more damage int64 references

* More spell damage int64 conversions

* HealDamage

* Damage fully working

* Remove debug

* Add migration

* More int64 adjustments

* Much wow, many int64

* More int64

* PR adjustments
2022-05-07 22:32:02 -05:00
JJ
cef352f0ac
[Bug Fix] Removed unused pointer. Fixes #157. (#1748) 2021-11-13 10:39:35 -05:00
Kinglykrab
3dcddcba04
[Quest API] Add GetHateRandomBot(), GetHateRandomClient(), and GetHateRandomNPC() to Perl/Lua. (#1613)
- Add $mob->GetHateRandomBot() to Perl.
- Add $mob->GetHateRandomClient() to Perl.
- Add $mob->GetHateRandomNPC() to Perl.
- Add mob:GetHateRandomBot() to Lua.
- Add mob:GetHateRandomClient() to Lua.
- Add mob:GetHateRandomNPC() to Lua.
2021-10-17 23:41:10 -04:00
Kinglykrab
1af1b7bbdc [Quest API] Add GetHateClosest() and GetHateListByDistance(distance) to Perl/Lua. 2021-02-25 22:53:33 -05:00
Uleat
ed67b461ea Added 'skip mez' ability to certain entity functions 2019-12-12 20:38:28 -05:00
Uleat
94c17f941c Fixed a few bot issues... 2018-10-06 23:23:29 -04:00
Michael Cook (mackal)
a440269c6b Adjust the behavior of out of range aggro removal
This is a bit more accurate
2018-01-18 19:59:04 -05:00
Michael Cook (mackal)
d8bbb428d8 Add hatelist removal for far distances and time 2018-01-18 15:44:51 -05:00
Michael Cook (mackal)
08c2f73e37 Implement aggro meter for RoF2 (RoF wasn't tested)
I didn't test RoF, so it's disabled for now (change AggroMeterAvaliable if you want to test)

Group member meters probably buggy ... but do later

The "lock target" feature isn't working currently either
2017-02-18 22:27:34 -05:00
Akkadius
4af3834715 Some more refactoring of hate_list 2014-12-27 23:52:44 -06:00
Akkadius
18f9a06f06 Re-Push Refactoring changes before without broken functionality 2014-12-27 23:44:15 -06:00
Akkadius
4f65066274 Reverting some hate stuff so things work again 2014-12-27 23:19:48 -06:00
Akkadius
8983953d7d Remove debugging from hate changes 2014-12-27 20:25:20 -06:00
Akkadius
73fe229e25 More hate changes 2014-12-27 20:23:49 -06:00
Akkadius
3a488e3a61 Changed hate counter to uint32 to prevent negative rollback, this most likely can will be an issue but more uncommon
Renamed and refactored most functions and variables in hate_list.h/cpp for readability
Refactored how hate works in some local functions mixing the use of hate variable and split it out into different status variables
hate_list.cpp/.h style cleanup
hate_list.h header function sort, comment erase
functions should clearly state their function
2014-12-27 18:24:42 -06:00
Akkadius
b733e96aea masterentity.h header order cleanup
hate_list.cpp & .h header cleanup and forward declare
2014-12-15 17:34:19 -06:00
KayenEQ
352d6fd83c Support for all remaining known spell target types.
Implemented target type (32) AE Target HateList
Implemented target type (36) Area Client Only
Implemented target type (37) Area PC Only
Implemented target type (39) Group No Pet
2014-11-13 05:19:01 -05:00
KayenEQ
f6d5e8031f Kayen: Implemented additional functionality for SE_CurrentHP utilizing base2 values. (ie limit to body type)
Kayen: Implemented SE_MitigateMeleeDamageSP (Partial Melee Rune that only is lowered if melee hits are over X amount of damage)
Kayen: Implemented SE_SpellOnAmtDmgTaken (Effect is triggered when X amount of damage is taken)
Kayen: Fix for various spell triggers/procs to now properly use their resist modifier.
Kayen: Fix to mob->ModSkillDmgTaken(skill_num, value), setting value to -1 will now properly effect all skills.
2013-12-13 21:29:35 -05:00
KimLS
239d4afb13 NPC Special Attacks should all work right: also huge explanation in changelog.txt 2013-07-11 13:44:45 -07:00
KimLS
3992ac02bb Rampage, Area Rampage, Flurry got new customizable effects. Part of that was adding a new set of stuff to attack. 2013-07-08 14:37:01 -07:00
KimLS
7adcf6d3e5 Some quest item and spell work, took out that stupid multiquesting code -> use your brains that's completely doable entirely in quests even perl 2013-05-17 17:10:38 -07:00
KimLS
bec6acc01e Hatelist will now use a std::list so i can avoid a list copy when exporting it to quests. Cause frankly two copies was absurd 2013-05-17 10:48:59 -07:00
j883376
4bdd8b2502 Change space indentation to tabs 2013-05-09 11:37:51 -04:00
Arthur Ice
7560b6b0a7 NULL to nullptr 2013-05-04 18:06:58 -07:00
KimLS
da7347f76f svn -> git Migration 2013-02-16 16:14:39 -08:00