11661 Commits

Author SHA1 Message Date
Chris Miles
d7a8fb8691
[Fix] Fix manifest for skill caps schema type (#4231) 2024-04-02 01:08:19 -05:00
Chris Miles
3a5381d38a
[Crash] Check mob pointer before trying to remove it (#4230) 2024-04-01 18:09:57 -04:00
Alex King
e64f03fcc0
[Bug Fix] Fix Lua Crash with Spell Blocked Event (#4236) 2024-04-01 18:06:39 -04:00
Alex King
d77966797e
[Quest API] Add Spell Blocked Event to Perl/Lua (#4217)
* [Spells] Add Unblockable Spell Table and Spell Blocked Event

- Add `EVENT_SPELL_BLOCKED`, exports `$blocking_spell_id`, `$cast_spell_id`, `$blocking_spell`, and `$cast_spell`.

- Add `event_spell_blocked`, exports `e.blocking_spell_id`, `e.cast_spell_id`, `e.blocking_spell`, and `e.cast_spell`.

- Adds `spells_unblockable` table with a `spell_id` and `is_unblockable` column.
- This table will need to be populated based on known spells that should be unblockable.

- This event will allow operators to perform events when spells are blocked.

* Cleanup

* Cleanup

* Update spells.cpp

* Remove unused repositories.

* Finalize

* Update lua_parser_events.cpp
2024-03-31 22:58:30 -05:00
Akkadius
048aad437b Update pull_request_template.md 2024-03-31 22:55:27 -05:00
hg
b2d9de8d96
[Quests] Avoid Player and Bot quests in unloaded zone (#4232)
If a mob has a target when a zone is shutdown it will crash while trying
to dispatch EVENT_TARGET_CHANGE when the Mob destructor cleans up hatelists
if a quest interface isn't loaded for the type (in this case no bot scripts):

 	zone.exe!fmt::v10::format<std::string const &,char const *>(fmt::v10::basic_format_string<char,std::string const &,char const *> fmt={...}, const std::string & <args_0>={...}, const char * && <args_1>=0x0000000000000000) Line 2835	C++
>	zone.exe!QuestParserCollection::GetQIByBotQuest(std::string & filename={...}) Line 1138	C++
 	zone.exe!QuestParserCollection::BotHasQuestSubLocal(QuestEventID event_id=EVENT_TARGET_CHANGE) Line 353	C++
 	zone.exe!QuestParserCollection::BotHasQuestSub(QuestEventID event_id=EVENT_TARGET_CHANGE) Line 389	C++
 	zone.exe!Mob::SetTarget(Mob * mob=0x0000000000000000) Line 5431	C++
 	zone.exe!NPC::SetTarget(Mob * mob=0x0000000000000000) Line 575	C++
 	zone.exe!Mob::RemoveFromHateList(Mob * mob=0x000001bfbdc66040) Line 4894	C++
 	zone.exe!EntityList::RemoveFromTargets(Mob * mob=0x000001bfbdc66040, bool RemoveFromXTargets=true) Line 1530	C++
 	zone.exe!Mob::~Mob() Line 547	C++
 	zone.exe!NPC::~NPC() Line 537	C++
 	zone.exe!NPC::`scalar deleting destructor'(unsigned int)	C++
 	zone.exe!EntityList::RemoveAllMobs() Line 2678	C++
 	zone.exe!EntityList::Clear() Line 3090	C++
 	zone.exe!Zone::~Zone() Line 1103	C++
 	zone.exe!Zone::`scalar deleting destructor'(unsigned int)	C++
 	zone.exe!Zone::Shutdown(bool quiet=false) Line 928	C++

This is caused by the Zone destructor deleting short_name before calling
entity_list.Clear(). With an unloaded quest interface BotHasQuestSubLocal
calls GetQIByBotQuest which gets a null zone->GetShortName() and crashes
while formatting strings.

The immediate regressing commit for this crash is because a check for
zone->IsLoaded() was removed in 74f1eac4 with others that were removed
to fix a regression by #4025. GetQIByBotQuest and GetQIByPlayerQuest
always had this check and should have remained for them.

This restores the zone->IsLoaded() checks for GetQIByBotQuest/PlayerQuest.
The other functions cannot have that check added until the other issues
mentioned in #4149 are addressed.
2024-03-31 22:49:13 -05:00
Fryguy
42bfa4bb2e
[Bug Fix] Shared Tasks - charid is now character_id (#4233)
## Type of change

Please delete options that are not relevant.

- [x] Bug fix (non-breaking change which fixes an issue)

# Checklist:

- [x] I have performed a self-review of my code. Ensuring variables, functions and methods are named in a human-readable way, comments are added only where naming of variables, functions and methods can't give enough context.
- [x] I have tested my changes
- [x] I own the changes of my code take responsibilities for the potential issues that occur
2024-03-31 22:41:15 -05:00
Chris Miles
72ce7c8e91
Update pull_request_template.md 2024-03-31 15:52:54 -05:00
Chris Miles
e306c86875
Create pull_request_template.md 2024-03-31 15:48:33 -05:00
Alex King
3ae7979a67
[Bug Fix] Fix Issue With Bot Raid Aggro (#4222)
# Notes
- Bots were reportedly being bypassed by NPCs due to not taking into consideration their raid group's damage.
- Must have been missed when bot raids were implemented.
2024-03-31 11:56:12 -05:00
Xackery
b638795f9b
[Feature] Add LuaMod functions for CommonDamage and HealDamage (#4227)
* Add LuaMod functions for CommonDamage and HealDamage

* Remove extra bracket
2024-03-31 11:30:16 -04:00
KayenEQ
9e3bf91374
[Spells] Implemented SPA 463 SE_SHIELD_TARGET (#4224)
SPA 463 SE_SHIELD_TARGET

Live description: "Shields your target, taking a percentage of their damage".

Only example spell on live is an NPC who uses it during a raid event "Laurion's Song" expansion. SPA 54492 'Guardian Stance' Described as 100% Melee Shielding

Example of mechanic. Base value = 70. Caster puts buff on target. Each melee hit Buff Target takes 70% less damage, Buff Caster receives 30% of the melee damage.
Added mechanic to cause buff to fade if target or caster are separated by a distance greater than the casting range of the spell. This allows similar mechanics to the /shield ability, without a range removal mechanic it would be too easy to abuse if put on a player spell. *can not confirm live does this currently

Can not be cast on self.
2024-03-30 13:34:03 -04:00
KayenEQ
cd89926435
[Feature] Additive Spell Focus from Worn slot with Limit Checks (#4208)
* [Feature] Additive Spell Focus from Worn slot with limits

New rule (UseAdditiveFocusFromWornSlotWithLimits) allows you place to focus effects in worn slots which will apply the focus additively and perform normal limit checks on those focus. This differs from regular focus behavior that only takes highest value.

This is a new version of an old rule "UseAdditiveFocusFromWornSlot"
which allowed similar behavior but ignored focus limits. Thus hindering its full potential for itemization.

* Update spell_effects.cpp

---------

Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
2024-03-30 13:23:02 -04:00
Xackery
e19f72f021
[Feature] Add RegisterBug LuaMod (#4209)
* Add RegisterBug LuaMod

* Add missing header

* Add missing header to lua_mod

* Fix RegisterBug ignore_default

* Fix ignore_default

* Fix formatting
2024-03-30 11:45:37 -04:00
JJ
df1dc5d1e4
[Cleanup] Avoid unnecessary copies in database functions (#4220)
Since `auto` doesn't deduce references, these will most likely create copies having unintended results.
2024-03-29 07:45:41 -04:00
Alex King
e11286164f
[Bug Fix] Fix Luabind Double Class Register (#4219)
* [Bug Fix] Fix Luabind Double Class Register

# Notes
- These two methods were registering to the same class as another method, causing an error seen by @neckkola and others.

# Error
```
zone: /home/eqemu/source_jas/libs/luabind/src/class_registry.cpp:151: void luabind::detail::class_registry::add_class(const luabind::type_id&, luabind::detail::class_rep*): Assertion `(m_classes.find(info) == m_classes.end()) && "you are trying to register a class twice"' failed.
```

* Update lua_general.cpp
2024-03-28 20:05:55 -04:00
JJ
b946b800fb
[Cleanup] Reference type in GetRaidLeaderName (#4218)
Minor cleanup from #4054
2024-03-28 19:15:16 -04:00
Alex King
ab8ac81df6
[Bug Fix] Fix Group Leadership (#4214)
* [Bug Fix] Fix Group Leadership

# Notes
- We were not sending anything to `group_leaders` table if we did not already have an existing row.

# Video

* Update database.cpp
2024-03-28 15:33:49 -05:00
Alex King
109940fc0c
[Quest API] Add Class/Deity/Race Methods to Perl/Lua (#4215)
# Perl
- Add `$client->GetDeityBitmask()`.
- Add `quest::get_class_bitmask(class_id)`.
- Add `quest::get_deity_bitmask(deity_id)`.
- Add `quest::get_race_bitmask(race_id)`.

# Lua
- Add `client:GetDeityBitmask()`.
- Add `eq.get_class_bitmask(class_id)`.
- Add `eq.get_deity_bitmask(deity_id)`.
- Add `eq.get_race_bitmask(race_id)`.

# Notes
- Allows operators to get the class/deity/race bitmask of a class/deity/race by ID.
- Allows operators to get a client's deity bitmask.
2024-03-28 15:32:02 -05:00
Fryguy
a87496b0cf
[Lua] Add Zone and Language Constants (#4211)
* [LUA] Add Zone and Language Constants

This will add Zone:

```lua
if eq.get_zone_id() == Zone.Qeynos then
   foo()
end
```

It will also add Language:

```lua
if e.language == Language.ElderElvish and e.other:GetLanguageSkill(Language.ElderElvish) >= 100 then
   e.self:Say("You know my language!", Language.ElderElvish);
end
```

These changes should help avoid magic numbers in quests and aide in readability without the need for -- comments to clarify.

* Adjust to lower case
2024-03-28 13:16:41 -04:00
Alex King
f905ee70e4
[Bug Fix] Fix Auto Login Issue (#4213)
* [Bug Fix] Fix Auto Login Issue

# Notes
- We were setting `live_name` value regardless of if we were zoning, causing us to automatically log in to the last character we'd logged in to before.

* Remove &
2024-03-28 09:48:17 -04:00
JJ
52417023f8
[Cleanup] Remove unnecessary reference types (#4212)
Minor clean up from #4054 and #4181
2024-03-27 22:17:21 -04:00
KayenEQ
20d9417628
[Spells] SPA148 Stacking Fix (#4206)
Update to SPA148 which acts to block spells buffs that are of lesser value than the current buff for specific effect slots. This effected was preventing detrimental debuffs from being applied that were using same effect slot. This bug affected a very small amount of spell interactions and was fixed on live in 2018.  Example being Vishmitars Corruption (6642) being blocked by SteelOak Skin (5352)

 I confirmed the behavior on live myself. The detrimental buff  if in conflict should now be applied instead of blocked.
2024-03-27 14:39:40 -04:00
Xackery
4692799677
[Bug Fix] Fix event_consider any_cast error (#4210) 2024-03-27 14:31:38 -04:00
Chris Miles
cf7f0f4321
[Skill Caps] Further improvements (#4205) 2024-03-24 13:04:26 -04:00
Chris Miles
823a5956de
[Hotfix] Fix crash in SendEnterWorld (#4204) 2024-03-23 23:28:29 -05:00
JJ
6a8bd3c5d6
[Bug Fix] Fix fishing chances (#4203)
Fix regression from #4008 where the item count wasn't being incremented
Move the zone table chance to a rule
General cleanup of some initializers and variable types
2024-03-23 23:32:07 -04:00
Alex King
523ba30d81
[Repositories] Convert database.cpp to Repositories (#4054)
* [Repositories] Convert database.cpp to Repositories

- Convert all database.cpp methods to repositories where possible.

* Final push.

* Cleanup

* Cleanup

* Update database.h

* Fix crash

* Update database.cpp
2024-03-23 19:30:56 -05:00
Alex King
d7ea290b6b
[Skill Caps] Remove from shared memory and simplify (#4069)
* [Skill Caps] Remove from shared memory and simplify

- Removes Skill Caps loading from shared memory and puts it into zone.
- Adds `id` column to `skill_caps`.
- Remove primary keys and use `id` as primary key.
- Add unique index using `skill_id`, `class_id`, `level`, and `cap`.
- Renames `class` to `class_id` in `skill_caps` table.
- Renames `skillID` to `skill_id` in `skill_caps` table.
- Regenerates Skill Caps repository.
- Adds `#reload skill_caps` to reload skill caps in real time.

* Update groups.cpp

* Update groups.cpp
2024-03-23 18:52:40 -05:00
Alex King
036309ebec
[Hot Fix] Hot Fix for Group::AddToGroup Hot Fix (#4202)
# Notes
- Typo in previous.
2024-03-23 18:51:43 -05:00
Alex King
b400700d81
[Hot Fix] Fix Group::AddToGroup (#4201)
# Notes
- We were not using `r` values at any point.
2024-03-23 18:49:15 -05:00
Alex King
21cec87ac4
[Bug Fix] Fix Bot/Character ID Overlap in Groups (#4093)
* [Bug Fix] Fix Bot/Character ID Overlap in Groups

- Attempt to fix bot/character ID overlap in groups keeping bots with the same unique identifier as players from not spawning on zone.
- Adds `bot_id` to `group_id` to differentiate bots from characters and hopefully alleviate this issue.

* Update base_group_id_repository.h

* Final push
2024-03-23 17:55:03 -05:00
Alex King
abdec39cdd
[Quest API] Add Archetype Methods to Perl/Lua (#4181)
* [Quest API] Add Archetype Methods to Perl/Lua

- Add `$mob->GetArchetypeName()`.
- Add `$mob->IsIntelligenceCasterClass()`.
- Add `$mob->IsPureMeleeClass()`.
- Add `$mob->IsWisdomCasterClass()`.

- Add `mob:GetArchetypeName()`.
- Add `mob:IsIntelligenceCasterClass()`.
- Add `mob:IsPureMeleeClass()`.
- Add `mob:IsWisdomCasterClass()`.

- Allows operators to use mob archetypes to perform different operations.
- Add a namespace for archetypes instead of constants.
- Utilize `IsIntelligenceCasterClass()`, `IsPureMeleeClass()`, and `IsWisdomCasterClass()` where necessary.
-

* Update mob.cpp
2024-03-23 14:37:35 -05:00
Fryguy
d2372de982
[Bug Fix] Radiant/Ebon Crystals should only extract to 1000 (#4195)
* [Bug] Radiant/Ebon Crystals should only extract to 1000

Creating a stack larger than 1000 can cause potential dupe issues further down the stream if other tasks are performed on the stack.

* Use stacksize instead

---------

Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
2024-03-23 12:56:59 -05:00
Chris Miles
ea9b7841d4
[Release] 22.48.0 (#4200) v22.48.0 2024-03-23 00:24:01 -05:00
Alex King
8826d7b927
[Rules] Add World:Rules Rule (#4194)
* [Rules] Add World:Rules Rule

# Notes
- Adds `World:Rules` rule to take the place of the variables table value.

* Update client.cpp

* Update client.cpp
2024-03-23 00:01:27 -05:00
JJ
e4157f0221
[Bug Fix] Fix reusing timers (#4199)
Fixes regression from #4099 where timers that were reused were not getting changed with their updated times
2024-03-23 00:01:15 -05:00
Alex King
66cc947b2a
[Quest API] Add Restore Methods for Health, Mana, and Endurance to Perl/Lua (#4179)
* [Quest API] Add Restore Methods for Health, Mana, and Endurance to Perl/Lua

- Add `$mob->RestoreEndurance()`.
- Add `$mob->RestoreHealth()`.
- Add `$mob->RestoreMana()`.

- Add `mob:RestoreEndurance()`.
- Add `mob:RestoreHealth()`.
- Add `mob:RestoreMana()`.

- Allows operators to easily restore a mob to full health, mana, or endurance.
- `RestoreHealth` is just a more verbosely named `Heal`.
- Convert spots in source to use these short hands instead of directly using `SetEndurance(GetMaxEndurance())`, `SetHP(GetMaxHP())`, or `SetMana(GetMaxMana())`.

* Update mob.h

* Update mob.h
2024-03-22 23:53:35 -05:00
hg
5bfd8f5da2
[Tradeskills] Implement learning recipes from books (#4170)
This uses the book scribe button to learn recipes in SoF+ clients. For
Titanium clients the button is not available so a workaround will need
to be added later.

Note live gives no feedback when scribing books (at least those tested).
2024-03-22 23:50:06 -05:00
Chris Miles
96830b4a19
[Loot] Fix issue with nested data being loaded multiple times (#4192)
* [Loot] Fix issue with nested data being loaded multiple times

* Update zone_loot.cpp

* Fix #lootsim printout

* Update loot.cpp
2024-03-22 23:49:23 -05:00
Alex King
4bf60a6522
[Bug Fix] Fix ScaleNPC() in Perl (#4196)
# Notes
- We were not passing `override_special_abilities` in the right parameter slot.
- Default `always_scale` to `true` when using the Perl/Lua method.
2024-03-22 23:36:30 -05:00
JJ
16cb7364e8
[Misc] Windows preprocessor define in crash.cpp (#4191) 2024-03-22 23:27:31 -05:00
Alex King
f5050ab5dc
[Bug Fix] Fix range_percent (#4197)
# Notes
- This was uninitialized and was getting bogus values.
2024-03-22 16:17:38 -04:00
Alex King
e32cbf19ee
[Bug Fix] Fix #serverrules Command (#4193)
* [Bug Fix] Fix #serverrules Command

# Notes
- This command was effectively disabled as it was not included nor was the command itself defined within a `command_add`

* Update command.cpp
2024-03-20 03:31:49 -04:00
Alex King
ee12a7ad2e
[Bug Fix] Fix EVENT_KILLED_MERIT firing before NPC removal (#4185)
* [Bug Fix] Fix EVENT_KILLED_MERIT firing before NPC removal

# Notes
- NPCs were parsing this event too early and anything that checked if they were still alive in `EVENT_KILLED_MERIT` would show them still alive because of this.

# Image

* Code cleanup

* Update client.h

* Add GetRaidOrGroupOrSelf() to Perl/Lua

* Update to luabind::object, fix logic per comments.

* Fix

* Fix per comments.
2024-03-17 17:32:44 -04:00
Alex King
e5bdbc4f1e
[Bug Fix] Fix Bot Cloning (#4186)
# Notes
- We were not setting `inventories_index` to `0` so it was trying to use the pre-existing unique identifier, causing the query to fail.
2024-03-16 23:09:57 -04:00
Alex King
f829a99e6d
[Quest API] Add RemoveAlternateCurrencyValue() to Perl/Lua (#4190)
# Perl
- Add `$client->RemoveAlternateCurrencyValue(currency_id, amount)`.

# Lua
- Add `client:RemoveAlternateCurrencyValue(currency_id, amount)`.

# Notes
- Allows operators to more easily remove alternate currencies, returns a `bool`, `false` if failed`, `true` if succeeded.
- Added `Zone::DoesAlternateCurrencyExist` that will reject setting, removing, or adding  to a currency that does not exist.
2024-03-16 23:09:51 -04:00
Alex King
82aa6a1587
[Bug Fix] Fix Proximity Say (#4189)
# Notes
- Without setting `HaveProximitySays` to `true` along with if `n->proximity->say` NPCs will not respond to proximity say stuff.
2024-03-14 20:26:30 -04:00
Alex King
161c13f457
[Quest API] Add Buff Support to Perl/Lua (#4182)
* [Quest API] Add Buff Support to Perl/Lua

- Add `$mob->GetCasterID()`.
- Add `$mob->GetCasterLevel()`.
- Add `$mob->GetCasterName()`.
- Add `$mob->GetCastOnX()`.
- Add `$mob->GetCastOnY()`.
- Add `$mob->GetCastOnZ()`.
- Add `$mob->GetCounters()`.
- Add `$mob->GetDOTRune()`.
- Add `$mob->GetExtraDIChance()`.
- Add `$mob->GetInstrumentModi()`.
- Add `$mob->GetMagicRune()`.
- Add `$mob->GetMeleeRune()`.
- Add `$mob->GetNumberOfHits()`.
- Add `$mob->GetRootBreakChanc()`.
- Add `$mob->GetSpellID()`.
- Add `$mob->GetTicsRemaining()`.
- Add `$mob->GetVirusSpreadTim()`.
- Add `$mob->IsCasterClient()`.
- Add `$mob->IsPersistentBuff()`.
- Add `$mob->SendsClientUpdate()`.

- Add `mob:GetCasterID()`.
- Add `mob:GetCasterLevel()`.
- Add `mob:GetCasterName()`.
- Add `mob:GetCastOnX()`.
- Add `mob:GetCastOnY()`.
- Add `mob:GetCastOnZ()`.
- Add `mob:GetCounters()`.
- Add `mob:GetDOTRune()`.
- Add `mob:GetExtraDIChance()`.
- Add `mob:GetInstrumentModi()`.
- Add `mob:GetMagicRune()`.
- Add `mob:GetMeleeRune()`.
- Add `mob:GetNumberOfHits()`.
- Add `mob:GetRootBreakChanc()`.
- Add `mob:GetSpellID()`.
- Add `mob:GetTicsRemaining()`.
- Add `mob:GetVirusSpreadTim()`.
- Add `mob:IsCasterClient()`.
- Add `mob:IsPersistentBuff()`.
- Add `mob:SendsClientUpdate()`.

- Adds support for `Buffs_Struct` to Perl/Lua.
- Allows operators to read a mob's buff data directly to determine caster, melee rune, etc.

* Fix GetCasterID() to proper data type.

* Remove Lua_Buffs, return table instead.

* Cleanup
2024-03-13 23:38:15 -04:00
Alex King
b29c26becb
[Bug Fix] Fix GetLeaderName() for Groups (#4184)
* [Bug Fix] Fix GetLeaderName() for Groups

# Notes
- We were getting bogus data in this.
- Made it its own method.

* Remove ExpeditionRequest::GetGroupLeaderName()
2024-03-13 21:52:02 -04:00