590 Commits

Author SHA1 Message Date
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
Aeadoin
a16f21d6fe
[Bots] Add Support for AA bonuses that were missing. (#2764)
* [Bots] Add Support for AA bonuses that were missing.

* Fix GetFocusEffect, add virtual override to Bot to prevent using NPC
2023-01-19 22:45:09 -06:00
Chris Miles
d3e756287e
[Logging] Remove function prefixes (#2766) 2023-01-19 22:24:50 -06:00
Paul Coene
9e5a530f0f
[Bug Fix] #npcstats command displaying incorrect faction (#2710) 2023-01-07 19:02:19 -05:00
Alex King
c1ad086eaf
[Quest API] Add Despawn Events to Perl/Lua. (#2707)
# Perl
- Add `$bot->GetBotID()`.
- Add `EVENT_DESPAWN`.
- Add `EVENT_DESPAWN_ZONE`.

# Lua
- Add `bot:GetBotID()`.
- Add `event_despawn`.
- Add `event_despawn_zone`.

# Notes
- Allows operators to determine when a Bot or an NPC has been despawned via Depop.
- Bots call NPC::Depop on ^camp so we just put the code there.
- Adds the ability to get a bot's ID using their reference in case you're looping a list and need that value.
- Moves `DispatchZoneControllerEvent` from NPC to Mob so it can be used by any type.
2023-01-07 12:04:33 -05:00
Alex King
1531650b3a
[Quest API] Add Augment Slot Type/Visible to GetItemStat (#2686)
* [Quest API] Add Augment Slot Type/Visible to GetItemStat

# Notes
- Adds the ability to get an item's augment slot types and augment slot visibility information.

* const
2023-01-01 11:35:15 -05:00
Alex King
a590ea1d52
[Feature] Add "Keeps Sold Items" Flag to NPCs (#2671)
# Perl
- Add `$npc->GetKeepsSoldItems()`.
- Add `$npc->SetKeepsSoldItems(keeps_sold_items)`.

# Lua
- Add `npc:GetKeepsSoldItems()`.
- Add `npc:SetKeepsSoldItems(keeps_sold_items)`.

# Notes
- Allows operators to keep specific NPCs from keeping items sold to them.
- Keeps NPCs from being cluttered with stuff like Cloth Caps, Bone Chips, etc.
2022-12-25 16:36:20 -05:00
Aeadoin
2f9a6daab5
[Client] Remove unimplemented Client Insight Method. (#2663)
* [Cleanup] Remove unused Insight Method, and cleanup Magic Numbers

* change emu->NPC back to 0, not Doug
2022-12-21 18:41:56 -05:00
Alex King
20efa83f73
[Bug Fix] Fix possible crash in ProcessSpecialAbilities. (#2630)
* [Bug Fix] Fix possible crash in ProcessSpecialAbilities.

# Notes
- Passing an invalid special ability along such as `4,1,,-1,100` currently causes a crash since every `,` assumes it's followed by a number.
- Fixed by making sure first and second parameters are numbers and then when looping additional parameters we also check if they are numbers.

* Update mob.cpp
2022-12-11 09:07:06 -05:00
Aeadoin
c8218574cc
[Logging] More AI Logging Cleanup (#2616)
* [Logging] Additional AI Cleanup

* More cleanup/formatting fixes

* Typo
2022-12-10 17:36:40 -06:00
Alex King
91ea6462f2
[Quest API] Add CopyHateList() to Perl/Lua. (#2623)
* [Quest API] Add CopyHateList() to Perl/Lua.

# Perl
- Add `$mob->CopyHateList(to_mob)`.

# Lua
- Add `mob:CopyHateList(to_mob)`.

# Notes
- Allows operators to easily copy and entire hatelist from one mob to another.

* Update mob.cpp
2022-12-06 08:38:51 -05:00
Alex King
7abc084cd1
[Quest API] Add Entity Variable Methods to Perl/Lua. (#2609)
* [Quest API] Add Entity Variable Methods to Perl/Lua.

# Perl
- Add `$mob->ClearEntityVariables()`.
- Add `$mob->DeleteEntityVariable(variable_name)`.
- Add `$object->ClearEntityVariables()`.
- Add `$object->DeleteEntityVariable(variable_name)`.

# Lua
- Add `mob:ClearEntityVariables()`.
- Add `mob:DeleteEntityVariable(variable_name)`.
- Add `object:ClearEntityVariables()`.
- Add `object:DeleteEntityVariable(variable_name)`.

# Notes
- Allows operators to clear all entity variables or delete one by name, previously you just had to set to an empty value to clear after being set.

* Cleanup.
2022-12-04 12:18:27 -05:00
Alex King
31d57342e1
[Quest API] Add Entity Variable Methods to Perl/Lua. (#2579)
* [Quest API] Add Entity Variable Methods to Perl/Lua.

# Perl
- Add `$mob->GetEntityVariables()`.
- Add `$object->GetEntityVariables()`.

# Lua
- Add `mob:GetEntityVariables()`.
- Add `object:GetEntityVariables()`.

# Notes
- Convert all overloads and methods to use `std::string` for entity variables.
- Allows operators to get a list of a Mob's entity variables.

* Update loottables.cpp
2022-11-26 16:24:01 -05:00
Kinglykrab
856aa51cb8
[Bots] Add support for Bot scripting. (#2515)
* [Bots] Add support for Bot scripting.

# Perl
- Add support for `zone/bot.pl` and `zone/bot_v#.pl`.
- Add support for `global/global_bot.pl`.
- Add `$bot->SignalBot(signal_id)` to Perl.
- Add `$bot->OwnerMessage(message)` to Perl.
- Add `$entity_list->SignalAllBotsByOwnerCharacterID(character_id, signal_id)` to Perl.
- Add `$entity_list->SignalBotByBotID(bot_id, signal_id)` to Perl.
- Add `$entity_list->SignalBotByBotName(bot_name, signal_id)` to Perl.
- Add `EVENT_SPELL_EFFECT_BOT` to Perl.
- Add `EVENT_SPELL_EFFECT_BUFF_TIC_BOT` to Perl.

# Lua
- Add support for `zone/bot.lua` and `zone/bot_v#.lua`.
- Add support for `global/global_bot.lua`.
- Add `bot:SignalBot(signal_id)` to Lua.
- Add `bot:OwnerMessage(message)` to Lua.
- Add `entity_list:SignalAllBotsByOwnerCharacterID(character_id, signal_id)` to Lua.
- Add `entity_list:SignalBotByBotID(bot_id, signal_id)` to Lua.
- Add `entity_list:SignalBotByBotName(bot_name, signal_id)` to Lua.
- Add `EVENT_SPELL_EFFECT_BOT` to Lua.
- Add `EVENT_SPELL_EFFECT_BUFF_TIC_BOT` to Lua.

# Supported Bot Events
1. `EVENT_CAST`
2. `EVENT_CAST_BEGIN`
3. `EVENT_CAST_ON`
4. `EVENT_COMBAT`
5. `EVENT_DEATH`
6. `EVENT_DEATH_COMPLETE`
7. `EVENT_SAY`
8. `EVENT_SIGNAL`
9. `EVENT_SLAY`
10. `EVENT_SLAY_NPC`
11. `EVENT_SPAWN`
12. `EVENT_TARGET_CHANGE`
13. `EVENT_TIMER`
14. `EVENT_USE_SKILL`

# Common
- Convert NPC pointers in common events to Mob pointers so bots are supported.
- Convert signal IDs to `int` where it wasn't already, allowing negative signals to be sent properly.

* Add EVENT_POPUP_RESPONSE.

* Cleanup and fix EVENT_COMBAT/EVENT_SLAY/EVENT_NPC_SLAY.

* Fix DoNPCEmote calls.

* Update attack.cpp

* Update event_codes.h

* Update bot_command.cpp
2022-11-16 21:02:16 -06:00
Kinglykrab
36887203d3
[Commands] Cleanup #doanim Command. (#2540)
* [Commands] Cleanup #doanim Command.

- Cleanup messages and logic.
- Allow you to use animation names or IDs, could possibly extend this to quest API in the future.

* Update dialogue_window.h
2022-11-14 16:38:05 -05:00
Kinglykrab
31e5622dad
[Quest API] Add CloneAppearance() to Perl/Lua. (#2531)
* [Quest API] Add CloneAppearance() to Perl/Lua.

# Perl
- Add `$client->CloneAppearance(other)` to Perl.
- Add `$client->CloneAppearance(other, clone_name)` to Perl.

# Lua
- Add `client:CloneAppearance(other)` to Lua.
- Add `client:CloneAppearance(other, clone_name)` to Lua.

# Notes
- Allows operators to easily clone appearance between mobs in a script without relying on a plugin or module.

* Update mob_appearance.cpp

* Update mob.cpp
2022-11-14 14:05:05 -05:00
Aeadoin
7e7358e9b6
[Bots] Add Data Bucket support to Bot Spell Entries. (#2505)
* [Bots] Add Data Bucket support to Bot Spell Entries.

* Cleanup Formatting and Functions

* Consolidated "CheckDataBucket" Functions

* Remove unneeded CastToClient

* Add choice to format data buckets as either "character-id" or "bot-id" to Bot spells

* Fix Formatting

* Clean up.

* Update npc.h

* Fix Bot Casting issues

* Formatting

Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
Co-authored-by: Kinglykrab <89047260+Kinglykrab@users.noreply.github.com>
2022-11-06 17:06:01 -05:00
Chris Miles
bbbebdd346
[Crash] Pointer validation in mob iteration loops (#2490) 2022-10-15 15:10:11 -05:00
Aeadoin
149fa54cfa
[Feature] Implement Heroic Strikethrough to NPCs (#2395)
* [Feature] Implement Heroic Strikethrough to NPCs

* Removed virtual from inline int32 GetHeroicStrikethrough()

* Fix formatting

* Removed unnecessary function
2022-08-30 23:29:41 -05:00
Aeadoin
1d5a3a82a8
[Feature] Change GetSkillDmgAmt to int32 (#2364) 2022-08-09 21:24:15 -04:00
hg
793d4bc3a4
[Quest API] Use Floating Point for CameraEffect Intensity (#2337)
This was implemented in a very odd way. The intensity is just a float.

This is a breaking api change but low-impact (intensity will be
different).

To convert old values to new values with same intensity:

  0: 0.03125
  1: 0.05625
  2: 0.1
  3: 0.175
  4: 0.3
  5: 0.5
  6: 0.9
  7: 1.6
  8: 2.8
  9: 4.8
 10: 8.0
2022-07-30 19:18:20 -05:00
Chris Miles
dfd8f84cac
[Strings] Refactor Strings Usage (#2305)
* Initial commit checkpoint

* More functions converted

* Commify

* More functions

* Fin

* Sort declarations

* Split functions between files

* Bots

* Update strings.h

* Split

* Revert find replaces

* Repository template

* Money

* Misc function

* Update CMakeLists.txt

* Saylink

* Update strings.cpp

* Swap Strings::Saylink for Saylink::Create since saylink is coupled to zone database

* API casings
2022-07-14 02:10:52 -05:00
Quintinon
b5c4357de2
[Bug Fix] Fix miscellaneous memory leaks related to EQApplicationPacket and it's pBuffer (#2262)
* Delete EQApplicationPacket after use

* Correct issue where Creating EQApplicationPackets in zone/mob.cpp may not free pBuffer[]

* Handle freeing pBuffer[] if exists in zone/mob.cpp Create*Packet functions

* Handle freeing pBuffer[] in zone/object.cpp Create*Packet methods

* Delete leaked outapp variables in zone/trading.cpp

* Make CreateHorseSpawnPacket() safer by freeing pBuffer[] before replacing with new[]

* Prevent initial new ServerPacket from being leaked in command_reload

* Free pack after sending in command_setlsinfo

* Delete new NPC in command_viewnpctype after printing stats

* Fix compile error

* Delete EQApplicationPacket after sending in command_kick

* Remove unneeded safe_delete(outapp) after FastQueuePacket and fix minor whitespace issue

* Delete packet after sending in WorldServer::SendReloadTasks

* Cleanup logic and free leaked NPCType in Client::Doppelganger

* Free RespawnOption in Client::HandleRespawnFromHover in 'unexpected rez from hover request' branch

* Free EQApplicationPacket after sending in Bot::ProcessBotInspectionRequest

* Free Bot when returning from failed Bot::Save() in helper_bot_create()

* Initialize variable to nullptr to prevent garbage initial value

* Undo change in other PR
2022-07-02 22:10:51 -05:00
Paul Coene
3936b2b882
[Fix] Boats should never get FixZ'd (#2246)
* Boats should never get FixZ'd

* Use member variable to avoid repetitive checks

* Resolve comments from review

* Fix return type
2022-07-02 13:49:45 -05:00
Kinglykrab
fc5105eed7
[Rules] Add Frontal Stun Immunity Rules. (#2217)
* [Rules] Add Frontal Stun Immunity Rules.
- Add Combat:FrontalStunImmunityClasses rule for determining Frontal Stun Immunity by class bitmasks
- Add Combat:FrontalStunImmunityRaces rule for determining Frontal Stun Immunity by race bitmasks
- Add Combat:NPCsUseFrontalStunImmunityClasses rule for determining if NPCs use Frontal Stun Immunity by class bitmasks
- Add Combat:NPCsUseFrontalStunImmunityRaces rule for determining if NPCs uses Frontal Stun Immunity by race bitmasks
- Cleanup GetDefaultGender() as best as possible with the globalload I have.
- Combat:NPCsUseFrontalStunImmunityRaces defaults to true as NPCs currently use Frontal Stun Immunity.
- Added **all** Ogre races to the check for Frontal Stun Immunity.

* Remove other Ogre races.
2022-06-06 22:29:06 -05:00
Kinglykrab
ec4d228dd5
[Bug Fix] Fix issue where #advnpcspawn addspawn does not add spawn sometimes. (#2247)
* [Bug Fix] Fix issue where #advnpcspawn addspawn does not add spawn sometimes.
- Cleanup where std::stoi should be std::stoul.
- Cleanup ShowStats message to show NPC stats at bottom as well.

* Update advnpcspawn.cpp
2022-06-06 22:24:45 -05:00
Kinglykrab
8f729fe948
[Rules] Add Rule to Disable NPC Last Names. (#2227)
* [Rules] Add Rule to Disable NPC Last Names.
- Add NPC:DisableLastNames to disable NPC Last Names.
- Fix #npcedit lastname to allow you to use an empty string.

* Cleanup of classes in naming.

* Duplicate.

* Update classes.cpp
2022-06-04 14:01:00 -04:00
Quintinon
be1772d464
[Bug Fix] Correct (probably) unintended bitwise AND instead of logical AND (#2239) 2022-06-01 21:17:39 -04:00
Quintinon
a00f086bb8
[Combat] Fix shield calculation (#2234)
* Fix max mitigation calculation

* Fix shield ability not receiving correct arguments from perl script.

* Correct shielder having wrong mitigation set.
2022-06-01 17:17:14 -04:00
Quintinon
de830e5535
[Code Cleanup] Resharper Warnings (#2235)
* Remove unused local variable

* Remove another unused variable

* Correct typos and remove unused initialization

* Cleanup some code in OPCharCreate

* Remove unused function in client.cpp and undefined declaration.
Also the function potentially had a null pointer dereference according to Visual Studio.
2022-06-01 17:16:49 -04:00
Kinglykrab
11369247b1
[INT64] Further int64 cleanup in Perl SetHP() and GetSpellHPBonuses() in Perl/Lua. (#2222) 2022-05-29 16:36:32 -05:00
Kinglykrab
7072b5721b
[Rules] Add Spells:BuffsFadeOnDeath. (#2200)
- Allows you to disable buffs fading on death.
2022-05-27 15:00:59 -04:00
Kinglykrab
123bc5f19a
[Commands] Cleanup #findclass and #findrace Commands. (#2211)
- Cleanup messages and logic.
- Add bitmasks to player race messages.
2022-05-27 14:46:53 -04:00
hg
d8aa8f7e7a
[Opcode] Implement SetFace opcode (#2167)
* Implement SetFace opcode

This implements the opcode that's used to update zone clients when a
client updates their face

* Use SetFace in #feature command

Add check for valid number

This adds the #feature eyes command which isn't in the illusion struct
2022-05-11 19:57:20 -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
Kinglykrab
7df9b2974b
[Commands] Cleanup #reloadzps Command. (#2129)
* [Commands] Cleanup #reloadzps Command.
- Cleanup messages and logic.
- Make reloading of zone points global instead of zone specific.

* Further cleanup.
- Add zone->GetZoneDescription().
- Add mob->GetTargetDescription(mob).

* Final cleanup.

* Typo.
2022-05-07 03:23:15 -04:00
Kinglykrab
6e15fae6a0
[Commands] Cleanup #randomizefeatures Command. (#2118)
- Cleanup messages and logic.
- Make #randomizefeatures function for Iksar and Vah Shir.
2022-05-06 20:42:34 -04:00
Kinglykrab
0aeab11408
[Commands] Cleanup #summon Command. (#2145)
* [Commands] Cleanup #summon Command.
- Cleanup messages and logic.
- Add glm::vec4 overload for GMMove.
- Remove unused parameter from GMMove.
- Remove unnecessary Lua GMMove now that parameter is gone.

* Update summon.cpp

* Cleanup.
2022-05-06 18:45:12 -05:00
Chris Miles
90da136b7a
[Regen] Implement Per Second HP Regen for NPCs (#2086)
* Implement NPC per second regen

* Add hp_regen_per_second to ModifyNPCStat

* Take per second regen the rest of the way

* Add #npcedit hp_regen_per_second

* Add db migration
2022-05-01 10:26:16 -04:00
Chris Miles
5b4aeaa457
[Code Cleanup] Remove this-> in code where its implied (#2088) 2022-05-01 10:22:09 -04:00
Kinglykrab
791d8b329d
[Quest API] Export killed XYZH to EVENT_DEATH_ZONE in Perl. (#2050)
- Export $killed_x, $killed_y, $killed_z, and $killed_h to EVENT_DEATH_ZONE in Perl.
- Cleanup export strings and unnecessary .c_str() calls on event exports.
2022-03-12 13:44:01 -05:00
KayenEQ
6dffeacc6e
[Spells] Fixes for numhits type 7 counter incrementing incorrectly. (#2022)
* [Spells] Fix for numhits type 7 counter incrementing incorrectly.

* [Spells] Fixes for numhits type 7 counter incrementing incorrectly.

bot fix

* [Spells] Fixes for numhits type 7 counter incrementing incorrectly.

mercs

* [Spells] Fixes for numhits type 7 counter incrementing incorrectly.

remove old variable and related code.

* [Spells] Fixes for numhits type 7 counter incrementing incorrectly.

comments
2022-03-01 21:20:27 -05:00
KayenEQ
b938e6223c
[Spells] Invisibility updates and rework (#1991)
* updates pre merge

* update

* Update spell_effects.cpp

* Update mob.h

* test

* test

* updates

* updates

* save

* update

* working solid

* animal and undead start

* progress

* updates

* rename

* set invis appearance on bonus

* remove fade buff state check

* update IsViisble check

* optimizing

* don't break bots

* debug remover

* Update ruletypes.h

* perl adds

* Update client_packet.cpp

* update

* done

* remove debugs

* Update client_packet.cpp

* update

* [Spells] Invisibility updates and rework

lua support

* [Spells] Invisibility updates and rework

lua
2022-02-15 00:18:02 -05:00
KayenEQ
51c8771bd2
bug fix (#2001) 2022-02-15 00:17:23 -05:00
KayenEQ
3f0987ba55
[Combat] /shield command "too far away message" (#1999)
* live did something that makes sense

* [Combat] /shield command "too far away message

better chat

* [Combat] /shield command "too far away message

never mind that one was red.
2022-02-14 10:44:26 -05:00
KayenEQ
e962ad3a35
procs silence (#1973) 2022-02-08 07:36:20 -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
Paul Coene
7749c626f0
[Bug Fix] Fix issue with mobs summoning PCs into ceilings (#1921) 2022-01-29 19:55:40 -06:00
Paul Coene
b9722c6d28
[Bug Fix] Any use of TempName left old clean_name. (#1946)
* [Bug Fix] Any use of TempName left old clean_name.

* Dunsel change
2022-01-26 17:02:37 -05:00