* Add database quest API
API functions are named to be similar to LuaSQL and perl DBI
New connections are made for Database objects. These can either use
credentials from the server eqemu_config or manual connections.
* Add option to use zone db connections
* [Spells] Add Unblockable Spell Table and Spell Blocked Event
- Add `EVENT_SPELL_BLOCKED`, exports `$blocking_spell_id`, `$cast_spell_id`, `$blocking_spell`, and `$cast_spell`.
- Add `event_spell_blocked`, exports `e.blocking_spell_id`, `e.cast_spell_id`, `e.blocking_spell`, and `e.cast_spell`.
- Adds `spells_unblockable` table with a `spell_id` and `is_unblockable` column.
- This table will need to be populated based on known spells that should be unblockable.
- This event will allow operators to perform events when spells are blocked.
* Cleanup
* Cleanup
* Update spells.cpp
* Remove unused repositories.
* Finalize
* Update lua_parser_events.cpp
* [LUA] Add Zone and Language Constants
This will add Zone:
```lua
if eq.get_zone_id() == Zone.Qeynos then
foo()
end
```
It will also add Language:
```lua
if e.language == Language.ElderElvish and e.other:GetLanguageSkill(Language.ElderElvish) >= 100 then
e.self:Say("You know my language!", Language.ElderElvish);
end
```
These changes should help avoid magic numbers in quests and aide in readability without the need for -- comments to clarify.
* Adjust to lower case
* [Quest API] Add RemoveAAPoints() and AA Loss Event to Perl/Lua
# Perl
- Add `$client->RemoveAAPoints(points)`.
- Add `EVENT_AA_LOSS`, exports `$aa_lost`.
# Lua
- Add `client:RemoveAAPoints(points)`.
- Add `event_aa_loss`, exports `e.aa_lost`.
# Notes
- Allows operators to more easily remove AA Points.
- Has a bool return type that will return false if the player does not have enough AA Points to complete the removal.
* Update client.cpp
This adds an error msg handler for lua calls to add a stack trace to
error messages. Lua 5.1 does not have luaL_traceback like luajit and lua
5.2+ so debug.traceback() is used directly as the msg handler.
The traceback will add more detail to errors than just logging package
and event names. Exceptions in C++ binds and luabind errors will now
show script context instead of just the error message.
e.g., for a luabind overload error:
No matching overload found, candidates:
void signal(int,int,int)
void signal(int,int)
stack traceback:
[C]: in function 'signal'
quests/arena/player.lua:10: in function 'somefn'
quests/arena/player.lua:27: in function <quests/arena/player.lua:17>
* [Quest API] Add EVENT_LEVEL_UP and EVENT_LEVEL_DOWN to bots
# Notes
- Bots did not have these events, this will allow operators to perform events on bot level up/down.
* Update bot.cpp
* [Quest API] Export target to EVENT_TARGET_CHANGE in Perl/Lua.
- Export `$target` to `EVENT_TARGET_CHANGE`.
- Export `e.other` to `event_target_change`.
- Allows operators to not have to grab bot, Client, or NPC's target in Perl with `GetTarget()`.
- Allows operators to not have to grab Client's target in Lua with `GetTarget()`.
* Update mob.cpp
* Update mob.cpp
* Update mob.cpp
* [Quest API] Add EVENT_DAMAGE_GIVEN and EVENT_DAMAGE_TAKEN to Perl/Lua.
# Perl
- Add `EVENT_DAMAGE_GIVEN`.
- Add `EVENT_DAMAGE_TAKEN`.
- Both events export `$entity_id`, `$damage`, `$spell_id`, `$skill_id`, `$is_damage_shield`, `$is_avoidable`, `$buff_slot`, `$is_buff_tic`, `$special_attack`.
# Lua
- Add `event_damage_given`.
- Add `event_damage_taken`.
- Both events export `e.entity_id`, `e.damage`, `e.spell_id`, `e.skill_id`, `e.is_damage_shield`, `e.is_avoidable`, `e.buff_slot`, `e.is_buff_tic`, `e.special_attack`, and `e.other`.
# Notes
- These events allow operators to have events fire based on damage given or taken, as well as keep better track of a Bot, Client, or NPC's damage per second or otherwise.
- Special Attack is only useful for NPCs, but allows you to see if the attack is Rampage, AERampage, or Chaotic Stab.
* Cleanup.
* [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>
* [Luamod] Add CalcSpellEffectValue_formula to luamods with example code in utils/mods/spell_formula.lua
* Fix typo
* Change formula down to uint32, fix format issues and remove debug on lua file
# 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.
* [Quest API] Add EVENT_LEVEL_DOWN to Perl/Lua.
# Perl
- Add `EVENT_LEVEL_DOWN`, exports `$levels_lost`.
- Add `$levels_gained` export to `EVENT_LEVEL_UP`.
# Lua
- Add `event_level_down`, exports `e.levels_lost`.
- Add `e.levels_gained` export to `event_level_up`.
# Notes
- Allows operators to perform actions on level down.
- Allows operators to tell how many levels were lost or gained in case people are gaining/losing multiple levels and they want to keep track or use this as a mechanic in their code somewhere.
* Update exp.cpp
* Update embparser.cpp