Compare commits

...

312 Commits

Author SHA1 Message Date
Xackery f37e0c3214 Added catch2 zone tests 2022-09-02 10:51:27 -07:00
Xackery 01b498f9c2 Fixed line printing to be hyperlink friendly 2022-09-02 10:50:02 -07:00
Xackery e0f9d9a8db Added sanity fixes for testing 2022-09-02 10:49:18 -07:00
Paul Coene ee54a7eb5f [Bug Fix] Restore missing messages for lifetap and dmg spells. (#2057)
* [Bug Fix] Restore missing messages for lifetap and dmg spells.

* Fix unintended duplicate message for DD on clients.

* Improve performance and accuracy of IsDamageSpell()
2022-04-13 23:11:26 -04:00
Kinglykrab a6814d46de [Commands] Cleanup #task Command. (#2071)
* [Commands] Cleanup #task Command.
- Cleanup messages.
- Add #task uncomplete [Task ID] to uncomplete a completed task without having to go in the database manually.

* Message cleanup.
2022-04-13 23:11:20 -04:00
KayenEQ 9dba6a6680 [Bug Fix] Blocked spells max spell id increased (#2073)
Blocked spell id should be checking int32 not int16
2022-04-13 11:54:11 -04:00
KayenEQ bc875ae554 [API] Methods for getting more information on quest timers. (#2060)
* hastimer

* [API] Check quest timer duration, timer remaining and if timer exists.

* [API] Methods for getting more information on quest timers.

* [API] Methods for getting more information on quest timers.

* [API] Methods for getting more information on quest timers.
2022-04-13 11:20:03 -04:00
KayenEQ bb897b755f [Bug Fix] Instrument Mods should not affect spells that change model size. (#2072)
Instrument Mods should not affect spells that change model size.
2022-04-13 11:02:21 -04:00
Kinglykrab a39a825045 [Quest API] Add GetBotListByCharacterID() to Perl/Lua. (#2069) 2022-04-02 17:51:26 -04:00
Paul Coene ccd0713b33 [Bug Fix] Fix recipient sound (vtell) on non-player races (#2066)
* [Bug Fix] Fix recipient sound (vtell) on non-player races

* Fix to use BaseRace as intended
2022-04-02 11:18:10 -04:00
Kinglykrab 5d94c9844a [Bug Fix] Clear title/suffix bug fix. (#2068)
- Clearing uses title ID 0, so need to make sure title ID is valid when setting and based on that, either check and set, or just clear.
2022-04-02 11:09:48 -04:00
KayenEQ bbe2db7c0f [Bug Fix] Bard Invisible causing display issues. (#2067)
* [Bug Fix] Bard Invisible causing display issues.

Error occurring due to bard modifiers being applied to invisible spell effect value.

* [Bug Fix] Bard Invisible causing display issues.
2022-04-02 00:01:38 +02:00
Kinglykrab 5dc76e595b [Quest API] Add GetBotListByClientName(client_name) to Perl/Lua. (#2064)
* [Quest API] Add GetBotListByClientName(client_name) to Perl/Lua.
- Add $entity_list->GetBotListByClientName(client_name) to Perl.
- Add eq.get_entity_list():GetBotListByClientName(client_name) to Lua.
- Allows you to get a bot list comprised solely of a specific character's bots.

* Update lua_entity_list.cpp
2022-03-23 08:47:47 -04:00
Natedog2012 b6b662f1c7 [Bug Fix] #peqzone no longer bypass Handle_OP_ZoneChange (#2063)
* [Bug Fix] #peqzone no longer bypass Handle_OP_ZoneChange

* Force other quest functions to trigger EVENT_ZONE properly

* call MovePC

* Use MoveZone to keep things uniform
2022-03-19 19:25:14 -04:00
Paul Coene 5275201713 [Bug Fix] Fix for being able to skill up on corspe. (#2058)
* [Bug Fix] Fix for being able to skill up on corspe.

* Fix whitespace
2022-03-19 13:21:54 -05:00
Paul Coene 1e86e0c02f [Bug Fix] manifest for db version 9176 had incorrect field name(#2062)
Field name in version 9176 doesn't match field created.
2022-03-19 13:13:56 -05:00
Natedog2012 25c0416f1e [Bug Fix] Force NPCs to respect special ability 24 and 50 when set on player pets (#2059)
* Force NPCs to respect special ability 24 and 50 when set on player pets

* Fix error in logic

* Remove this
2022-03-15 19:28:36 -05:00
Paul Coene 326dba6aeb [Logging] Fix log messages to final damage values (#2056) 2022-03-14 12:05:39 -04:00
Kinglykrab b75741ff4e [Bug Fix] Fix possible crash with zone name methods. (#2055)
- ZoneLongName and ZoneName were returning nullptr in places that were then attempting to use that nullptr value, causing zone crashes.
2022-03-13 15:59:57 -04:00
Kinglykrab 8e62383997 [Quest API] Add AddItem() to Perl/Lua. (#2054)
- Add $client->AddItem(item_data) to Perl.
- Add client:AddItem(item_table) to Lua.
- This will allow server operators to add items without needless parameters.

Perl Example:
```pl
my %item_data = (
	"item_id" => 1200,
	"charges" => 1,
	"augment_one" => 49656,
	"augment_two" => 49656,
	"augment_three" => 49656,
	"augment_four" => 49656,
	"augment_five" => 49656,
	"augment_six" => 49656,
	"attuned" => 1,
	"slot_id" => quest::getinventoryslotid("general1")
);
$client->AddItem(\%item_data);
```
Lua Example:
```lua
local item_data = {
	item_id = 1200,
	charges = 1,
	augment_one = 49656,
	augment_two = 49656,
	augment_three = 49656,
	augment_four = 49656,
	augment_five = 49656,
	augment_six = 49656,
	attuned = true,
	slot_id = Slot.General1
};
e.self:AddItem(item_data);
```
2022-03-13 15:59:48 -04:00
KayenEQ 4296e2e39e [API] GetNPCStat default better naming (#2053) 2022-03-12 20:01:25 -05:00
Kinglykrab e5f924d1d5 [Quest API] Allow EVENT_ZONE to be parsed as non-zero to prevent zoning. (#2052)
- This will allow server operators to prevent zoning to or from a specific zone based on whatever criteria they want.
2022-03-12 16:11:27 -05:00
Kinglykrab fb2aee1827 [Quest API] Add EVENT_CAST_ON exports to EVENT_CAST and EVENT_CAST_BEGIN. (#2051)
- Export $caster_id and $caster_level to EVENT_CAST and EVENT_CAST_BEGIN in Perl.
- Export e.caster_id and e.caster_level to EVENT_CAST and EVENT_CAST_BEGIN in Lua.
2022-03-12 14:33:00 -05:00
Kinglykrab 791d8b329d [Quest API] Export killed XYZH to EVENT_DEATH_ZONE in Perl. (#2050)
- Export $killed_x, $killed_y, $killed_z, and $killed_h to EVENT_DEATH_ZONE in Perl.
- Cleanup export strings and unnecessary .c_str() calls on event exports.
2022-03-12 13:44:01 -05:00
catapultam-habeo abcf8cbce1 [Bots] Update Bot Heal & Damage methods to more closely match Clients + Bugfixes (#2045)
* - Fixed Bots Spell Damage being negative under some circumstances (heal target)
- Allow Bots to send non-melee damage reports in the same manner as Clients
- Refactor\Update Bots Spell Damage & Heal calculations to match current state of Clients.
- Allow Bots to actually utilize Spell Damage and Heal Amount stats

* Don't send packets to bots

* remove random tab

* align text lol
2022-03-11 18:28:00 -05:00
Chris Miles 3ed6663c4c [Repositories] Update repositories (#2040) 2022-03-11 18:27:36 -05:00
Chris Miles f22608a43a [Bug FIx] Saylink Collation Database Edge Case (#2039) 2022-03-11 18:27:15 -05:00
KayenEQ 0e5d578d71 [Bug Fix] #tune command various fixes (#2046)
* tune fixes

* [Bug Fix] #tune command various fixes

accuracy tune fix
2022-03-11 10:13:51 -05:00
KayenEQ 8107ed52e1 [API] GetNPCStat can now return default stat values. (#2048)
* [API] GetNPCStat return default stat values.

* [API] GetNPCStat can now return default stat values.
2022-03-11 09:10:52 -05:00
Kinglykrab d904db0e52 [Quest API] Add caster_id and caster_level export to EVENT_CAST_ON in Perl/Lua. (#2049)
- Add $caster_id and $caster_level to EVENT_CAST_ON in Perl.
- Add e.caster_id and e.caster_level to EVENT_CAST_ON in Perl.
2022-03-10 21:46:27 -05:00
Kinglykrab e6c8a38ffa [Bug Fix] Spell Buckets/Globals did not allow string-based values. (#2043) 2022-03-09 14:18:24 -05:00
KayenEQ dbe0591b09 [API] Perl functions to set invulnerable to and modify environmental damage. (#2044)
* 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
2022-03-08 19:50:46 -05:00
KayenEQ 5b6f1d38be [Bug Fix] Invisible will display as dropped now on air pets when they attack. (#2042)
invisible display issue on pets
2022-03-07 16:41:43 -05:00
JJ ce85c70a07 [Database] Update 2022_01_10_checksum_verification.sql (#2041) 2022-03-07 14:30:24 -06:00
KayenEQ f814b5bec5 [Bug Fix] PR 2032 would lock client on casting fail as written (#2038) 2022-03-06 22:03:19 -06:00
Chris Miles 4e40d7eacc [Command] Fix #killallnpcs from crashing (#2037) 2022-03-06 22:03:10 -06:00
Randy Girard 31ad0da811 [Content Filtering] Updates contents flags to be checked at runtime. (#1940)
* Updates contents flags to be checked at runtime.

* Fix formatting

* Add expansion flags

* Tweaks to logic

* Logic tweaks

* Update world_content_service.cpp

* Inverse DoesPassContentFiltering logic

* Update world_content_service.cpp

* Update world_content_service.cpp

Co-authored-by: Akkadius <akkadius1@gmail.com>
2022-03-06 22:02:57 -06:00
Chris Miles 25a19a13dc [Database] Add Primary ID Keys to Tables (#2036) 2022-03-06 22:02:33 -06:00
Paul Coene 2a5ddde78a [Feature] Client Checksum Verification (Resubmit old 1678) (#1922)
* [Feature] Client Checksum Verification (Resubmit old 1678)

* Updated db version

* Add new updatechecksum to CmakeLists.txt

* Removed magic number and used constant

* Fix new command to have access to worldserver

* spacing, more venbose desc and remove unneeded check

* Cleanup, refactoring

Co-authored-by: Akkadius <akkadius1@gmail.com>
2022-03-06 20:26:29 -06:00
catapultam-habeo eca2ed0321 [Feature] EQ2-style implied targeting for spells. (#2032)
* Implemented EQ2-style implied targeting for spells.

* Fixed nullptr w\ target that has no target
2022-03-06 20:25:40 -06:00
Paul Coene afc32afb02 [AI] Spell Type (1024) InCombatBuff were spam casting (#2030) 2022-03-06 20:18:30 -06:00
catapultam-habeo 751db6fffb [Feature] Allow pets to zone with permanent (buffdurationformula 50) buffs to maintain them through zone transitions (#2035) 2022-03-06 20:17:25 -06:00
Paul Coene c4eb1f8439 [Bug Fix] Bandolier didn't recognize source weapon on cursor (#2026)
* [Bug Fix] Bandolier didn't recognize source weapon on cursor

* Add TODO comment
2022-03-06 20:15:22 -06:00
Paul Coene d6c03b54a1 [Bug Fix] Fixed several instances of incorrect comparision - & executes after == (#2025) 2022-03-06 18:42:23 -06:00
neckkola 261a9e6938 [Bots] Fix bot spawn when bot id = char_id (#1984)
* Fix for GENERIC_9_STRINGS

* Update .gitignore

* Fixed query for use case when char_id of owner equals a bot_id

* Update BotDatabase::LoadGroupedBotsByGroupID to not use a view though correct edge case where botid=charid
2022-03-06 18:41:53 -06:00
catapultam-habeo ac214f71d4 [Bots] Apply Spells:IgnoreSpellDmgLvlRestriction to bots (#2024)
* Correct bot spell damage and healing pathways to account for rule Spell:IgnoreSpellDmgLvlRestriction

* Corrected to be more consistent in regard to the 'spells[spell_id].no_heal_damage_item_mod' modifier. This modifier doesn't seem to actually exist on any content, and bots didn't use it to begin with.

This restriction is present on players - do we want it on bots also?
2022-03-06 18:40:21 -06:00
KayenEQ fd878e7b16 [Bug Fix] Missing break (#2031) 2022-03-04 18:35:59 -05:00
Michael Cook (mackal) 58cde58b45 Fix order of operations issues in worldshutdown command (#2029) 2022-03-04 12:24:13 -05:00
Kinglykrab cc2ef11158 [Bug Fix] Objects::GetTiltX() and Objects::GetTiltY() Perl Croak Typos. (#2028)
- Typo was causing GetIncline() to show three times on Spire and causing GetTiltX() and GetTiltY() not to show at all on Spire.
2022-03-03 22:06:25 -05:00
Kinglykrab 2dfb7614cc [Bug Fix] Doors::GetSize() Perl Croak Typo. (#2027)
- Typo was causing GetIncline() to show twice on Spire and causing GetSize() not to show at all on Spire.
2022-03-03 21:54:02 -05:00
KayenEQ 6dffeacc6e [Spells] Fixes for numhits type 7 counter incrementing incorrectly. (#2022)
* [Spells] Fix for numhits type 7 counter incrementing incorrectly.

* [Spells] Fixes for numhits type 7 counter incrementing incorrectly.

bot fix

* [Spells] Fixes for numhits type 7 counter incrementing incorrectly.

mercs

* [Spells] Fixes for numhits type 7 counter incrementing incorrectly.

remove old variable and related code.

* [Spells] Fixes for numhits type 7 counter incrementing incorrectly.

comments
2022-03-01 21:20:27 -05:00
Michael 2ec6dcbe24 Merge pull request #2023 from EQEmu/bug_fix/lua_argument_dispatch 2022-02-28 20:22:12 -05:00
Kinglykrab 39bc12b582 [Bug Fix] Removed Lua Event Argument Dispatch.
Fix accidentally removal of argument dispatch for EVENT_CONSIDER_CORPSE in https://github.com/EQEmu/Server/pull/2015
2022-02-28 19:59:34 -05:00
Kinglykrab 6d78f926c8 [Commands] Cleanup #worldwide command. (#2021)
- Cleanup messages and logic.
- Command usages would not display when using commands improperly, this will fix that.
2022-02-28 19:46:56 -05:00
catapultam-habeo 00af2903c3 Rule to apply Spell Dmg and Heal Amount stats as a percentage instead of flat value. (#2017)
* Apply Spell Dmg and Heal Amt stats as a percentage increase (1 SD\HA = 1% increase to spell effectiveness) instead of a flat addition.

* Corrected logic to allow for coexistence of FlatItemExtraSpellAmt rule and this.

* Adjusted rule name to be less ambiguous.
2022-02-28 15:24:16 -05:00
Kinglykrab 58fafd0f9c [Bug Fix] quest::MovePCInstance() Arguments Fix. (#2020)
- Logic made the method return an "error" when not using last parameter.
2022-02-27 16:39:45 -05:00
Kinglykrab 9f0989ee2d [Bug Fix] Spell Buckets/Globals SQL Escape. (#2019) 2022-02-26 10:17:05 -05:00
KayenEQ 14648b96c4 [Spells] SPA 79 SE_CurrentHPOnce now will check for focus, critical and partial resist checks, except for buffs. (#2018)
* [Spells] SPA 79 SE_CurrentHPOnce check for focus and related effects.

SPA 79 SE_CurrentHPOnce should have the damage checks as SPA 0 for heal/damage

* Update spell_effects.cpp

* [Spells] SPA 79 SE_CurrentHPOnce now will check for focus, critical and partial resist checks.
2022-02-24 13:47:54 -05:00
Kinglykrab bfd1cf9379 [Quest API] Add EVENT_EQUIP_ITEM_CLIENT and EVENT_UNEQUIP_ITEM_CLIENT to Perl/Lua. (#2015)
- These events allow more customization beyond forcing operators to use a script file for each and every item they want to have some sort of functionality for these events.
- Perl event exports $item_id, $item_quantity, and $slot_id.
- Lua event exports item_id, item_quantity, slot_id, and item.
2022-02-22 20:04:08 -05:00
Chris Miles 3c35e9bbc8 [GM Command] Fix Crash Issue and Validation with #zclip (#2014)
* Fix crash issue and validation with zclip

* Formatting.

Co-authored-by: Kinglykrab <89047260+Kinglykrab@users.noreply.github.com>
2022-02-21 17:02:48 -05:00
Kinglykrab d86544ff60 [Bug Fix] Alleviate some lag with crosszone/worldwide spell casting. (#2016)
- Spell casting was using SpellFinished which casts the spell, and if the spell was a group spell each member of the group would cast it on all the other members, causing a chain reaction.
- This fix utilizes ApplySpellBuff(spell_id, duration) so that it only casts the spell on the target, as with the crosszone and worldwide methods you will be affecting your target based on identifiers regardless.
- This should alleviate some of the crosszone/worldwide casting crashes on larger servers such as Lazarus.
2022-02-20 21:59:46 -05:00
KayenEQ 70eed67e08 [Bug Fix] checking casting_spell_slot before its defined is bad (#2013) 2022-02-20 15:56:17 -05:00
KayenEQ 1c0524681e [API] perl added GetNPCStat(identifier) (#2012)
* [API] perl added GetNPCStat

Returns values of the modifiers from ModifyNPCStat

* https://github.com/EQEmu/Server/pull/2012
2022-02-20 14:00:28 -05:00
KayenEQ aa9320de3c [Spells] Bard songs from item clickies should not require components (#2011) 2022-02-18 09:37:09 -05:00
KayenEQ ad28f3c3f3 [Bug Fix] Fix for castspell command (#2010)
Fix for using castspell command with parameter 0
2022-02-17 20:44:11 -05:00
Kinglykrab 71dfa9acc0 [Commands] Bug fix for #logs command. (#2008)
* [Commands] Bug fix for #logs command.

* Update logs.cpp
2022-02-17 12:01:06 -05:00
KayenEQ 56d0478ab1 [API] Fix for SetBuffDuration function to check bard slots. (#2009) 2022-02-17 12:00:42 -05:00
Kinglykrab 0d02fadb60 [Quest API] Add GetRandomMob() and GetRandomNPC() to Perl/Lua. (#2006)
- Add $entity_list->GetRandomMob(x, y, z, distance, exclude_mob) to Perl.
- Add $entity_list->GetRandomNPC(x, y, z, distance, exclude_npc) to Perl.
- Add eq.get_entity_list():GetRandomMob(x, y, z, distance, exclude_mob) to Lua.
- Add eq.get_entity_list():GetRandomNPC(x, y, z, distance, exclude_npc) to Lua.
2022-02-17 08:57:02 -05:00
cybernine186 4de5a7b86d [Bug] Fixed trade items record log (#2003)
LogPlayerHandin was not recording the item details of the trade. It should be inserting the trade details into `qs_player_handin_record_entries` but it was not running the query because of missing QueryDatabase function.
2022-02-16 21:52:14 -06:00
KayenEQ ba3c19ad0b [Spells] AE Duration effect (Rains) will now work with Target Ring and PBAE spells. (#2000)
* done

* Update beacon.cpp

* [Spells] AE Duration effect (Rains) will now work with Target Ring and PBAE spells.

Mackals suggestions implemented.
2022-02-16 10:12:13 -05:00
Kinglykrab 8ec80644ee [Commands] Cleanup #unscribespell Command. (#1998)
* [Commands] Cleanup #unscribespell Command.
- Cleanup messages and logic.
- Add Client::UnscribeSpellBySpellID(spell_id, update_client).
- Add $client->UnscribeSpellBySpellID(spell_id, update_client) to Perl.
- Add client:UnscribeSpellBySpellID(spell_id, update_client) to Lua.

* Update unscribespell.cpp
2022-02-16 06:04:01 -05:00
Kinglykrab ed7e2b2652 [Commands] Cleanup #untraindisc Command. (#1996)
- Cleanup messages and logic.
2022-02-16 06:03:51 -05:00
KayenEQ a83ad7080a fix for meloday cast bar issue (#2005) 2022-02-15 14:01:01 -05:00
KayenEQ 677d595c9d invis updates (#2004) 2022-02-15 11:39:19 -05:00
KayenEQ 615f4a5304 [API] Apply spells with custom buff durations and adjust existing spell buff durations. (#1997)
* working

* Update spell_effects.cpp

* updates

* disable_buff_overwrite

* revert

* update

* working

* update

* updates

* Update spells.cpp

* getbuffstat done

* Update perl_mob.cpp

* [API] Apply spells with custom buff durations and adjust existing spell buff durations.

* [API] Apply spells with custom buff durations and adjust existing spell buff durations.

* [API] Apply spells with custom buff durations and adjust existing spell buff durations.

* [API] Apply spells with custom buff durations and adjust existing spell buff durations.

* https://github.com/EQEmu/Server/pull/1997

Lua added, thanks kinglykrab
2022-02-15 08:58:10 -05:00
KayenEQ 5fd62d82db Update bonuses.cpp (#2002) 2022-02-15 08:57:53 -05:00
KayenEQ b938e6223c [Spells] Invisibility updates and rework (#1991)
* updates pre merge

* update

* Update spell_effects.cpp

* Update mob.h

* test

* test

* updates

* updates

* save

* update

* working solid

* animal and undead start

* progress

* updates

* rename

* set invis appearance on bonus

* remove fade buff state check

* update IsViisble check

* optimizing

* don't break bots

* debug remover

* Update ruletypes.h

* perl adds

* Update client_packet.cpp

* update

* done

* remove debugs

* Update client_packet.cpp

* update

* [Spells] Invisibility updates and rework

lua support

* [Spells] Invisibility updates and rework

lua
2022-02-15 00:18:02 -05:00
KayenEQ 51c8771bd2 bug fix (#2001) 2022-02-15 00:17:23 -05:00
Kinglykrab cc9196bd65 [Commands] Cleanup #showskills Command. (#1994)
* [Commands] Cleanup #showskills Command.
- Utilize popup over messages.
- Usage: #showskills [Start Skill ID] [All] - shows skills starting from skill ID and if "all" is specified it will show skills the player does not have normally (no max/cannot have skill).

* Update showskills.cpp

* Update command.cpp
2022-02-14 19:49:14 -05:00
Kinglykrab 6303f129af [Commands] Cleanup #setskillall Command. (#1992)
- Cleanup messages and logic.
2022-02-14 19:02:27 -05:00
KayenEQ 3f0987ba55 [Combat] /shield command "too far away message" (#1999)
* live did something that makes sense

* [Combat] /shield command "too far away message

better chat

* [Combat] /shield command "too far away message

never mind that one was red.
2022-02-14 10:44:26 -05:00
KayenEQ 1d4438ae1f [Bug Fix] Edge case AA reset timer issue fixes (#1995)
* SendCastRestriction not displaying right on linux build

changed const char to string

* fail safe to prevent recast timer checks from triggered spells

* fixed

* Update spell_effects.cpp

* https://github.com/EQEmu/Server/pull/1995

better message code
2022-02-13 21:50:53 -05:00
KayenEQ 03adf20fe9 bot crash fix (#1993) 2022-02-13 12:09:32 -05:00
KimLS dd6cde68bb Small change to order of a couple of files in zone cmakefile, added the gm commands to their own source group so they are cleanly separated in any IDEs cmake supports 2022-02-12 23:31:51 -08:00
KimLS 95c8b60ec6 Extra extern c warning squash, XS macro expands to XS_EXTERNAL which under c++ expands to extern c 2022-02-12 22:04:30 -08:00
KimLS fa418172d6 What is this random semicoloned if, removed to silence warning 2022-02-12 22:04:30 -08:00
KimLS 7b106fc622 Handle default case of GetDynamicZoneTypeName to silence warning 2022-02-12 22:04:30 -08:00
KimLS 62a453f0d7 Remove obsolete register spec on int to silence warning 2022-02-12 22:04:30 -08:00
KayenEQ fa9314811e [Bug Fix] Fix for Bot command casting (#1990)
* missing return true in ApplyBardPulse

* Update bot.cpp

* [Bug Fix] Fix for Bot command casting

compile error

* [Bug Fix] Fix for Bot command casting

* Update bot.cpp
2022-02-12 15:12:35 -05:00
Kinglykrab d2d7b8108d [Commands] Cleanup #ai Command. (#1980)
- Cleanup messages and logic.
- Remove #ai start/#ai stop as they can crash zones and are mostly useless.
- Add EQ::constants::GetConsiderLevelMap() and EQ::constants::GetConsiderLevelName().
- Add quest::getconsiderlevelname(consider_level) to Perl.
- Add eq.get_consider_level_name(consider_level) to Lua.
2022-02-11 16:26:08 -05:00
KayenEQ 99793cab8b [Spells] Fix for AA recast timers not resetting properly (#1989)
* revert completed

Too many issues popping up that are difficult to track down. This was probably not best way to solve the problem.

* fixed for real

* Update aa.cpp

* Update aa.cpp

* Update aa.cpp

* should work

* remove spaces

* [Spells] Fix for AA recast timers not resetting properly
2022-02-11 16:25:59 -05:00
KayenEQ e2484997dd revert completed (#1988)
Too many issues popping up that are difficult to track down. This was probably not best way to solve the problem.
2022-02-11 10:58:43 -05:00
KimLS 66935fe21b Fix for passing std::string to vsprintf 2022-02-11 01:15:02 -08:00
KayenEQ db988e4261 group message (#1987) 2022-02-10 23:55:59 -05:00
Kinglykrab fdd260d5fa [Commands] Cleanup #npcloot Command. (#1974)
- Cleanup messages and logic.
- Utilize item links where helpful.
- Implement #npcloot remove all to remove all loot from an NPC using GetLootList().
- #npcloot money now supports 0 to 65,535 for the money types, clamped using EQ::Clamp.
2022-02-10 20:05:36 -05:00
Kinglykrab 9110bc863e [Commands] Cleanup #logs Command. (#1969)
- Cleanup messages and logic.
- Utilize popup for list and applying settings.
2022-02-10 16:52:15 -05:00
Kinglykrab 4a41583805 [Commands] Cleanup #flagedit Command. (#1968)
- Cleanup and fix messages and logic.
- Utilized popup for listing zones that have required flags.
2022-02-10 16:17:52 -05:00
Kinglykrab 5396c0c88b [Commands] Cleanup #name Command. (#1977)
- Cleanup messages and logic.
2022-02-10 16:14:40 -05:00
Kinglykrab 968ae26c99 [Commands] Cleanup #hatelist Command. (#1976)
- Cleanup messages and logic.
2022-02-10 16:14:17 -05:00
Kinglykrab 7bf466cf3f [Commands] Cleanup #netstats Command. (#1970)
- Utilize popup over chat messages.
2022-02-10 16:10:31 -05:00
Kinglykrab 49d7eb1402 [Commands] Cleanup #version Command. (#1967)
- Utilize popup over chat message.
2022-02-10 16:10:23 -05:00
Kinglykrab d83ced6f76 [Commands] Cleanup #undye and #undyeme Commands. (#1966)
- Fix #undye command as its method was not being used in command.cpp.
- Cleanup messages and logic for both #undye and #undyeme.
2022-02-10 16:10:16 -05:00
Kinglykrab 1ea8888607 [Commands] Cleanup #timers Command. (#1965)
- Cleanup message and logic.
- Utilize popup instead of chat messages.
- Utilize ConvertSecondsToTime() helper method.
2022-02-10 16:10:06 -05:00
Kinglykrab f9eb4603a3 [Quest API] Add GetEnvironmentalDamageName() to Perl/Lua. (#1964)
- Add EQ::constants::GetEnvironmentalDamageMap() and EQ::constants::GetEnvironmentalDamageName().
- Add quest::getenvironmentaldamagename(damage_type) to Perl.
- Add eq.get_environmental_damage_name(damage_type) to Lua.
- Cleanup GM messages for avoiding environmental damage.
2022-02-10 16:09:56 -05:00
KayenEQ d656be6be4 [Bug Fix] Fix for PR1954 target restriction with npcpc_only_flag from groupbuffs (#1986)
* Update spells.cpp

* Update spells.cpp

* [Bug Fix] Fix for PR1954 target restriction with npcpc_only_flag from groupbuffs

disc failure log

* [Bug Fix] Fix for PR1954 target restriction with npcpc_only_flag from groupbuffs

improved HasItemRecastTimer check
2022-02-10 14:58:28 -05:00
KayenEQ fbbbd3b09d [Bug Fix] PR 1982 (#1985)
* Update spells.cpp

* [Bug Fix] PR 1982
2022-02-09 23:24:18 -05:00
KayenEQ a6d1652f44 fixed (#1983) 2022-02-09 18:02:45 -05:00
KayenEQ f0bf285836 [Spells] Support for SPA 194 SE_FadingMemories to use max level checks on aggroed mobs (#1979)
* escape fix for different target types

* implemented max level for fade

* test

* update

* update

* support modern limits

* Update ruletypes.h

* update

* [Spells] Support for SPA 194 SE_FadingMemories to use max level checks on aggroed mobs

not sure why this code got removed, maybe merge error.
2022-02-09 15:12:39 -05:00
KayenEQ 1f560529da [Bug Fix] Bard update fixes 1 (#1982)
* fix for bard item charge consumables

* [Bug Fix] Bards not consuming item click charges on instant cast items.

* [Bug Fix] Bard update fixes 1

bards not respecting deity/race/class restrictions on instant cast items
2022-02-09 15:07:38 -05:00
Kinglykrab f65a6d2761 [Quest API] Add AddAISpellEffect(spell_effect_id, base_value, limit_value, max_value) and RemoveAISpellEffect(spell_effect_id) to Lua. (#1981)
- Add npc:AddAISpellEffect(spell_effect_id, base_value, limit_value, max_value) to Lua.
- Add npc:RemoveAISpellEffect(spell_effect_id) to Lua.
2022-02-08 20:46:59 -05:00
KayenEQ 79f250da2d [API] Perl functions added to apply spell effects directly to NPCs without requiring buffs. (#1975)
* script functions working

* Update perl_npc.cpp

* [API] Perl functions added to apply spell effects directly to NPCs without requiring buffs.
2022-02-08 18:32:13 -05:00
KayenEQ 752e6c89f3 [Spells] Allow damage spells to heal if quest based spell mitigation is over 100 pct. (#1978)
* heal from nuke

* Update mob.cpp
2022-02-08 09:03:31 -05:00
KayenEQ e962ad3a35 procs silence (#1973) 2022-02-08 07:36:20 -05:00
KayenEQ 872d494bb6 [Bug Fix] Summon Companion causing pets to warps away. (#1972)
* Update spell_effects.cpp

* Update spell_effects.cpp
2022-02-08 07:36:04 -05:00
KayenEQ 8a48473dbc [Spells] Fix for AA and Discipline recast timers being set on spell casting failure. (#1971)
* recast timer updates

* reworked

* removed unneeded param

* fix expendible AA

* fixed

* Update spells.cpp

* [Spells] Fix for AA and Discipline recast timers being set on spell casting failure.

don't check recasts from triggered spells.
2022-02-08 07:35:47 -05:00
KayenEQ a208801d1f [Spells] Major update to Bard song pulsing, Bard item clicks while singing, and spell casting restriction logic. (#1954)
* test

* complete

* Update effects.cpp

* Update spells.cpp

* Update effects.cpp

* [Spells] Support for bards using Disciplines while casting or /melody.

Support for spell field 'cast not standing' not allow casting from divine aura

* [Spells] Support for bards using Disciplines while casting or /melody.

DA bypass logic for spells with field 'cast_not_standing'

* updates

* stun and mez bypass

* Update spdat.cpp

* Update spdat.cpp

* Update spells.cpp

* clean

* requirement messages

* update

* pct

* save work

* Reform code 1_22_22

* updated

* update id to pointer

* Update spells.cpp

* rework 2

* update 1_23_22

* Update spells.cpp

* updates

* msg string works

* fix disc timers not be set

* more optimization

* update 1_23_22 PM

moved stop casting out
charm and harmony moved in

* update 1_25_22

rework of functions

* updates 1_26_22

* remove old checks

* gm override added for some

* update bard AA casting checks

* updates

* addbuff exception for bard

* debugs

* charm working

* update

* moved skill check here

* cast from item while singing

* lets not attack mounts

* instant cast items click

* aug clicks working

* aug tests

Bug? Cast time not display on aug clicks for bards

* aug recast from items semi ok

* added item timer function

* unified setting item recast timer

* clean up time

* update

* bard AA cast updates

* debugs removed

* debugs removed

* clean up

* clean up

* better placement of bindsight and numhits fix

* move and rename function

* Update spells.cpp

* add logs

* delete old DoCastingChecks

* Removed old bard pulse functions

* remove AEBardPulse and GroupPulse

* removed Raid::GroupBardPulse

* Pulse Restriction: Divine Aura

* Pulse Restrictions : Fear behavior

* Update spells.cpp

* Update spells.cpp

* [Spells] Major update to Bard song pulsing, Bard item clicks while singing, and spell casting restriction logic.

bots...

* [Spells] Major update to Bard song pulsing, Bard item clicks while singing, and spell casting restriction logic.

added recommended isvalidspell check

* [Spells] Major update to Bard song pulsing, Bard item clicks while singing, and spell casting restriction logic.

merged

* [Spells] Major update to Bard song pulsing, Bard item clicks while singing, and spell casting restriction logic.

removed defines since we have them as constants
2022-02-07 07:48:52 -05:00
Kinglykrab a5d8a64792 [Quest API] Add inventory->CountItemEquippedByID(item_id) and inventory->HasItemEquippedByID(item_id) to Perl/Lua. (#1963)
- Add $inventory->CountItemEquippedByID(item_id) to Perl.
- Add $inventory->HasItemEquippedByID(item_id) to Perl.
- Add inventory:CountItemEquippedByID(item_id) to Lua.
- Add inventory:HasItemEquippedByID(item_id) to Lua
2022-02-06 13:21:48 -05:00
Chris Miles ee1f0ea91f [Maintenance Script] Pull from different maps mirror for now 2022-02-05 00:34:28 -06:00
KayenEQ 7c20a86f23 escape fix for different target types (#1962) 2022-02-04 21:14:53 -05:00
KayenEQ dbe6adbed0 [Spells] SPA 311 SE_LimitCombatSkills should prevent focusing of procs even if proc is a 'casted' spell. (#1961)
* proc limiter update

* Update spdat.h

* [Spells] SPA 311 SE_LimitCombatSkills should prevent focusing of procs even if proc is a 'casted' spell.
2022-02-04 21:14:40 -05:00
KayenEQ d300e78b39 [Spells] Illusions will now persist onto the corpse when mob is killed. (#1960)
* illusion applies to corpse

* Update spell_effects.cpp

* [Spells] Illusions will now persist onto the corpse when mob is killed.

addressed comments
2022-02-04 21:14:29 -05:00
Kinglykrab 0400504adc [Bug Fix] NPC::CountItem and Corpse::CountItem 0 Charge Item Fix. (#1959)
- Fixes an issue where 0 charged or out of charge items do not count towards the return value.
2022-02-04 06:07:46 -05:00
KayenEQ 5ce2889210 [Bug Fix] Illusions will now properly display armor to other clients when they zone in. (#1958)
* Fix for illusion wear change

On zone in, mobs with illusions were not displaying correct armor.

* [Bug Fix] Illusions will now properly display armor to other clients when they zone in

better looping
2022-02-03 22:04:15 -05:00
KayenEQ cc0371c16e [Spells] Swarm pet aggro logic fix (#1956)
* temp commit

* swarm pet logic fix

* [Spells] Swarm pet aggro logic fix
2022-02-03 22:00:52 -05:00
Kinglykrab 4e297f3d96 [Commands] #ginfo Cleanup. (#1955)
* [Commands] #ginfo Cleanup.
- Use popup over chat messages.

* Remove leader since GetLeaderName() is wrong.
2022-02-03 18:52:31 -05:00
Kinglykrab e9f48d5fba [Commands] Cleanup #npceditmass command. (#1957)
* [Commands] Cleanup #npceditmass command.
- Cleanup messages and logic.
- Fix crash with SQL format.

* Message change.
2022-02-03 15:25:37 -06:00
KayenEQ 00c41dda8c [Spells] Support for 'HateAdded' spell field to apply negative values to reduce hate. (#1953)
* HateAdded field can be negative

* [Spells] Support for 'HateAdded' spell field to apply negative values to reduce hate.
2022-02-02 21:43:17 -05:00
Kinglykrab 7b235a6ede [Bug Fix] Fix issue where you can set your title to titles you don't have. (#1917)
* [Bug Fix] Fix issue where you can set your title to titles you don't have.

* Fixes.

* Fix missing logic check for HasTitle

Co-authored-by: Natedog2012 <jwalters_06@yahoo.com>
2022-01-29 20:09:02 -06:00
mmcgarvey 58d5983ef1 [Skills] Configurable Exponential Decay Formula for Skill Up (#1887)
* [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
2022-01-29 20:01:58 -06:00
Paul Coene 7749c626f0 [Bug Fix] Fix issue with mobs summoning PCs into ceilings (#1921) 2022-01-29 19:55:40 -06:00
KayenEQ a6cd0bc33a [Bug Fix] Do not allow /open to be used on traps or auras, causes crash (#1951)
* Update client_packet.cpp

* [Bug Fix] Do not allow /open to be used on traps or auras, causes crash

* [Bug Fix] Do not allow /open to be used on traps or auras, causes crash
2022-01-29 19:54:26 -06:00
Chris Miles cba95851a2 [Combat] Legacy Combat Middleware Affected by PR #1858 (#1939) 2022-01-29 19:47:35 -06:00
KayenEQ 7f5706abcf bard throw while casting (#1937) 2022-01-28 22:07:23 -05:00
KayenEQ 44b8c9203a [Spells] Updates to spell field 'cast not stands' to ignore casting restrictions (#1938)
* test

* complete

* Update effects.cpp

* Update spells.cpp

* Update effects.cpp

* [Spells] Support for bards using Disciplines while casting or /melody.

Support for spell field 'cast not standing' not allow casting from divine aura

* [Spells] Support for bards using Disciplines while casting or /melody.

DA bypass logic for spells with field 'cast_not_standing'

* updates

* stun and mez bypass

* Update spdat.cpp

* Update spdat.cpp

* Update spells.cpp
2022-01-28 22:05:45 -05:00
KayenEQ afdbc0ce80 bug fix for push while rooted (#1949) 2022-01-28 22:05:29 -05:00
Paul Coene e850d80656 [Bug Fix (faction)] Do not award faction if NPC is charmed. (#1945)
* Do not award faction if npc is charmed.

* No faction on kill of charmed mob or questreward of same
2022-01-26 18:17:25 -05:00
Paul Coene b9722c6d28 [Bug Fix] Any use of TempName left old clean_name. (#1946)
* [Bug Fix] Any use of TempName left old clean_name.

* Dunsel change
2022-01-26 17:02:37 -05:00
Kinglykrab 5a7ee28740 [Bug Fix] Fix quest::updatespawntimer() Perl croak. (#1947) 2022-01-26 14:57:18 -06:00
mmcgarvey e4f2aec11e [XTarget] Revert All XTarget Corpse Changes (#1944) 2022-01-23 20:18:38 -06:00
KayenEQ e99c8dafc5 spellbar lock bug fix (#1943) 2022-01-23 20:27:45 -05:00
KayenEQ 936043a53c bind sight pets (#1942) 2022-01-23 20:27:32 -05:00
KayenEQ 3c09448e90 [Spells] NPC spell push should work on rooted mobs. (#1941)
* Update spells.cpp

* [Spells] NPC spell push should work on rooted mobs.

don't push perma or psuedorooted mobs
2022-01-20 12:13:14 -05:00
KayenEQ e09a8f8f8f [Spells] Support for bards using Disciplines while casting or /melody. (#1936)
* test

* complete

* Update effects.cpp

* Update spells.cpp

* Update effects.cpp

* [Spells] Support for bards using Disciplines while casting or /melody.

Support for spell field 'cast not standing' not allow casting from divine aura

* [Spells] Support for bards using Disciplines while casting or /melody.

DA bypass logic for spells with field 'cast_not_standing'
2022-01-19 22:44:17 -05:00
Randy Girard 804f0681a9 [Content Flags] Load the content flags before loading shared data. (#1935) 2022-01-19 12:58:15 -06:00
KayenEQ 71c53cb18b [Spells] Updates and fixes to Target Locked Pets (#1932)
* start of rework

* reworked v2 no timer

* fix

* more mechanics

* Update pets.cpp

* move to pet.cpp

* [Spells] Updates and fixes to Target Locked Pets

* [Spells] Updates and fixes to Target Locked Pets
2022-01-18 21:48:36 -05:00
Natedog2012 176bfc8524 [Bug Fix] Loading pets from database will make unique name to not overlap existing pets with same name in zone (#1933) 2022-01-18 16:43:58 -06:00
KayenEQ 28b1abe1a7 [Bug Fix] Fixes Enchanter AA Doppleganger crash issue (#1931)
* Fix crash bug

* [Bug Fix] Fixes Enchanter AA Doppleganger crash issue
2022-01-17 09:10:37 -05:00
Kinglykrab 3a94132749 [Quest API] Add multiple augment related methods to Perl/Lua. (#1930)
* [Quest API] Add multiple augment related methods to Perl/Lua.
- Add $inventory->CountAugmentEquippedByID(item_id) to Perl.
- Add $inventory->HasAugmentEquippedByID(item_id) to Perl.
- Add $item->ContainsAugmentByID(item_id) to Perl.
- Add $item->CountAugmentByID(item_id) to Perl.
- Add inventory:CountAugmentEquippedByID(item_id) to Perl.
- Add inventory:HasAugmentEquippedByID(item_id) to Perl.
- Add item:ContainsAugmentByID(item_id) to Perl.
- Add item:CountAugmentByID(item_id) to Perl.

* Update inventory_profile.cpp
2022-01-16 18:04:51 -05:00
KayenEQ 5ebbbf647b [Spells] SPA 299 Wake the Dead updates and crash fixes. SPA 306 Army of Dead implemented. (#1929)
* start

* wtd fix v1

* Update aa.cpp

* rework done, army of dead supported

* debugs

* Update aa.cpp

* Update spdat.h
2022-01-16 14:55:51 -05:00
KayenEQ 5f482a9b30 [Combat] Implemented rule for live like Riposte mechanics (#1927)
* Live like Riposte

* [Combat] Implemented rule for live like Riposte mechanics

bot fix
2022-01-15 19:37:47 -05:00
KayenEQ 91aa950304 fix for hasten AA (#1928) 2022-01-15 18:28:21 -05:00
JJ 613066976d [Bug Fix] Update to #1893 (#1926)
* Update to #1893

* Missed bonuses.cpp
2022-01-12 22:04:58 -05:00
mmcgarvey 1a556f4451 [XTarget] Performance Improvement After Corpse Change (#1918)
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]
2022-01-12 16:04:18 -06:00
KayenEQ d10145fc6f [Bug Fix] Fix Tradeskill Salvage (#1925) 2022-01-11 18:24:47 -05:00
Kinglykrab f3002d9656 [Commands] Cleanup #who Command. (#1924)
* [Commands] Cleanup #who Command.
- Cleanup messages and logic.
- Add GetAccountStatusMap() and GetAccountStatusName() helpers for account status stuff.
- Use Chat::Who instead of Chat::Magenta so you can more easily see saylinks.
- Add a summon saylink to the list of saylinks so you can summon the player.

* New line.
2022-01-11 06:09:29 -05:00
KayenEQ 59c373bcff Update client_packet.cpp (#1923)
bug fix
2022-01-10 21:22:56 -05:00
Kinglykrab ae8273e0b1 [Commands] #guild create argument count bug fix. (#1920)
- Names with spaces were breaking command.
2022-01-10 17:33:28 -05:00
KayenEQ 10083387b6 [Spells] SPA 193 SE_SkillAttack will no longer trigger procs (#1919)
* fixed

* [Spells] SPA 193 SE_SkillAttack will no longer trigger procs
2022-01-09 08:32:09 -05:00
Chris Miles 7e065ad966 [Docs] Update Readme to reflect new docs 2022-01-08 13:57:31 -06:00
Kinglykrab ffa968f64f [Bug Fix] Disallow multiple augments in same item. (#1916)
- Disallows multiple augments via #augmentitem or otherwise.
- Added ItemInstance::ContainsAugmentByID(item_id) helper method for finding an augment in an item instance.
2022-01-04 17:18:17 -05:00
Natedog2012 6bf5608cf3 [Bug Fix] Add range check to OP_PickPocket (#1912)
* [Bug Fix] Add range check to OP_PickPocket

* Pickpocket distance is 15 constant according to Mackal

* Re-add wiggle room for distance check due to pathing
2022-01-03 22:26:37 -05:00
mmcgarvey 3853c4f150 [Bug Fix] XTarget Changes Causing Crashes (#1915)
* [Bugfix] XTarget Changes Causing Crashes

Added nullptr check when processing XTargetAutoHaters for pet owner.

* [Bugfix] XTarget Changes Causing Crashes

Added another needed sanity check after the nullptr check.

* [Bugfix] XTarget Changes Causing Crashes

Added another check against nullptr.

* [Bugfix] XTarget Changes Causing Crashes

Cleaned up nullptr checks per PR comments.
2022-01-03 22:22:21 -05:00
Chris Miles d6d4c458e7 [Database] Mark titles as a server table so it at least shows up in dumps (#1914) 2022-01-03 14:55:10 -06:00
Natedog2012 26b160c59b [Bug Fix] OP_Taunt checks if we have the skill (#1913) 2022-01-03 14:54:36 -06:00
Akkadius d107ff3069 [Hotfix] Add additional check to IsContentFlagEnabled given refactor from #1909 2022-01-03 01:06:17 -06:00
mmcgarvey 220d8497dd [XTarget] Disallow Corpses in XTarget Auto Slots (#1881)
* [XTarget] Disallow Corpses in XTarget Auto Slots

Why:
There exists an odd state where corpses will fill up your XTarget window.
This is reproducable using a combination of a pet to kill a mob
and timely feign death to wipe the owner's aggro.

What:
Added an IsCorpse check to IsXTarget.
Added a block to mark corpse XTargets as dirty to ProcessXTargetAutoHaters

* fixup! [XTarget] Disallow Corpses in XTarget Auto Slots

* fixup! [XTarget] Disallow Corpses in XTarget Auto Slots

* [XTarget] Disallow Corpses Code Cleanup

Added some safety, performance, and code readability changes per PR request.
2022-01-02 21:07:57 -06:00
Kinglykrab 645251992d [Bug Fix] Remove possible Duel exploit. (#1911)
* [Duels] Cleanup duel response/request logic.

* Fixes and function name cleanup.

* Patch file name changes.
2022-01-02 21:06:31 -06:00
Chris Miles 9815f50efa [Expansion] Content Filtering Adjustments (#1910)
* Change default expansion values for ALL to -1 from 0

* Adjust content_filter_criteria

* Refactor content filtering logic

* Allow flag strings to also just be empty instead of null

* Formatting

* Editor oops
2022-01-02 20:52:29 -06:00
Kinglykrab c0f57bed1f [Bug Fix] Cleanup Perl croaks for Spire parser. (#1908)
- Client::SendToInstance()
- Mob::DeleteBucket()
- Mob::GetBucket()
- Mob::GetBucketExpires()
- Mob::GetBucketRemaining()
- Mob::SetBucket()
2021-12-30 19:47:52 -06:00
j883376 d280d54446 [Spells] Allow GMs to remove buffs from any target (#1907) 2021-12-30 19:40:14 -06:00
Kinglykrab c99c5c1f1c [Bug Fix] Fix #guild rename, #killallnpcs, and #worldwide message errors. (#1904)
- #guild rename was checking argument count and not allowing you to rename guilds to names that had spaces.
- #killallnpcs was crashing zones when used sometimes due to getting a nullptr somewhere in the loop.
- #worldwide message was using just the first word of the message sent using the command, not all of them.
2021-12-29 12:06:51 -05:00
Natedog2012 e45f02af95 [Skills] RoF+ allows other classes to have feign death if set in skill_caps (#1902) 2021-12-29 11:17:31 -05:00
KayenEQ 323b35989c [Spells] Implemented SPA 281 SE_PetFeignMinion (#1900)
* start

* update

* debugs in

* test

* clean up

* debugs removed

* Update mob_ai.cpp

* Update spdat.h

* [Spells] Implemented SPA 281 SE_PetFeignMinion

debug remoevd

* [Spells] Implemented SPA 281 SE_PetFeignMinion

npc forget timer

* [Spells] Implemented SPA 281 SE_PetFeignMinion
2021-12-27 11:33:57 -05:00
Kinglykrab 7f23c93ce5 [Commands] Cleanup #setadventurepoints Command. (#1901)
- Cleanup message and logic.
2021-12-24 13:46:17 -05:00
Chris Miles 6a7782ab8d [Doors] Ignore Doors that Have Non-Zero Trigger or Door Param (#1899) 2021-12-23 14:47:24 -06:00
mmcgarvey 5457f30659 [Spells] Instant Heals honor IgnoreSpellDmgLvlRestriction (#1888)
Why:
Heal Over Time spells honor the Spells:IgnoreSpellDmgLvlRestriction rule,
shouldn't instant heals honor this rule too?

The fix:
Added a check for Spells:IgnoreSpellDmgLvlRestriction in the GetActSpellHealing
method.
2021-12-23 14:43:02 -06:00
KayenEQ 652ea89dea [Rule] Added rule to disable SPA 173 from making player immune to enrage. (#1897)
* immune enrage rule

* [Rule] Added rule to disable SPA 173 from making player immune to enrage.

spelling oops
2021-12-23 14:21:46 -06:00
mmcgarvey c79fbb99aa [Shared Tasks] Cross Zone Remove Fix (#1740)
* [Shared Tasks] Cross Zone Remove Fix

Why:
	The cross_zone_remove_task quest methods were not removing from
	shared_task_members database table and were not clearing shared task
	cache.  This resulted in a situation where a character could not
	request other shared tasks.

What:
	Shamelessly copied shared task logic from ClientTaskState::CancelTask
	into ClientTaskState::RemoveTaskByTaskID

* What:

Instead of copying code from CancelTask into RemoveTaskByTaskID, it is better
for code maintenance to simply call CancelTask from RemoveTaskByTaskID.
This is cleaner.

Note:  I chose to be explicit with the remove_from_db parameter, despite true
being the default.  I tend to do this to protect from the default value
changing in the future.

* [Shared Tasks] RemoveTaskByTaskID Cleanup

Removed unused variables.
Distinguished log messages for Shared Tasks from regular Tasks.
2021-12-23 14:20:15 -06:00
Paul Coene 4f0e9945c6 [Combat] Allow npcs/pets to kick vs opponents requiring magic weapons if wearing magic booties. (#1868)
* [Pets/NPC Kick] Allow pets/npcs kick vs mobs that req magic if using magic boots

* Backout accidental change to bash
2021-12-23 14:01:56 -06:00
mmcgarvey 4fbb98a5f7 [Skills] Make Tracking Skill Configurable (#1784)
Added 1 rule per class that defines tracking distance multiplier for that class
Kept the defaults of 12 for ranger, 10 for druid, and 7 for bard

Created 1 method for determining class tracking distance multiplier
Created 1 method for determining if a class can track, based on multiplier

Updated tracking logic to use these methods to determine whether a tracking
packet should and can be sent or not.
2021-12-23 13:57:53 -06:00
Paul Coene 8c78a19c95 [Bug Fix] Pick Lock was allowing skillups on doors above player skill (#1815)
* [Bux Fix] Pick Lock was allowing skillups on doors above player skill

* Fixed indentation

* Fix indentation #2 - I am not so bright :(

* Further refine messages for pick lock to match live

* sql to make pot pick locks book pickable by skill 1 and skillup
2021-12-23 13:56:06 -06:00
Kinglykrab 6a77764f8b [Commands] Cleanup #guild Command. (#1880)
- Cleanup messages and logic.
- Adds GetGuildNameByID, GetGuildRankName, GetGuildIDByCharacterID, and IsCharacterInGuild helper methods for guild stuff.
- Convert #guild info message to a popup display to tidy it up and make it more legible.
2021-12-23 13:04:26 -05:00
Natedog2012 d0ec0872b9 Client will give 1 second window to start casting at the end of DA effect but we interrupt it and need to allow spellbar active after (#1894) 2021-12-22 22:35:48 -06:00
Kinglykrab 724d47432b [Bug Fix] Fix Perl Croak for GetEnt() (#1898) 2021-12-22 15:27:25 -05:00
KayenEQ f26d56d6d5 validspell check (#1895) 2021-12-21 09:17:35 -05:00
KayenEQ 886b321e66 [Spells] Rework of SPA 288 SE_SkillAttackProc (#1893)
* start

* updated 288
2021-12-20 09:47:32 -05:00
Natedog2012 85971590c8 Re-enable spellbar and reset Discipline timer when stopping casts in EVENT_CAST_BEGIN (#1891) 2021-12-19 15:17:04 -06:00
KayenEQ 898b1ea4d1 Update attack.cpp (#1892) 2021-12-16 07:23:11 -05:00
KayenEQ d460fb3db8 [Spells] Update to SPA 440 SE_FinishingBlowMaxLevel limit value sets HP ratio for FB (#1890)
* fb max level update

* Update to SPA 440 SE_FinishingBlowMaxLevel limit value sets HP ratio for FB
2021-12-15 22:00:34 -05:00
Paul Coene fbc5d045de [Doors] Add new rule enabling classic "key on cursor" for pre keyring keys (#1869) 2021-12-15 13:26:31 -05:00
KayenEQ 3414d3a1ae fearstun update (#1889) 2021-12-15 13:17:15 -05:00
mmcgarvey feed584a41 [Database] Escape reserved mysql keyword rank w/ backticks (#1862)
Fixes #1567
2021-12-14 13:57:35 -05:00
KayenEQ 119b2d023f [Spells] Throwing procs fixed and other proc updates (#1871)
* first updating sbindex defines

* updates

* updates

* proctypes added for organization

* debug

* updates

* range procs cleaned up

* skill proc clean up

* fix

* remove debugs

* [Spells] Throwing procs fixed and other proc updates

* [Spells] Throwing procs fixed and other proc updates

bot fix

* [Spells] Throwing procs fixed and other proc updates

proctype updates
2021-12-14 12:34:51 -05:00
KayenEQ 73acc3310c [Spells] Updates and fixes to targeted focus effects (#1870) 2021-12-14 12:31:38 -05:00
KayenEQ 6da7116c66 [Bug Fix] Hero Forge armor graphics not displaying properly to other clients in zone. (#1883)
* fix part1

* updates

* Update inventory.cpp

* fixed

* Update inventory.cpp

* update

* [Bug Fix] Hero Forge armor graphics not displaying properly to other clients in zone.
2021-12-14 11:26:59 -05:00
KayenEQ 26b21673ad [Spells] Implemented SPA 245 SE_TrapCircumvention (#1885)
* implemented

* [Spells] Implemented SPA 245 SE_TrapCircumvention
2021-12-13 20:33:22 -05:00
KayenEQ ef1f6adf18 effective casting level update (#1886) 2021-12-13 20:32:25 -05:00
KayenEQ 1c2e1ea228 rampage updates (#1882) 2021-12-13 18:49:53 -05:00
KayenEQ 7cf66a2daa [Spells] Update SPA 238 SE_IllusionPersistence allow illusions to persist through deaths at higher AA ranks. (#1884)
* start

* working
2021-12-13 18:49:33 -05:00
KayenEQ 91c958ae63 Update spell_effects.cpp (#1877)
updated
2021-12-12 13:22:43 -05:00
KayenEQ 8de410ebb7 [Features] Appearance Effects will now be sent to clients upon zone in. GM commands. (#1874)
* start

* working

* Update perl_mob.cpp

* updates

* Update perl_mob.cpp

* illusion behavior

* rework start

* fix later

* Update mob.cpp

* rework

* updates

* Update mob.cpp

* update

* gm command updates

* updates

* Update CMakeLists.txt

* [Features] Appearance Effects will now be sent to clients upon zone in. GM commands.

remove debugs

* [Features] Appearance Effects will now be sent to clients upon zone in. GM commands.

perl fix

* [Features] Appearance Effects will now be sent to clients upon zone in. GM commands.

space fix

* [Features] Appearance Effects will now be sent to clients upon zone in. GM commands.

minor fix

* Update CMakeLists.txt

* [Features] Appearance Effects will now be sent to clients upon zone in. GM commands.

cleaned up some inconsistency

* [Features] Appearance Effects will now be sent to clients upon zone in. GM commands.
2021-12-10 13:46:23 -05:00
KayenEQ 550485ba33 [Spells] Fixed issue with permanent Illusions not being consistent when zoning. (#1876)
* start of work

* updates

* [Spells] Fixed issue with permanent Illusions not being consistent when zoning.
2021-12-10 12:21:19 -05:00
KayenEQ eb2b4fd9e0 [Spells] Update to SPA 58 SE_Levitate to support limit value (#1875)
* [Spells] Update to SPA 58 SE_Levitate to support limit value

* [Spells] Update to SPA 58 SE_Levitate to support limit value

apply same on zone in
2021-12-10 12:20:25 -05:00
Natedog2012 42f439c4b7 [Quest API] Add ResetCastbarCooldownBySlot / ResetCastbarCooldownBySpellID / ResetAllCastbarCooldowns (#1873)
* New function to reset spellbar in perl/lua ResetCastbarCooldownsBySlot -1 for all slots and anything else to do it by slot number

* Add ResetCastbarCooldownsBySlot / ResetCastbarCooldownsBySpellID / ResetAllCastbarCooldowns
2021-12-08 21:39:35 -06:00
Kinglykrab 294e51fca7 [Commands] Add #setaltcurrency Command. (#1850)
* [Commands] Add #setaltcurrency Command.
- Add #setaltcurrency [Currency ID] [Amount] command to allow you to set a specific alternate currency to a value.
- Add Zone::GetCurrencyID() and Zone::GetCurrencyItemID() helper methods.
- Cleanup loops through zone->AlternateCurrencies.
- Utilize helper methods where necessary.
- Convert old methods parameters and return values from int to uint32 where necessary.

* Typo.
2021-12-08 18:58:06 -05:00
Kinglykrab 94166e0f95 [Commands] Add #unmemspell and #unmemspells Commands. (#1867)
- Add #unmemspell [Spell ID] command to unmemorize a spell by ID from you or your target.
- Add #unmemspells command to unmemorize all spells from you or your target.
- Cleanup #memspell command and change arguments from #memspell [Slot] [Spell ID] to #memspell [Spell ID] [Spell Gem] for easier use.
- Add #memspell [Spell ID] functionality to memorize to first open spell gem if there are any using FindEmptyMemSlot helper method.
- Rename client->FindMemmedSpellByID(spell_id) to FindMemmedSpellBySpellID(spell_id).
- Add client->FindEmptyMemSlot() helper method.
- Add $client->FindEmptyMemSlot() to Perl.
- Add client:FindEmptyMemSlot() to Lua.
- Add $client->FindMemmedSpellBySpellID(spell_id) to Perl.
- Add client:FindMemmedSpellBySpellID(spell_id) to Lua.
2021-12-08 18:18:14 -05:00
Kinglykrab 1a1c3abc24 [Commands] Cleanup #setstartzone Command. (#1853)
- Add a message when setting start zone.
- Cleanup logic.
2021-12-08 18:18:06 -05:00
Natedog2012 0f4f5d7046 RemoveAllAppearanceEffects sends all relevant data so NPC appearance doesn't get altered. (#1864) 2021-12-07 15:15:28 -05:00
Kinglykrab 8ec4afe721 [Commands] Cleanup #wpinfo Command. (#1866)
- Cleanup message and logic.
- Only display grid/waypoints if NPC has a grid.
2021-12-04 21:53:29 -05:00
Kinglykrab aa4536e1ef [Quest API] Add GetLDoNThemeName() to Perl/Lua. (#1861)
* [Quest API] Add GetLDoNThemeName() to Perl/Lua.
- Add quest::getldonthemename(theme_id) to Perl.
- Add eq.get_ldon_theme_name(theme_id) to Lua.

* Update embparser_api.cpp
2021-12-03 19:53:00 -05:00
Kinglykrab 01a671918a [Quest API] Add GetBodyTypeName() to Perl/Lua. (#1863)
* [Quest API] Add GetBodyTypeName() to Perl/Lua.
- Add GetBodyTypeName() and GetBodyTypeMap() helper methods.
- Add quest::getbodytypename(bodytype_id) to Perl.
- Add eq.get_body_type_name(bodytype_id) to Lua.

* ShowStats() cleanup.
2021-12-03 19:52:42 -05:00
KayenEQ e09f28c62c [Spells] Update to SPA 296 and 483 item and AA support (#1857)
[Spells] Update to SPA 296 and 483 item and AA support
2021-12-03 15:39:21 -05:00
KayenEQ 82000949e3 [Spells] Update to SPA 297 and 484 to support focus from AA and items. (#1858)
[Spells] Update to SPA 297 and 484 to support focus from  AA and items.
2021-12-03 15:39:06 -05:00
Kinglykrab 4a154686e1 [Quest API] Add GetFactionName() to Perl/Lua. (#1859)
* [Quest API] Add GetFactionName() to Perl/Lua.
- Add quest::getfactionname(faction_id) to Perl.
- Add eq.get_faction_name(faction_id) to Lua.

* Update embparser_api.cpp

* Update embparser_api.cpp

* Update embparser_api.cpp
2021-12-02 10:09:15 -05:00
Kinglykrab 29dfe9d404 [Quest API] Add GetLanguageName() to Perl/Lua. (#1860)
- Add quest::getlanguagename(language_id) to Perl.
- Add eq.get_language_name(language_id) to Lua.
2021-12-01 20:31:20 -05:00
Kinglykrab 9a0c98397e [Bug Fix] Charm Break Invisibility Fix. (#1855)
- Invisibility vs. Undead and Invisibility vs. Animals were not breaking charm.
- Add Invisibility enumerator.
- Add special identifier for Invisibility vs. Undead and Invisibility vs. Animals.
2021-12-01 12:01:19 -05:00
KayenEQ bc0795bb48 [Spells] SPA 310 SE_ReduceReuseTimer will now work on spell recast time (#1856)
* [Spells] SPA 310 SE_ReduceReuseTimer	will now work on spell recast time

[Spells] SPA 310 SE_ReduceReuseTimer	will now work on spell recast time

* [Spells] SPA 310 SE_ReduceReuseTimer will now work on spell recast time

[Spells] SPA 310 SE_ReduceReuseTimer will now work on spell recast time
2021-12-01 00:22:10 -06:00
JJ d972183a79 [Cleanup] holdzones not used. (#1852)
Fixes #1116.
2021-11-28 22:35:52 -05:00
Natedog2012 f70b4a79b2 SetPetID after we assign the new NPC an ID (#1851) 2021-11-28 15:42:42 -06:00
Kinglykrab 7cac2e2bc3 [Commands] Add #viewcurrencies Command. (#1844)
* [Commands] Add #viewcurrencies Command.
- Add #viewcurrencies command to view your or your target's currencies (Money, Crystals, Alternate Currency, LDoN, and PVP).
- Add GetLDoNThemeName() helper method.

* Update viewcurrencies.cpp

* Cleanup name of map method.

* Cleanup.
2021-11-28 00:09:07 -05:00
Kinglykrab 2be1321aa9 [Commands] Add #removeitem Command. (#1847)
- Add #removeitem [Item ID] [Amount] command to remove items by amount versus nuking them all, removes all if amount is greater than what you or your target have.
2021-11-27 21:41:54 -05:00
Kinglykrab ba5bb09af7 [Commands] Cleanup #flymode Command. (#1845)
- Cleanup message and logic.
- Add GetFlyModeName() and GetFlyModeMap() helper methods.
- Cleanup #npcedit flymode to use helper methods.
2021-11-27 21:39:54 -05:00
Kinglykrab 5ab9b941e2 [Commands] Cleanup #titlesuffix Command. (#1834)
- Cleanup message and logic.
2021-11-27 21:29:56 -05:00
Kinglykrab d28f902ecc [Commands] Add #countitem Command. (#1842)
* [Commands] Add #countitem Command.
- Add #countitem [Item ID] command to count an item by ID on yourself or your player/NPC target.

* Cleanup.
2021-11-27 20:52:09 -05:00
Kinglykrab fd862d16bb [Commands] Cleanup #mysql Command. (#1837)
* [Commands] Cleanup #mysql Command.
- Cleanup messages and logic.

* Update mysql.cpp
2021-11-27 20:32:21 -05:00
Kinglykrab a6e5534b64 [Commands] Cleanup #texture Command. (#1835)
* [Commands] Cleanup #texture Command.
- Cleanup message and logic.

* Update command.cpp
2021-11-27 20:21:58 -05:00
Kinglykrab 225497337c [Commands] Add #setendurance Command. (#1841)
- Add #setendurance [Endurance] command to set an NPC or player's endurance to a specified amount, or to max if the amount is greater than their max.
- Cleanup #endurance command message and logic.
2021-11-27 19:08:07 -05:00
Kinglykrab a5348e207b [Commands] Add #sethp Command. (#1840)
- Add #sethp [Health] command to set an NPC or player's health to a specified amount, or to max if the amount is greater than their max.
- Cleanup #heal command message and logic.
2021-11-27 19:08:00 -05:00
Kinglykrab c4c5256438 [Commands] Add #setmana Command. (#1839)
* [Commands] Add #setmana Command.
- Add #setmana [Mana] command to set an NPC or player's mana to a specified amount, or to max if the amount is greater than their max.
- Cleanup #mana command message and logic.

* Update mana.cpp
2021-11-27 19:07:47 -05:00
Kinglykrab b3b9899a23 [Commands] Cleanup #movechar Command. (#1838)
- Cleanup messages and logic.
- Add support for Zone ID versus Zone Short Name.
- Add support for Character ID versus Character Name.
2021-11-27 19:06:40 -05:00
Kinglykrab 7d1d385418 [Commands] Cleanup #gmzone Command. (#1836)
- Cleanup messages and logic.
- Add support for Zone ID.
2021-11-27 18:19:03 -05:00
Kinglykrab 96cdf1b076 [Commands] Cleanup #title Command. (#1833)
- Cleanup message and logic.
2021-11-27 18:18:27 -05:00
KayenEQ 8688e9c9fa [Spells] Eye of Zomm will now despawn and stack properly (#1849)
* [Spells] Eye of Zomm stop chain spawning

No more chain spawning.

* [Spells] Eye of Zomm stop chain spawning

* [Spells] Eye of Zomm update
2021-11-27 12:11:23 -05:00
KayenEQ 6a28828e08 [API] mob->AppearanceEffects improved functionality. (#1821)
* appearanceffectscript

* update

* debugged

* [API] SendAppearanceEffect update

* [API] SendAppearanceEffect update

* [API] SendAppearanceEffect Upates

perl method RemoveAppearanceEffect to remove the apperanceeffect

* [API} AppearanceEffects update

* [API] SendAppearanceEffects update
2021-11-27 12:10:08 -05:00
Natedog2012 8566662d56 [Bug Fix] SendSpellBarEnable sends correct slotid to fix spellbar on RoF2 (#1848)
* SendSpellBarEnable sends correct slotid to fix spellbar on RoF2

* Send correct data when using StopCasting() to re-enable spellbar
2021-11-27 09:45:57 -05:00
Kinglykrab 298ae3e3ba [Bug Fix] Fix possible crash with #killallnpcs. (#1846) 2021-11-27 09:45:13 -05:00
Michael Cook (mackal) 4507b063f5 Switch server to use new style ManaChange_Struct (#1843)
This will allow us to fix some bugs the current handling has.

Note: the decoder isn't needed since the client always sends it up as a
0 length packet.
2021-11-26 21:33:49 -05:00
Natedog2012 774e0c7faa Do not set teleport doors to Open (#1786) 2021-11-26 15:26:07 -06:00
Kinglykrab 8b54bb34e4 [Commands] Cleanup #gmspeed Command. (#1831)
* [Commands] Cleanup #gmspeed Command.
- Cleanup message and logic.

* Update gmspeed.cpp

* Update gmspeed.cpp
2021-11-26 13:56:45 -05:00
Kinglykrab e87b8e2682 [Commands] Cleanup #gender Command. (#1832)
- Cleanup message and logic.
- Cleanup other spots using similar logic so they're all uniform.
2021-11-26 10:01:35 -05:00
Kinglykrab 2dc3ca52db [Commands] Cleanup #gm Command. (#1830)
- Cleanup message and logic.
- Cleanup SetGM() message.
2021-11-26 10:01:13 -05:00
Kinglykrab 514029a6bb [Commands] Cleanup #bind Command. (#1829)
- Add message and cleanup logic.
2021-11-26 10:01:04 -05:00
Kinglykrab b29f398239 [Commands] Cleanup #getplayerburiedcorpsecount Command. (#1818)
* [Commands] Cleanup #getplayerburiedcorpsecount Command.
- Cleanup message and logic.

* Update command.cpp
2021-11-25 21:01:23 -05:00
Kinglykrab e474b2a280 [Commands] Add #petitems Command. (#1823)
- Add #petitems command to show a person's pet items if they have access to the command.
- Adds a default false parameter to QueryLoot for NPCs that keeps messages and logic from being ran on pets for no reason.
- Cleaned up message a bit for loot and stuff.
- Remove check for loottable ID when using #npcstats for NPCs that get items from a script or otherwise.
2021-11-25 14:50:05 -05:00
Kinglykrab d38b8a4867 [Bug Fix] Fix possible crash in #givemoney. (#1828) 2021-11-25 13:55:06 -05:00
KayenEQ 1a5f48521d [Bug Fix] Bind Sight will now function properly (#1825)
* start

* bind sight fixed

* Update spdat.h

* Update spells.cpp

* Search or jump to… Pull requests Issues Marketplace Explore   @KayenEQ  EQEmu / Server Public 60 338 290 Code Issues 106 Pull requests 11 Actions Projects 1 Wiki Security Insights [Bug Fix] Bind Sight will now function properly #1825  Open KayenEQ wants to merge 4 commits into EQEmu:master from KayenEQ:bindsightfix2  Open [Bug Fix] Bind Sight will now function properly
2021-11-25 10:16:28 -05:00
KayenEQ ba427c64ba [Bug Fix] Numhits now display instantly on cast. (#1826) 2021-11-25 08:33:39 -05:00
KayenEQ 9d59b3def4 [Spells] Bard AA clicks should not receive song modifiers. (#1824) 2021-11-25 08:32:46 -05:00
KayenEQ a6f5bf72be Update spell_effects.cpp (#1822) 2021-11-24 19:43:43 -05:00
KayenEQ 6ff7f7aa53 [API] mob->SpellEffect small perl fix (#1820)
* Update perl_mob.cpp

* Update perl_mob.cpp
2021-11-24 12:48:23 -05:00
Kinglykrab 1a2897c423 [Commands] Cleanup #disablerecipe Command. (#1816)
- Cleanup message and logic.
2021-11-23 21:45:59 -05:00
Kinglykrab 8b5b19ae2c [Commands] Cleanup #enablerecipe Command. (#1817)
- Cleanup message and logic.
2021-11-23 21:45:52 -05:00
Kinglykrab 6fa41a3b73 [Commands] Remove duplicate commands. (#1819) 2021-11-23 19:53:39 -05:00
Kinglykrab 6496690123 [Commands] Cleanup #zsafecoords Command. (#1806)
* [Commands] Cleanup #zsafecoords Command.
- Cleanup message and logic.
- Add parameter to allow data to be saved to database.

* Typo.

* Update zsafecoords.cpp

* Update zsafecoords.cpp
2021-11-23 18:25:12 -05:00
Kinglykrab a11482ff23 [Cleanup] Utilize ConvertSecondsToTime() method. (#1805)
* [Cleanup] Utilize ConvertSecondsToTime() method.

* Lowercase.
2021-11-23 18:25:02 -05:00
Kinglykrab 4672e48fbd [Commands] Cleanup #zcolor Command. (#1813)
* [Commands] Cleanup #zcolor Command.
- Cleanup message and logic.
- Add parameter to allow data to be saved to database.

* Update zcolor.cpp
2021-11-23 16:45:31 -05:00
KayenEQ 8f3cce6585 send graphic to target correctly (#1785) 2021-11-23 12:55:58 -05:00
Kinglykrab 8d3a179ecc [Commands] Remove #zuwcoords Command. (#1810)
- Remove duplicate command of #zunderworld
2021-11-23 06:03:09 -05:00
Kinglykrab 2cbcefd9a0 [Commands] Cleanup #zheader Command. (#1814)
* [Commands] Cleanup #zheader Command.
- Cleanup message and logic.
- Add parameter to allow versions to be loaded.
- Cleanup parameter name in CFG methods from instance_id to instance_version.

* Update zonedb.cpp
2021-11-23 05:49:11 -05:00
Kinglykrab ef06a0d0b6 [Commands] Cleanup #zclip Command. (#1812)
* [Commands] Cleanup #zclip Command.
- Cleanup message and logic.
- Add parameter to allow data to be saved to database.

* Cleanup.
2021-11-23 05:48:47 -05:00
Kinglykrab 1935ea60d0 [Commands] Remove #zonespawn Command. (#1811)
* [Commands] Remove #zonespawn Command.
- Remove unimplemented command.

* Remove from CMakeLists.txt.

* Fix.
2021-11-23 05:48:39 -05:00
Kinglykrab 8c7e1be344 [Commands] Cleanup #givemoney Command. (#1804)
- Cleanup money message to use new helper method.
2021-11-22 21:18:04 -05:00
Kinglykrab 9240497cbc [Commands] Cleanup #zsky Command. (#1808)
- Cleanup message and logic.
- Add parameter to allow data to be saved to database.
2021-11-22 21:17:13 -05:00
Kinglykrab 0da4610249 [Commands] Cleanup #zsave Command. (#1807)
* [Commands] Cleanup #zsave Command.
- Cleanup message and logic.

* White.
2021-11-22 21:17:03 -05:00
Kinglykrab 26c7287997 [Commands] Cleanup #zunderworld Command. (#1809)
* [Commands] Cleanup #zunderworld Command.
- Cleanup message and logic.
- Add parameter to allow data to be saved to database.

* Update zunderworld.cpp
2021-11-22 21:16:42 -05:00
Kinglykrab cece66adc6 [Commands] Cleanup #instance Command. (#1803)
* [Commands] Cleanup #instance Command.
- Cleanups message and logic.
- Cleanup ListAllInstances() method.
- Fix day calculation in ConvertSecondsToTime().

* Cleanup.

* Add return.
2021-11-21 19:02:01 -05:00
Kinglykrab d29993fafa [Commands] Cleanup #nukebuffs Command. (#1795)
* [Commands] Cleanup #nukebuffs Command.
- Cleanup messages and logic.
- #nukebuffs now allows you to nuke all, beneficial, or detrimental buffs, also added a help menu.
- Add BuffFadeBeneficial().
- Cleanup logic in some buff fade methods.
- Fix several spots where we were using CalcBonuses() when it was unnecessary, i.e when you fade no buffs you do not need to recalculate bonuses.

* Update spells.cpp
2021-11-21 15:20:16 -05:00
Kinglykrab 39c27c987d [Commands] Cleanup #peqzone Command. (#1794)
- Cleanup messages and logic.
- Add RULE_INT(Zone, PEQZoneHPRatio, 75, "Required HP Ratio to use #peqzone")
- Modify #peqzone Timer rule to allow it to be disabled.
2021-11-21 14:19:08 -05:00
Kinglykrab 5470ec6293 [Commands] Cleanup #corpse Command. (#1790)
- Cleanup message and logic.
- Add ConvertMoneyToString(platinum, gold, silver, copper) helper method.
- Cleanup NPC::QueryLoot() and Corpse::QueryLoot().
2021-11-21 14:02:03 -05:00
Kinglykrab 1acdc6034b [Commands] Cleanup #permagender Command. (#1779)
- Cleanup message and logic.
2021-11-21 14:01:15 -05:00
KayenEQ e9fc80815a [Spells] Support for SPA 161 and 450 to give percent spell or dot mitigation from Items or AA's. (#1793)
* spell dot shield item AA support

* Update spdat.h

* Update attack.cpp
2021-11-21 10:16:55 -05:00
splose a84536cd05 [Bug Fix] Autofire attacking yourself (#1776)
* Fix being able to attack yourself with autofire if Combat:MinRangedAttackDist == 0

* requested changes

* 2
2021-11-21 10:16:20 -05:00
splose 0a34809bb3 [Bug Fix] - Monk AA Spirit of Master Wu (#1775)
* Monk AA Spirit of Master Wu sends message even if it grants 0 extra attacks.

* fomatting + put if statement in wrong place.. oops.

* Need to push something to set up my Tortoise Github Auth

* test

* test

* test

* test

* test

* requested changes

* Update special_attacks.cpp

Co-authored-by: Kinglykrab <89047260+Kinglykrab@users.noreply.github.com>
2021-11-21 10:15:36 -05:00
Kinglykrab 03847fb1ac [Commands] Cleanup #lastname Command. (#1802)
- Cleanup message and logic.
2021-11-21 10:12:47 -05:00
Kinglykrab 8a27fce3a8 [Commands] Cleanup #memspell Command. (#1801)
- Cleanup message and logic.
- Add support for memorizing spell to target if you have GM enabled.
2021-11-21 10:12:37 -05:00
Kinglykrab 6a42639386 [Commands] Cleanup #pvp Command. (#1800)
- Cleanup messages and logic.
2021-11-21 10:12:23 -05:00
Kinglykrab b9214bfdee [Commands] Cleanup #aggro Command. (#1799)
- Cleanup messages and logic.
- Cleanup constant names and references.
- Cleanup aggro description methods.
2021-11-21 10:12:12 -05:00
Kinglykrab 04fda24c8e [Commands] Cleanup #aggrozone Command. (#1798)
- Cleanup message and logic.
- Add the ability to aggro the zone on your target if you have one.
2021-11-21 10:12:02 -05:00
Kinglykrab 446c5d90ec [Commands] Cleanup #killallnpcs Command. (#1797)
- Cleanup message and logic.
2021-11-21 10:11:47 -05:00
Kinglykrab 80f15ed04a [Commands] Cleanup #myskills Command. (#1796)
- Cleanup popup window display and logic.
2021-11-21 10:11:29 -05:00
Kinglykrab 51fb46556d [Commands] Cleanup #setfaction Command. (#1792)
- Cleanup message and logic.
- Doesn't allow you to use invalid faction IDs anymore.
2021-11-21 10:11:03 -05:00
Kinglykrab d73194c1f6 [Commands] Cleanup #setanim Command. (#1791)
- Cleanup message and logic.
- SetAppearance was not sending to self, so if you modified your own appearance, you wouldn't be able to see it.
2021-11-21 10:10:52 -05:00
Kinglykrab ec1cf68ce2 [Commands] Cleanup #damage Command. (#1789)
- Cleanup logic.
2021-11-21 10:08:20 -05:00
Kinglykrab 39b39970f6 [Commands] Cleanup #ginfo Command. (#1788)
- Cleanup message and logic.
2021-11-21 10:03:31 -05:00
Kinglykrab 40edefa6f4 [Commands] Cleanup #camerashake Command. (#1787)
- Cleanup message and logic.
- Fix ConvertSecondsToTime logic for milliseconds.
- Add ConvertMillisecondsToTime inline function.
2021-11-21 10:03:20 -05:00
Kinglykrab 7154d5b841 [Commands] Cleanup #flags Command. (#1783)
- Cleanup message and logic.
2021-11-21 10:03:08 -05:00
Kinglykrab dfe43ce189 [Commands] Cleanup #nukeitem Command. (#1782)
* [Commands] Cleanup #nukeitem Command.
- Cleanup message and logic.

* Typo.
2021-11-21 09:59:07 -05:00
Kinglykrab 69d5fee471 [Commands] Cleanup #givemoney Command. (#1781)
* [Commands] Cleanup #givemoney Command.
- Cleanup message and logic.

* Update givemoney.cpp
2021-11-21 09:58:23 -05:00
Kinglykrab f1d9221b4c [Commands] Cleanup #invul Command. (#1780)
- Cleanup message and logic.
2021-11-21 09:58:13 -05:00
Kinglykrab fb2f901539 [Commands] Cleanup #permarace Command. (#1778)
- Cleanup message and logic.
2021-11-21 09:56:27 -05:00
Kinglykrab 7c12c5d5ef [Commands] Cleanup #permaclass Command. (#1777)
- Cleanup message and logic.
2021-11-21 09:56:10 -05:00
splose 7559732408 [Bug Fix] Frenzy is supposed to use 1H Animation. (#1774) 2021-11-21 01:19:04 -05:00
KayenEQ fac0d795f2 [Bug Fix] Melee Life tap overflowing and causing damage (#1773)
* Update mob.cpp

* Update mob.cpp
2021-11-18 09:10:02 -05:00
Kinglykrab 3efd9c7f60 [Cleanup] Convert DeleteItemInInventory quantity to int16. (#1767)
* [Cleanup] Convert DeleteItemInInventory quantity to int16.

* Type conversion.
2021-11-16 08:52:22 -05:00
Kinglykrab bf8a0328b3 [Cleanup] Add Entity ID to ShowStats() NPC display. (#1770) 2021-11-15 18:19:42 -05:00
Michael Cook (mackal) 0ebb1cc54c Fix linking tests due to ddcb18418 (#1769) 2021-11-15 13:27:01 -05:00
Akkadius a111668888 [Hotfix] Default PR #1758 to false 2021-11-15 04:07:55 -06:00
Chris Miles 0550fcfd3f [GM Commands] Split GM Commands Into Separate Files (#1766)
* Split GM commands into their own files

* Code cleanup
2021-11-14 22:48:47 -06: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
Kinglykrab 5d75b7b365 [Commands] Cleanup #advnpcspawn and #npcspawn Commands. (#1754)
* [Commands] Cleanup #advnpcspawn and #npcspawn Commands.
- Cleanup messages and logic.
- Add enum for spawn types to remove magic numbers.
- Cleanup messages that were improper/unused.

* Cleanup.

* Cleanup.

* Cleanup.

* Typo.

* Update command.cpp
2021-11-14 19:58:55 -06:00
Natedog2012 6400e2f8bc [Rules] Add option rule to load AA based on CurrentExpansion rule (#1758)
* Add option rule to load AA based on CurrentExpansion rule

* Default UseCurrentExpansionAAOnly to true

* Only clear the PlayerAA when reloadingAA
2021-11-14 19:54:45 -06:00
JJ 76b0183a0f [Loginserver] Increase IP/hostname size a bit more (#1765) 2021-11-14 19:53:53 -06:00
JJ b3471c51df [Config] Delete extra versions (#1763)
* [Config] Delete extra versions [CI SKIP]

* Same
2021-11-14 19:53:14 -06:00
Kinglykrab b2c86f5571 [Commands] Cleanup #raidloot Command. (#1757)
- Cleanup message and logic.
- Add RaidLootTypes enum and map for names.
2021-11-14 19:50:51 -06:00
Kinglykrab 264c6cb019 [Commands] Cleanup #setcrystals Command. (#1745)
* [Commands] Cleanup #setcrystals Command.
- Add message.
- Increase cap from 100,000 to 2,000,000,000.

* Cleanup.

* Remove condition, ID is always defined.

* Cleanup.
2021-11-14 19:47:36 -06:00
Akkadius 9bcb617f90 [Hotfix] Line ending changes 2021-11-14 15:59:03 -06:00
Kinglykrab f5d37a9959 [Commands] Cleanup #setpvppoints Command. (#1755)
* [Commands] Cleanup #setpvppoints Command.
- Cleanup message and logic.

* Cleanup.
2021-11-14 14:47:25 -05:00
Kinglykrab c44b82500d [Commands] Cleanup #setaaxp Command. (#1751)
* [Commands] Cleanup #setaaxp Command.
- Add message.
- Cleanup logic.

* Update command.cpp

* Cleanup.
2021-11-14 14:47:17 -05:00
Kinglykrab 4f550fcbf3 [Commands] Cleanup #loc Command. (#1752)
- Cleanup message and logic.
2021-11-14 14:09:10 -05:00
Kinglykrab 1103d50733 [Commands] Cleanup #setaapts Command. (#1750)
* [Commands] Cleanup #setaapts Command.
- Cleanup message and logic.
- Increase cap from 5,000 to 2,000,000,000.

* Update command.cpp

* Update command.cpp

* Cleanup.

* Cleanup.
2021-11-14 14:06:57 -05:00
Kinglykrab ddcb184183 [Commands] Cleanup #stun Command. (#1749)
* [Commands] Cleanup #stun Command.
- Cleanup message.
- Add ConvertSecondsToTime() to string_util.h and convert Quest API Methods to use helper.

* Add days to ConvertSecondsToTime() and cleanup logic.

* Cleanup.

* Typo.

* Cleanup.

* Cleanup.
2021-11-14 14:05:44 -05:00
Kinglykrab 90bcc5f03c [Commands] Cleanup #zonelock Command. (#1711)
* [Commands] Cleanup #zonelock Command.
- Add support for Zone IDs.
- Cleanup messages and display.
- Fix dangling pointer in ZoneLongName() helper method so name is displayed properly.

* Add account status enum.

* Typo.

* Typo.

* Convert list to constants.

* Cleanup.

* Update command.cpp

* Fix compile.
2021-11-14 11:32:08 -05:00
680 changed files with 60249 additions and 22072 deletions
+2
View File
@@ -54,3 +54,5 @@ bin/
/Win32
/x64
/client_files/**/CMakeFiles/
.idea
+116
View File
@@ -0,0 +1,116 @@
{
//"testMate.cpp.test.executables": "{build,Build,BUILD,out,Out,OUT}/**/*{test,Test,TEST}*"
"testMate.cpp.test.executables": "{build,Build,BUILD,out,Out,OUT}/**/*zone{test,Test,TEST}*",
"cmake.configureSettings": {
//"EQEMU_BUILD_SERVER": "ON",
"EQEMU_BUILD_LUA": "ON"
},
"files.associations": {
"chrono": "cpp",
"functional": "cpp",
"algorithm": "cpp",
"any": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"cfenv": "cpp",
"charconv": "cpp",
"cinttypes": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"codecvt": "cpp",
"compare": "cpp",
"complex": "cpp",
"concepts": "cpp",
"condition_variable": "cpp",
"coroutine": "cpp",
"csetjmp": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"exception": "cpp",
"execution": "cpp",
"resumable": "cpp",
"filesystem": "cpp",
"format": "cpp",
"forward_list": "cpp",
"fstream": "cpp",
"future": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"ios": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"iterator": "cpp",
"limits": "cpp",
"list": "cpp",
"locale": "cpp",
"map": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"mutex": "cpp",
"new": "cpp",
"numeric": "cpp",
"optional": "cpp",
"ostream": "cpp",
"queue": "cpp",
"random": "cpp",
"ratio": "cpp",
"regex": "cpp",
"scoped_allocator": "cpp",
"set": "cpp",
"shared_mutex": "cpp",
"source_location": "cpp",
"sstream": "cpp",
"stack": "cpp",
"stdexcept": "cpp",
"stop_token": "cpp",
"streambuf": "cpp",
"string": "cpp",
"strstream": "cpp",
"system_error": "cpp",
"thread": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"typeindex": "cpp",
"typeinfo": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"utility": "cpp",
"valarray": "cpp",
"variant": "cpp",
"vector": "cpp",
"xfacet": "cpp",
"xhash": "cpp",
"xiosbase": "cpp",
"xlocale": "cpp",
"xlocbuf": "cpp",
"xlocinfo": "cpp",
"xlocmes": "cpp",
"xlocmon": "cpp",
"xlocnum": "cpp",
"xloctime": "cpp",
"xmemory": "cpp",
"xstddef": "cpp",
"xstring": "cpp",
"xtr1common": "cpp",
"xtree": "cpp",
"xutility": "cpp",
"*.tcc": "cpp",
"string_view": "cpp",
"rope": "cpp",
"slist": "cpp",
"*.ipp": "cpp"
}
}
+2 -1
View File
@@ -127,7 +127,7 @@ OPTION(EQEMU_COMMANDS_LOGGING "Enable GM Command logs" ON)
OPTION(EQEMU_BUILD_SERVER "Build the game server." ON)
OPTION(EQEMU_BUILD_LOGIN "Build the login server." ON)
OPTION(EQEMU_BUILD_HC "Build the headless client." OFF)
OPTION(EQEMU_BUILD_TESTS "Build utility tests." OFF)
OPTION(EQEMU_BUILD_TESTS "Build zone tests." ON)
OPTION(EQEMU_BUILD_CLIENT_FILES "Build Client Import/Export Data Programs." ON)
OPTION(EQEMU_PREFER_LUA "Build with normal Lua even if LuaJIT is found." OFF)
@@ -442,6 +442,7 @@ ENDIF(EQEMU_BUILD_HC)
IF(EQEMU_BUILD_TESTS)
ADD_SUBDIRECTORY(tests)
ADD_SUBDIRECTORY(test)
ENDIF(EQEMU_BUILD_TESTS)
IF(EQEMU_BUILD_CLIENT_FILES)
+4 -4
View File
@@ -18,16 +18,16 @@
|**Install Count**|![Windows Install Count](http://analytics.akkadius.com/?install_count&windows_count)|![Linux Install Count](http://analytics.akkadius.com/?install_count&linux_count)|
### > Windows
* [Install Guide](https://eqemu.gitbook.io/server/categories/installation/server-installation-windows)
* [Install Guide](https://docs.eqemu.io/server/installation/server-installation-windows/)
### > Debian/Ubuntu/CentOS/Fedora
* [Install Guide](https://eqemu.gitbook.io/server/categories/installation/server-installation-linux)
* [Install Guide](https://docs.eqemu.io/server/installation/server-installation-linux/)
* You can use curl or wget to kick off the installer (whichever your OS has)
> curl -O https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/linux_installer/install.sh install.sh && chmod 755 install.sh && ./install.sh
> wget --no-check-certificate https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/linux_installer/install.sh -O install.sh && chmod 755 install.sh && ./install.sh
> wget --no-check-certificate https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/linux_installer/install.sh -O install.sh && chmod 755 install.sh && ./install.sh
## Supported Clients
@@ -56,7 +56,7 @@ forum, although pull requests will be much quicker and easier on all parties.
## Resources
- [EQEmulator Forums](http://www.eqemulator.org/forums)
- [EQEmulator Wiki](https://eqemu.gitbook.io/)
- [EQEmulator Wiki](https://docs.eqemu.io/)
## Related Repositories
* [ProjectEQ Quests](https://github.com/ProjectEQ/projecteqquests)
+138 -17
View File
@@ -22,6 +22,7 @@
#include "../database.h"
#include "../rulesys.h"
#include "../eqemu_logsys.h"
#include "../loottable.h"
#include "../repositories/content_flags_repository.h"
@@ -35,8 +36,12 @@ int WorldContentService::GetCurrentExpansion() const
return current_expansion;
}
void WorldContentService::SetExpansionContext()
WorldContentService *WorldContentService::SetExpansionContext()
{
// do a rule manager reload until where we store expansion is changed to somewhere else
RuleManager::Instance()->LoadRules(GetDatabase(), "default", true);
// pull expansion from rules
int expansion = RuleI(Expansion, CurrentExpansion);
if (expansion >= Expansion::Classic && expansion <= Expansion::MaxId) {
content_service.SetCurrentExpansion(expansion);
@@ -47,6 +52,8 @@ void WorldContentService::SetExpansionContext()
GetCurrentExpansion(),
GetCurrentExpansionName()
);
return this;
}
std::string WorldContentService::GetCurrentExpansionName()
@@ -73,15 +80,47 @@ void WorldContentService::SetCurrentExpansion(int current_expansion)
/**
* @return
*/
const std::vector<std::string> &WorldContentService::GetContentFlags() const
const std::vector<ContentFlagsRepository::ContentFlags> &WorldContentService::GetContentFlags() const
{
return content_flags;
}
/**
* @return
*/
std::vector<std::string> WorldContentService::GetContentFlagsEnabled()
{
std::vector<std::string> enabled_flags;
for (auto &f: GetContentFlags()) {
if (f.enabled) {
enabled_flags.emplace_back(f.flag_name);
}
}
return enabled_flags;
}
/**
* @return
*/
std::vector<std::string> WorldContentService::GetContentFlagsDisabled()
{
std::vector<std::string> disabled_flags;
for (auto &f: GetContentFlags()) {
if (!f.enabled) {
disabled_flags.emplace_back(f.flag_name);
}
}
return disabled_flags;
}
/**
* @param content_flags
*/
void WorldContentService::SetContentFlags(std::vector<std::string> content_flags)
void WorldContentService::SetContentFlags(std::vector<ContentFlagsRepository::ContentFlags> content_flags)
{
WorldContentService::content_flags = content_flags;
}
@@ -90,10 +129,10 @@ void WorldContentService::SetContentFlags(std::vector<std::string> content_flags
* @param content_flag
* @return
*/
bool WorldContentService::IsContentFlagEnabled(const std::string& content_flag)
bool WorldContentService::IsContentFlagEnabled(const std::string &content_flag)
{
for (auto &flag : GetContentFlags()) {
if (flag == content_flag) {
for (auto &f: GetContentFlags()) {
if (f.flag_name == content_flag && f.enabled == true) {
return true;
}
}
@@ -101,20 +140,102 @@ bool WorldContentService::IsContentFlagEnabled(const std::string& content_flag)
return false;
}
void WorldContentService::ReloadContentFlags(Database &db)
/**
* @param content_flag
* @return
*/
bool WorldContentService::IsContentFlagDisabled(const std::string &content_flag)
{
std::vector<std::string> set_content_flags;
auto content_flags = ContentFlagsRepository::GetWhere(db, "enabled = 1");
set_content_flags.reserve(content_flags.size());
for (auto &flags: content_flags) {
set_content_flags.push_back(flags.flag_name);
for (auto &f: GetContentFlags()) {
if (f.flag_name == content_flag && f.enabled == false) {
return true;
}
}
LogInfo(
"Enabled content flags [{}]",
implode(", ", set_content_flags)
);
return false;
}
bool WorldContentService::DoesPassContentFiltering(const ContentFlags &f)
{
// if we're not set to (-1 All) then fail when we aren't within minimum expansion
if (f.min_expansion > Expansion::EXPANSION_ALL && current_expansion < f.min_expansion) {
return false;
}
// if we're not set to (-1 All) then fail when we aren't within max expansion
if (f.max_expansion > Expansion::EXPANSION_ALL && current_expansion > f.max_expansion) {
return false;
}
// if we don't have any enabled flag in enabled flags, we fail
for (const auto& flag: SplitString(f.content_flags)) {
if (!contains(GetContentFlagsEnabled(), flag)) {
return false;
}
}
// if we don't have any disabled flag in disabled flags, we fail
for (const auto& flag: SplitString(f.content_flags_disabled)) {
if (!contains(GetContentFlagsDisabled(), flag)) {
return false;
}
}
return true;
}
void WorldContentService::ReloadContentFlags()
{
std::vector<ContentFlagsRepository::ContentFlags> set_content_flags;
auto flags = ContentFlagsRepository::All(*GetDatabase());
set_content_flags.reserve(flags.size());
for (auto &f: flags) {
set_content_flags.push_back(f);
LogInfo(
"Loaded content flag [{}] [{}]",
f.flag_name,
(f.enabled ? "Enabled" : "Disabled")
);
}
SetContentFlags(set_content_flags);
}
Database *WorldContentService::GetDatabase() const
{
return m_database;
}
WorldContentService *WorldContentService::SetDatabase(Database *database)
{
WorldContentService::m_database = database;
return this;
}
void WorldContentService::SetContentFlag(const std::string &content_flag_name, bool enabled)
{
auto flags = ContentFlagsRepository::GetWhere(
*GetDatabase(),
fmt::format("flag_name = '{}'", content_flag_name)
);
auto f = ContentFlagsRepository::NewEntity();
if (!flags.empty()) {
f = flags.front();
}
f.enabled = enabled ? 1 : 0;
f.flag_name = content_flag_name;
if (!flags.empty()) {
ContentFlagsRepository::UpdateOne(*GetDatabase(), f);
}
else {
ContentFlagsRepository::InsertOne(*GetDatabase(), f);
}
ReloadContentFlags();
}
+22 -7
View File
@@ -23,6 +23,8 @@
#include <string>
#include <vector>
#include "../loottable.h"
#include "../repositories/content_flags_repository.h"
class Database;
@@ -160,15 +162,28 @@ public:
bool IsCurrentExpansionTheBurningLands() { return current_expansion == Expansion::ExpansionNumber::TheBurningLands; }
bool IsCurrentExpansionTormentOfVelious() { return current_expansion == Expansion::ExpansionNumber::TormentOfVelious; }
const std::vector<ContentFlagsRepository::ContentFlags> &GetContentFlags() const;
std::vector<std::string> GetContentFlagsEnabled();
std::vector<std::string> GetContentFlagsDisabled();
bool IsContentFlagEnabled(const std::string& content_flag);
bool IsContentFlagDisabled(const std::string& content_flag);
void SetContentFlags(std::vector<ContentFlagsRepository::ContentFlags> content_flags);
void ReloadContentFlags();
WorldContentService * SetExpansionContext();
bool DoesPassContentFiltering(const ContentFlags& f);
WorldContentService * SetDatabase(Database *database);
Database *GetDatabase() const;
void SetContentFlag(const std::string &content_flag_name, bool enabled);
private:
int current_expansion{};
std::vector<std::string> content_flags;
public:
const std::vector<std::string> &GetContentFlags() const;
bool IsContentFlagEnabled(const std::string& content_flag);
void SetContentFlags(std::vector<std::string> content_flags);
void ReloadContentFlags(Database &db);
void SetExpansionContext();
std::vector<ContentFlagsRepository::ContentFlags> content_flags;
// reference to database
Database *m_database;
};
extern WorldContentService content_service;
+14 -2
View File
@@ -716,7 +716,7 @@ bool Database::SaveCharacterCreate(uint32 character_id, uint32 account_id, Playe
/* HoTT Ability */
if(RuleB(Character, GrantHoTTOnCreate))
{
query = StringFormat("INSERT INTO `character_leadership_abilities` (id, slot, rank) VALUES (%u, %i, %i)", character_id, 14, 1);
query = StringFormat("INSERT INTO `character_leadership_abilities` (id, slot, `rank`) VALUES (%u, %i, %i)", character_id, 14, 1);
results = QueryDatabase(query);
}
@@ -997,6 +997,18 @@ bool Database::SetVariable(const std::string varname, const std::string &varvalu
return true;
}
void Database::SetAccountCRCField(uint32 account_id, std::string field_name, uint64 checksum)
{
QueryDatabase(
fmt::format(
"UPDATE `account` SET `{}` = '{}' WHERE `id` = {}",
field_name,
checksum,
account_id
)
);
}
// Get zone starting points from DB
bool Database::GetSafePoints(const char* zone_short_name, uint32 instance_version, float* safe_x, float* safe_y, float* safe_z, float* safe_heading, int16* min_status, uint8* min_level, char *flag_needed) {
@@ -2285,7 +2297,7 @@ void Database::SetIPExemption(std::string account_ip, int exemption_amount) {
auto row = results.begin();
exemption_id = atoi(row[0]);
}
query = fmt::format(
"INSERT INTO `ip_exemptions` (`exemption_ip`, `exemption_amount`) VALUES ('{}', {})",
account_ip,
+2
View File
@@ -190,6 +190,8 @@ public:
int16 CheckStatus(uint32 account_id);
void SetAccountCRCField(uint32 account_id, std::string field_name, uint64 checksum);
uint32 CheckLogin(const char* name, const char* password, const char *loginserver, int16* oStatus = 0);
uint32 CreateAccount(const char* name, const char* password, int16 status, const char* loginserver, uint32 lsaccount_id);
uint32 GetAccountIDFromLSID(const std::string& in_loginserver_id, uint32 in_loginserver_account_id, char* in_account_name = 0, int16* in_status = 0);
+2 -2
View File
@@ -476,7 +476,7 @@ bool Database::CheckDatabaseConversions() {
CheckDatabaseConvertCorpseDeblob();
/* Run EQEmu Server script (Checks for database updates) */
if(system("perl eqemu_server.pl ran_from_world"));
system("perl eqemu_server.pl ran_from_world");
return true;
}
@@ -1452,7 +1452,7 @@ bool Database::CheckDatabaseConvertPPDeblob(){
for (i = 0; i < MAX_LEADERSHIP_AA_ARRAY; i++){
if (pp->leader_abilities.ranks[i] > 0 && pp->leader_abilities.ranks[i] < 6){
if (first_entry != 1){
rquery = StringFormat("REPLACE INTO `character_leadership_abilities` (id, slot, rank) VALUES (%i, %u, %u)", character_id, i, pp->leader_abilities.ranks[i]);
rquery = StringFormat("REPLACE INTO `character_leadership_abilities` (id, slot, `rank`) VALUES (%i, %u, %u)", character_id, i, pp->leader_abilities.ranks[i]);
first_entry = 1;
}
rquery = rquery + StringFormat(", (%i, %u, %u)", character_id, i, pp->leader_abilities.ranks[i]);
+1 -2
View File
@@ -82,7 +82,6 @@ namespace DatabaseSchema {
{"player_titlesets", "char_id"},
{"quest_globals", "charid"},
{"timers", "char_id"},
{"titles", "char_id"},
{"trader", "char_id"},
{"zone_flags", "charID"}
};
@@ -158,7 +157,6 @@ namespace DatabaseSchema {
"spell_buckets",
"spell_globals",
"timers",
"titles",
"trader",
"trader_audit",
"zone_flags"
@@ -270,6 +268,7 @@ namespace DatabaseSchema {
"perl_event_export_settings",
"profanity_list",
"rule_sets",
"titles",
"rule_values",
"variables",
};
+2 -1
View File
@@ -561,8 +561,9 @@ std::string DynamicZoneBase::GetDynamicZoneTypeName(DynamicZoneType dz_type)
return "Mission";
case DynamicZoneType::Quest:
return "Quest";
default:
return "Unknown";
}
return "Unknown";
}
EQ::Net::DynamicPacket DynamicZoneBase::GetSerializedDzPacket()
+187 -2
View File
@@ -19,6 +19,8 @@
#include "emu_constants.h"
#include "languages.h"
#include "data_verification.h"
#include "bodytypes.h"
int16 EQ::invtype::GetInvTypeSize(int16 inv_type) {
@@ -148,8 +150,9 @@ const char *EQ::constants::GetStanceName(StanceType stance_type) {
}
int EQ::constants::ConvertStanceTypeToIndex(StanceType stance_type) {
if (stance_type >= EQ::constants::stancePassive && stance_type <= EQ::constants::stanceBurnAE)
if (EQ::ValueWithin(stance_type, EQ::constants::stancePassive, EQ::constants::stanceBurnAE)) {
return (stance_type - EQ::constants::stancePassive);
}
return 0;
}
@@ -191,9 +194,191 @@ const std::map<int, std::string>& EQ::constants::GetLanguageMap()
std::string EQ::constants::GetLanguageName(int language_id)
{
if (language_id >= LANG_COMMON_TONGUE && language_id <= LANG_UNKNOWN) {
if (EQ::ValueWithin(language_id, LANG_COMMON_TONGUE, LANG_UNKNOWN)) {
auto languages = EQ::constants::GetLanguageMap();
return languages[language_id];
}
return std::string();
}
const std::map<uint32, std::string>& EQ::constants::GetLDoNThemeMap()
{
static const std::map<uint32, std::string> ldon_theme_map = {
{ LDoNThemes::Unused, "Unused" },
{ LDoNThemes::GUK, "Deepest Guk" },
{ LDoNThemes::MIR, "Miragul's Menagerie" },
{ LDoNThemes::MMC, "Mistmoore Catacombs" },
{ LDoNThemes::RUJ, "Rujarkian Hills" },
{ LDoNThemes::TAK, "Takish-Hiz" },
};
return ldon_theme_map;
}
std::string EQ::constants::GetLDoNThemeName(uint32 theme_id)
{
if (EQ::ValueWithin(theme_id, LDoNThemes::Unused, LDoNThemes::TAK)) {
auto ldon_themes = EQ::constants::GetLDoNThemeMap();
return ldon_themes[theme_id];
}
return std::string();
}
const std::map<uint8, std::string>& EQ::constants::GetFlyModeMap()
{
static const std::map<uint8, std::string> flymode_map = {
{ GravityBehavior::Ground, "Ground" },
{ GravityBehavior::Flying, "Flying" },
{ GravityBehavior::Levitating, "Levitating" },
{ GravityBehavior::Water, "Water" },
{ GravityBehavior::Floating, "Floating" },
{ GravityBehavior::LevitateWhileRunning, "Levitating While Running" },
};
return flymode_map;
}
std::string EQ::constants::GetFlyModeName(uint8 flymode_id)
{
if (EQ::ValueWithin(flymode_id, GravityBehavior::Ground, GravityBehavior::LevitateWhileRunning)) {
auto flymodes = EQ::constants::GetFlyModeMap();
return flymodes[flymode_id];
}
return std::string();
}
const std::map<bodyType, std::string>& EQ::constants::GetBodyTypeMap()
{
static const std::map<bodyType, std::string> bodytype_map = {
{ BT_Humanoid, "Humanoid" },
{ BT_Lycanthrope, "Lycanthrope" },
{ BT_Undead, "Undead" },
{ BT_Giant, "Giant" },
{ BT_Construct, "Construct" },
{ BT_Extraplanar, "Extraplanar" },
{ BT_Magical, "Magical" },
{ BT_SummonedUndead, "Summoned Undead" },
{ BT_RaidGiant, "Raid Giant" },
{ BT_RaidColdain, "Raid Coldain" },
{ BT_NoTarget, "Untargetable" },
{ BT_Vampire, "Vampire" },
{ BT_Atenha_Ra, "Aten Ha Ra" },
{ BT_Greater_Akheva, "Greater Akheva" },
{ BT_Khati_Sha, "Khati Sha" },
{ BT_Seru, "Seru" },
{ BT_Grieg_Veneficus, "Grieg Veneficus" },
{ BT_Draz_Nurakk, "Draz Nurakk" },
{ BT_Zek, "Zek" },
{ BT_Luggald, "Luggald" },
{ BT_Animal, "Animal" },
{ BT_Insect, "Insect" },
{ BT_Monster, "Monster" },
{ BT_Summoned, "Summoned" },
{ BT_Plant, "Plant" },
{ BT_Dragon, "Dragon" },
{ BT_Summoned2, "Summoned 2" },
{ BT_Summoned3, "Summoned 3" },
{ BT_Dragon2, "Dragon 2" },
{ BT_VeliousDragon, "Velious Dragon" },
{ BT_Familiar, "Familiar" },
{ BT_Dragon3, "Dragon 3" },
{ BT_Boxes, "Boxes" },
{ BT_Muramite, "Muramite" },
{ BT_NoTarget2, "Untargetable 2" },
{ BT_SwarmPet, "Swarm Pet" },
{ BT_MonsterSummon, "Monster Summon" },
{ BT_InvisMan, "Invisible Man" },
{ BT_Special, "Special" },
};
return bodytype_map;
}
std::string EQ::constants::GetBodyTypeName(bodyType bodytype_id)
{
auto bodytypes = EQ::constants::GetBodyTypeMap();
if (!bodytypes[bodytype_id].empty()) {
return bodytypes[bodytype_id];
}
return std::string();
}
const std::map<uint8, std::string>& EQ::constants::GetAccountStatusMap()
{
static const std::map<uint8, std::string> account_status_map = {
{ AccountStatus::Player, "Player" },
{ AccountStatus::Steward, "Steward" },
{ AccountStatus::ApprenticeGuide, "Apprentice Guide" },
{ AccountStatus::Guide, "Guide" },
{ AccountStatus::QuestTroupe, "Quest Troupe" },
{ AccountStatus::SeniorGuide, "Senior Guide" },
{ AccountStatus::GMTester, "GM Tester" },
{ AccountStatus::EQSupport, "EQ Support" },
{ AccountStatus::GMStaff, "GM Staff" },
{ AccountStatus::GMAdmin, "GM Admin" },
{ AccountStatus::GMLeadAdmin, "GM Lead Admin" },
{ AccountStatus::QuestMaster, "Quest Master" },
{ AccountStatus::GMAreas, "GM Areas" },
{ AccountStatus::GMCoder, "GM Coder" },
{ AccountStatus::GMMgmt, "GM Mgmt" },
{ AccountStatus::GMImpossible, "GM Impossible" },
{ AccountStatus::Max, "GM Max" }
};
return account_status_map;
}
std::string EQ::constants::GetAccountStatusName(uint8 account_status)
{
auto account_statuses = EQ::constants::GetAccountStatusMap();
std::string status_name;
for (auto status_level = account_statuses.rbegin(); status_level != account_statuses.rend(); ++status_level) {
if (account_status >= status_level->first) {
status_name = status_level->second;
break;
}
}
return status_name;
}
const std::map<uint8, std::string>& EQ::constants::GetConsiderLevelMap()
{
static const std::map<uint8, std::string> consider_level_map = {
{ ConsiderLevel::Ally, "Ally" },
{ ConsiderLevel::Warmly, "Warmly" },
{ ConsiderLevel::Kindly, "Kindly" },
{ ConsiderLevel::Amiably, "Amiably" },
{ ConsiderLevel::Indifferently, "Indifferently" },
{ ConsiderLevel::Apprehensively, "Apprehensively" },
{ ConsiderLevel::Dubiously, "Dubiously" },
{ ConsiderLevel::Threateningly, "Threateningly" },
{ ConsiderLevel::Scowls, "Scowls" }
};
return consider_level_map;
}
std::string EQ::constants::GetConsiderLevelName(uint8 faction_consider_level)
{
auto consider_levels = EQ::constants::GetConsiderLevelMap();
if (!consider_levels[faction_consider_level].empty()) {
return consider_levels[faction_consider_level];
}
return std::string();
}
const std::map<uint8, std::string>& EQ::constants::GetEnvironmentalDamageMap()
{
static const std::map<uint8, std::string> damage_type_map = {
{ EnvironmentalDamage::Lava, "Lava" },
{ EnvironmentalDamage::Drowning, "Drowning" },
{ EnvironmentalDamage::Falling, "Falling" },
{ EnvironmentalDamage::Trap, "Trap" }
};
return damage_type_map;
}
std::string EQ::constants::GetEnvironmentalDamageName(uint8 damage_type)
{
if (EQ::ValueWithin(damage_type, EnvironmentalDamage::Lava, EnvironmentalDamage::Trap)) {
auto damage_types = EQ::constants::GetEnvironmentalDamageMap();
return damage_types[damage_type];
}
return std::string();
}
+86 -7
View File
@@ -22,6 +22,7 @@
#include "eq_limits.h"
#include "emu_versions.h"
#include "bodytypes.h"
#include <string.h>
@@ -220,12 +221,46 @@ namespace EQ
stanceBurnAE
};
enum GravityBehavior : uint8 {
Ground,
Flying,
Levitating,
Water,
Floating,
LevitateWhileRunning
};
enum EnvironmentalDamage : uint8 {
Lava = 250,
Drowning,
Falling,
Trap
};
const char *GetStanceName(StanceType stance_type);
int ConvertStanceTypeToIndex(StanceType stance_type);
extern const std::map<int, std::string>& GetLanguageMap();
std::string GetLanguageName(int language_id);
extern const std::map<uint32, std::string>& GetLDoNThemeMap();
std::string GetLDoNThemeName(uint32 theme_id);
extern const std::map<uint8, std::string>& GetFlyModeMap();
std::string GetFlyModeName(uint8 flymode_id);
extern const std::map<bodyType, std::string>& GetBodyTypeMap();
std::string GetBodyTypeName(bodyType bodytype_id);
extern const std::map<uint8, std::string>& GetAccountStatusMap();
std::string GetAccountStatusName(uint8 account_status);
extern const std::map<uint8, std::string>& GetConsiderLevelMap();
std::string GetConsiderLevelName(uint8 consider_level);
extern const std::map<uint8, std::string>& GetEnvironmentalDamageMap();
std::string GetEnvironmentalDamageName(uint8 damage_type);
const int STANCE_TYPE_FIRST = stancePassive;
const int STANCE_TYPE_LAST = stanceBurnAE;
const int STANCE_TYPE_COUNT = stanceBurnAE;
@@ -328,13 +363,57 @@ namespace EQ
Guild
};
}; // namespace consent
} /*EQEmu*/
enum ServerLockType : int {
List,
Lock,
Unlock
};
enum AccountStatus : uint8 {
Player = 0,
Steward = 10,
ApprenticeGuide = 20,
Guide = 50,
QuestTroupe = 80,
SeniorGuide = 81,
GMTester = 85,
EQSupport = 90,
GMStaff = 95,
GMAdmin = 100,
GMLeadAdmin = 150,
QuestMaster = 160,
GMAreas = 170,
GMCoder = 180,
GMMgmt = 200,
GMImpossible = 250,
Max = 255
};
enum Invisibility : uint8 {
Visible,
Invisible,
Special = 255
};
enum AugmentActions : int {
Insert,
Remove,
Swap,
Destroy
};
enum ConsiderLevel : uint8 {
Ally = 1,
Warmly,
Kindly,
Amiably,
Indifferently,
Apprehensively,
Dubiously,
Threateningly,
Scowls
};
#endif /*COMMON_EMU_CONSTANTS_H*/
/* hack list to prevent circular references
eq_limits.h:EQ::inventory::LookupEntry::InventoryTypeSize[n];
*/
+3 -2
View File
@@ -129,8 +129,8 @@ N(OP_DisciplineTimer),
N(OP_DisciplineUpdate),
N(OP_DiscordMerchantInventory),
N(OP_DoGroupLeadershipAbility),
N(OP_DuelResponse),
N(OP_DuelResponse2),
N(OP_DuelDecline),
N(OP_DuelAccept),
N(OP_DumpName),
N(OP_Dye),
N(OP_DynamicWall),
@@ -558,6 +558,7 @@ N(OP_WhoAllRequest),
N(OP_WhoAllResponse),
N(OP_World_Client_CRC1),
N(OP_World_Client_CRC2),
N(OP_World_Client_CRC3),
N(OP_WorldClientReady),
N(OP_WorldComplete),
N(OP_WorldLogout),
+7 -1
View File
@@ -448,6 +448,7 @@ struct ManaChange_Struct
/*08*/ uint32 spell_id;
/*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting?
/*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like
/*16*/ int32 slot; // -1 normal, otherwise clear ETA and GCD
};
struct SwapSpell_Struct
@@ -2761,7 +2762,7 @@ struct EnvDamage2_Struct {
/*0004*/ uint16 unknown4;
/*0006*/ uint32 damage;
/*0010*/ uint8 unknown10[12];
/*0022*/ uint8 dmgtype; //FA = Lava; FC = Falling
/*0022*/ uint8 dmgtype; // FA = Lava, FB = Drowning, FC = Falling, FD = Trap
/*0023*/ uint8 unknown2[4];
/*0027*/ uint16 constant; //Always FFFF
/*0029*/ uint16 unknown29;
@@ -5581,6 +5582,11 @@ struct SayLinkBodyFrame_Struct {
/*056*/
};
struct Checksum_Struct {
uint64 checksum;
uint8 data[2048];
};
struct UpdateMovementEntry {
/* 00 */ float Y;
/* 04 */ float X;
+20 -18
View File
@@ -116,22 +116,24 @@ EQEmuLogSys *EQEmuLogSys::LoadLogSettingsDefaults()
/**
* Set Defaults
*/
log_settings[Logs::WorldServer].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::ZoneServer].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::QSServer].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::UCSServer].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::Crash].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::MySQLError].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::Loginserver].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::HeadlessClient].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::NPCScaling].log_to_gmsay = static_cast<uint8>(Logs::General);
log_settings[Logs::HotReload].log_to_gmsay = static_cast<uint8>(Logs::General);
log_settings[Logs::HotReload].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::Loot].log_to_gmsay = static_cast<uint8>(Logs::General);
log_settings[Logs::Scheduler].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::Cheat].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::HTTP].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::HTTP].log_to_gmsay = static_cast<uint8>(Logs::General);
log_settings[Logs::WorldServer].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::ZoneServer].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::QSServer].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::UCSServer].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::Crash].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::MySQLError].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::Loginserver].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::HeadlessClient].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::NPCScaling].log_to_gmsay = static_cast<uint8>(Logs::General);
log_settings[Logs::HotReload].log_to_gmsay = static_cast<uint8>(Logs::General);
log_settings[Logs::HotReload].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::Loot].log_to_gmsay = static_cast<uint8>(Logs::General);
log_settings[Logs::Scheduler].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::Cheat].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::HTTP].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::HTTP].log_to_gmsay = static_cast<uint8>(Logs::General);
log_settings[Logs::ChecksumVerification].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::ChecksumVerification].log_to_gmsay = static_cast<uint8>(Logs::General);
/**
* RFC 5424
@@ -241,7 +243,7 @@ void EQEmuLogSys::ProcessGMSay(
*/
if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone ||
EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformWorld
) {
) {
on_log_gmsay_hook(log_category, message);
}
}
@@ -467,7 +469,7 @@ void EQEmuLogSys::Out(
std::string prefix;
if (RuleB(Logging, PrintFileFunctionAndLine)) {
prefix = fmt::format("[{0}::{1}:{2}] ", base_file_name(file), func, line);
prefix = fmt::format("[{0}:{1}] ", base_file_name(file), line);
}
va_list args;
+2
View File
@@ -127,6 +127,7 @@ namespace Logs {
DiaWind,
HTTP,
Saylink,
ChecksumVerification,
MaxCategoryID /* Don't Remove this */
};
@@ -212,6 +213,7 @@ namespace Logs {
"DialogueWindow",
"HTTP",
"Saylink",
"ChecksumVerification",
};
}
+22
View File
@@ -696,6 +696,16 @@
OutF(LogSys, Logs::Detail, Logs::Saylink, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogChecksumVerification(message, ...) do {\
if (LogSys.log_settings[Logs::ChecksumVerification].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::ChecksumVerification, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogChecksumVerificationDetail(message, ...) do {\
if (LogSys.log_settings[Logs::ChecksumVerification].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::ChecksumVerification, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define Log(debug_level, log_category, message, ...) do {\
if (LogSys.log_settings[log_category].is_category_enabled == 1)\
LogSys.Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
@@ -1092,6 +1102,18 @@
#define LogHTTPDetail(message, ...) do {\
} while (0)
#define LogSaylink(message, ...) do {\
} while (0)
#define LogSaylinkDetail(message, ...) do {\
} while (0)
#define LogChecksumVerification(message, ...) do {\
} while (0)
#define LogChecksumVerificationDetail(message, ...) do {\
} while (0)
#define Log(debug_level, log_category, message, ...) do {\
} while (0)
+22 -22
View File
@@ -20,31 +20,31 @@
#include "races.h"
#include "rulesys.h"
const char *FactionValueToString(FACTION_VALUE fv)
const char *FactionValueToString(FACTION_VALUE faction_value)
{
switch (fv) {
switch (faction_value) {
case FACTION_ALLY:
return ("Ally");
return "Ally";
case FACTION_WARMLY:
return ("Warmly");
return "Warmly";
case FACTION_KINDLY:
return ("Kindly");
case FACTION_AMIABLE:
return ("Amiable");
case FACTION_INDIFFERENT:
return ("Indifferent");
case FACTION_APPREHENSIVE:
return ("Apprehensive");
case FACTION_DUBIOUS:
return ("Dubious");
case FACTION_THREATENLY:
return ("Threatenly");
return "Kindly";
case FACTION_AMIABLY:
return "Amiably";
case FACTION_INDIFFERENTLY:
return "Indifferently";
case FACTION_APPREHENSIVELY:
return "Apprehensively";
case FACTION_DUBIOUSLY:
return "Dubiously";
case FACTION_THREATENINGLY:
return "Threateningly";
case FACTION_SCOWLS:
return ("Scowls, ready to attack.");
return "Scowls";
default:
break;
}
return ("Unknown Faction Con");
return "Unknown";
}
@@ -70,19 +70,19 @@ FACTION_VALUE CalculateFaction(FactionMods* fm, int32 tmpCharacter_value)
return FACTION_KINDLY;
}
if (character_value >= RuleI(Faction, AmiablyFactionMinimum)) {
return FACTION_AMIABLE;
return FACTION_AMIABLY;
}
if (character_value >= RuleI(Faction, IndifferentlyFactionMinimum)) {
return FACTION_INDIFFERENT;
return FACTION_INDIFFERENTLY;
}
if (character_value >= RuleI(Faction, ApprehensivelyFactionMinimum)) {
return FACTION_APPREHENSIVE;
return FACTION_APPREHENSIVELY;
}
if (character_value >= RuleI(Faction, DubiouslyFactionMinimum)) {
return FACTION_DUBIOUS;
return FACTION_DUBIOUSLY;
}
if (character_value >= RuleI(Faction, ThreateninglyFactionMinimum)) {
return FACTION_THREATENLY;
return FACTION_THREATENINGLY;
}
return FACTION_SCOWLS;
}
+6 -6
View File
@@ -27,13 +27,13 @@ enum FACTION_VALUE {
FACTION_ALLY = 1,
FACTION_WARMLY = 2,
FACTION_KINDLY = 3,
FACTION_AMIABLE = 4,
FACTION_AMIABLY = 4,
FACTION_INDIFFERENT = 5,
FACTION_INDIFFERENTLY = 5,
FACTION_APPREHENSIVE = 6,
FACTION_DUBIOUS = 7,
FACTION_THREATENLY = 8,
FACTION_APPREHENSIVELY = 6,
FACTION_DUBIOUSLY = 7,
FACTION_THREATENINGLY = 8,
FACTION_SCOWLS = 9
};
@@ -75,6 +75,6 @@ struct NPCFaction
uint8 temp;
};
const char *FactionValueToString(FACTION_VALUE fv);
const char *FactionValueToString(FACTION_VALUE faction_value);
FACTION_VALUE CalculateFaction(FactionMods* fm, int32 tmpCharacter_value);
#endif
+1 -1
View File
@@ -204,7 +204,7 @@ enum { //some random constants
#define MIN_LEVEL_ALCHEMY 25
//chance ratio that a
#define THREATENLY_ARRGO_CHANCE 32 // 32/128 (25%) chance that a mob will arrgo on con Threatenly
#define THREATENINGLY_AGGRO_CHANCE 32 // 32/128 (25%) chance that a mob will arrgo on con Threatenly
//max factions per npc faction list
#define MAX_NPC_FACTIONS 20
+6 -1
View File
@@ -64,4 +64,9 @@ void FileUtil::mkdir(const std::string& directory_name)
}
::mkdir(directory_name.c_str(), 0755);
#endif
}
}
bool file_exists(const std::string& name) {
std::ifstream f(name.c_str());
return f.good();
}
+1
View File
@@ -28,5 +28,6 @@ public:
static void mkdir(const std::string& directory_name);
};
bool file_exists(const std::string& name);
#endif //EQEMU_FILE_UTIL_H
+66 -6
View File
@@ -63,7 +63,7 @@ bool BaseGuildManager::LoadGuilds() {
for (auto row=results.begin();row!=results.end();++row)
_CreateGuild(atoi(row[0]), row[1], atoi(row[2]), atoi(row[3]), row[4], row[5], row[6], row[7]);
query = "SELECT guild_id,rank,title,can_hear,can_speak,can_invite,can_remove,can_promote,can_demote,can_motd,can_warpeace FROM guild_ranks";
query = "SELECT guild_id,`rank`,title,can_hear,can_speak,can_invite,can_remove,can_promote,can_demote,can_motd,can_warpeace FROM guild_ranks";
results = m_db->QueryDatabase(query);
if (!results.Success())
@@ -131,7 +131,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) {
info = _CreateGuild(guild_id, row[0], atoi(row[1]), atoi(row[2]), row[3], row[4], row[5], row[6]);
query = StringFormat("SELECT guild_id, rank, title, can_hear, can_speak, can_invite, can_remove, can_promote, can_demote, can_motd, can_warpeace "
query = StringFormat("SELECT guild_id, `rank`, title, can_hear, can_speak, can_invite, can_remove, can_promote, can_demote, can_motd, can_warpeace "
"FROM guild_ranks WHERE guild_id=%lu", (unsigned long)guild_id);
results = m_db->QueryDatabase(query);
@@ -268,7 +268,7 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) {
m_db->DoEscapeString(title_esc, rankInfo.name.c_str(), rankInfo.name.length());
query = StringFormat("INSERT INTO guild_ranks "
"(guild_id,rank,title,can_hear,can_speak,can_invite,can_remove,can_promote,can_demote,can_motd,can_warpeace)"
"(guild_id,`rank`,title,can_hear,can_speak,can_invite,can_remove,can_promote,can_demote,can_motd,can_warpeace)"
" VALUES(%d,%d,'%s',%d,%d,%d,%d,%d,%d,%d,%d)",
guild_id, rank, title_esc,
rankInfo.permissions[GUILD_HEAR],
@@ -738,7 +738,7 @@ bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) {
std::string query;
if(guild_id != GUILD_NONE) {
query = StringFormat("REPLACE INTO guild_members (char_id,guild_id,rank,public_note) VALUES(%d,%d,%d,'')", charid, guild_id, rank);
query = StringFormat("REPLACE INTO guild_members (char_id,guild_id,`rank`,public_note) VALUES(%d,%d,%d,'')", charid, guild_id, rank);
auto results = m_db->QueryDatabase(query);
if (!results.Success()) {
@@ -758,7 +758,7 @@ bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) {
}
bool BaseGuildManager::DBSetGuildRank(uint32 charid, uint8 rank) {
std::string query = StringFormat("UPDATE guild_members SET rank=%d WHERE char_id=%d", rank, charid);
std::string query = StringFormat("UPDATE guild_members SET `rank`=%d WHERE char_id=%d", rank, charid);
return(QueryWithLogging(query, "setting a guild member's rank"));
}
@@ -1208,7 +1208,7 @@ BaseGuildManager::RankInfo::RankInfo() {
BaseGuildManager::GuildInfo::GuildInfo() {
leader_char_id = 0;
minstatus = 0;
minstatus = AccountStatus::Player;
}
uint32 BaseGuildManager::DoesAccountContainAGuildLeader(uint32 AccountID)
@@ -1225,6 +1225,66 @@ uint32 BaseGuildManager::DoesAccountContainAGuildLeader(uint32 AccountID)
return results.RowCount();
}
std::string BaseGuildManager::GetGuildNameByID(uint32 guild_id) const {
if(guild_id == GUILD_NONE) {
return std::string();
}
std::map<uint32, GuildInfo *>::const_iterator res;
res = m_guilds.find(guild_id);
if(res == m_guilds.end()) {
return "Invalid Guild";
}
return res->second->name;
}
std::string BaseGuildManager::GetGuildRankName(uint32 guild_id, uint8 rank) const
{
if(rank > GUILD_MAX_RANK) {
return "Invalid Rank";
}
std::map<uint32, GuildInfo *>::const_iterator res;
res = m_guilds.find(guild_id);
if(res == m_guilds.end()) {
return "Invalid Guild Rank";
}
return res->second->ranks[rank].name;
}
uint32 BaseGuildManager::GetGuildIDByCharacterID(uint32 character_id)
{
if(!m_db) {
return GUILD_NONE;
}
std::string query = fmt::format(
"SELECT `guild_id` FROM `guild_members` WHERE char_id = {} LIMIT 1",
character_id
);
auto results = m_db->QueryDatabase(query);
if(!results.Success() || !results.RowCount()) {
return GUILD_NONE;
}
auto row = results.begin();
auto guild_id = std::stoul(row[0]);
return guild_id;
}
bool BaseGuildManager::IsCharacterInGuild(uint32 character_id, uint32 guild_id)
{
auto current_guild_id = GetGuildIDByCharacterID(character_id);
if (current_guild_id == GUILD_NONE) {
return false;
}
if (guild_id && current_guild_id != guild_id) {
return false;
}
return true;
}
+4
View File
@@ -76,8 +76,12 @@ class BaseGuildManager
bool GetGuildChannel(uint32 GuildID, char *ChannelBuffer) const;
const char *GetRankName(uint32 guild_id, uint8 rank) const;
const char *GetGuildName(uint32 guild_id) const;
std::string GetGuildNameByID(uint32 guild_id) const;
std::string GetGuildRankName(uint32 guild_id, uint8 rank) const;
bool IsCharacterInGuild(uint32 character_id, uint32 guild_id = 0);
bool GetGuildNameByID(uint32 guild_id, std::string &into) const;
uint32 GetGuildIDByName(const char *GuildName);
uint32 GetGuildIDByCharacterID(uint32 character_id);
bool IsGuildLeader(uint32 guild_id, uint32 char_id) const;
uint8 GetDisplayedRank(uint32 guild_id, uint8 rank, uint32 char_id) const;
bool CheckGMStatus(uint32 guild_id, uint8 status) const;
+63 -1
View File
@@ -399,7 +399,7 @@ bool EQ::InventoryProfile::SwapItem(
}
// Remove item from inventory (with memory delete)
bool EQ::InventoryProfile::DeleteItem(int16 slot_id, uint8 quantity) {
bool EQ::InventoryProfile::DeleteItem(int16 slot_id, int16 quantity) {
// Pop item out of inventory map (or queue)
ItemInstance *item_to_delete = PopItem(slot_id);
@@ -590,6 +590,68 @@ bool EQ::InventoryProfile::HasSpaceForItem(const ItemData *ItemToTry, int16 Quan
// Checks that user has at least 'quantity' number of items in a given inventory slot
// Returns first slot it was found in, or SLOT_INVALID if not found
bool EQ::InventoryProfile::HasAugmentEquippedByID(uint32 item_id)
{
bool has_equipped = false;
ItemInstance* item = nullptr;
for (int slot_id = EQ::invslot::EQUIPMENT_BEGIN; slot_id <= EQ::invslot::EQUIPMENT_END; ++slot_id) {
item = GetItem(slot_id);
if (item && item->ContainsAugmentByID(item_id)) {
has_equipped = true;
break;
}
}
return has_equipped;
}
int EQ::InventoryProfile::CountAugmentEquippedByID(uint32 item_id)
{
int quantity = 0;
ItemInstance* item = nullptr;
for (int slot_id = EQ::invslot::EQUIPMENT_BEGIN; slot_id <= EQ::invslot::EQUIPMENT_END; ++slot_id) {
item = GetItem(slot_id);
if (item && item->ContainsAugmentByID(item_id)) {
quantity += item->CountAugmentByID(item_id);
}
}
return quantity;
}
bool EQ::InventoryProfile::HasItemEquippedByID(uint32 item_id)
{
bool has_equipped = false;
ItemInstance* item = nullptr;
for (int slot_id = EQ::invslot::EQUIPMENT_BEGIN; slot_id <= EQ::invslot::EQUIPMENT_END; ++slot_id) {
item = GetItem(slot_id);
if (item && item->GetID() == item_id) {
has_equipped = true;
break;
}
}
return has_equipped;
}
int EQ::InventoryProfile::CountItemEquippedByID(uint32 item_id)
{
int quantity = 0;
ItemInstance* item = nullptr;
for (int slot_id = EQ::invslot::EQUIPMENT_BEGIN; slot_id <= EQ::invslot::EQUIPMENT_END; ++slot_id) {
item = GetItem(slot_id);
if (item && item->GetID() == item_id) {
quantity += item->IsStackable() ? item->GetCharges() : 1;
}
}
return quantity;
}
//This function has a flaw in that it only returns the last stack that it looked at
//when quantity is greater than 1 and not all of quantity can be found in 1 stack.
int16 EQ::InventoryProfile::HasItem(uint32 item_id, uint8 quantity, uint8 where)
+13 -1
View File
@@ -132,7 +132,7 @@ namespace EQ
bool SwapItem(int16 source_slot, int16 destination_slot, SwapItemFailState& fail_state, uint16 race_id = 0, uint8 class_id = 0, uint16 deity_id = 0, uint8 level = 0);
// Remove item from inventory
bool DeleteItem(int16 slot_id, uint8 quantity = 0);
bool DeleteItem(int16 slot_id, int16 quantity = 0);
// Checks All items in a bag for No Drop
bool CheckNoDrop(int16 slot_id, bool recurse = true);
@@ -140,6 +140,18 @@ namespace EQ
// Remove item from inventory (and take control of memory)
ItemInstance* PopItem(int16 slot_id);
// Check if player has a specific item equipped by Item ID
bool HasItemEquippedByID(uint32 item_id);
// Check how many of a specific item the player has equipped by Item ID
int CountItemEquippedByID(uint32 item_id);
// Check if player has a specific augment equipped by Item ID
bool HasAugmentEquippedByID(uint32 item_id);
// Check how many of a specific augment the player has equipped by Item ID
int CountAugmentEquippedByID(uint32 item_id);
// Check whether there is space for the specified number of the specified item.
bool HasSpaceForItem(const ItemData *ItemToTry, int16 Quantity);
+40 -1
View File
@@ -689,6 +689,45 @@ bool EQ::ItemInstance::IsAugmented()
return false;
}
bool EQ::ItemInstance::ContainsAugmentByID(uint32 item_id)
{
if (!m_item || !m_item->IsClassCommon()) {
return false;
}
if (!item_id) {
return false;
}
for (uint8 augment_slot = invaug::SOCKET_BEGIN; augment_slot <= invaug::SOCKET_END; ++augment_slot) {
if (GetAugmentItemID(augment_slot) == item_id) {
return true;
}
}
return false;
}
int EQ::ItemInstance::CountAugmentByID(uint32 item_id)
{
int quantity = 0;
if (!m_item || !m_item->IsClassCommon()) {
return quantity;
}
if (!item_id) {
return quantity;
}
for (uint8 augment_slot = invaug::SOCKET_BEGIN; augment_slot <= invaug::SOCKET_END; ++augment_slot) {
if (GetAugmentItemID(augment_slot) == item_id) {
quantity++;
}
}
return quantity;
}
// Has attack/delay?
bool EQ::ItemInstance::IsWeapon() const
{
@@ -1706,4 +1745,4 @@ EvolveInfo::EvolveInfo(uint32 first, uint8 max, bool allkills, uint32 L2, uint32
EvolveInfo::~EvolveInfo() {
}
}
+2
View File
@@ -132,6 +132,8 @@ namespace EQ
void DeleteAugment(uint8 slot);
ItemInstance* RemoveAugment(uint8 index);
bool IsAugmented();
bool ContainsAugmentByID(uint32 item_id);
int CountAugmentByID(uint32 item_id);
ItemInstance* GetOrnamentationAug(int32 ornamentationAugtype) const;
bool UpdateOrnamentationInfo();
static bool CanTransform(const ItemData *ItemToTry, const ItemData *Container, bool AllowAll = false);
+14 -5
View File
@@ -30,11 +30,19 @@ struct LootTableEntries_Struct {
float probability;
};
struct ContentFlags {
int16 min_expansion;
int16 max_expansion;
char content_flags[100];
char content_flags_disabled[100];
};
struct LootTable_Struct {
uint32 mincash;
uint32 maxcash;
uint32 avgcoin;
uint32 NumEntries;
uint32 mincash;
uint32 maxcash;
uint32 avgcoin;
uint32 NumEntries;
ContentFlags content_flags;
LootTableEntries_Struct Entries[0];
};
@@ -51,7 +59,8 @@ struct LootDropEntries_Struct {
};
struct LootDrop_Struct {
uint32 NumEntries;
uint32 NumEntries;
ContentFlags content_flags;
LootDropEntries_Struct Entries[0];
};
#pragma pack()
+1 -1
View File
@@ -194,7 +194,7 @@ void MD5::Final(uint8 digest[16], MD5Context *ctx) {
/* The heart of the MD5 algorithm. */
void MD5::Transform(uint32 hash[4], const uint32 input[16]) {
register uint32 a = hash[0], b = hash[1], c = hash[2], d = hash[3];
uint32 a = hash[0], b = hash[1], c = hash[2], d = hash[3];
MD5STEP(F1, a, b, c, d, input[ 0]+0xd76aa478, 7);
MD5STEP(F1, d, a, b, c, input[ 1]+0xe8c7b756, 12);
+2 -2
View File
@@ -15,7 +15,7 @@ EQ::Net::ConsoleServerConnection::ConsoleServerConnection(ConsoleServer *parent,
memset(m_line, 0, MaxConsoleLineLength);
m_accept_messages = false;
m_user_id = 0;
m_admin = 0;
m_admin = AccountStatus::Player;
m_connection->OnRead(std::bind(&ConsoleServerConnection::OnRead, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
m_connection->OnDisconnect(std::bind(&ConsoleServerConnection::OnDisconnect, this, std::placeholders::_1));
@@ -29,7 +29,7 @@ EQ::Net::ConsoleServerConnection::ConsoleServerConnection(ConsoleServer *parent,
if (addr.find("127.0.0.1") != std::string::npos || addr.find("::0") != std::string::npos) {
SendLine("Connection established from localhost, assuming admin");
m_status = ConsoleStatusLoggedIn;
m_admin = 255;
m_admin = AccountStatus::Max;
SendPrompt();
}
else {
+3 -2
View File
@@ -5,6 +5,7 @@
#include <map>
#include <unordered_set>
#include <array>
#include "../emu_constants.h"
struct MethodHandlerEntry
{
@@ -174,13 +175,13 @@ Json::Value EQ::Net::WebsocketServer::Login(WebsocketServerConnection *connectio
auto r = _impl->login_handler(connection, user, pass);
if (r.logged_in) {
connection->SetAuthorized(true, r.account_name, r.account_id, 255);
connection->SetAuthorized(true, r.account_name, r.account_id, AccountStatus::Max);
ret["status"] = "Ok";
}
else if (user == "admin" && (connection->RemoteIP() == "127.0.0.1" || connection->RemoteIP() == "::")) {
r.logged_in = true;
r.account_id = 0;
connection->SetAuthorized(true, r.account_name, r.account_id, 255);
connection->SetAuthorized(true, r.account_name, r.account_id, AccountStatus::Max);
ret["status"] = "Ok";
}
else {
+2 -2
View File
@@ -115,8 +115,8 @@ IN(OP_GMTraining, GMTrainee_Struct);
IN(OP_GMEndTraining, GMTrainEnd_Struct);
IN(OP_GMTrainSkill, GMSkillChange_Struct);
IN(OP_RequestDuel, Duel_Struct);
IN(OP_DuelResponse, DuelResponse_Struct);
IN(OP_DuelResponse2, Duel_Struct);
IN(OP_DuelDecline, DuelResponse_Struct);
IN(OP_DuelAccept, Duel_Struct);
IN(OP_SpawnAppearance, SpawnAppearance_Struct);
IN(OP_BazaarInspect, BazaarInspect_Struct);
IN(OP_Death, Death_Struct);
+2 -2
View File
@@ -240,8 +240,8 @@ void load_opcode_names()
opcode_map[0x00a1] = "LiveOP_SaveOnZoneReq";
opcode_map[0x0185] = "LiveOP_Logout";
opcode_map[0x0298] = "LiveOP_RequestDuel";
opcode_map[0x0a5d] = "LiveOP_DuelResponse";
opcode_map[0x016e] = "LiveOP_DuelResponse2";
opcode_map[0x0a5d] = "LiveOP_DuelDecline";
opcode_map[0x016e] = "LiveOP_DuelAccept";
opcode_map[0x007c] = "LiveOP_InstillDoubt";
opcode_map[0x00ac] = "LiveOP_SafeFallSuccess";
opcode_map[0x02fb] = "LiveOP_DisciplineUpdate";
-14
View File
@@ -1634,20 +1634,6 @@ namespace RoF
FINISH_ENCODE();
}
ENCODE(OP_ManaChange)
{
ENCODE_LENGTH_EXACT(ManaChange_Struct);
SETUP_DIRECT_ENCODE(ManaChange_Struct, structs::ManaChange_Struct);
OUT(new_mana);
OUT(stamina);
OUT(spell_id);
OUT(keepcasting);
eq->slot = -1; // this is spell gem slot. It's -1 in normal operation
FINISH_ENCODE();
}
ENCODE(OP_MercenaryDataResponse)
{
//consume the packet
-14
View File
@@ -1683,20 +1683,6 @@ namespace RoF2
FINISH_ENCODE();
}
ENCODE(OP_ManaChange)
{
ENCODE_LENGTH_EXACT(ManaChange_Struct);
SETUP_DIRECT_ENCODE(ManaChange_Struct, structs::ManaChange_Struct);
OUT(new_mana);
OUT(stamina);
OUT(spell_id);
OUT(keepcasting);
eq->slot = -1; // this is spell gem slot. It's -1 in normal operation
FINISH_ENCODE();
}
ENCODE(OP_MercenaryDataResponse)
{
//consume the packet
-1
View File
@@ -93,7 +93,6 @@ E(OP_ItemVerifyReply)
E(OP_LeadershipExpUpdate)
E(OP_LogServer)
E(OP_LootItem)
E(OP_ManaChange)
E(OP_MercenaryDataResponse)
E(OP_MercenaryDataUpdate)
E(OP_MoveItem)
+6 -1
View File
@@ -3061,7 +3061,7 @@ struct EnvDamage2_Struct {
/*0006*/ uint32 damage;
/*0010*/ float unknown10; // New to Underfoot - Seen 1
/*0014*/ uint8 unknown14[12];
/*0026*/ uint8 dmgtype; // FA = Lava; FC = Falling
/*0026*/ uint8 dmgtype; // FA = Lava, FB = Drowning, FC = Falling, FD = Trap
/*0027*/ uint8 unknown27[4];
/*0031*/ uint16 unknown31; // New to Underfoot - Seen 66
/*0033*/ uint16 constant; // Always FFFF
@@ -5218,6 +5218,11 @@ struct SayLinkBodyFrame_Struct {
/*056*/
};
struct Checksum_Struct {
uint64_t checksum;
uint8_t data[2048];
};
}; /*structs*/
}; /*RoF2*/
-1
View File
@@ -79,7 +79,6 @@ E(OP_ItemVerifyReply)
E(OP_LeadershipExpUpdate)
E(OP_LogServer)
E(OP_LootItem)
E(OP_ManaChange)
E(OP_MercenaryDataResponse)
E(OP_MercenaryDataUpdate)
E(OP_MoveItem)
+1 -1
View File
@@ -3032,7 +3032,7 @@ struct EnvDamage2_Struct {
/*0006*/ uint32 damage;
/*0010*/ float unknown10; // New to Underfoot - Seen 1
/*0014*/ uint8 unknown14[12];
/*0026*/ uint8 dmgtype; // FA = Lava; FC = Falling
/*0026*/ uint8 dmgtype; // FA = Lava, FB = Drowning, FC = Falling, FD = Trap
/*0027*/ uint8 unknown27[4];
/*0031*/ uint16 unknown31; // New to Underfoot - Seen 66
/*0033*/ uint16 constant; // Always FFFF
-14
View File
@@ -1170,20 +1170,6 @@ namespace SoD
FINISH_ENCODE();
}
ENCODE(OP_ManaChange)
{
ENCODE_LENGTH_EXACT(ManaChange_Struct);
SETUP_DIRECT_ENCODE(ManaChange_Struct, structs::ManaChange_Struct);
OUT(new_mana);
OUT(stamina);
OUT(spell_id);
OUT(keepcasting);
eq->slot = -1; // this is spell gem slot. It's -1 in normal operation
FINISH_ENCODE();
}
ENCODE(OP_MercenaryDataResponse)
{
//consume the packet
-1
View File
@@ -63,7 +63,6 @@ E(OP_ItemVerifyReply)
E(OP_LeadershipExpUpdate)
E(OP_LogServer)
E(OP_LootItem)
E(OP_ManaChange)
E(OP_MercenaryDataResponse)
E(OP_MercenaryDataUpdate)
E(OP_MoveItem)
+1 -1
View File
@@ -2539,7 +2539,7 @@ struct EnvDamage2_Struct {
/*0004*/ uint16 unknown4;
/*0006*/ uint32 damage;
/*0010*/ uint8 unknown10[12];
/*0022*/ uint8 dmgtype; //FA = Lava; FC = Falling
/*0022*/ uint8 dmgtype; // FA = Lava, FB = Drowning, FC = Falling, FD = Trap
/*0023*/ uint8 unknown2[4];
/*0027*/ uint16 constant; //Always FFFF
/*0029*/ uint16 unknown29;
-14
View File
@@ -966,20 +966,6 @@ namespace SoF
FINISH_ENCODE();
}
ENCODE(OP_ManaChange)
{
ENCODE_LENGTH_EXACT(ManaChange_Struct);
SETUP_DIRECT_ENCODE(ManaChange_Struct, structs::ManaChange_Struct);
OUT(new_mana);
OUT(stamina);
OUT(spell_id);
OUT(keepcasting);
eq->slot = -1; // this is spell gem slot. It's -1 in normal operation
FINISH_ENCODE();
}
ENCODE(OP_MemorizeSpell)
{
ENCODE_LENGTH_EXACT(MemorizeSpell_Struct);
-1
View File
@@ -59,7 +59,6 @@ E(OP_ItemVerifyReply)
E(OP_LeadershipExpUpdate)
E(OP_LogServer)
E(OP_LootItem)
E(OP_ManaChange)
E(OP_MemorizeSpell)
E(OP_MoveItem)
E(OP_NewSpawn)
+1 -1
View File
@@ -2509,7 +2509,7 @@ struct EnvDamage2_Struct {
/*0004*/ uint16 unknown4;
/*0006*/ uint32 damage;
/*0010*/ uint8 unknown10[12];
/*0022*/ uint8 dmgtype; //FA = Lava; FC = Falling
/*0022*/ uint8 dmgtype; // FA = Lava, FB = Drowning, FC = Falling, FD = Trap
/*0023*/ uint8 unknown2[4];
/*0027*/ uint16 constant; //Always FFFF
/*0029*/ uint16 unknown29;
+13
View File
@@ -932,6 +932,19 @@ namespace Titanium
FINISH_ENCODE();
}
ENCODE(OP_ManaChange)
{
ENCODE_LENGTH_EXACT(ManaChange_Struct);
SETUP_DIRECT_ENCODE(ManaChange_Struct, structs::ManaChange_Struct);
OUT(new_mana);
OUT(stamina);
OUT(spell_id);
OUT(keepcasting);
FINISH_ENCODE();
}
ENCODE(OP_MemorizeSpell)
{
ENCODE_LENGTH_EXACT(MemorizeSpell_Struct);
+1
View File
@@ -55,6 +55,7 @@ E(OP_ItemPacket)
E(OP_LeadershipExpUpdate)
E(OP_LFGuild)
E(OP_LootItem)
E(OP_ManaChange)
E(OP_MemorizeSpell)
E(OP_MoveItem)
E(OP_OnLevelMessage)
-14
View File
@@ -1390,20 +1390,6 @@ namespace UF
FINISH_ENCODE();
}
ENCODE(OP_ManaChange)
{
ENCODE_LENGTH_EXACT(ManaChange_Struct);
SETUP_DIRECT_ENCODE(ManaChange_Struct, structs::ManaChange_Struct);
OUT(new_mana);
OUT(stamina);
OUT(spell_id);
OUT(keepcasting);
eq->slot = -1; // this is spell gem slot. It's -1 in normal operation
FINISH_ENCODE();
}
ENCODE(OP_MercenaryDataResponse)
{
//consume the packet
-1
View File
@@ -68,7 +68,6 @@ E(OP_ItemVerifyReply)
E(OP_LeadershipExpUpdate)
E(OP_LogServer)
E(OP_LootItem)
E(OP_ManaChange)
E(OP_MercenaryDataResponse)
E(OP_MercenaryDataUpdate)
E(OP_MoveItem)
-3
View File
@@ -221,9 +221,6 @@ XS(XS_EQDB_escape_string)
XSRETURN(1);
}
#ifdef __cplusplus
extern "C"
#endif
XS(boot_EQDB); /* prototype to pass -Wmissing-prototypes */
XS(boot_EQDB)
{
-3
View File
@@ -260,9 +260,6 @@ XS(XS_EQDBRes_fetch_lengths)
XSRETURN(1);
}
#ifdef __cplusplus
extern "C"
#endif
XS(boot_EQDBRes); /* prototype to pass -Wmissing-prototypes */
XS(boot_EQDBRes)
{
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseAaAbilityRepository {
public:
@@ -59,11 +60,36 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"name",
"category",
"classes",
"races",
"drakkin_heritage",
"deities",
"status",
"type",
"charges",
"grant_only",
"first_rank_id",
"enabled",
"reset_on_death",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("aa_ability");
@@ -73,7 +99,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseAaRankEffectsRepository {
public:
@@ -41,11 +42,27 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"rank_id",
"slot",
"effect_id",
"base1",
"base2",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("aa_rank_effects");
@@ -55,7 +72,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseAaRankPrereqsRepository {
public:
@@ -37,11 +38,25 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"rank_id",
"aa_id",
"points",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("aa_rank_prereqs");
@@ -51,7 +66,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseAaRanksRepository {
public:
@@ -57,11 +58,35 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"upper_hotkey_sid",
"lower_hotkey_sid",
"title_sid",
"desc_sid",
"cost",
"level_req",
"spell",
"spell_type",
"recast_time",
"expansion",
"prev_id",
"next_id",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("aa_ranks");
@@ -71,7 +96,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseAccountFlagsRepository {
public:
@@ -37,11 +38,25 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"p_accid",
"p_flag",
"p_value",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("account_flags");
@@ -51,7 +66,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseAccountIpRepository {
public:
@@ -39,11 +40,26 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"accid",
"ip",
"count",
"lastused",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("account_ip");
@@ -53,7 +69,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -74,7 +90,7 @@ public:
entry.accid = 0;
entry.ip = "";
entry.count = 1;
entry.lastused = "";
entry.lastused = std::time(nullptr);
return entry;
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseAccountRepository {
public:
@@ -32,11 +33,14 @@ public:
std::string minilogin_ip;
int hideme;
int rulesflag;
std::string suspendeduntil;
time_t suspendeduntil;
int time_creation;
int expansion;
std::string ban_reason;
std::string suspend_reason;
std::string crc_eqgame;
std::string crc_skillcaps;
std::string crc_basedata;
};
static std::string PrimaryKey()
@@ -66,6 +70,37 @@ public:
"expansion",
"ban_reason",
"suspend_reason",
"crc_eqgame",
"crc_skillcaps",
"crc_basedata",
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"name",
"charname",
"sharedplat",
"password",
"status",
"ls_id",
"lsaccount_id",
"gmspeed",
"revoked",
"karma",
"minilogin_ip",
"hideme",
"rulesflag",
"UNIX_TIMESTAMP(suspendeduntil)",
"time_creation",
"expansion",
"ban_reason",
"suspend_reason",
"crc_eqgame",
"crc_skillcaps",
"crc_basedata",
};
}
@@ -74,6 +109,11 @@ public:
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("account");
@@ -83,7 +123,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -115,11 +155,14 @@ public:
entry.minilogin_ip = "";
entry.hideme = 0;
entry.rulesflag = 0;
entry.suspendeduntil = "0000-00-00 00:00:00";
entry.suspendeduntil = 0;
entry.time_creation = 0;
entry.expansion = 0;
entry.ban_reason = "";
entry.suspend_reason = "";
entry.crc_eqgame = "";
entry.crc_skillcaps = "";
entry.crc_basedata = "";
return entry;
}
@@ -169,11 +212,14 @@ public:
entry.minilogin_ip = row[11] ? row[11] : "";
entry.hideme = atoi(row[12]);
entry.rulesflag = atoi(row[13]);
entry.suspendeduntil = row[14] ? row[14] : "";
entry.suspendeduntil = strtoll(row[14] ? row[14] : "-1", nullptr, 10);
entry.time_creation = atoi(row[15]);
entry.expansion = atoi(row[16]);
entry.ban_reason = row[17] ? row[17] : "";
entry.suspend_reason = row[18] ? row[18] : "";
entry.crc_eqgame = row[19] ? row[19] : "";
entry.crc_skillcaps = row[20] ? row[20] : "";
entry.crc_basedata = row[21] ? row[21] : "";
return entry;
}
@@ -220,11 +266,14 @@ public:
update_values.push_back(columns[11] + " = '" + EscapeString(account_entry.minilogin_ip) + "'");
update_values.push_back(columns[12] + " = " + std::to_string(account_entry.hideme));
update_values.push_back(columns[13] + " = " + std::to_string(account_entry.rulesflag));
update_values.push_back(columns[14] + " = '" + EscapeString(account_entry.suspendeduntil) + "'");
update_values.push_back(columns[14] + " = FROM_UNIXTIME(" + (account_entry.suspendeduntil > 0 ? std::to_string(account_entry.suspendeduntil) : "null") + ")");
update_values.push_back(columns[15] + " = " + std::to_string(account_entry.time_creation));
update_values.push_back(columns[16] + " = " + std::to_string(account_entry.expansion));
update_values.push_back(columns[17] + " = '" + EscapeString(account_entry.ban_reason) + "'");
update_values.push_back(columns[18] + " = '" + EscapeString(account_entry.suspend_reason) + "'");
update_values.push_back(columns[19] + " = '" + EscapeString(account_entry.crc_eqgame) + "'");
update_values.push_back(columns[20] + " = '" + EscapeString(account_entry.crc_skillcaps) + "'");
update_values.push_back(columns[21] + " = '" + EscapeString(account_entry.crc_basedata) + "'");
auto results = db.QueryDatabase(
fmt::format(
@@ -260,11 +309,14 @@ public:
insert_values.push_back("'" + EscapeString(account_entry.minilogin_ip) + "'");
insert_values.push_back(std::to_string(account_entry.hideme));
insert_values.push_back(std::to_string(account_entry.rulesflag));
insert_values.push_back("'" + EscapeString(account_entry.suspendeduntil) + "'");
insert_values.push_back("FROM_UNIXTIME(" + (account_entry.suspendeduntil > 0 ? std::to_string(account_entry.suspendeduntil) : "null") + ")");
insert_values.push_back(std::to_string(account_entry.time_creation));
insert_values.push_back(std::to_string(account_entry.expansion));
insert_values.push_back("'" + EscapeString(account_entry.ban_reason) + "'");
insert_values.push_back("'" + EscapeString(account_entry.suspend_reason) + "'");
insert_values.push_back("'" + EscapeString(account_entry.crc_eqgame) + "'");
insert_values.push_back("'" + EscapeString(account_entry.crc_skillcaps) + "'");
insert_values.push_back("'" + EscapeString(account_entry.crc_basedata) + "'");
auto results = db.QueryDatabase(
fmt::format(
@@ -308,11 +360,14 @@ public:
insert_values.push_back("'" + EscapeString(account_entry.minilogin_ip) + "'");
insert_values.push_back(std::to_string(account_entry.hideme));
insert_values.push_back(std::to_string(account_entry.rulesflag));
insert_values.push_back("'" + EscapeString(account_entry.suspendeduntil) + "'");
insert_values.push_back("FROM_UNIXTIME(" + (account_entry.suspendeduntil > 0 ? std::to_string(account_entry.suspendeduntil) : "null") + ")");
insert_values.push_back(std::to_string(account_entry.time_creation));
insert_values.push_back(std::to_string(account_entry.expansion));
insert_values.push_back("'" + EscapeString(account_entry.ban_reason) + "'");
insert_values.push_back("'" + EscapeString(account_entry.suspend_reason) + "'");
insert_values.push_back("'" + EscapeString(account_entry.crc_eqgame) + "'");
insert_values.push_back("'" + EscapeString(account_entry.crc_skillcaps) + "'");
insert_values.push_back("'" + EscapeString(account_entry.crc_basedata) + "'");
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
}
@@ -360,11 +415,14 @@ public:
entry.minilogin_ip = row[11] ? row[11] : "";
entry.hideme = atoi(row[12]);
entry.rulesflag = atoi(row[13]);
entry.suspendeduntil = row[14] ? row[14] : "";
entry.suspendeduntil = strtoll(row[14] ? row[14] : "-1", nullptr, 10);
entry.time_creation = atoi(row[15]);
entry.expansion = atoi(row[16]);
entry.ban_reason = row[17] ? row[17] : "";
entry.suspend_reason = row[18] ? row[18] : "";
entry.crc_eqgame = row[19] ? row[19] : "";
entry.crc_skillcaps = row[20] ? row[20] : "";
entry.crc_basedata = row[21] ? row[21] : "";
all_entries.push_back(entry);
}
@@ -403,11 +461,14 @@ public:
entry.minilogin_ip = row[11] ? row[11] : "";
entry.hideme = atoi(row[12]);
entry.rulesflag = atoi(row[13]);
entry.suspendeduntil = row[14] ? row[14] : "";
entry.suspendeduntil = strtoll(row[14] ? row[14] : "-1", nullptr, 10);
entry.time_creation = atoi(row[15]);
entry.expansion = atoi(row[16]);
entry.ban_reason = row[17] ? row[17] : "";
entry.suspend_reason = row[18] ? row[18] : "";
entry.crc_eqgame = row[19] ? row[19] : "";
entry.crc_skillcaps = row[20] ? row[20] : "";
entry.crc_basedata = row[21] ? row[21] : "";
all_entries.push_back(entry);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseAccountRewardsRepository {
public:
@@ -37,11 +38,25 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"account_id",
"reward_id",
"amount",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("account_rewards");
@@ -51,7 +66,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseAdventureDetailsRepository {
public:
@@ -49,11 +50,31 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"adventure_id",
"instance_id",
"count",
"assassinate_count",
"status",
"time_created",
"time_zoned",
"time_completed",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("adventure_details");
@@ -63,7 +84,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseAdventureMembersRepository {
public:
@@ -35,11 +36,24 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"charid",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("adventure_members");
@@ -49,7 +63,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseAdventureStatsRepository {
public:
@@ -53,11 +54,33 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"player_id",
"guk_wins",
"mir_wins",
"mmc_wins",
"ruj_wins",
"tak_wins",
"guk_losses",
"mir_losses",
"mmc_losses",
"ruj_losses",
"tak_losses",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("adventure_stats");
@@ -67,7 +90,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseAdventureTemplateEntryFlavorRepository {
public:
@@ -35,11 +36,24 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"text",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("adventure_template_entry_flavor");
@@ -49,7 +63,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseAdventureTemplateEntryRepository {
public:
@@ -35,11 +36,24 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"template_id",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("adventure_template_entry");
@@ -49,7 +63,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseAdventureTemplateRepository {
public:
@@ -97,11 +98,55 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"zone",
"zone_version",
"is_hard",
"is_raid",
"min_level",
"max_level",
"type",
"type_data",
"type_count",
"assa_x",
"assa_y",
"assa_z",
"assa_h",
"text",
"duration",
"zone_in_time",
"win_points",
"lose_points",
"theme",
"zone_in_zone_id",
"zone_in_x",
"zone_in_y",
"zone_in_object_id",
"dest_x",
"dest_y",
"dest_z",
"dest_h",
"graveyard_zone_id",
"graveyard_x",
"graveyard_y",
"graveyard_z",
"graveyard_radius",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("adventure_template");
@@ -111,7 +156,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -148,7 +193,7 @@ public:
entry.zone_in_time = 1800;
entry.win_points = 0;
entry.lose_points = 0;
entry.theme = LDoNThemes::GUK;
entry.theme = 1;
entry.zone_in_zone_id = 0;
entry.zone_in_x = 0;
entry.zone_in_y = 0;
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseAlternateCurrencyRepository {
public:
@@ -35,11 +36,24 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"item_id",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("alternate_currency");
@@ -49,7 +63,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseAurasRepository {
public:
@@ -53,11 +54,33 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"type",
"npc_type",
"name",
"spell_id",
"distance",
"aura_type",
"spawn_type",
"movement",
"duration",
"icon",
"cast_time",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("auras");
@@ -67,7 +90,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseBaseDataRepository {
public:
@@ -51,11 +52,32 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"level",
"`class`",
"hp",
"mana",
"end",
"unk1",
"unk2",
"hp_fac",
"mana_fac",
"end_fac",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("base_data");
@@ -65,7 +87,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseBlockedSpellsRepository {
public:
@@ -55,11 +56,34 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"spellid",
"type",
"zoneid",
"x",
"y",
"z",
"x_diff",
"y_diff",
"z_diff",
"message",
"description",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("blocked_spells");
@@ -69,7 +93,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -0,0 +1,326 @@
/**
* DO NOT MODIFY THIS FILE
*
* This repository was automatically generated and is NOT to be modified directly.
* Any repository modifications are meant to be made to the repository extending the base.
* Any modifications to base repositories are to be made by the generator only
*
* @generator ./utils/scripts/generators/repository-generator.pl
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
*/
#ifndef EQEMU_BASE_BOOKS_REPOSITORY_H
#define EQEMU_BASE_BOOKS_REPOSITORY_H
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseBooksRepository {
public:
struct Books {
int id;
std::string name;
std::string txtfile;
int language;
};
static std::string PrimaryKey()
{
return std::string("id");
}
static std::vector<std::string> Columns()
{
return {
"id",
"name",
"txtfile",
"language",
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"name",
"txtfile",
"language",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("books");
}
static std::string BaseSelect()
{
return fmt::format(
"SELECT {} FROM {}",
SelectColumnsRaw(),
TableName()
);
}
static std::string BaseInsert()
{
return fmt::format(
"INSERT INTO {} ({}) ",
TableName(),
ColumnsRaw()
);
}
static Books NewEntity()
{
Books entry{};
entry.id = 0;
entry.name = "";
entry.txtfile = "";
entry.language = 0;
return entry;
}
static Books GetBooksEntry(
const std::vector<Books> &bookss,
int books_id
)
{
for (auto &books : bookss) {
if (books.id == books_id) {
return books;
}
}
return NewEntity();
}
static Books FindOne(
Database& db,
int books_id
)
{
auto results = db.QueryDatabase(
fmt::format(
"{} WHERE id = {} LIMIT 1",
BaseSelect(),
books_id
)
);
auto row = results.begin();
if (results.RowCount() == 1) {
Books entry{};
entry.id = atoi(row[0]);
entry.name = row[1] ? row[1] : "";
entry.txtfile = row[2] ? row[2] : "";
entry.language = atoi(row[3]);
return entry;
}
return NewEntity();
}
static int DeleteOne(
Database& db,
int books_id
)
{
auto results = db.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {} = {}",
TableName(),
PrimaryKey(),
books_id
)
);
return (results.Success() ? results.RowsAffected() : 0);
}
static int UpdateOne(
Database& db,
Books books_entry
)
{
std::vector<std::string> update_values;
auto columns = Columns();
update_values.push_back(columns[1] + " = '" + EscapeString(books_entry.name) + "'");
update_values.push_back(columns[2] + " = '" + EscapeString(books_entry.txtfile) + "'");
update_values.push_back(columns[3] + " = " + std::to_string(books_entry.language));
auto results = db.QueryDatabase(
fmt::format(
"UPDATE {} SET {} WHERE {} = {}",
TableName(),
implode(", ", update_values),
PrimaryKey(),
books_entry.id
)
);
return (results.Success() ? results.RowsAffected() : 0);
}
static Books InsertOne(
Database& db,
Books books_entry
)
{
std::vector<std::string> insert_values;
insert_values.push_back(std::to_string(books_entry.id));
insert_values.push_back("'" + EscapeString(books_entry.name) + "'");
insert_values.push_back("'" + EscapeString(books_entry.txtfile) + "'");
insert_values.push_back(std::to_string(books_entry.language));
auto results = db.QueryDatabase(
fmt::format(
"{} VALUES ({})",
BaseInsert(),
implode(",", insert_values)
)
);
if (results.Success()) {
books_entry.id = results.LastInsertedID();
return books_entry;
}
books_entry = NewEntity();
return books_entry;
}
static int InsertMany(
Database& db,
std::vector<Books> books_entries
)
{
std::vector<std::string> insert_chunks;
for (auto &books_entry: books_entries) {
std::vector<std::string> insert_values;
insert_values.push_back(std::to_string(books_entry.id));
insert_values.push_back("'" + EscapeString(books_entry.name) + "'");
insert_values.push_back("'" + EscapeString(books_entry.txtfile) + "'");
insert_values.push_back(std::to_string(books_entry.language));
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
}
std::vector<std::string> insert_values;
auto results = db.QueryDatabase(
fmt::format(
"{} VALUES {}",
BaseInsert(),
implode(",", insert_chunks)
)
);
return (results.Success() ? results.RowsAffected() : 0);
}
static std::vector<Books> All(Database& db)
{
std::vector<Books> all_entries;
auto results = db.QueryDatabase(
fmt::format(
"{}",
BaseSelect()
)
);
all_entries.reserve(results.RowCount());
for (auto row = results.begin(); row != results.end(); ++row) {
Books entry{};
entry.id = atoi(row[0]);
entry.name = row[1] ? row[1] : "";
entry.txtfile = row[2] ? row[2] : "";
entry.language = atoi(row[3]);
all_entries.push_back(entry);
}
return all_entries;
}
static std::vector<Books> GetWhere(Database& db, std::string where_filter)
{
std::vector<Books> all_entries;
auto results = db.QueryDatabase(
fmt::format(
"{} WHERE {}",
BaseSelect(),
where_filter
)
);
all_entries.reserve(results.RowCount());
for (auto row = results.begin(); row != results.end(); ++row) {
Books entry{};
entry.id = atoi(row[0]);
entry.name = row[1] ? row[1] : "";
entry.txtfile = row[2] ? row[2] : "";
entry.language = atoi(row[3]);
all_entries.push_back(entry);
}
return all_entries;
}
static int DeleteWhere(Database& db, std::string where_filter)
{
auto results = db.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {}",
TableName(),
where_filter
)
);
return (results.Success() ? results.RowsAffected() : 0);
}
static int Truncate(Database& db)
{
auto results = db.QueryDatabase(
fmt::format(
"TRUNCATE TABLE {}",
TableName()
)
);
return (results.Success() ? results.RowsAffected() : 0);
}
};
#endif //EQEMU_BASE_BOOKS_REPOSITORY_H
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseBugReportsRepository {
public:
@@ -45,9 +46,9 @@ public:
int _unknown_value;
std::string bug_report;
std::string system_info;
std::string report_datetime;
time_t report_datetime;
int bug_status;
std::string last_review;
time_t last_review;
std::string last_reviewer;
std::string reviewer_notes;
};
@@ -95,11 +96,54 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"zone",
"client_version_id",
"client_version_name",
"account_id",
"character_id",
"character_name",
"reporter_spoof",
"category_id",
"category_name",
"reporter_name",
"ui_path",
"pos_x",
"pos_y",
"pos_z",
"heading",
"time_played",
"target_id",
"target_name",
"optional_info_mask",
"_can_duplicate",
"_crash_bug",
"_target_info",
"_character_flags",
"_unknown_value",
"bug_report",
"system_info",
"UNIX_TIMESTAMP(report_datetime)",
"bug_status",
"UNIX_TIMESTAMP(last_review)",
"last_reviewer",
"reviewer_notes",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("bug_reports");
@@ -109,7 +153,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -154,9 +198,9 @@ public:
entry._unknown_value = 0;
entry.bug_report = "";
entry.system_info = "";
entry.report_datetime = "";
entry.report_datetime = std::time(nullptr);
entry.bug_status = 0;
entry.last_review = "";
entry.last_review = std::time(nullptr);
entry.last_reviewer = "None";
entry.reviewer_notes = "";
@@ -221,9 +265,9 @@ public:
entry._unknown_value = atoi(row[24]);
entry.bug_report = row[25] ? row[25] : "";
entry.system_info = row[26] ? row[26] : "";
entry.report_datetime = row[27] ? row[27] : "";
entry.report_datetime = strtoll(row[27] ? row[27] : "-1", nullptr, 10);
entry.bug_status = atoi(row[28]);
entry.last_review = row[29] ? row[29] : "";
entry.last_review = strtoll(row[29] ? row[29] : "-1", nullptr, 10);
entry.last_reviewer = row[30] ? row[30] : "";
entry.reviewer_notes = row[31] ? row[31] : "";
@@ -285,9 +329,9 @@ public:
update_values.push_back(columns[24] + " = " + std::to_string(bug_reports_entry._unknown_value));
update_values.push_back(columns[25] + " = '" + EscapeString(bug_reports_entry.bug_report) + "'");
update_values.push_back(columns[26] + " = '" + EscapeString(bug_reports_entry.system_info) + "'");
update_values.push_back(columns[27] + " = '" + EscapeString(bug_reports_entry.report_datetime) + "'");
update_values.push_back(columns[27] + " = FROM_UNIXTIME(" + (bug_reports_entry.report_datetime > 0 ? std::to_string(bug_reports_entry.report_datetime) : "null") + ")");
update_values.push_back(columns[28] + " = " + std::to_string(bug_reports_entry.bug_status));
update_values.push_back(columns[29] + " = '" + EscapeString(bug_reports_entry.last_review) + "'");
update_values.push_back(columns[29] + " = FROM_UNIXTIME(" + (bug_reports_entry.last_review > 0 ? std::to_string(bug_reports_entry.last_review) : "null") + ")");
update_values.push_back(columns[30] + " = '" + EscapeString(bug_reports_entry.last_reviewer) + "'");
update_values.push_back(columns[31] + " = '" + EscapeString(bug_reports_entry.reviewer_notes) + "'");
@@ -338,9 +382,9 @@ public:
insert_values.push_back(std::to_string(bug_reports_entry._unknown_value));
insert_values.push_back("'" + EscapeString(bug_reports_entry.bug_report) + "'");
insert_values.push_back("'" + EscapeString(bug_reports_entry.system_info) + "'");
insert_values.push_back("'" + EscapeString(bug_reports_entry.report_datetime) + "'");
insert_values.push_back("FROM_UNIXTIME(" + (bug_reports_entry.report_datetime > 0 ? std::to_string(bug_reports_entry.report_datetime) : "null") + ")");
insert_values.push_back(std::to_string(bug_reports_entry.bug_status));
insert_values.push_back("'" + EscapeString(bug_reports_entry.last_review) + "'");
insert_values.push_back("FROM_UNIXTIME(" + (bug_reports_entry.last_review > 0 ? std::to_string(bug_reports_entry.last_review) : "null") + ")");
insert_values.push_back("'" + EscapeString(bug_reports_entry.last_reviewer) + "'");
insert_values.push_back("'" + EscapeString(bug_reports_entry.reviewer_notes) + "'");
@@ -399,9 +443,9 @@ public:
insert_values.push_back(std::to_string(bug_reports_entry._unknown_value));
insert_values.push_back("'" + EscapeString(bug_reports_entry.bug_report) + "'");
insert_values.push_back("'" + EscapeString(bug_reports_entry.system_info) + "'");
insert_values.push_back("'" + EscapeString(bug_reports_entry.report_datetime) + "'");
insert_values.push_back("FROM_UNIXTIME(" + (bug_reports_entry.report_datetime > 0 ? std::to_string(bug_reports_entry.report_datetime) : "null") + ")");
insert_values.push_back(std::to_string(bug_reports_entry.bug_status));
insert_values.push_back("'" + EscapeString(bug_reports_entry.last_review) + "'");
insert_values.push_back("FROM_UNIXTIME(" + (bug_reports_entry.last_review > 0 ? std::to_string(bug_reports_entry.last_review) : "null") + ")");
insert_values.push_back("'" + EscapeString(bug_reports_entry.last_reviewer) + "'");
insert_values.push_back("'" + EscapeString(bug_reports_entry.reviewer_notes) + "'");
@@ -464,9 +508,9 @@ public:
entry._unknown_value = atoi(row[24]);
entry.bug_report = row[25] ? row[25] : "";
entry.system_info = row[26] ? row[26] : "";
entry.report_datetime = row[27] ? row[27] : "";
entry.report_datetime = strtoll(row[27] ? row[27] : "-1", nullptr, 10);
entry.bug_status = atoi(row[28]);
entry.last_review = row[29] ? row[29] : "";
entry.last_review = strtoll(row[29] ? row[29] : "-1", nullptr, 10);
entry.last_reviewer = row[30] ? row[30] : "";
entry.reviewer_notes = row[31] ? row[31] : "";
@@ -520,9 +564,9 @@ public:
entry._unknown_value = atoi(row[24]);
entry.bug_report = row[25] ? row[25] : "";
entry.system_info = row[26] ? row[26] : "";
entry.report_datetime = row[27] ? row[27] : "";
entry.report_datetime = strtoll(row[27] ? row[27] : "-1", nullptr, 10);
entry.bug_status = atoi(row[28]);
entry.last_review = row[29] ? row[29] : "";
entry.last_review = strtoll(row[29] ? row[29] : "-1", nullptr, 10);
entry.last_reviewer = row[30] ? row[30] : "";
entry.reviewer_notes = row[31] ? row[31] : "";
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseBugsRepository {
public:
@@ -57,11 +58,35 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"zone",
"name",
"ui",
"x",
"y",
"z",
"type",
"flag",
"target",
"bug",
"date",
"status",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("bugs");
@@ -71,7 +96,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseBuyerRepository {
public:
@@ -43,11 +44,28 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"charid",
"buyslot",
"itemid",
"itemname",
"quantity",
"price",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("buyer");
@@ -57,7 +75,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseCharCreateCombinationsRepository {
public:
@@ -43,11 +44,28 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"allocation_id",
"race",
"`class`",
"deity",
"start_zone",
"expansions_req",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("char_create_combinations");
@@ -57,7 +75,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseCharCreatePointAllocationsRepository {
public:
@@ -61,11 +62,37 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"base_str",
"base_sta",
"base_dex",
"base_agi",
"base_int",
"base_wis",
"base_cha",
"alloc_str",
"alloc_sta",
"alloc_dex",
"alloc_agi",
"alloc_int",
"alloc_wis",
"alloc_cha",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("char_create_point_allocations");
@@ -75,7 +102,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseCharRecipeListRepository {
public:
@@ -37,11 +38,25 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"char_id",
"recipe_id",
"madecount",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("char_recipe_list");
@@ -51,7 +66,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseCharacterActivitiesRepository {
public:
@@ -41,11 +42,27 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"charid",
"taskid",
"activityid",
"donecount",
"completed",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("character_activities");
@@ -55,7 +72,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseCharacterAltCurrencyRepository {
public:
@@ -37,11 +38,25 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"char_id",
"currency_id",
"amount",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("character_alt_currency");
@@ -51,7 +66,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseCharacterAlternateAbilitiesRepository {
public:
@@ -39,11 +40,26 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"aa_id",
"aa_value",
"charges",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("character_alternate_abilities");
@@ -53,7 +69,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseCharacterAurasRepository {
public:
@@ -37,11 +38,25 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"slot",
"spell_id",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("character_auras");
@@ -51,7 +66,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseCharacterBandolierRepository {
public:
@@ -43,11 +44,28 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"bandolier_id",
"bandolier_slot",
"item_id",
"icon",
"bandolier_name",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("character_bandolier");
@@ -57,7 +75,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseCharacterBindRepository {
public:
@@ -47,11 +48,30 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"slot",
"zone_id",
"instance_id",
"x",
"y",
"z",
"heading",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("character_bind");
@@ -61,7 +81,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseCharacterBuffsRepository {
public:
@@ -65,11 +66,39 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"character_id",
"slot_id",
"spell_id",
"caster_level",
"caster_name",
"ticsremaining",
"counters",
"numhits",
"melee_rune",
"magic_rune",
"persistent",
"dot_rune",
"caston_x",
"caston_y",
"caston_z",
"ExtraDIChance",
"instrument_mod",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("character_buffs");
@@ -79,7 +108,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseCharacterCorpseItemsRepository {
public:
@@ -53,11 +54,33 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"corpse_id",
"equip_slot",
"item_id",
"charges",
"aug_1",
"aug_2",
"aug_3",
"aug_4",
"aug_5",
"aug_6",
"attuned",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("character_corpse_items");
@@ -67,7 +90,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseCharacterCorpsesRepository {
public:
@@ -27,7 +28,7 @@ public:
float y;
float z;
float heading;
std::string time_of_death;
time_t time_of_death;
int guild_consent_id;
int is_rezzed;
int is_buried;
@@ -125,11 +126,69 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"charid",
"charname",
"zone_id",
"instance_id",
"x",
"y",
"z",
"heading",
"UNIX_TIMESTAMP(time_of_death)",
"guild_consent_id",
"is_rezzed",
"is_buried",
"was_at_graveyard",
"is_locked",
"exp",
"size",
"level",
"race",
"gender",
"`class`",
"deity",
"texture",
"helm_texture",
"copper",
"silver",
"gold",
"platinum",
"hair_color",
"beard_color",
"eye_color_1",
"eye_color_2",
"hair_style",
"face",
"beard",
"drakkin_heritage",
"drakkin_tattoo",
"drakkin_details",
"wc_1",
"wc_2",
"wc_3",
"wc_4",
"wc_5",
"wc_6",
"wc_7",
"wc_8",
"wc_9",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("character_corpses");
@@ -139,7 +198,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -166,7 +225,7 @@ public:
entry.y = 0;
entry.z = 0;
entry.heading = 0;
entry.time_of_death = "0000-00-00 00:00:00";
entry.time_of_death = 0;
entry.guild_consent_id = 0;
entry.is_rezzed = 0;
entry.is_buried = 0;
@@ -248,7 +307,7 @@ public:
entry.y = static_cast<float>(atof(row[6]));
entry.z = static_cast<float>(atof(row[7]));
entry.heading = static_cast<float>(atof(row[8]));
entry.time_of_death = row[9] ? row[9] : "";
entry.time_of_death = strtoll(row[9] ? row[9] : "-1", nullptr, 10);
entry.guild_consent_id = atoi(row[10]);
entry.is_rezzed = atoi(row[11]);
entry.is_buried = atoi(row[12]);
@@ -327,7 +386,7 @@ public:
update_values.push_back(columns[6] + " = " + std::to_string(character_corpses_entry.y));
update_values.push_back(columns[7] + " = " + std::to_string(character_corpses_entry.z));
update_values.push_back(columns[8] + " = " + std::to_string(character_corpses_entry.heading));
update_values.push_back(columns[9] + " = '" + EscapeString(character_corpses_entry.time_of_death) + "'");
update_values.push_back(columns[9] + " = FROM_UNIXTIME(" + (character_corpses_entry.time_of_death > 0 ? std::to_string(character_corpses_entry.time_of_death) : "null") + ")");
update_values.push_back(columns[10] + " = " + std::to_string(character_corpses_entry.guild_consent_id));
update_values.push_back(columns[11] + " = " + std::to_string(character_corpses_entry.is_rezzed));
update_values.push_back(columns[12] + " = " + std::to_string(character_corpses_entry.is_buried));
@@ -395,7 +454,7 @@ public:
insert_values.push_back(std::to_string(character_corpses_entry.y));
insert_values.push_back(std::to_string(character_corpses_entry.z));
insert_values.push_back(std::to_string(character_corpses_entry.heading));
insert_values.push_back("'" + EscapeString(character_corpses_entry.time_of_death) + "'");
insert_values.push_back("FROM_UNIXTIME(" + (character_corpses_entry.time_of_death > 0 ? std::to_string(character_corpses_entry.time_of_death) : "null") + ")");
insert_values.push_back(std::to_string(character_corpses_entry.guild_consent_id));
insert_values.push_back(std::to_string(character_corpses_entry.is_rezzed));
insert_values.push_back(std::to_string(character_corpses_entry.is_buried));
@@ -471,7 +530,7 @@ public:
insert_values.push_back(std::to_string(character_corpses_entry.y));
insert_values.push_back(std::to_string(character_corpses_entry.z));
insert_values.push_back(std::to_string(character_corpses_entry.heading));
insert_values.push_back("'" + EscapeString(character_corpses_entry.time_of_death) + "'");
insert_values.push_back("FROM_UNIXTIME(" + (character_corpses_entry.time_of_death > 0 ? std::to_string(character_corpses_entry.time_of_death) : "null") + ")");
insert_values.push_back(std::to_string(character_corpses_entry.guild_consent_id));
insert_values.push_back(std::to_string(character_corpses_entry.is_rezzed));
insert_values.push_back(std::to_string(character_corpses_entry.is_buried));
@@ -551,7 +610,7 @@ public:
entry.y = static_cast<float>(atof(row[6]));
entry.z = static_cast<float>(atof(row[7]));
entry.heading = static_cast<float>(atof(row[8]));
entry.time_of_death = row[9] ? row[9] : "";
entry.time_of_death = strtoll(row[9] ? row[9] : "-1", nullptr, 10);
entry.guild_consent_id = atoi(row[10]);
entry.is_rezzed = atoi(row[11]);
entry.is_buried = atoi(row[12]);
@@ -622,7 +681,7 @@ public:
entry.y = static_cast<float>(atof(row[6]));
entry.z = static_cast<float>(atof(row[7]));
entry.heading = static_cast<float>(atof(row[8]));
entry.time_of_death = row[9] ? row[9] : "";
entry.time_of_death = strtoll(row[9] ? row[9] : "-1", nullptr, 10);
entry.guild_consent_id = atoi(row[10]);
entry.is_rezzed = atoi(row[11]);
entry.is_buried = atoi(row[12]);
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseCharacterCurrencyRepository {
public:
@@ -65,11 +66,39 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"platinum",
"gold",
"silver",
"copper",
"platinum_bank",
"gold_bank",
"silver_bank",
"copper_bank",
"platinum_cursor",
"gold_cursor",
"silver_cursor",
"copper_cursor",
"radiant_crystals",
"career_radiant_crystals",
"ebon_crystals",
"career_ebon_crystals",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("character_currency");
@@ -79,7 +108,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseCharacterDataRepository {
public:
@@ -119,7 +120,7 @@ public:
int aa_points_spent_old;
int aa_points_old;
int e_last_invsnapshot;
std::string deleted_at;
time_t deleted_at;
};
static std::string PrimaryKey()
@@ -235,11 +236,124 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"account_id",
"name",
"last_name",
"title",
"suffix",
"zone_id",
"zone_instance",
"y",
"x",
"z",
"heading",
"gender",
"race",
"`class`",
"level",
"deity",
"birthday",
"last_login",
"time_played",
"level2",
"anon",
"gm",
"face",
"hair_color",
"hair_style",
"beard",
"beard_color",
"eye_color_1",
"eye_color_2",
"drakkin_heritage",
"drakkin_tattoo",
"drakkin_details",
"ability_time_seconds",
"ability_number",
"ability_time_minutes",
"ability_time_hours",
"exp",
"aa_points_spent",
"aa_exp",
"aa_points",
"group_leadership_exp",
"raid_leadership_exp",
"group_leadership_points",
"raid_leadership_points",
"points",
"cur_hp",
"mana",
"endurance",
"intoxication",
"str",
"sta",
"cha",
"dex",
"`int`",
"agi",
"wis",
"zone_change_count",
"toxicity",
"hunger_level",
"thirst_level",
"ability_up",
"ldon_points_guk",
"ldon_points_mir",
"ldon_points_mmc",
"ldon_points_ruj",
"ldon_points_tak",
"ldon_points_available",
"tribute_time_remaining",
"career_tribute_points",
"tribute_points",
"tribute_active",
"pvp_status",
"pvp_kills",
"pvp_deaths",
"pvp_current_points",
"pvp_career_points",
"pvp_best_kill_streak",
"pvp_worst_death_streak",
"pvp_current_kill_streak",
"pvp2",
"pvp_type",
"show_helm",
"group_auto_consent",
"raid_auto_consent",
"guild_auto_consent",
"leadership_exp_on",
"RestTimer",
"air_remaining",
"autosplit_enabled",
"lfp",
"lfg",
"mailkey",
"xtargets",
"firstlogon",
"e_aa_effects",
"e_percent_to_aa",
"e_expended_aa_spent",
"aa_points_spent_old",
"aa_points_old",
"e_last_invsnapshot",
"UNIX_TIMESTAMP(deleted_at)",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("character_data");
@@ -249,7 +363,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -368,7 +482,7 @@ public:
entry.aa_points_spent_old = 0;
entry.aa_points_old = 0;
entry.e_last_invsnapshot = 0;
entry.deleted_at = "";
entry.deleted_at = 0;
return entry;
}
@@ -505,7 +619,7 @@ public:
entry.aa_points_spent_old = atoi(row[98]);
entry.aa_points_old = atoi(row[99]);
entry.e_last_invsnapshot = atoi(row[100]);
entry.deleted_at = row[101] ? row[101] : "";
entry.deleted_at = strtoll(row[101] ? row[101] : "-1", nullptr, 10);
return entry;
}
@@ -639,7 +753,7 @@ public:
update_values.push_back(columns[98] + " = " + std::to_string(character_data_entry.aa_points_spent_old));
update_values.push_back(columns[99] + " = " + std::to_string(character_data_entry.aa_points_old));
update_values.push_back(columns[100] + " = " + std::to_string(character_data_entry.e_last_invsnapshot));
update_values.push_back(columns[101] + " = '" + EscapeString(character_data_entry.deleted_at) + "'");
update_values.push_back(columns[101] + " = FROM_UNIXTIME(" + (character_data_entry.deleted_at > 0 ? std::to_string(character_data_entry.deleted_at) : "null") + ")");
auto results = db.QueryDatabase(
fmt::format(
@@ -762,7 +876,7 @@ public:
insert_values.push_back(std::to_string(character_data_entry.aa_points_spent_old));
insert_values.push_back(std::to_string(character_data_entry.aa_points_old));
insert_values.push_back(std::to_string(character_data_entry.e_last_invsnapshot));
insert_values.push_back("'" + EscapeString(character_data_entry.deleted_at) + "'");
insert_values.push_back("FROM_UNIXTIME(" + (character_data_entry.deleted_at > 0 ? std::to_string(character_data_entry.deleted_at) : "null") + ")");
auto results = db.QueryDatabase(
fmt::format(
@@ -893,7 +1007,7 @@ public:
insert_values.push_back(std::to_string(character_data_entry.aa_points_spent_old));
insert_values.push_back(std::to_string(character_data_entry.aa_points_old));
insert_values.push_back(std::to_string(character_data_entry.e_last_invsnapshot));
insert_values.push_back("'" + EscapeString(character_data_entry.deleted_at) + "'");
insert_values.push_back("FROM_UNIXTIME(" + (character_data_entry.deleted_at > 0 ? std::to_string(character_data_entry.deleted_at) : "null") + ")");
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
}
@@ -1028,7 +1142,7 @@ public:
entry.aa_points_spent_old = atoi(row[98]);
entry.aa_points_old = atoi(row[99]);
entry.e_last_invsnapshot = atoi(row[100]);
entry.deleted_at = row[101] ? row[101] : "";
entry.deleted_at = strtoll(row[101] ? row[101] : "-1", nullptr, 10);
all_entries.push_back(entry);
}
@@ -1154,7 +1268,7 @@ public:
entry.aa_points_spent_old = atoi(row[98]);
entry.aa_points_old = atoi(row[99]);
entry.e_last_invsnapshot = atoi(row[100]);
entry.deleted_at = row[101] ? row[101] : "";
entry.deleted_at = strtoll(row[101] ? row[101] : "-1", nullptr, 10);
all_entries.push_back(entry);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseCharacterDisciplinesRepository {
public:
@@ -37,11 +38,25 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"slot_id",
"disc_id",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("character_disciplines");
@@ -51,7 +66,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -0,0 +1,327 @@
/**
* DO NOT MODIFY THIS FILE
*
* This repository was automatically generated and is NOT to be modified directly.
* Any repository modifications are meant to be made to the repository extending the base.
* Any modifications to base repositories are to be made by the generator only
*
* @generator ./utils/scripts/generators/repository-generator.pl
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
*/
#ifndef EQEMU_BASE_CHARACTER_EXP_MODIFIERS_REPOSITORY_H
#define EQEMU_BASE_CHARACTER_EXP_MODIFIERS_REPOSITORY_H
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseCharacterExpModifiersRepository {
public:
struct CharacterExpModifiers {
int character_id;
int zone_id;
float aa_modifier;
float exp_modifier;
};
static std::string PrimaryKey()
{
return std::string("character_id");
}
static std::vector<std::string> Columns()
{
return {
"character_id",
"zone_id",
"aa_modifier",
"exp_modifier",
};
}
static std::vector<std::string> SelectColumns()
{
return {
"character_id",
"zone_id",
"aa_modifier",
"exp_modifier",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("character_exp_modifiers");
}
static std::string BaseSelect()
{
return fmt::format(
"SELECT {} FROM {}",
SelectColumnsRaw(),
TableName()
);
}
static std::string BaseInsert()
{
return fmt::format(
"INSERT INTO {} ({}) ",
TableName(),
ColumnsRaw()
);
}
static CharacterExpModifiers NewEntity()
{
CharacterExpModifiers entry{};
entry.character_id = 0;
entry.zone_id = 0;
entry.aa_modifier = 0;
entry.exp_modifier = 0;
return entry;
}
static CharacterExpModifiers GetCharacterExpModifiersEntry(
const std::vector<CharacterExpModifiers> &character_exp_modifierss,
int character_exp_modifiers_id
)
{
for (auto &character_exp_modifiers : character_exp_modifierss) {
if (character_exp_modifiers.character_id == character_exp_modifiers_id) {
return character_exp_modifiers;
}
}
return NewEntity();
}
static CharacterExpModifiers FindOne(
Database& db,
int character_exp_modifiers_id
)
{
auto results = db.QueryDatabase(
fmt::format(
"{} WHERE id = {} LIMIT 1",
BaseSelect(),
character_exp_modifiers_id
)
);
auto row = results.begin();
if (results.RowCount() == 1) {
CharacterExpModifiers entry{};
entry.character_id = atoi(row[0]);
entry.zone_id = atoi(row[1]);
entry.aa_modifier = static_cast<float>(atof(row[2]));
entry.exp_modifier = static_cast<float>(atof(row[3]));
return entry;
}
return NewEntity();
}
static int DeleteOne(
Database& db,
int character_exp_modifiers_id
)
{
auto results = db.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {} = {}",
TableName(),
PrimaryKey(),
character_exp_modifiers_id
)
);
return (results.Success() ? results.RowsAffected() : 0);
}
static int UpdateOne(
Database& db,
CharacterExpModifiers character_exp_modifiers_entry
)
{
std::vector<std::string> update_values;
auto columns = Columns();
update_values.push_back(columns[0] + " = " + std::to_string(character_exp_modifiers_entry.character_id));
update_values.push_back(columns[1] + " = " + std::to_string(character_exp_modifiers_entry.zone_id));
update_values.push_back(columns[2] + " = " + std::to_string(character_exp_modifiers_entry.aa_modifier));
update_values.push_back(columns[3] + " = " + std::to_string(character_exp_modifiers_entry.exp_modifier));
auto results = db.QueryDatabase(
fmt::format(
"UPDATE {} SET {} WHERE {} = {}",
TableName(),
implode(", ", update_values),
PrimaryKey(),
character_exp_modifiers_entry.character_id
)
);
return (results.Success() ? results.RowsAffected() : 0);
}
static CharacterExpModifiers InsertOne(
Database& db,
CharacterExpModifiers character_exp_modifiers_entry
)
{
std::vector<std::string> insert_values;
insert_values.push_back(std::to_string(character_exp_modifiers_entry.character_id));
insert_values.push_back(std::to_string(character_exp_modifiers_entry.zone_id));
insert_values.push_back(std::to_string(character_exp_modifiers_entry.aa_modifier));
insert_values.push_back(std::to_string(character_exp_modifiers_entry.exp_modifier));
auto results = db.QueryDatabase(
fmt::format(
"{} VALUES ({})",
BaseInsert(),
implode(",", insert_values)
)
);
if (results.Success()) {
character_exp_modifiers_entry.character_id = results.LastInsertedID();
return character_exp_modifiers_entry;
}
character_exp_modifiers_entry = NewEntity();
return character_exp_modifiers_entry;
}
static int InsertMany(
Database& db,
std::vector<CharacterExpModifiers> character_exp_modifiers_entries
)
{
std::vector<std::string> insert_chunks;
for (auto &character_exp_modifiers_entry: character_exp_modifiers_entries) {
std::vector<std::string> insert_values;
insert_values.push_back(std::to_string(character_exp_modifiers_entry.character_id));
insert_values.push_back(std::to_string(character_exp_modifiers_entry.zone_id));
insert_values.push_back(std::to_string(character_exp_modifiers_entry.aa_modifier));
insert_values.push_back(std::to_string(character_exp_modifiers_entry.exp_modifier));
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
}
std::vector<std::string> insert_values;
auto results = db.QueryDatabase(
fmt::format(
"{} VALUES {}",
BaseInsert(),
implode(",", insert_chunks)
)
);
return (results.Success() ? results.RowsAffected() : 0);
}
static std::vector<CharacterExpModifiers> All(Database& db)
{
std::vector<CharacterExpModifiers> all_entries;
auto results = db.QueryDatabase(
fmt::format(
"{}",
BaseSelect()
)
);
all_entries.reserve(results.RowCount());
for (auto row = results.begin(); row != results.end(); ++row) {
CharacterExpModifiers entry{};
entry.character_id = atoi(row[0]);
entry.zone_id = atoi(row[1]);
entry.aa_modifier = static_cast<float>(atof(row[2]));
entry.exp_modifier = static_cast<float>(atof(row[3]));
all_entries.push_back(entry);
}
return all_entries;
}
static std::vector<CharacterExpModifiers> GetWhere(Database& db, std::string where_filter)
{
std::vector<CharacterExpModifiers> all_entries;
auto results = db.QueryDatabase(
fmt::format(
"{} WHERE {}",
BaseSelect(),
where_filter
)
);
all_entries.reserve(results.RowCount());
for (auto row = results.begin(); row != results.end(); ++row) {
CharacterExpModifiers entry{};
entry.character_id = atoi(row[0]);
entry.zone_id = atoi(row[1]);
entry.aa_modifier = static_cast<float>(atof(row[2]));
entry.exp_modifier = static_cast<float>(atof(row[3]));
all_entries.push_back(entry);
}
return all_entries;
}
static int DeleteWhere(Database& db, std::string where_filter)
{
auto results = db.QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {}",
TableName(),
where_filter
)
);
return (results.Success() ? results.RowsAffected() : 0);
}
static int Truncate(Database& db)
{
auto results = db.QueryDatabase(
fmt::format(
"TRUNCATE TABLE {}",
TableName()
)
);
return (results.Success() ? results.RowsAffected() : 0);
}
};
#endif //EQEMU_BASE_CHARACTER_EXP_MODIFIERS_REPOSITORY_H
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseCharacterExpeditionLockoutsRepository {
public:
@@ -22,7 +23,7 @@ public:
int character_id;
std::string expedition_name;
std::string event_name;
std::string expire_time;
time_t expire_time;
int duration;
std::string from_expedition_uuid;
};
@@ -45,11 +46,29 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"character_id",
"expedition_name",
"event_name",
"UNIX_TIMESTAMP(expire_time)",
"duration",
"from_expedition_uuid",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("character_expedition_lockouts");
@@ -59,7 +78,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -81,7 +100,7 @@ public:
entry.character_id = 0;
entry.expedition_name = "";
entry.event_name = "";
entry.expire_time = "";
entry.expire_time = std::time(nullptr);
entry.duration = 0;
entry.from_expedition_uuid = "";
@@ -123,7 +142,7 @@ public:
entry.character_id = atoi(row[1]);
entry.expedition_name = row[2] ? row[2] : "";
entry.event_name = row[3] ? row[3] : "";
entry.expire_time = row[4] ? row[4] : "";
entry.expire_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10);
entry.duration = atoi(row[5]);
entry.from_expedition_uuid = row[6] ? row[6] : "";
@@ -162,7 +181,7 @@ public:
update_values.push_back(columns[1] + " = " + std::to_string(character_expedition_lockouts_entry.character_id));
update_values.push_back(columns[2] + " = '" + EscapeString(character_expedition_lockouts_entry.expedition_name) + "'");
update_values.push_back(columns[3] + " = '" + EscapeString(character_expedition_lockouts_entry.event_name) + "'");
update_values.push_back(columns[4] + " = '" + EscapeString(character_expedition_lockouts_entry.expire_time) + "'");
update_values.push_back(columns[4] + " = FROM_UNIXTIME(" + (character_expedition_lockouts_entry.expire_time > 0 ? std::to_string(character_expedition_lockouts_entry.expire_time) : "null") + ")");
update_values.push_back(columns[5] + " = " + std::to_string(character_expedition_lockouts_entry.duration));
update_values.push_back(columns[6] + " = '" + EscapeString(character_expedition_lockouts_entry.from_expedition_uuid) + "'");
@@ -190,7 +209,7 @@ public:
insert_values.push_back(std::to_string(character_expedition_lockouts_entry.character_id));
insert_values.push_back("'" + EscapeString(character_expedition_lockouts_entry.expedition_name) + "'");
insert_values.push_back("'" + EscapeString(character_expedition_lockouts_entry.event_name) + "'");
insert_values.push_back("'" + EscapeString(character_expedition_lockouts_entry.expire_time) + "'");
insert_values.push_back("FROM_UNIXTIME(" + (character_expedition_lockouts_entry.expire_time > 0 ? std::to_string(character_expedition_lockouts_entry.expire_time) : "null") + ")");
insert_values.push_back(std::to_string(character_expedition_lockouts_entry.duration));
insert_values.push_back("'" + EscapeString(character_expedition_lockouts_entry.from_expedition_uuid) + "'");
@@ -226,7 +245,7 @@ public:
insert_values.push_back(std::to_string(character_expedition_lockouts_entry.character_id));
insert_values.push_back("'" + EscapeString(character_expedition_lockouts_entry.expedition_name) + "'");
insert_values.push_back("'" + EscapeString(character_expedition_lockouts_entry.event_name) + "'");
insert_values.push_back("'" + EscapeString(character_expedition_lockouts_entry.expire_time) + "'");
insert_values.push_back("FROM_UNIXTIME(" + (character_expedition_lockouts_entry.expire_time > 0 ? std::to_string(character_expedition_lockouts_entry.expire_time) : "null") + ")");
insert_values.push_back(std::to_string(character_expedition_lockouts_entry.duration));
insert_values.push_back("'" + EscapeString(character_expedition_lockouts_entry.from_expedition_uuid) + "'");
@@ -266,7 +285,7 @@ public:
entry.character_id = atoi(row[1]);
entry.expedition_name = row[2] ? row[2] : "";
entry.event_name = row[3] ? row[3] : "";
entry.expire_time = row[4] ? row[4] : "";
entry.expire_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10);
entry.duration = atoi(row[5]);
entry.from_expedition_uuid = row[6] ? row[6] : "";
@@ -297,7 +316,7 @@ public:
entry.character_id = atoi(row[1]);
entry.expedition_name = row[2] ? row[2] : "";
entry.event_name = row[3] ? row[3] : "";
entry.expire_time = row[4] ? row[4] : "";
entry.expire_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10);
entry.duration = atoi(row[5]);
entry.from_expedition_uuid = row[6] ? row[6] : "";
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseCharacterInspectMessagesRepository {
public:
@@ -35,11 +36,24 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"inspect_message",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("character_inspect_messages");
@@ -49,7 +63,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseCharacterInstanceSafereturnsRepository {
public:
@@ -49,11 +50,31 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"character_id",
"instance_zone_id",
"instance_id",
"safe_zone_id",
"safe_x",
"safe_y",
"safe_z",
"safe_heading",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("character_instance_safereturns");
@@ -63,7 +84,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseCharacterItemRecastRepository {
public:
@@ -37,11 +38,25 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"recast_type",
"timestamp",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("character_item_recast");
@@ -51,7 +66,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseCharacterLanguagesRepository {
public:
@@ -37,11 +38,25 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"lang_id",
"value",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("character_languages");
@@ -51,7 +66,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseCharacterLeadershipAbilitiesRepository {
public:
@@ -37,11 +38,25 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"slot",
"rank",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("character_leadership_abilities");
@@ -51,7 +66,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseCharacterMaterialRepository {
public:
@@ -45,11 +46,29 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"slot",
"blue",
"green",
"red",
"use_tint",
"color",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("character_material");
@@ -59,7 +78,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseCharacterMemmedSpellsRepository {
public:
@@ -37,11 +38,25 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"id",
"slot_id",
"spell_id",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("character_memmed_spells");
@@ -51,7 +66,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseCharacterPetBuffsRepository {
public:
@@ -53,11 +54,33 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"char_id",
"pet",
"slot",
"spell_id",
"caster_level",
"castername",
"ticsremaining",
"counters",
"numhits",
"rune",
"instrument_mod",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("character_pet_buffs");
@@ -67,7 +90,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}

Some files were not shown because too many files have changed in this diff Show More