On live if a task update would affect multiple elements, only the first
one gets updated. This was added as part of the changes in 7482cfc0.
Setting `UpdateOneElementPerTask` to false will restore the old behavior
that increments all active elements matching the task update criteria.
* [Zone Points] Fix zone point heading data
* Update 2022_09_03_fix_zone_point_heading_data.sql
* Augment #showzonepoints with saylinks
* Add more heading fixes to zone points
* Account for 999 target_heading
* Add zone safe headings
Some live npcs ignore the request cooldown timer (tutorialb)
A separate function had to be used for perl because the apis use an
array instead of array reference which won't allow a bool overload
This also replaces the fixed array and count args with a vector
* [NPC Scaling] Recalculate Skills and Reload Spells on Level Change
- Add $npc->ReloadSpells() to Perl.
- Add npc:ReloadSpells() to Lua.
Previously, you would you have to manually call RecalculateSkills() after you scale the NPC, now the call is built in to the scaling.
Spells did not reload when NPCs were scaled, causing them to continue to use their low/high level spells depending upon which way their level had been scaled, this has been adding to the scaling method. This will make NPCs properly use their level-based spells.
RecalculateSkills() and ReloadSpells() can still be used manually if people scale using something other than the source scaling method. Having this functionality built in to the scaling itself just makes more sense to me. Open to any ideas or thoughts.
* Reload spell effects, too.
* Add faction logging category
Probably should use this for more things
* Add FactionAssociation struct
This is simply just a struct that contains an array of faction ids and
multiplier. This can hold a maximum of 10 entries (Seru hit is 8, so 2
extra) this can be raised if need be.
* Add database changes and other data point changes
This is all the database changes and loading changes
Included is an optional SQL that will be used as a starting point, there
is likely errors or typos, but we will fix those as they are discovered.
* Add Client::RewardFaction function
This just takes the faction ID and the magnitude of the primary faction
hit and calculates the rest.
The minimum change will be either 1 or -1. We stop processing after we
see an ID of 0 and assume there will be no later entries.
The primary faction ID will always receive a hit even if there is no
faction association entries
* Add users of RewardFaction to NPC death, tasks, and QuestRewards
This will only use the new system if the magnitude is set, otherwise we
will just use the old system still
* Add quest system calls and lua QuestReward support
* Add #factionassociation command
This just calls RewardFaction, mostly useful for debugging
This allows removal of the task id limit (MAXTASKS)
There's some suspect places task data isn't verified but left unchanged
If memory use becomes too high once more live data is added tasks can be
stored in shared memory instead
* [Zoning] Fix various zoning issues, flag logic, #zone etc
* Enforce character restrictions later in the connection process so we don't end up in a loop race condition in world
Erasing from the map inside the range loop invalidated the iterator used
internally by the loop. This caused ucs access violations under msvc
debug builds when a discord logging category was enabled.
The task goal system made implementing tasks a little confusing since
the goal could be ambiguous depending on type. This also didn't support
filtering on multiple goals (e.g. looting items from matching npc names
inside an area). Deliver types could specify an npc id in `delivertonpc`
but the database may have multiple npcs with the same name or a task
might want to match partial npc names.
This replaces goalids with explicit fields for npcs, items, proximity
areas, and touch switch ids. These changes make managing task data
easier without needing to update multiple tables and allows filtering
task updates by multiple criteria. To mitigate any performance impact
from merging task proximities, only clients with explore tasks in the
current zone are checked during client movement updates.
Items and npcs still support goallists but it would be possible to
denormalize entries into delimited strings to combine with the match
lists. This would also decouple task goals from reward lists.
The client task update functions were refactored to run through a single
filtering function which significantly reduces duplicated code from the
legacy task system. This will also make it easier to later implement
any unhandled types.
Since the new fields will handle filtering single entries and lists
based on having values set, `goalmethod` now only distinguishes quest
controlled from source controlled.
This is a breaking api change, `taskexploredarea` has been removed
since explore ids no longer exist.
* [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
* 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>
* [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
* [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>
* 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.
* [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.
- 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.
* [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.