9919 Commits

Author SHA1 Message Date
Chris Miles
89fdd842e1
[Code Cleanup] Zone Data Loading Refactor (#2388)
* [Code Cleanup] Zone data loading refactor

* Update client_packet.cpp

* strcpy adjustments

* Ensure safe points get reloaded properly

* Simplify GetPEQZone and getZoneShutDownDelay

* Bring in zone_store where needed

* Update client.cpp

* Signature

* Signature

* Convert helpers to using pointers

* PR comment

* Update worlddb.cpp

* Fix loading for instances

* Fix zoning with fallback as well

* Another place for instance fallback
2022-09-01 18:48:28 -05:00
Michael Cook (mackal)
c613dbb2f7
Fix issues with Client::SetHideMe (#2403)
Arg was shadowing the member variable and we weren't updating the member
variable
2022-09-01 11:48:23 -04:00
Michael Cook (mackal)
6f7fa98996
[Repositories] Add more precise types to repository generator (#2391)
* Make utils/scripts/generators/repository-generator.pl aware of more
datatypes

This adds support for unsigned and more integer types. It also avoids
using parsing functions that require casting (still needed in some
cases)

Having the data types in the Repository structs better map to the types
in the database will allow us to avoid casting when we pull data out of
them. And as a benefit, assume something is wrong if we do :)

Hopefully clean up some warnings due to casting too.

Co-authored-by: Akkadius <akkadius1@gmail.com>
2022-08-31 00:04:27 -05:00
Kinglykrab
fcf01f6d87
[Commands] Add #findrecipe and #viewrecipe Commands. (#2401)
* [Commands] Add #findrecipe and #viewrecipe Commands.

- Add #findrecipe [Search Critieria] command.
- Add #viewrecipe [Recipe ID] command.
- #findrecipe will show #viewrecipe saylinks if the user has access to that command.
- #viewrecipe will show #summonitem saylinks if the user has access to that command.

* Cleanup

* Lexicon change.

* Remove unnecessary .c_str() and
2022-08-30 23:32:17 -05:00
Michael
3228d6edf6
[Bug] Loot Drop Randomization adjustment (#2368)
* [Bug] Loot Drop Randomization adjustment

Loot Table currently favors the first item in the loot drop. This should help remove that condition.

Code by Ailia.

* snake_case

Co-authored-by: Akkadius <akkadius1@gmail.com>
2022-08-30 23:31:07 -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
Michael Cook (mackal)
edda5ef811
[Utility] Add std::string_view overloads for std::from_chars (#2392)
* Add std::string_view overloads for std::from_chars

std::from_chars floating point support is still pour, so we provide some
fall backs. These fall backs currently lack error handling.

(since GCC 11 and MSVC 2019 16.4 FP support is added, clang with libc++
still doesn't support FP)

GCC's floating point support is still rather pour (performance) and
probably shouldn't be used, but we have support to if people want to
now.

Probably need more test cases ...

* Fix issue with std::chars_format define lacking

My test case for lacking FP support was clang with libc++ which defined
this enum anyways.
2022-08-30 23:13:59 -05:00
Chris Miles
786a7e2169
[Zone] Fix and simplify zone shutdown logic (#2390)
* Fix and simplify zone shutdown logic

* Add ResetShutdownTimer
2022-08-30 23:08:24 -05:00
Michael Cook (mackal)
59584a8d94
Use macro to generate correct format specifier (#2400)
Windows and Linux use different data models on 64 bit systems so "%lld"
isn't the same on them.
2022-08-28 14:38:26 -04:00
hg
94ac04b360
[Bug Fix] Fix loading world shared task state (#2398)
The default for this field is -1 not 0, so on world restarts this was
marking all elements completed
2022-08-28 13:16:35 -04:00
Kinglykrab
3e703769a4
[Quest API] Allow CreateInstance to be used without a Client initiator. (#2399)
* [Quest API] Allow CreateInstance to be used without a Client initiator.

Currently, you have to create the instance with a client initiator, whether that's in an NPC's EVENT_SAY /EVENT_ITEM or in a player script.

This will allow you to create instances without needing a client, but if there is one and there are errors, the messages will be sent to the client.

* Update questmgr.h

* Instance version.
2022-08-28 13:10:19 -04:00
Kinglykrab
57b3255fad
[Quest API] Add Recipe Methods (#2393)
- Add $client->GetRecipeMadeCount(recipe_id) to Perl.
- Add $client->HasRecipeLearned(recipe_id) to Perl.
- Add quest::getrecipemadecount(recipe_id) to Perl.
- Add quest::getrecipename(recipe_id) to Perl.
- Add quest::hasrecipelearned(recipe_id) to Perl.
- Add client:GetRecipeMadeCount(recipe_id) to Lua.
- Add client:HasRecipeLearned(recipe_id) to Lua.
- Add eq.get_recipe_made_count(recipe_id) to Lua.
- Add eq.get_recipe_name(recipe_id) to Lua.
- Add eq.has_recipe_learned(recipe_id) to Lua.
2022-08-23 13:23:33 -05:00
Michael Cook (mackal)
10fd26ebbf
[Manifest] Its not_empty not notempty (#2394) 2022-08-22 22:26:24 -05:00
Kinglykrab
b9d8a13c76
[Bug Fix] Fix Silent Saylinks Sending Message to Others. (#2389)
* [Bug Fix] Fix Silent Saylinks Sending Message to Others.
Silent saylinks wouldn't send to sender, but to everyone else, so they could see what your saylinks were.

Added an optional `is_silent` bool to ChannelMessageReceived to account for this where necessary.

* Nullptr fix.
2022-08-21 23:26:25 -04:00
Chris Miles
c0d4dd4176
[Expansions] Zone expansion consistency changes (#2380)
* [Expansions] Zone expansion consistency changes

* Add expansion check exclusions

* Update 2022_08_19_zone_expansion_consistency.sql
2022-08-21 20:36:21 -05:00
Kinglykrab
6637e2c59f
[Feature] Add Guild Chat to Console. (#2387)
Adds guild chat to console.
2022-08-21 20:55:26 -04:00
hg
e65b61a95f
[Tasks] Implement task activity prerequisites (#2374)
Some live tasks make new elements available without requiring all
currently active ones to be completed first.

This adds the `req_activity_id` field to task activities which will mark
an element active if its required activity id is completed. If a valid
value is set then it's used instead of checking the current step.

The `step` field may still be set on rows with a valid `req_activity_id`
to specify its logical step and prevent later steps from becoming active
until completed. It's only ignored when deciding if the current element
is active.

The legacy task logic for unlocking activities was completely refactored
for this. A common method has been added so both zone and world can make
use of it to determine which elements are currently active. The previous
step system should remain unchanged.

The world logic for locking shared tasks when an element became active
did not account for "sequential" mode (all steps 0), unordered steps, or
gaps in step numbers. This also resolves that issue.
2022-08-21 19:55:19 -05:00
Kinglykrab
c954685239
[Bug Fix] Fix Duplicate Silent Saylink Messages (#2386)
Clicking silent saylinks was sending the message twice if you had an NPC targeted due to duplicate code within ChannelMessageReceived.
2022-08-21 20:54:40 -04:00
Chris Miles
893d53425a
[Repository] Modernize character recipe list (#2385) 2022-08-21 19:06:57 -05:00
Chris Miles
295ec0e1b4
[Tasks] Data validation for zone_version (#2381)
* [Tasks] Data validation for zone_version

* Update task_manager.cpp

* Update task_manager.cpp

* Update task_manager.cpp

* Update task_manager.cpp
2022-08-21 14:45:06 -05:00
Aeadoin
1d8dc4c8a8
[Feature] Change Mana Costs to use Signed Int (#2384) 2022-08-21 15:38:21 -04:00
Kinglykrab
b108828502
[Bug Fix] Fix Strings::Money Missing Conditions. (#2383)
Noudess pointed out we were missing CSP, CP, and SP options in these conditions.
2022-08-21 15:00:02 -04:00
Michael Cook (mackal)
3f9df40c3c
Update CURRENT_BINARY_DATABASE_VERSION (#2382)
PR #2376 didn't update it
2022-08-20 17:20:37 -04:00
Kinglykrab
3e8d34825a
[Quest API] Add Goto Player Teleport Methods. (#2379)
* [Quest API] Add Player Teleport Methods.

These methods will allow server operators to teleport players directly to other players via the quest API using the #goto command's functionality.
- Add $client->TeleportToPlayerByCharID(character_id) to Perl.
- Add $client->TeleportToPlayerByName(player_name) to Perl.
- Add $client->TeleportGroupToPlayerByCharID(character_id) to Perl.
- Add $client->TeleportGroupToPlayerByName(player_name) to Perl.
- Add $client->TeleportRaidToPlayerByCharID(character_id) to Perl.
- Add $client->TeleportRaidToPlayerByName(player_name) to Perl.
- Add client:TeleportToPlayerByCharID(character_id) to Lua.
- Add client:TeleportToPlayerByName(player_name) to Lua.
- Add client:TeleportGroupToPlayerByCharID(character_id) to Lua.
- Add client:TeleportGroupToPlayerByName(player_name) to Lua.
- Add client:TeleportRaidToPlayerByCharID(character_id) to Lua.
- Add client:TeleportRaidToPlayerByName(player_name) to Lua.

* Simplify by using repositories

* Simplify

Co-authored-by: Akkadius <akkadius1@gmail.com>
2022-08-20 10:23:41 -04:00
Kinglykrab
59691f39d7
[Commands] Command Status Reload and Helper Method (#2377)
* [Commands] Command Status Reloading

Currently command status changes require a server restart to take effect, this will allow them to be changed and use `#reload commands` without needing a restart.

Added a helper method called GetCommandStatus() for future reference when sending command saylinks to people and making sure if they're high enough status for the command before sending the link.

* Update client.cpp

* Update command.h

* Saylink cleanup.

* Remove unnecessary packet sending.

* Revert "Remove unnecessary packet sending."

This reverts commit e7e77b83af02955e6cda97fae7901620e09f9ba1.
2022-08-20 10:23:26 -04:00
Kinglykrab
8e3ad529dc
[Feature] Instance Version Specific Experience Modifiers (#2376)
* [Feature] Add Instance Version Support to Experience Modifiers.

Allows Operators to set experience modifiers to be instance version specific so that you can have different versions of the same zone have different modifiers. If there is not one found, it defaults to zone_id 0 for global and instance_veresion -1 for global.

* Update zonedb.cpp

* Typo.
2022-08-20 03:16:58 -05:00
Chris Miles
607871a7ac
[Loot] Add #lootsim (Loot Simulator) command (#2375)
* [Loot] Add #lootsim (Loot Simulator) command

* Validation

* Add global loot
2022-08-20 03:16:09 -05:00
Kinglykrab
6232a64cdb
[Bug Fix] Fix Bot Group Loading (#2366)
* [Bug Fix] Fix Bot Group Loading

There were some weird cases where this code would falsely say a bot group did not exist and this would disallow summoning this botgroup as well as deleting it.

* Typo.
2022-08-20 03:15:58 -05:00
Michael Cook (mackal)
25c6b055a4
Fix issue with trap auras casting on caster (#2378)
Unsure if something changed or I just failed to test correctly
2022-08-18 12:34:37 -04:00
Kinglykrab
216b6ef426
[Saylinks] Convert all GM Command Saylinks to Silent Saylinks. (#2373)
* [Saylinks] Convert all GM Command Saylinks to Silent Saylinks.
- This cleans up all non-silent GM Command Saylinks that we had before due to the way they worked before. All saylinks like this should be silent now.
- Add source short hand capability for say links with same link as text.

* Defaults to r anyway.

* Spacing.
2022-08-13 20:40:22 -04:00
Chris Miles
597b041d92
[Saylinks] Add Silent helper (#2372)
* [Saylinks] Add Silent helper

* Swap out usage in door manipulation for silent saylink helper
2022-08-13 19:44:53 -04:00
Michael
f6889d20e9
[Bug] UINT32 EmoteID (#2369)
emoteid packet structure is UINT32 but a number of references are in UINT16.
2022-08-13 18:41:14 -05:00
Chris Miles
79285b1002
[Repositories] Add GetMaxId, Count (#2371)
* [Repositories] Add GetMaxId, Count

* Update cmake with repositories, regenerate extended repos

* Remove license from files

* Simplify receivers

* Receiver simplify remaining

* Simplify receivers final

* Pass params by const reference

* Modernize grid tables

* Remove guild members since it doesn't conform as a generatable table

* PR comment
2022-08-13 18:40:56 -05:00
Chris Miles
b79e1947f1
[Doors] Improvements to door manipulation (#2370) 2022-08-13 18:16:55 -05:00
Kinglykrab
aa2b7f8947
[Quest API] Add GetSkillDmgAmt() to Perl. (#2365)
- Add $mob->GetSkillDmgAmt(skill_id) to Perl.
- This already exists in Lua, but not Perl.
2022-08-10 13:39:51 -04:00
Aeadoin
1d5a3a82a8
[Feature] Change GetSkillDmgAmt to int32 (#2364) 2022-08-09 21:24:15 -04:00
Kinglykrab
8ee7759dec
[Rules] Add Rule to Enable Tells with #hideme (#2358)
With the recent changes to #hideme as of #2328, tells are disabled to hidden GMs, meaning a GM must show themselves in order to receive tells.
2022-08-04 16:41:36 -04:00
Chris Miles
5ec18709a6
[Hotfix] Remove expansion field from account for those who have it (#2357) 2022-08-01 15:07:36 -05:00
hg
7c27c4350d
[Tasks] Add task accept packet validation (#2354)
This makes it so clients can only accept tasks that have been offered
2022-07-31 17:54:42 -05:00
hg
6068085de4
[Quest API] Fix lua task selector count when over max (#2353)
This was leaving the task count at 0 if called with more than the max
number of tasks (40)
2022-07-31 17:52:18 -05:00
Kinglykrab
e1f515ba4b
[Typo] Remove CanTradeFVNoDropItem() Duplicate (#2352) 2022-07-31 13:57:48 -05:00
hg
c7a3e88b81
[Tasks] Make #task reloadall not quit shared tasks (#2351)
This was causing #task reloadall to desync state for shared tasks.
Characters were removed from the shared task but remained in the
character_tasks table. This CancelTask is cosmetic only to reload
the client window.
2022-07-31 13:57:33 -05:00
Kinglykrab
b0da836f5a
[Quest API] Add GetBotItem() and GetBotItemIDBySlot() to Perl/Lua. (#2350)
- Add $bot->GetBotItem() to Perl.
- Add $bot->GetBotItemIDBySlot() to Perl.
- Add bot:GetBotItem() to Lua.
- Add bot:GetBotItemIDBySlot() to Lua.
2022-07-31 13:45:17 -05:00
Michael Cook (mackal)
a24a6f1160
[Code Cleanup] Resolve some warnings in loginserver/world_server.cpp (#2347) 2022-07-31 13:25:09 -05:00
hg
be1e558b3b
[Shared Tasks] Fix shared task message target (#2349)
Small regression from refactoring
2022-07-31 13:24:36 -05:00
hg
c4a99aabd0
[Shared Tasks] Avoid erasing shared tasks while iterating (#2348)
This wasn't safe since the erase would invalidate iterators used
internally by the range loops.

Shared tasks with no members are now also cleaned up

Make GetMembers return reference instead of copy (this is used a lot)

Add rule for shared task terminate time for easier debugging
2022-07-31 13:24:21 -05:00
Akkadius
0dfc6eaa15 [Hotfix] Fix potential race for crash dumps (Linux) 2022-07-31 04:10:09 -05:00
Akkadius
3cccb183a2 [Hotfix] SQL Update 2022-07-31 03:00:24 -05:00
Michael Cook (mackal)
c6cfcc3ea9
[Bug Fix] Limit merchant temp item list to zone and instance (#2346)
This prevents issues with a merchant being in more than one zone as well
as guild hall merchants sharing a list of temp items
2022-07-30 22:22:09 -05:00
hg
53b599518a
[Dynamic Zones] Implement dz templates (#2345)
This allows shared tasks to create dz instances automatically through
the `dz_template_id` field instead of using quest scripts. Quest apis
were also added to create expeditions from template ids.
2022-07-30 21:25:43 -05:00