203 Commits

Author SHA1 Message Date
Alex King
3bfb148bdc
[Quest API] Add RemoveAAPoints() and AA Loss Event to Perl/Lua (#4174)
* [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
2024-03-08 21:20:33 -05:00
Alex King
d68c1a7a6c
[Quest API] Add IsInAGuild() to Perl/Lua (#4066)
# Perl
- Add `$client->IsInAGuild()`.

# Lua
- Add `client:IsInAGuild()`.

# Notes
- Allows operators to more accurately tell if a player is in a group.
- `GuildID()` returns `uint32` max value if the player isn't in a guild so conditions using it must check for a value over a certain point, this is just a bool that simplifies that logic.
2024-02-13 19:27:43 -05:00
Chris Miles
c654c1d674
[Loot] Remove from shared memory, simplification (#3988)
* First pass of pulling loot out of shared memory, functional

* More code cleanup

* More cleanup

* More cleanup

* More cleanup

* Add loot reload type

* Reload, logging

* Update npc.h

* Cleanup

* Logging, don't load attempt to load loottable id 0

* Update worldserver.cpp

* Update client.cpp

* Update zone_loot.cpp

* PR feedback

* Update zone.cpp

* Memory leak suggestion

* Update CMakeLists.txt

* Post rebase issues
2024-02-05 15:17:53 -06:00
Alex King
0ffea36905
[Quest API] Add GetAAEXPPercentage() and GetEXPPercentage() to Perl/Lua (#4044)
* Initial Push

* Push

* Push.
2024-02-04 18:16:28 -05:00
Alex King
297e358c02
[Factions] Remove from shared memory and simplify (#3999)
* [Factions] Remove from shared memory and simplify

- Removes factions from shared memory and moves to zone based storage of repositories and changes the NPC `faction_list` to also use repositories.
- This affects NPC Factions and Faction Associations.

* Bug fixes.

* Update client.cpp

* Update client.cpp

* Update client.cpp

* Cleanup

* Update client.cpp

* Update client.cpp

* Update client.cpp

* Final push

* Update CMakeLists.txt

* Consolidate reloading.

* [Cleanup] PR # 3999 (#4039)

* [Fixes for PR # 3999

* [Reload actual in game factions, not just the umbrella data.

* syntax

* Fix typo

* Foix bug where primary_faction not filled in when no hits

* Fix typos

* Fix splash factions for kills.

* Fix typo

* Fix more variable names to be accurate

* Fix Loads to load new ones as they come in.

* Load npc_factions without primary (tasks) and support old task faction

* Rename to make way for new LoadFactionAssocition (by faction_id)

* Fix some review comments

* Add code to load factions for splash tasks and quests.

* Fix issue with sign and RewardFaction, fix Log Message

---------

Co-authored-by: Paul Coene <noudess@gmail.com>
2024-02-04 10:38:38 -05:00
Alex King
73a099c5ea
[Character] Character EXP Modifiers in Memory (#3934)
* Cleanup

* Final push.

* Update zonedb.cpp

* Update zone.h

* Update exp.cpp

* Update zonedb.cpp

---------

Co-authored-by: Chris Miles <akkadius1@gmail.com>
2024-01-13 00:03:36 -06:00
Alex King
77c0eb3998
[Character] Convert Character Corpses to Repositories (#3941)
* asdsa

* Final push

* Update character_corpses_repository.h

* Update character_corpses_repository.h

* Update zonedb.cpp

* Update zonedb.cpp

* Final push

* Update character_corpses_repository.h
2024-01-13 00:02:44 -06:00
Alex King
44d63c47d9
[Account] Convert UpdateGMStatus to Repositories (#3859)
- Convert `UpdateGMStatus` to repositories.
- Convert parameter of status to `int`.
2024-01-07 00:24:02 -06:00
Alex King
259add68f5
[Commands] Cleanup #appearance Command (#3827)
* [Commands] Cleanup #appearance Command

# Notes
- Cleanup messages and logic.
- Cleanup appearance type constants to use a namespace with constexpr instead.
- Cleanup animation constants to use a namespace with constexpr instead.

* Update emu_constants.cpp

* Cleanup
2024-01-06 22:24:32 -06:00
Alex King
99d2e3a8b1
[Commands] Add #clearxtargets Command (#3833)
# Perl
- Add `$client->ClearXTargets()`.

# Lua
- Add `client:ClearXTargets()`.

# Notes
- Add `#clearxtargets` command for players.
- Allows operators/players to clear their XTargets if something get stuck on it.
2024-01-06 22:18:21 -06:00
Alex King
122fe398b4
[Languages] Cleanup language constants, use repositories (#3838)
* [Languages] Cleanup languages constants

# Notes
- Cleanup formatting and logic where necessary.
- Cleaned up constants to use a namespace with `constexpr` instead.
- Changed `LoadCharacterLanguages` to use a repository instead.

* Lua GroupMessage uint8/language_id

* Lua More uint8/language_id
2024-01-06 22:17:10 -06:00
Alex King
6c18cd0bee
[Quest API] Add HasItemOnCorpse() to Perl/Lua (#3824)
# Perl
- Add `$client->HasItemOnCorpse(item_id)`.

# Lua
- Add `client:HasItemOnCorpse(item_id)`.

# Notes
- Allows operators to see if a player has an item on any of their corpses.
- May need to address having to allocate and deallocate memory for every corpse that could possibly exist for a player.
2023-12-30 22:09:48 -06:00
Fryguy
605502cd9d
[Bug Fix] Client:SetBucket Overload Incorrectly Named (#3825)
There was an issue with Client:SetBucket when attempting to use an expiration date. Looks like a lua def was mistakenly named SetBucketExpires.
2023-12-30 15:31:04 -05:00
Alex King
f3ef8a0993
[Quest API] Add SummonItemIntoInventory() to Perl/Lua (#3797)
* [Quest API] Add SummonItemIntoInventory() to Perl/Lua

# Perl
- Add `$client->SummonItemIntoInventory(item_data)`.

## Example
```pl
sub EVENT_SAY {
	if ($text=~/#a/i) {
		my %item_data = (
			"item_id" => 32557,
			"charges" => 1
		);
		$client->SummonItemIntoInventory(\%item_data);
	}
}
```

# Lua
- Add `client:SummonItemIntoInventory(item_data)`.

## Example
```lua
function event_say(e)
	if e.message:find("#a") then
		local item_data = {
			"item_id" = 32557,
			"charges" = 1
		}
		e.self:SummonItemIntoInventory(item_data)
	end
end
```

* Update effects.cpp
2023-12-22 02:45:40 -06:00
Alex King
0c9c2e25c1
[Quest API] Add EVENT_CRYSTAL_GAIN and EVENT_CRYSTAL_LOSS to Perl/Lua (#3735)
* [Quest API] Add EVENT_CRYSTAL_GAIN and EVENT_CRYSTAL_LOSS

- Add `$client->AddEbonCrystals(amount)`.
- Add `$client->AddRadiantCrystals(amount)`.
- Add `$client->RemoveEbonCrystals(amount)`.
- Add `$client->RemoveRadiantCrystals(amount)`.
- Add `EVENT_CRYSTAL_GAIN`.
- Add `EVENT_CRYSTAL_LOSS`.
- Export `$ebon_amount`, `$radiant_amount`, and `$is_reclaim`.

- Add `client:AddEbonCrystals(amount)`.
- Add `client:AddRadiantCrystals(amount)`.
- Add `client:RemoveEbonCrystals(amount)`.
- Add `client:RemoveRadiantCrystals(amount)`.
- Add `event_crystal_gain`.
- Add `event_crystal_loss`.
- Export `e.ebon_amount`, `e.radiant_amount`, and `e.is_reclaim`.

- Allows operators to add or remove Ebon/Radiant Crystals directly.
- Allows operators to track gain/loss of Ebon/Radiant Crystals.

* Update perl_client.cpp

* Update lua_client.cpp
2023-12-16 22:47:13 -06:00
Alex King
9739c1c8ef
[Quest API] Add EVENT_ALT_CURRENCY_GAIN and EVENT_ALT_CURRENCY_LOSS to Perl/Lua (#3734)
* [Quest API] Add EVENT_ALT_CURRENCY_GAIN and EVENT_ALT_CURRENCY_LOSS

- Add `EVENT_ALT_CURRENCY_GAIN`.
- Add `EVENT_ALT_CURRENCY_LOSS`.
- Export `$currency_id`, `$amount`, and `$total.

- Add `event_alt_currency_gain`.
- Add `event_alt_currency_loss`.
- Export `e.currency_id`, `e.amount`, and `e.total.

- Convert `int8 method` to `bool is_scripted` in `Client::AddAlternateCurrencyValue`.
- Properly utilize `is_scripted` parameter in `perl_client.cpp`.
- Allows operators to perform events on alternate currency gains/losses.

* Update lua_general.cpp

* Cleanup types.

* Update lua_client.cpp
2023-12-16 22:40:24 -06:00
Alex King
345dd442dd
[Quest API] Add GrantAllAAPoints() to Perl/Lua and Modify #grantaa (#3616)
# Command
- Add optional `level` argument to `#grantaa` so you can grant AAs up the specified level.

# Perl
- Add `$client->GrantAllAAPoints()`.
- Add `$client->GrantAllAAPoints(level)`.

# Lua
- Add `client:GrantAllAAPoints()`.
- Add `client:GrantAllAAPoints(level)`.

# Notes
- Grants all AA abilities up to client's current level or a specified level.
2023-10-13 20:13:55 -05:00
Alex King
bab16771aa
[Quest API] Add ApplySpell() and SetBuffDuration() overloads to Perl/Lua (#3576)
# Perl
- Add `$bot->ApplySpell(spell_id, duration, level)`.
- Add `$bot->ApplySpell(spell_id, duration, level, allow_pets)`.
- Add `$bot->ApplySpellGroup(spell_id, duration, level)`.
- Add `$bot->ApplySpellGroup(spell_id, duration, level, allow_pets)`.
- Add `$bot->ApplySpellRaid(spell_id)`.
- Add `$bot->ApplySpellRaid(spell_id, duration)`.
- Add `$bot->ApplySpellRaid(spell_id, duration, level)`.
- Add `$bot->ApplySpellRaid(spell_id, duration, level, allow_pets)`.
- Add `$bot->ApplySpellRaid(spell_id, duration, level, allow_pets, is_raid_group_only)`.
- Add `$bot->SetSpellDuration(spell_id, duration, level)`.
- Add `$bot->SetSpellDuration(spell_id, duration, level, allow_pets)`.
- Add `$bot->SetSpellDurationGroup(spell_id, duration, level)`.
- Add `$bot->SetSpellDurationGroup(spell_id, duration, level, allow_pets)`.
- Add `$bot->SetSpellDurationRaid(spell_id)`.
- Add `$bot->SetSpellDurationRaid(spell_id, duration)`.
- Add `$bot->SetSpellDurationRaid(spell_id, duration, level)`.
- Add `$bot->SetSpellDurationRaid(spell_id, duration, level, allow_pets)`.
- Add `$bot->SetSpellDurationRaid(spell_id, duration, level, allow_pets, is_raid_group_only)`.
- Add `$client->ApplySpell(spell_id, duration, level)`.
- Add `$client->ApplySpell(spell_id, duration, level, allow_pets)`.
- Add `$client->ApplySpellGroup(spell_id, duration, level)`.
- Add `$client->ApplySpellGroup(spell_id, duration, level, allow_pets)`.
- Add `$client->ApplySpellRaid(spell_id, duration, level)`.
- Add `$client->ApplySpellRaid(spell_id, duration, level, allow_pets)`.
- Add `$client->ApplySpellRaid(spell_id, duration, level, allow_pets, is_raid_group_only)`.
- Add `$client->ApplySpellRaid(spell_id, duration, level, allow_pets, is_raid_group_only, allow_bots)`.
- Add `$client->SetSpellDuration(spell_id, duration, level)`.
- Add `$client->SetSpellDuration(spell_id, duration, level, allow_pets)`.
- Add `$client->SetSpellDurationGroup(spell_id, duration, level)`.
- Add `$client->SetSpellDurationGroup(spell_id, duration, level, allow_pets)`.
- Add `$client->SetSpellDurationRaid(spell_id, duration, level)`.
- Add `$client->SetSpellDurationRaid(spell_id, duration, level, allow_pets)`.
- Add `$client->SetSpellDurationRaid(spell_id, duration, level, allow_pets, is_raid_group_only)`.
- Add `$client->SetSpellDurationRaid(spell_id, duration, level, allow_pets, is_raid_group_only, allow_bots)`.
- Add `$mob->ApplySpellBuff(spell_id, duration, level)`.
- Add `$mob->SetSpellDuration(spell_id, duration, level)`.

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

# Notes
- This allows operators to override the spell level.
2023-09-17 13:14:13 -05:00
Alex King
a75648f73f
[Data Buckets] Distributed Databucket Caching (#3500)
* [Data Buckets] Zone-Based Data Bucket Caching

# Notes
- Adds a data bucket cache so we're not needlessly hitting the database every time we need to read a data bucket value.

* Cleanup and unify GetData access patterns

* Cache work

* Push

* Add to cache when we fetch and do a db hit

* Handle bucket misses in cache

* Formatting

* Logging

* [Data Buckets] Zone-Based Data Bucket Caching

- Adds a data bucket cache so we're not needlessly hitting the database every time we need to read a data bucket value.

* Cleanup and unify GetData access patterns

* Cache work

* Push

* Add to cache when we fetch and do a db hit

* Handle bucket misses in cache

* Formatting

* Remove redundant fetches from cache since GetData does the same thing

* Push progress

* Distributed cache work

* Logging

* Fix issue with scoping where same named keys could return overlapping results

* Misses cache tweak, logging, comments

* Add bot, client, and NPC bucket methods to Lua.

---------

Co-authored-by: Akkadius <akkadius1@gmail.com>
2023-07-24 12:22:50 -05:00
Alex King
ee45a28efe
[Quest API] Add SetLDoNPoints() to Perl/Lua (#3496)
# Perl
- Add `$client->SetLDoNPoints(theme_id, points)`.

# Lua
- Add `client:SetLDoNPoints(theme_id, points)`.

# Notes
- Allows operators to directly set LDoN Points.
2023-07-15 21:46:49 -05:00
Alex King
2717fcc339
[Quest API] Add ClearAccountFlag() and GetAccountFlags() to Perl/Lua (#3469)
* [Quest API] Add ClearAccountFlag() and GetAccountFlags() to Perl/Lua

# Perl
- Add `$client->ClearAccountFlag(flag)`.
- Add `$client->GetAccountFlags()`.

# Lua
- Add `client:ClearAccountFlag(flag)`.
- Add `client:GetAccountFlags()`.

# Notes
- Made use of repositories and cleaned up existing code.

* Update lua_client.cpp

* Don't use auto.
2023-07-03 01:19:48 -05:00
Alex King
dc28c8d485
[Bug Fix] Fix data type of GetAggroCount() (#3470)
# Notes
- This is an `unsigned int`, not an `int`, so this fixes that.
2023-07-03 00:10:27 -05:00
Alex King
6324e3687a
[Quest API] Add GetClassAbbreviation() and GetRaceAbbreviation() to Perl/Lua (#3463)
# Perl
- Add `$bot->GetClassAbbreviation()`.
- Add `$bot->GetRaceAbbreviation()`.
- Add `$client->GetClassAbbreviation()`.
- Add `$client->GetRaceAbbreviation()`.

# Lua
- Add `bot:GetClassAbbreviation()`.
- Add `bot:GetRaceAbbreviation()`.
- Add `client:GetClassAbbreviation()`.
- Add `client:GetRaceAbbreviation()`.

# Notes
- Allows operators to easily get a player race/class abbreviation, example being `Warrior` as `WAR`.
2023-07-02 10:26:51 -04:00
Alex King
c5c575b028
[Quest API] Add GetEXPForLevel() to Perl/Lua (#3403)
# Perl
- Add `$client->GetEXPForLevel(check_level)`.

# Lua
- Add `client:GetEXPForLevel(check_level)`.

# Notes
- This allows operators to see the required experience for a level based on the client provided, this takes race/class modifiers into account as well if enabled.
2023-06-12 19:18:39 -05:00
Jasdac
9f4d60ec36
[Feature] Intoxication setter/getter for source, getter for Perl/Lua (#3330)
* Add setter and getter methods for intoxication
Add GetIntoxication functions for perl and Lua

* Remove trailing tab

* Use clamp instead of min/max
2023-05-03 16:19:53 -04:00
Aeadoin
7f7ba2e6c2
[Cleanup] Remove unused Includes under zone files (#3162) 2023-04-01 22:55:28 -04:00
Alex King
6960a1a682
[Bug Fix] Fix issues with Lua tables not starting at index 1 (#3160)
* [Bug Fix] Fix issues with Lua tables not starting at index 1

# Notes
- This would cause the first item in the table to be inaccessible since Lua tables start at index `1` instead of index `0`.
- All other spots using Lua tables have their indexes starting at `1`.

* Update lua_general.cpp
2023-03-30 06:02:53 -04:00
Aeadoin
59ad91a140
[Feature] Add Data Bucket support for scaling of Heroic Stats. (#3058)
* [Feature] Add Data Bucket support for scaling of Heroic Stats.

* update

* fixes, still reworking logic

* fixes, still reworking logic

* logic done

* logic done

* fixes

* Cleanup

* Cleanup

* Cleanup naming, verify behaviors

* formatting

* formatting

* fix issue with endurance and mana.

* update rule desc

* cleanup

* DataBucket Struct

* Cleanup data_bucket.cpp and add constants

* cleanup

* changes

* formatting

* fix from merge

* escape keyword `key`

* Add `key` to generator, run repository-generator.pl

* fix for change to key

* cleanup

* formatting

* formatting

* typo
2023-03-23 21:42:13 -04:00
Alex King
6b65e93a06
[Cleanup] Remove unused SaveBackup in client.h (#3030)
# Notes
- This is unused and does nothing in both Perl and Lua.
2023-03-05 12:18:26 -05:00
Alex King
69c6a7b89a
[Quest API] Add IsBerserk() to Perl/Lua (#2997)
* [Quest API] Add IsBerserk() to Perl/Lua

# Perl
- Add `$client->IsBerserk()`.

# Lua
- Add `client:IsBerserk()`.
- Remove `mob:IsBerserk()` to move to client.

# Notes
- Allows operators to check if a client is berserk.

* Move to Mob.

* Update lua_client.cpp
2023-02-28 20:31:20 -05:00
Alex King
0d72295cc9
[Quest API] Add IsAutoAttackEnabled() to Perl/Lua (#2979)
# Perl
- Add `$client->IsAutoAttackEnabled()`.

# Lua
- Add `client:IsAutoAttackEnabled()`.

# Notes
- Allows operators to check if a client has auto attack enabled.
2023-02-23 02:31:35 -06:00
Alex King
9d4f231619
[Quest API] Add IsAutoFireEnabled() to Perl/Lua (#2978)
# Perl
- Add `$client->IsAutoFireEnabled()`.

# Lua
- Add `client:IsAutoFireEnabled()`.

# Notes
- Allows operators to check if a client has auto fire enabled.
2023-02-22 23:30:04 -05:00
Natedog2012
155ec9ac0d
[Quest API] Add rule AlternateAugmentationSealer for using a different bagtype (#2831)
* [Quest API] Add rule AlternateAugmentationSealer for using a different bagtype as an alternate augmentation sealer. Use EVENT_COMBINE with UseAugmentContainer

* Default it to be off or bagtype 53 (BagTypeAugmentationSealer)
2023-02-06 17:30:16 -06:00
Natedog2012
66896a3121
[Quest API] Add GetItemCooldown to return the time remaining on items… (#2811)
* [Quest API] Add GetItemCooldown to return the time remaining on items in seconds

* Change GetItemCooldown to uint32 for timers up to 130 years
2023-01-30 00:04:06 -06:00
Natedog2012
68a34565f9
[Bugfix] Add SetItemCooldown to tell client exact timer of item when clicked and export to perl and lua (#2795)
Items that are on cooldown but client doesn't show.. clicking item will fix the timer in client
2023-01-27 17:31:14 -06:00
Natedog2012
1fe79f430c
[Feature] ResetItemCooldown added to lua/perl and fix item re-cast times to show properly (#2793)
* Testing.

* Add ResetItemCooldown and port it over to perl

* This flag needs to be set for updating shared item cooldowns

* Properly set item recast for all item types, on corpses, on looting

* SummonItem properly sets recast timers of summoned items

* Rename variable to avoid confusion and change manifest to be more specific

* Sanity check item_d

* Recast -1 added as RECAST_TYPE_UNLINKED_ITEM
ResetItemCooldown will still remove cooldown of item that we don't have so when we acquire it the cooldown is reset

* change magic numbers

* more magic numbers

* More constants yay

* Remove unneeded export DeleteItemRecastTimer

* Remove duplicate message, this is handled by the client in this part of the code

Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
2023-01-25 20:09:08 -06: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
Alex King
eed45e5250
[Quest API] Add SendPath() to Perl/Lua. (#2740)
* [Quest API] Add SendPath() to Perl/Lua.

# Perl
- Add `$client->SendPath(target)`.

# Lua
- Add `client:SendPath(target)`.

# Notes
- Allows operators to send a path to a target arbitrarily with a script.

* Update client.cpp
2023-01-15 17:02:06 -05:00
Alex King
f5523b40d2
[Quest API] Add CampAllBots() to Perl/Lua. (#2732)
# Perl
- Add `$client->CampAllBots()`.
- Add `$client->CampAllBots(class_id)`.

# Lua
- Add `client:CampAllBots()`.
- Add `client:CampAllBots(class_id)`.

# Notes
- Adds constants for `NO_CLASS` which is class `0` and uses `RACE_DOUG_0` for any spots that use race ID `0`.
- Cleans up magic number usage of race/class of `0`.
2023-01-14 09:14:50 -06:00
Alex King
0d23ffe5e5
[Zones] Add Max Level Check to Zones. (#2714)
* [Zones] Add Max Level Check to Zones.

# Perl
- Add `$client->CanEnterZone(zone_short_name)`.
- Add `$client->CanEnterZone(zone_short_name, instance_version)`.

# Lua
- Add `client:CanEnterZone(zone_short_name)`.
- Add `client:CanEnterZone(zone_short_name, instance_version)`.

# Notes
- Allows operators to limit zones to a maximum level.
- Allows operators to see if a player can enter a zone before sending them.
- Keeps players from entering via `#peqzone` and `#zone` as well if they do not meet the requirements or are not high enough status to bypass the requirements.

* Cleanup.
2023-01-10 20:47:37 -05:00
Aeadoin
143c4fe6aa
[Quest API] Add option to Ignore Mods to CalcEXP (#2704)
# Perl
- Add `$client->CalcEXP(consider_level, ignore_modifiers)`.

# Lua
- Add `client:CalcEXP(consider_level)`.
- Add `client:CalcEXP(consider_level, ignore_modifiers)`.

# Notes
- Allows operators to calculate experience based on consider level as well as ignore modifiers to get a baseline of experience that should be expected when killing a mob.
2023-01-05 20:38:08 -05:00
Aeadoin
9c3c5b5230
[Experience] Change Exp Calculations to be 64 bit where needed. (#2677)
* [Experience] Change Exp Calculations to be 64 bit where needed.

* Fix lua values

* Formatting
2022-12-30 22:03:30 -05:00
Alex King
a6fa6084fa
[Feature] Add Experience Gain Toggle. (#2676)
* [Feature] Add Experience Gain Toggle.

# Perl
- Add `$client->IsEXPEnabled()`.
- Add `$client->SetEXPEnabled(is_exp_enabled)`.

# Lua
- Add `client:IsEXPEnabled()`.
- Add `client:SetEXPEnabled(is_exp_enabled)`.

# Commands
- Add `#exptoggle [Toggle] - Toggle your or your target's experience gain.`.

# Notes
- Allows operators to turn on/off a player's experience gain individually without changing their rule values.
- The command allows operators to give players access to the command to disable their own experience gain.
2022-12-30 17:30:23 -05:00
Alex King
d7ae3d5c6d
[Quest API] Add GetAugmentIDsBySlotID() to Perl/Lua. (#2673)
* [Quest API] Add GetAugmentIDsBySlotID() to Perl/Lua.

# Perl
- Add `$client->GetAugmentIDsBySlotID(slot_id)`.
- Add `$inventory->GetAugmentIDsBySlotID(slot_id)`.

# Lua
- Add `client:GetAugmentIDsBySlotID(slot_id)`.
- Add `inventory:GetAugmentIDsBySlotID(slot_id)`.

# Notes
- Allows operators to get a list of augments from a specific slot instead of having to build a plugin or something to do it.
- Fix issue with Lua tables starting at index `1` versus index `0`, so you lost the first value of the table due to this.

* Update inventory_profile.cpp
2022-12-25 15:14:54 -05:00
Chris Miles
c236c57a2c
[C++20] Enable C++20 + Fixes + FMT 9.1 (#2664)
* [CPP] Enable and build compliance with cpp20

* Windows build fix

* bump fmt version

* Updated fmt to 9.1, updated cmake minimum and verified preprocessor stuff works.

* Missing :

* Fix warning: top-level comma expression in array subscript is deprecated

* Fix warning: top-level comma expression in array subscript is deprecated

Co-authored-by: KimLS <KimLS@peqtgc.com>
2022-12-20 21:52:36 -06:00
Alex King
f7fb1c9fe1
[Quest API] Add MaxSkills() to Perl/Lua. (#2621)
* [Quest API] Add MaxSkills() to Perl/Lua.

# Perl
- Add `$client->MaxSkills()`.

# Lua
- Add `client:MaxSkills()`.

# Notes
- Allows operators an easy short hand for maxing a player's skills for their level without needing to do all the looping and stuff on their own.

* Cleanup.

* Only set if it's higher than skill level player has.

* Add constant.
2022-12-06 08:46:21 -05:00
Alex King
3774dc50d9
[Quest API] Add Fling Overloads to Perl/Lua. (#2622)
* [Quest API] Add Fling Overload to Perl/Lua.

# Perl
- Add `$client->Fling(target_x, target_y, target_z)`.
- Add `$client->Fling(target_x, target_y, target_z, ignore_los)`.
- Add `$client->Fling(target_x, target_y, target_z, ignore_los, clipping)`.

# Lua
- Add `client:Fling(target_x, target_y, target_z)`.
- Add `client:Fling(target_x, target_y, target_z, ignore_los)`.
- Add `client:Fling(target_x, target_y, target_z, ignore_los, clipping)`.

# Notes
- These overloads calculate the speed based on the distance automatically.

* Update client.cpp

* Update client.cpp

* Update client.cpp

* clip_through_walls
2022-12-06 08:38:33 -05:00
Alex King
9a35cacf27
[Quest API] Add EVENT_PAYLOAD to Perl/Lua. (#2611)
* [Quest API] Add EVENT_PAYLOAD to Perl/Lua.

# Perl
- Add `$bot->SendPayload(payload_id)`.
- Add `$bot->SendPayload(payload_id, payload_value)`.
- Add `$client->SendPayload(payload_id)`.
- Add `$client->SendPayload(payload_id, payload_value)`.
- Add `$mob->SendPayload(payload_id)`.
- Add `$mob->SendPayload(payload_id, payload_value)`.
- Add `$npc->SendPayload(payload_id)`.
- Add `$npc->SendPayload(payload_id, payload_value)`.

# Lua
- Add `bot:SendPayload(payload_id)`.
- Add `bot:SendPayload(payload_id, payload_value)`.
- Add `client:SendPayload(payload_id)`.
- Add `client:SendPayload(payload_id, payload_value)`.
- Add `mob:SendPayload(payload_id)`.
- Add `mob:SendPayload(payload_id, payload_value)`.
- Add `npc:SendPayload(payload_id)`.
- Add `npc:SendPayload(payload_id, payload_value)`.

# Notes
- Allows operators to send payload IDs with a payload value, the value can be a comma separated value, JSON, etc.
- The idea is to allow a more configurable event for operators to send information to/from entities.

* Cleanup parser events.
2022-12-04 17:47:49 -05:00
Alex King
e1d5274bd5
[Quest API] Cleanup Signal Methods in Perl/Lua. (#2604)
# Perl
- Add `$client->Signal(signal_id)`.

# Notes
- Some places still had signal as `uint32` versus `int`.
- Rename `signal` to `signal_id` where valid so we don't have conflicts.
2022-12-04 17:40:48 -05:00
Alex King
5d5c2a4194
[Quest API] Add GetGuildPublicNote() to Perl/Lua. (#2608)
# Perl
- Add `$client->GetGuildPublicNote()`.

# Lua
- Add `client:GetGuildPublicNote()`.

# Notes
- Allows operators to grab a player's public note in there guild if they wanted to.
2022-12-04 12:18:18 -05:00