89 Commits

Author SHA1 Message Date
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
Vayle
8219cc9ea0
[Rules] Rule to allow cap on % XP gain per kill (#2667)
* [Rules] Add rule to limit single kill xp gain

Adds a rule to allow server operators to restrict XP gain/kill to a specified % of their current level.

* Logic correction

* Commenting

* Logic tweaks

* Rule description update

* Logic adjustment

Changed to allow xp cap > 100% and -1 = disabled

* Formatting

* Removed extra space

* Formatting

Renamed rule to be more clear.
Updated rule description.
Minor formatting tweaks.
Implemented use of descriptive bools.

* Data type adjustment

* Removed Bools

* Update exp.cpp

* Update exp.cpp

* Update exp.cpp

* Update exp.cpp

Co-authored-by: Alex King <89047260+Kinglykrab@users.noreply.github.com>
2022-12-25 15:59:05 -05:00
Alex King
d3fac8a0cb
[Quest API] Add EVENT_LEVEL_DOWN to Perl/Lua. (#2620)
* [Quest API] Add EVENT_LEVEL_DOWN to Perl/Lua.

# Perl
- Add `EVENT_LEVEL_DOWN`, exports `$levels_lost`.
- Add `$levels_gained` export to `EVENT_LEVEL_UP`.

# Lua
- Add `event_level_down`, exports `e.levels_lost`.
- Add `e.levels_gained` export to `event_level_up`.

# Notes
- Allows operators to perform actions on level down.
- Allows operators to tell how many levels were lost or gained in case people are gaining/losing multiple levels and they want to keep track or use this as a mechanic in their code somewhere.

* Update exp.cpp

* Update embparser.cpp
2022-12-10 19:22:31 -05:00
Kinglykrab
f6dbdf5db8
[Quest API] Add EVENT_AA_BUY and EVENT_AA_GAIN to Perl/Lua. (#2504)
# Perl
- Add EVENT_AA_BUY to Perl.
  - Exports `$aa_cost`, `$aa_id`, `$aa_previous_id`, and `$aa_next_id`
- Add EVENT_AA_GAIN to Perl.
  - Exports `$aa_gained`
- Add quest::getaaname(aa_id) to Perl.

# Lua
- Add event_aa_buy to Lua.
  - Exports `e.aa_cost`, `e.aa_id`, `e.aa_previous_id`, and `e.aa_next_id`
- Add event_aa_gain to Lua.
  - Exports `e.aa_gained`
- Add eq.get_aa_name(aa_id) to Lua.
2022-11-05 11:09:47 -04:00
Michael
d7097e84ff
[Feature] AA Cap Limit (#2423)
* [Feature] AA Cap Limit

Will force unused AA points to the cap if they exceed the cap. Will also force AA Percentage to 0%. NOTE: The variable, UnusedAAPointCap, should NOT be lowered once implemented without first checking the DB for how many Unused AAs people have.  The next time they gain any EXP, it WILL drop them to cap.  Also, PCs should be given warning prior to this patch going to Live, to ensure they have a chance to spend any AAs above the cap, else they will lose them.

* Fix formatting on strings

* Fixes

* Change ConvertArray to fmt

* Fix formating and >= 0 aa_cap per review
2022-10-12 20:14:44 -05: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
dfd8f84cac
[Strings] Refactor Strings Usage (#2305)
* Initial commit checkpoint

* More functions converted

* Commify

* More functions

* Fin

* Sort declarations

* Split functions between files

* Bots

* Update strings.h

* Split

* Revert find replaces

* Repository template

* Money

* Misc function

* Update CMakeLists.txt

* Saylink

* Update strings.cpp

* Swap Strings::Saylink for Saylink::Create since saylink is coupled to zone database

* API casings
2022-07-14 02:10:52 -05:00
Kinglykrab
9e9ef6809b
[Cleanup] Cleanup spell and max level bucket logic. (#2181)
* [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
2022-05-28 14:35:17 -04:00
Chris Miles
5b4aeaa457
[Code Cleanup] Remove this-> in code where its implied (#2088) 2022-05-01 10:22:09 -04:00
Kinglykrab
293361a1f7
[Cleanup] Make use of AccountStatus constants wherever status is checked or used. (#1764)
* [Cleanup] Make use of AccountStatus constants wherever status is checked or used.
- Cleanup all instances of SendEmoteMessage.
- Cleanup all instances of SendEmoteMessageRaw.
- Cleanup all instances of MessageStatus.
- Convert Quest API method defaults to use constants.

* Cleanup constant names.
2021-11-14 21:01:13 -06:00
Alex
dd06033a58
Add character-specific zone-based experience modifiers. (#1326)
* Add character-specific zone-based experience modifiers.

This will allow server operators to give players individual experience modifiers (regular and AA).

Zone ID 0 will server as a global modifier for players, if no rows are found the modifier defaults to 1.0 so experience is neither increased nor decreased.

Setting a zone-specific modifier will override the zone ID 0 global modifier.

Requires a SQL update: sql/git/required/2021_04_11_character_exp_modifiers.sql

- Add quest::getaaexpmodifierbycharid(character_id, zone_id) to Perl.
- Add eq.get_aa_exp_modifier_by_char_id(character_id, zone_id) to Lua.
- Add quest::getexpmodifierbycharid(character_id, zone_id) to Perl.
- Add eq.get_exp_modifier_by_char_id(character_id, zone_id) to Lua.
- Add quest::setaaexpmodifierbycharid(character_id, zone_id, aa_modifier) to Perl.
- Add eq.set_aa_exp_modifier_by_char_id(character_id, zone_id, aa_modifier) to Lua.
- Add quest::setexpmodifierbycharid(character_id, zone_id, exp_modifier) to Perl.
- Add eq.set_exp_modifier_by_char_id(character_id, zone_id, exp_modifier) to Lua.
- Add $client->GetAAEXPModifier(character_id, zone_id) to Perl.
- Add client:GetAAEXPModifier(character_id, zone_id) to Lua.
- Add $client->GetEXPModifier(character_id, zone_id) to Perl.
- Add client:GetEXPModifier(character_id, zone_id) to Lua.
- Add $client->SetAAEXPModifier(zone_id, aa_modifier) to Perl.
- Add client:SetAAEXPModifier(zone_id, aa_modifier) to Lua.
- Add $client->SetEXPModifier(zone_id, exp_modifier) to Perl.
- Add client:SetEXPModifier(zone_id, exp_modifier) to Lua.

* Removed unneeded [].

* Fix variable name,

* Fix variable name.

* Fix version.h.

* Rename 2021_04_11_character_exp_modifiers.sql to 2021_04_23_character_exp_modifiers.sql

* Update db_update_manifest.txt
2021-04-23 08:47:39 -04:00
Alex
bf3593a60d
[Experience] Add exp mod to npc types to let a server op change the exp modifier (#1252)
* Add exp mod to npc types to let a server op change the exp modifier a npc gives (useful for custom content)

* Updated version.h
2021-02-23 11:50:38 -06:00
Kinglykrab
1c00edb458 Add AA gain messages. 2021-01-15 19:54:44 -05:00
Michael Cook (mackal)
32f4722c0f Only UF and earlier have the CORPSE_ITEM_LOST string
Let's not confuse players with missing messages I guess
2020-09-20 13:55:45 -04:00
Akkadius
32407dbb56 Add rule Character:FinalExpMultiplier - Added on top of everything else, easy for setting EXP events 2020-08-21 01:04:18 -05:00
Noudess
db4f113129 Added rule to allow the Ding sound when AA is earned. 2020-07-13 08:12:02 -04:00
Kinglykrab
15609ab1e8 Added optional 'ignore_mods' parameter to AddLevelBasedExp() in Perl and Lua. 2019-10-31 23:38:09 -04:00
Akkadius
31cebb5793 Logs::Normal to LogInfo 2019-09-02 02:18:54 -05:00
Akkadius
bfd0752c4d Logs::None added to LogDebug 2019-09-01 23:54:24 -05:00
Akkadius
678c25e02c Simplify error logging 2019-09-01 22:05:44 -05:00
Akkadius
9f25c9070c Refactor message functions 2019-08-11 00:14:02 -05:00
Akkadius
57354579aa Unify chat constants usage 2019-08-11 00:00:55 -05:00
=
31b33ba72c Properly escape key in SQL queries 2019-01-08 06:16:57 +00:00
Kinglykrab
3a757a7a85 Resolved a possible scaling issue with the way CharMaxLevel works with quest globals and data buckets. 2018-12-15 01:37:13 -05:00
Kinglykrab
8ae9c99f3d Added new data bucket and quest functionality.
Added multiple new instance related quest functions.
	1. quest::GetInstanceIDByCharID(const char *zone, int16 version, uint32 char_id)
		- Allows you to pull the instance ID of a client by character ID.
	2. quest::AssignToInstanceByCharID(uint16 instance_id, uint32 char_id)
		- Allows you to assign an instance to a client by character ID.
	3. quest::RemoveFromInstanceByCharID(uint16 instance_id, uint32 char_id)
		- Allows you to remove a client from an instance by character ID.

Added spell buckets, similar to spell globals.
	- Uses a new spell_buckets table and the Spells:EnableSpellBuckets rule.

Added max level by data bucket.
	- Uses data bucket char_id-CharMaxLevel and Character:PerCharacterBucketMaxLevel rule.
2018-12-13 19:42:31 -05:00
Trust
2f40e5da98 Fixing incorrect operator so Appveyor will pass. 2018-07-21 16:10:55 -04:00
Trust
f51396aa70 [Exploit Fix] AA Below Level Fix - When you are below level 52 with AA set above 0% it will revert the aa % to 0% 2018-07-21 00:01:36 -04:00
Xackery
008b17aaf2 added minimum level to pvp flag. 2018-02-26 09:33:15 -08:00
Daerath
d90982e63b * Merge from master and removal of commented code. 2018-01-06 11:01:41 -05:00
Daerath
b25c5d509d * Refactored how XP is calculated
* Added ability to use normalized XP per AA (based on # of kills per AA per white con NPC -- TSS era change)
* Added ability to use accelerated AA gain between a defined range (based on live, 0 - 4000 AA, linearly decreasing)
2018-01-06 10:22:26 -05:00
Daerath
feafd43fdf * Renamed rule to enable modern AA scaling to be consistent with the other related rules. 2018-01-03 06:19:48 -05:00
Daerath
7d7b9d0238 * Added rules for managing AA scaling. 2018-01-02 17:27:59 -05:00
Daerath
c2b5820153 * Implementing live-like AA scaling rules based on a window where accelerated AA XP is earned.
* TODO: Add scaling rules to database and rules engine and remove hardcoding
2018-01-01 14:23:24 -05:00
Michael Cook (mackal)
477ba3f4b9 Apply HotZone for AAs
Ahh is this the right spot? No idea :P
2017-12-15 01:47:45 -05:00
KimLS
8df8d7c3f6 Bugs in mod return values fixed 2017-06-16 23:12:54 -07:00
KimLS
31d8336b4b Fix acceptmessages, added exp hooks to luamods 2017-06-10 15:12:31 -07:00
E Spause
cb8c3595b7 SoF-era con system. New rule, UseOldConSystem to disable this functionality. 2017-04-15 13:06:46 -04:00
Akkadius
7aa1d243b0 [Performance] Reworked how all log calls are made in the source, see changelog.txt for more details 2017-04-01 03:51:46 -05:00
Xackery
19b6a96063 Changed lost exp message to all be 15. 2016-09-26 02:11:50 -07:00
Xackery
6079b34a2a Added Ruleset AA:ShowExpValues. 2016-09-26 02:09:39 -07:00
Paul Coene
56d355935b Fix task experience by level % to take into account hell level rule. 2016-09-10 14:21:19 -04:00
Michael Cook (mackal)
60da544d3a clang-tidy modernize-use-auto 2016-05-25 16:10:28 -04:00
Cilraaz
e2f1456624 Allow For Old Race/Class Experience Modifiers
Add new ruletypes 'Character:UseOldRaceExpPenalties' and 'Character:UseOldClassExpPenalties'

When set to true, adds in bonuses/penalties that existed in Classic

Class-based penalties were disabled during Velious, while race-based penalties were not removed until TSS

This method uses the original SOE method of increase exp needed to level, rather than decreasing exp gained
2015-10-14 22:57:17 -04:00
KimLS
1589169200 AAs should load from character data now, though will be fucked up if you already had stacked aas. 2015-06-10 22:46:57 -07:00
Russell Kinasz
f35594947c Full group was being excluded from group exp bonus 2015-06-07 16:53:38 -07:00
SecretsOTheP
788959a5e2 Haynar's movement fixes.
Changes Speed from float to int. EQ client deals with int step locs better than it does floats according to Haynar's testing.

This also contains mob runspeed changes. I recommend you set runspeeds to start in the DB 1.25 for NPCs below 1.25 which will match player runspeeds almost equally. Existing DBs will need to be updated.

General Cleanup of MobAI functions. Mobs now change their heading on AIMovement timers if their targets' heading has changed since that time. This prevents players from being able to land backstabs inbetween mob swings.

Charmed/feared players now send the appropriate packet, there was a missing CastToClient() in spells that was missing.

Mob runspeed can no longer be snared to 0%, instead, 1% of their base runspeed is the maximum. Roots apply as roots instead of a modifier under this code.

There is going to be bugs with this code. It's better we push through it than revert it. Sanctuary has been running this for a good week and we've worked through the issues.

Misc updates:
Exported some variables to perl, including:

EVENT_ITE_CLICK_CAST:
EVENT_ITEM_CLICK:
spell_id - returns the spell_id of the click effect.
return value - cancels the cast.

EVENT_DROP_ITEM:
quantity - returns the # of items dropped in the packet. If the item has charges, charges are returned here instead.
itemname - name of the item being dropped
itemid - id of the item being droppped
spell_id - spell_id associated with the item's click effect.
slotid - the inventory slot id of the item being dropped.
return value - cancels the item from being dropped.

Added Perl function: CalcEXP. Calculates the experience you would gain for an NPC that cons a specific con value to you.

Fixed a bug where you would receive the group experience bonus and group experience messages for simply being in a group, regardless of the player being in the same zone as you.
2015-05-25 12:35:53 -04:00
regneq
cc2a60feb2 * change the kill faction hits display before the xp message not after.
* removed the double level gain messages to display once either the level gained or the level.
* implement the message "You will now lose experience when you die" and "Your items will no longer stay with you..." when reach a certain level already sets in the rule table.
2015-05-11 16:34:46 -07:00
Trevius
0aba2d578a Added more information to Mercenary Logging.
Added potential fix for Mercenaries that fail to unsuspend.
Added a new "statscale" field to the merc_stats table that can be used to quickly balance Mercenary Stats based on Level.
The new "statscale" field now combines with the Mercs::ScaleRate rule value (default 100 percent for both).
2015-01-29 23:04:41 -06:00