* 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
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
- 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.
* [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>
* [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.
* [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.
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.
This adds the `dz_switch_id` field to doors and dynamic_zones. It will
allow for compasses to be automatically added to dz entrances and will
support moving clients to the dz on use without needing to script it.
These can be imported for switches/doors from live packet dumps.
Also removes compass packet encoders (same struct in all clients)
* [Feature] GM State Change Persistance
- Flymode and Invulnerable will now persist over zoning.
- Appended GMSpeed, Flymode and Invulnerable to the hideme message GMs see when they first login.
- Added #godmode [on/off] command to turn on or off hideme, flymode, gmspeed and invulnerable all in one shot.
- /becomenpc will now disable tells to the target player. It will also automatically disable GM States that interfere with its functionality.
- GM Command /toggle will not properly turn tells on/off
- GMs will now be notified if they are ignoring tells when they first zone-in, provided their GM flag is up.
- Added TellsOff variable to the output to #showstats
* [Bug] Fix tells when gmhideme is turned off.
* [Cleanup] Cleanup function and rename for consistancy.
Remove un-needed this->
* Tweaks
* Tweaks
* Update db_update_manifest.txt
* Move string building logic to a vector and use strings join
* Update client_packet.cpp
* Update 2022_07_28_gm_state_changes.sql
* PR comment tweaks
Co-authored-by: Akkadius <akkadius1@gmail.com>
* Delete EQApplicationPacket after use
* Correct issue where Creating EQApplicationPackets in zone/mob.cpp may not free pBuffer[]
* Handle freeing pBuffer[] if exists in zone/mob.cpp Create*Packet functions
* Handle freeing pBuffer[] in zone/object.cpp Create*Packet methods
* Delete leaked outapp variables in zone/trading.cpp
* Make CreateHorseSpawnPacket() safer by freeing pBuffer[] before replacing with new[]
* Prevent initial new ServerPacket from being leaked in command_reload
* Free pack after sending in command_setlsinfo
* Delete new NPC in command_viewnpctype after printing stats
* Fix compile error
* Delete EQApplicationPacket after sending in command_kick
* Remove unneeded safe_delete(outapp) after FastQueuePacket and fix minor whitespace issue
* Delete packet after sending in WorldServer::SendReloadTasks
* Cleanup logic and free leaked NPCType in Client::Doppelganger
* Free RespawnOption in Client::HandleRespawnFromHover in 'unexpected rez from hover request' branch
* Free EQApplicationPacket after sending in Bot::ProcessBotInspectionRequest
* Free Bot when returning from failed Bot::Save() in helper_bot_create()
* Initialize variable to nullptr to prevent garbage initial value
* Undo change in other PR
* [Quest API] Add TrackNPC to Perl/Lua.
- Add quest::tracknpc(entity_id) to Perl.
- Add eq.track_npc(entity_id) to Lua.
- This will allow server operators to arbitrarily Track NPCs for clients with scripts.
- Modified tracking to auto turn off and tell you that you discovered your target if within 10 units, this is to allow scripted Tracking to turn off without the need for the Tracking skill.
* Remove unnecessary DoTracking() call.
* Update client.cpp
* Correct potential read out of bounds on array in Client::Doppelganger
* Correct potential read out of bounds in Client::ChannelMessageSend
* Corrected logic to not read out of bounds on the lower end.
* Remove unused local variable
* Remove another unused variable
* Correct typos and remove unused initialization
* Cleanup some code in OPCharCreate
* Remove unused function in client.cpp and undefined declaration.
Also the function potentially had a null pointer dereference according to Visual Studio.
* [Cleanup] Cleanup spell and max level bucket logic.
- Spell buckets will now allow new mob->SetBucket() buckets since most people use these now.
- Max level bucket will now allow new mob->SetBucket() bucket since most people use these now.
- Clean up GetScribeableSpells() and GetLearnableDisciplines() logic and magic numbers.
- Make GetClientMaxLevel() uint8 instead of int since it can only be 0-255.
* Fix typo from other commit.
* Lua setter.
* Update client.cpp
* [Titles] Cleanup titles, title suffix, and last name methods.
- Use strings instead of const chars*.
- Add optional parameter to SetAATitle in Lua so you can save to the database similar to Perl.
- Cleanup #lastname command.
- Cleanup #title command.
- Cleanup #titlesuffix command.
* Update npc.cpp
* [Commands] #reload Command Overhaul.
- Consolidated #reloadaa, #reloadallrules, #reloadcontentflags, #reloademote, #reloadlevelmods, #reloadmerchants, #reloadperlexportsettings, #reloadqst, #reloadstatic, #reloadtitles, #relaodtraps, #reloadworld, and #reloadzps in to one command.
- #reload has 15 different sub commands you may use, including Log Settings and Tasks reloading.
- All the reload commands are a part of the Developer Tools Menu messages now, as well as part of the documentation.
- Fixes the commands that weren't actually sending their packet to zone server to globally reload stuff.
- Added Variables table reloading to command.
* Consistency.
* Hot reload.
* Final big push.
* [Merchants] Add Merchant Data Bucket capability.
- Allows server operators to limit merchant items based on data bucket values and comparisons.
- Adds 3 columns, bucket_name, bucket_value, and bucket_comparison to merchantlist table.
- Bucket is checked based on GetBucketKey()-bucket_name.
- Buckets are mass loaded when using the merchant so it's not a database call per item, just a grouping of all their buckets from the start.
- This is a nearly year old pull request redone for master.
- bucket_comparison Values are as follows:
- bucket_comparison 0: bucket_name == bucket_value
- bucket_comparison 1: bucket_name != bucket_value
- bucket_comparison 2: bucket_name >= bucket_value
- bucket_comparison 3: bucket_name <= bucket_value
- bucket_comparison 4: bucket_name > bucket_value
- bucket_comparison 5: bucket_name < bucket_value
- bucket_comparison 6: bucket_name is any of pipe(|)-separated bucket_value
- bucket_comparison 7: bucket_name is not any of pipe(|)-separated bucket_value
- bucket_comparison 8: bucket_name is between first and second value of pipe(|)-separated bucket_value
- bucket_comparison 9: bucket_name is not between first and second value of pipe(|)-separated bucket_value
* Revert query change.
* [Quest API] Add AddPlatinum(), GetCarriedPlatinum() and TakePlatinum() to Perl/Lua.
- Allows for easier NPC interactions.
- GetCarriedPlatinum() adds together all currencies in inventory based on conversion amounts so it works easily with removals/checks.
- Add $client->AddPlatinum(platinum, update_client) to Perl.
- Add $client->GetCarriedPlatinum() to Perl.
- Add $client->TakePlatinum(platinum, update_client) to Perl.
- Add client:AddPlatinum(platinum, update_client) to Lua.
- Add client:GetCarriedPlatinum() to Lua.
- Add client:TakePlatinum(platinum, update_client) to Lua.
* Formatting.
Added EVENT_SKILL_UP to Perl/Lua
Adds sub EVENT_SKILL_UP output for use.
Exports:
$skill_id - ID of the skill being exported. Will export skill or language as the same so check below.
$skill_value - New skill level
$skill_max - Maximum value of skill
$is_tradeskill - 0 for non-tradeskill, 1 for tradeskill
Example usage:
sub EVENT_SKILL_UP {
if($is_tradeskill == 0) {
quest::shout("Skill Increase! " . $client->GetCleanName() . " has increased their " . quest::getskillname($skill_id) . " to " . $skill_value . " of " . $skill_max . "!"); #deleteme
}
if ($is_tradeskill == 1) {
quest::shout("Tradeskill Increase! " . $client->GetCleanName() . " has increased their " . quest::getskillname($skill_id) . " to " . $skill_value . " of " . $skill_max . "!"); #deleteme
}
}
Adds sub EVENT_LANGUAGE_SKILL_UP output for use.
Exports:
$skill_id - ID of the skill being exported. Will export skill or language as the same so check below.
$skill_value - New skill level
$skill_max - Maximum value of skill
Example usage:
sub EVENT_LANGUAGE_SKILL_UP {
quest::shout("Language Increase! " . $client->GetCleanName() . " has increased their " . quest::getlanguagename($skill_id) . " to " . $skill_value . " of " . $skill_max . "!"); #deleteme
}
Co-authored-by: toxin06 <53322305+toxin06@users.noreply.github.com>
* invulnerable
* modifier
* fix
* fix
* fix
* [API] Perl functions to set invulnerable to and modify environmental damage.
* [API] Perl and Lua functions to set invulnerable to and modify environmental damage.
credit to kinglykrab for lua
* [Skills] Exponential Decay Skill Up Formula
Added an exponential decay skill up formula option.
The current, linear, formula results in negative chances to skill up, which
have been mitigated via a multiplier and minimum of 1%
* [Skills]Configurable Exponential Decay Formala for Skill Up
What this fixes:
The existing formula for determining whether or not to skill up could result
in negative chances, and made an assumption around the number 252.
This would ultimately result in an override that would set the chance to 1.
My fix:
I created 2 new rules:
Character:SkillUpMaximumChancePercentage
Character:SkillUpMinimumChancePercentage
I changed the forumla to:
chance = ((max - min + skill_modification) * (.99^skill)) + min
This results in an exponential decay that starts at skill-modified maximum
and approaches minimum.
I decided that max-min+skill_modification should never be less than min
I also decided to continue to apply the Character:SkillUpModifier rule
post-calculation. I do not really think this is necessary anymore, given
this new formula, but we can discuss removing it.
I chose 25 and 2 as default maximum and minimum based on feel.
Related method signature fix:
Client::mod_increase_skill_chance was changed to return a double and
accept a double as an input for chance. This matches the actual data types
provided while calling the method and eliminates some type coersion and
resultant truncation. Right now, this method doesn't do anything, but in the
future we could implement skill-specific training dummies that accelerate
skill ups. I deduce that this is the purpose of this method call.
* [Skills]Configurable Exponential Decay Formula for Skill Up
What this fixes:
The existing formula for determining whether or not to skill up could result
in negative chances, and made an assumption around the number 252.
This would ultimately result in an override that would set the chance to 1.
My fix:
I created 2 new rules:
Character:SkillUpMaximumChancePercentage
Character:SkillUpMinimumChancePercentage
I changed the forumla to:
chance = ((max - min + skill_modification) * (.99^skill)) + min
This results in an exponential decay that starts at skill-modified maximum
and approaches minimum.
I decided that max-min+skill_modification should never be less than min
I also decided to continue to apply the Character:SkillUpModifier rule
post-calculation. I do not really think this is necessary anymore, given
this new formula, but we can discuss removing it.
I chose 25 and 2 as default maximum and minimum based on feel.
Related method signature fix:
Client::mod_increase_skill_chance was changed to return a double and
accept a double as an input for chance. This matches the actual data types
provided while calling the method and eliminates some type coersion and
resultant truncation. Right now, this method doesn't do anything, but in the
future we could implement skill-specific training dummies that accelerate
skill ups. I deduce that this is the purpose of this method call.
* fixup! [Skills]Configurable Exponential Decay Formula for Skill Up
* fixup! [Skills]Configurable Exponential Decay Formula for Skill Up
Removed a conditional that was rendered obsolete by moving the addition of a
mob to the auto haters list to fire after an IsValidXTarget check. This
made an entity_list call unnecessary. [zone/client.cpp]
Removed said unnecessary entity_list call. [zone/client.cpp]
Removed a superfluous call to ProcessXTargetAutoHaters [zone/attack.cpp]