* [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>
* [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
# Perl
- Add `$mob->IsAttackAllowed(target)`.
- Add `$mob->IsAttackAllowed(target, is_spell_attack)`.
# Lua
- Add `mob:IsAttackAllowed(target)`.
# Notes
- Lua had `mob:IsAttackAllowed(target, is_spell_attack)` but not the other overload.
- Perl had neither.
* [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.
* [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
* [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
* [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.
* [Quest API] Add Owner methods to Perl/Lua.
# Perl
- Add `$mob->GetOwner()` to Perl.
# Lua
- Add `mob:GetOwnerID()` to Lua.
# Notes
- `GetOwner()` exists in Lua, but not Perl.
- `GetOwnerID()` exists in Perl, but not Lua.
* Update lua_mob.cpp
# Perl
- Add `$mob->RandomizeFeatures()` to Perl.
- Add `$mob->RandomizeFeatures(send_illusion)` to Perl.
- Add `$mob->RandomizeFeatures(send_illusion, set_variables)` to Perl.
# Lua
- Add `mob:RandomizeFeatures()` to Lua.
- Add `mob:RandomizeFeatures(send_illusion)` to Lua.
- Add `mob:RandomizeFeatures(send_illusion, set_variables)` to Lua.
# Notes
- Previous overload required `send_illusion` and `set_variables` despite both default values being `true`, this will allow you to just send nothing if you want both to be `true`.
- Change `RandomizeFeatures()` type to `bool` from `void` to match source method, returns `false` when used on a race that has no features to randomize.
- This allows operators to do something different if the NPC can't use this method.
* [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
# Perl
- Add `$mob->GetUltimateOwner()` to Perl.
# Lua
- Add `mob:GetUltimateOwner()` to Lua.
# Notes
- Allows operators to get ultimate owner of something like a pet's pet or a pet's swarm pet.
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
* [INT64] Fix int64 for OOC Regen and GetHP(), GetMaxHP(), GetItemHPBonuses() in Perl/Lua.
- These all had int64 values and were overflowing, returning garbage data.
* Update npc.cpp
* [Cleanup] Quest API push methods using invalid types.
- Some push methods were pushing integers as unsigned integers or unsigned integer as integers, this fixes all of that.
- Also cleans up some lines that had multiple function calls on them.
* More cleanup of bools and one expansion name was wrong.
* start
* working
* Update perl_mob.cpp
* updates
* Update perl_mob.cpp
* illusion behavior
* rework start
* fix later
* Update mob.cpp
* rework
* updates
* Update mob.cpp
* update
* gm command updates
* updates
* Update CMakeLists.txt
* [Features] Appearance Effects will now be sent to clients upon zone in. GM commands.
remove debugs
* [Features] Appearance Effects will now be sent to clients upon zone in. GM commands.
perl fix
* [Features] Appearance Effects will now be sent to clients upon zone in. GM commands.
space fix
* [Features] Appearance Effects will now be sent to clients upon zone in. GM commands.
minor fix
* Update CMakeLists.txt
* [Features] Appearance Effects will now be sent to clients upon zone in. GM commands.
cleaned up some inconsistency
* [Features] Appearance Effects will now be sent to clients upon zone in. GM commands.
- Keeps things tidier.
Perl script was used to get this in order easily.
```pl
my @perl_file_types = (
"bot",
"client",
"doors",
"entity",
"expedition",
"groups",
"hateentry",
"inventory",
"mob",
"npc",
"object",
"perlpacket",
"player_corpse",
"questitem",
"raids",
"spell"
);
foreach my $file_type (sort {$a cmp $b} @perl_file_types) {
my $perl_file = "perl_$file_type.cpp";
open my $client_file, '<', $perl_file or die "Cannot open file_name $perl_file";
{
local $/;
$content = <$client_file>;
}
close $client_file;
open my $perl_data_file, ">", "perl_$file_type\_data.cpp";
my @variables = ();
foreach my $line (split("\n", $content)) {
if ($line=~/newXSproto\(/i) {
$line =~ s/\s+/ /g;
my @line_data = split(/ /, $line);
push(@variables, join(" ", @line_data));
}
}
foreach my $variable (sort {$a cmp $b} @variables) {
$variable =~ s/^ //ig;
print $perl_data_file "\t$variable\n";
}
close $perl_data_file;
}```
- 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.
* Implement auto saylink injection
* Cover Lua say since it takes a different code path
* [Dialogue] Dialogue Window Middleware (#1526)
* Dialogue window quest dialogue work
* Add rest of DialogueWindow hooks
* Remove spacing
* shield ability initial work
* updates
* update
* updates
* Update client_process.cpp
* major updates
optimized
pet support
perl support
* updates
* minor update
* fix merge error
* requested changes
* variable fix
* optimization
* minor update
* Revert "optimization"
This reverts commit 27e11e758b23933ba8b6878d12d3eeb1e780aeda.
* fix
reset variables on shield_target if shielder dies or zones during shielding.
* edge case fix
Catch and fix situations where shield target doesn't have shielder variable cleared. Can occur if shielder . uses ability when target is not in combat then zones.
* combined packet and mob function
Shield now uses a common pathway through ShieldAbility, added parameters to perl function
* Addressing formatting for Kayen
* Fix function typo
Co-authored-by: Akkadius <akkadius1@gmail.com>
* [Quest API] Add CanRaceEquipItem(item_id) to Perl/Lua.
- Add $mob->CanRaceEquipItem(item_id) to Perl.
- Add mob:CanClassEquipItem(item_id) to Lua.
- Add mob:CanRaceEquipItem(item_id) to Lua.
* Use constants.
Co-authored-by: Chris Miles <akkadius1@gmail.com>