156 Commits

Author SHA1 Message Date
Alex King
b82b32e1d2
[Feature] Add Immune to Assassinate Special Ability (#3622)
# Notes
- Allows mobs normally susceptible to Assassinate to be made immune to it.
2023-10-13 21:01:06 -04:00
Chris Miles
efb03164c7
[Crash] Fix crash in CastSpell Quest API input cast (#3610) 2023-10-07 14:00:11 -05:00
Alex King
cf27f2bc88
[Quest API] Add Caster ID Parameter to FindBuff in Perl/Lua (#3590)
* [Quest API] Add Caster ID Parameter to FindBuff in Perl/Lua

# Perl
- Add `$mob->FindBuff(spell_id, caster_id)`.

# Lua
- Add `mob:FindBuff(spell_id, caster_id)`.

# Notes
- Allows operators to check if the spell ID is cast by a specific entity ID.
- We don't use `Mob*` reference here since the mob may have died, left zone, etc.

* Formatting.
2023-09-29 19:38:36 -04:00
Alex King
bab16771aa
[Quest API] Add ApplySpell() and SetBuffDuration() overloads to Perl/Lua (#3576)
# Perl
- Add `$bot->ApplySpell(spell_id, duration, level)`.
- Add `$bot->ApplySpell(spell_id, duration, level, allow_pets)`.
- Add `$bot->ApplySpellGroup(spell_id, duration, level)`.
- Add `$bot->ApplySpellGroup(spell_id, duration, level, allow_pets)`.
- Add `$bot->ApplySpellRaid(spell_id)`.
- Add `$bot->ApplySpellRaid(spell_id, duration)`.
- Add `$bot->ApplySpellRaid(spell_id, duration, level)`.
- Add `$bot->ApplySpellRaid(spell_id, duration, level, allow_pets)`.
- Add `$bot->ApplySpellRaid(spell_id, duration, level, allow_pets, is_raid_group_only)`.
- Add `$bot->SetSpellDuration(spell_id, duration, level)`.
- Add `$bot->SetSpellDuration(spell_id, duration, level, allow_pets)`.
- Add `$bot->SetSpellDurationGroup(spell_id, duration, level)`.
- Add `$bot->SetSpellDurationGroup(spell_id, duration, level, allow_pets)`.
- Add `$bot->SetSpellDurationRaid(spell_id)`.
- Add `$bot->SetSpellDurationRaid(spell_id, duration)`.
- Add `$bot->SetSpellDurationRaid(spell_id, duration, level)`.
- Add `$bot->SetSpellDurationRaid(spell_id, duration, level, allow_pets)`.
- Add `$bot->SetSpellDurationRaid(spell_id, duration, level, allow_pets, is_raid_group_only)`.
- Add `$client->ApplySpell(spell_id, duration, level)`.
- Add `$client->ApplySpell(spell_id, duration, level, allow_pets)`.
- Add `$client->ApplySpellGroup(spell_id, duration, level)`.
- Add `$client->ApplySpellGroup(spell_id, duration, level, allow_pets)`.
- Add `$client->ApplySpellRaid(spell_id, duration, level)`.
- Add `$client->ApplySpellRaid(spell_id, duration, level, allow_pets)`.
- Add `$client->ApplySpellRaid(spell_id, duration, level, allow_pets, is_raid_group_only)`.
- Add `$client->ApplySpellRaid(spell_id, duration, level, allow_pets, is_raid_group_only, allow_bots)`.
- Add `$client->SetSpellDuration(spell_id, duration, level)`.
- Add `$client->SetSpellDuration(spell_id, duration, level, allow_pets)`.
- Add `$client->SetSpellDurationGroup(spell_id, duration, level)`.
- Add `$client->SetSpellDurationGroup(spell_id, duration, level, allow_pets)`.
- Add `$client->SetSpellDurationRaid(spell_id, duration, level)`.
- Add `$client->SetSpellDurationRaid(spell_id, duration, level, allow_pets)`.
- Add `$client->SetSpellDurationRaid(spell_id, duration, level, allow_pets, is_raid_group_only)`.
- Add `$client->SetSpellDurationRaid(spell_id, duration, level, allow_pets, is_raid_group_only, allow_bots)`.
- Add `$mob->ApplySpellBuff(spell_id, duration, level)`.
- Add `$mob->SetSpellDuration(spell_id, duration, level)`.

# Lua
- Add `bot:ApplySpell(spell_id, duration, level)`.
- Add `bot:ApplySpell(spell_id, duration, level, allow_pets)`.
- Add `bot:ApplySpellGroup(spell_id, duration, level)`.
- Add `bot:ApplySpellGroup(spell_id, duration, level, allow_pets)`.
- Add `bot:ApplySpellRaid(spell_id)`.
- Add `bot:ApplySpellRaid(spell_id, duration)`.
- Add `bot:ApplySpellRaid(spell_id, duration, level)`.
- Add `bot:ApplySpellRaid(spell_id, duration, level, allow_pets)`.
- Add `bot:ApplySpellRaid(spell_id, duration, level, allow_pets, is_raid_group_only)`.
- Add `bot:SetSpellDuration(spell_id, duration, level)`.
- Add `bot:SetSpellDuration(spell_id, duration, level, allow_pets)`.
- Add `bot:SetSpellDurationGroup(spell_id, duration, level)`.
- Add `bot:SetSpellDurationGroup(spell_id, duration, level, allow_pets)`.
- Add `bot:SetSpellDurationRaid(spell_id, duration, level)`.
- Add `bot:SetSpellDurationRaid(spell_id, duration, level, allow_pets)`.
- Add `bot:SetSpellDurationRaid(spell_id, duration, level, allow_pets, is_raid_group_only)`.
- Add `client:ApplySpell(spell_id, duration, level)`.
- Add `client:ApplySpell(spell_id, duration, level, allow_pets)`.
- Add `client:ApplySpellGroup(spell_id, duration, level)`.
- Add `client:ApplySpellGroup(spell_id, duration, level, allow_pets)`.
- Add `client:ApplySpellRaid(spell_id, duration, level)`.
- Add `client:ApplySpellRaid(spell_id, duration, level, allow_pets)`.
- Add `client:ApplySpellRaid(spell_id, duration, level, allow_pets, is_raid_group_only)`.
- Add `client:ApplySpellRaid(spell_id, duration, level, allow_pets, is_raid_group_only, allow_bots)`.
- Add `client:SetSpellDuration(spell_id, duration, level)`.
- Add `client:SetSpellDuration(spell_id, duration, level, allow_pets)`.
- Add `client:SetSpellDurationGroup(spell_id, duration, level)`.
- Add `client:SetSpellDurationGroup(spell_id, duration, level, allow_pets)`.
- Add `client:SetSpellDurationRaid(spell_id, duration, level)`.
- Add `client:SetSpellDurationRaid(spell_id, duration, level, allow_pets)`.
- Add `client:SetSpellDurationRaid(spell_id, duration, level, allow_pets, is_raid_group_only)`.
- Add `client:SetSpellDurationRaid(spell_id, duration, level, allow_pets, is_raid_group_only, allow_bots)`.
- Add `mob:ApplySpellBuff(spell_id, duration, level)`.
- Add `mob:SetSpellDuration(spell_id, duration, level)`.

# Notes
- This allows operators to override the spell level.
2023-09-17 13:14:13 -05:00
Alex King
fb20d92166
[Bug Fix] Fix Appearance Issues (#3520)
* [Bug Fix] Fix Appearance Issues

# Notes
- Changing race, gender, or texture of a Mob could result in it changing sizes due to use not sending the size as part of the appearance packet.
- Also converts the parameterized method to a struct parameter so that we can optionally send things without back-filling multiple arguments.

* Gender cleanup.

* Fix.

* Formatting.
2023-07-31 20:15:13 -05:00
Alex King
8c4cd34e01
[Quest API] Add GetMobTypeIdentifier() to Perl/Lua (#3512)
# Perl
- Add `$mob->GetMobTypeIdentifier()`.

# Lua
- Add `mob:GetMobTypeIdentifier()`.

# Notes
- Gets unique identifier independent of mob type.
2023-07-27 23:16:41 -05:00
Chris Miles
3f3bbe98b5
[Data Buckets] Implement scoped data buckets (#3498)
* [Data Buckets] Implement scoped data buckets

* Update database_update_manifest.cpp

* Update data_bucket.cpp

* Update data_bucket.cpp

* Update data_bucket.cpp

* Update data_bucket.h

* Update database_update_manifest.cpp

* Add GetScopedDbFilters references

* Scope transfer
2023-07-16 14:52:28 -04:00
Alex King
e55f9b9d27
[Feature] Add Support for item textures higher than 65,535 (#3494)
* [Feature] Add Support for item textures higher than 65,535

# Notes
- We were previously using `uint16` which has a max of `65,535`, but some of the new Live textures that are being used have values way beyond this.
- Updates quest API, commands, and database tables that also used `uint16`.

* Update version.h
2023-07-14 18:49:59 -04:00
Alex King
4854201b2a
[Quest API] Add Mob/Entity type check methods to Perl/Lua (#3493)
* [Quest API] Add Mob/Entity type check methods to Perl/Lua

# Perl
- Add `$mob->IsAura()`.
- Add `$mob->IsEncounter()`.
- Add `$mob->IsMerc()`.
- Add `$mob->IsOfClientBot()`.
- Add `$mob->IsOfClientBotMerc()`.
- Add `$mob->IsTemporaryPet()`.

# Lua
- Add `entity:IsAura()`.
- Add `entity:IsOfClientBot()`.
- Add `entity:IsOfClientBotMerc()`.
- Add `mob:IsTemporaryPet()`.

* Update lua_entity.cpp

* Update lua_mob.cpp
2023-07-12 21:20:07 -05:00
Alex King
2717fcc339
[Quest API] Add ClearAccountFlag() and GetAccountFlags() to Perl/Lua (#3469)
* [Quest API] Add ClearAccountFlag() and GetAccountFlags() to Perl/Lua

# Perl
- Add `$client->ClearAccountFlag(flag)`.
- Add `$client->GetAccountFlags()`.

# Lua
- Add `client:ClearAccountFlag(flag)`.
- Add `client:GetAccountFlags()`.

# Notes
- Made use of repositories and cleaned up existing code.

* Update lua_client.cpp

* Don't use auto.
2023-07-03 01:19:48 -05:00
Alex King
a633784f78
[Quest API] Add GetClassPlural() and GetRacePlural() to Perl/Lua (#3468)
* [Quest API] Add GetClassPlural() and GetRacePlural() to Perl/Lua

# Perl
- Add `$mob->GetClassPlural()`.
- Add `$mob->GetRacePlural()`.

# Lua
- Add `mob:GetClassPlural()`.
- Add `mob:GetRacePlural()`.

# Notes
- Allows operators to get the plural of a player class or race, example being `Warrior` as `Warriors` or `Dark Elf` as `Dark Elves`.

* Update mob.cpp
2023-07-03 00:08:04 -05:00
Alex King
728ce0c519
[Quest API] Add GetCloseMobList() and CalculateDistance() overload to Perl/Lua (#3455)
* [Quest API] Add GetCloseMobList() and CalculateDistance() overload to Perl/Lua

# Perl
- Add `$entity_list->GetCloseMobList(mob)`.
- Add `$entity_list->GetCloseMobList(mob, distance)`.
- Add `$mob->CalculateDistance(mob)`.
- Add `$mob->GetCloseMobList()`.
- Add `$mob->GetCloseMobList(distance)`.

# Lua
- Add `eq.get_entity_list():GetCloseMobList(mob)`.
- Add `eq.get_entity_list():GetCloseMobList(mob, distance)`.
- Add `mob:CalculateDistance(mob)`.
- Add `mob:GetCloseMobList()`.
- Add `mob:GetCloseMobList(distance)`.

* Ignore Self

* Update lua_entity_list.cpp

* Cleanup
2023-07-02 10:55:27 -04:00
RekkasGit
32f7dc3d1b
[Quest API] Add GetHateListClosest(), GetHateListClosestBot(), GetHateListClosestClient(), and GetHateListClosestNPC() methods/overloads to Perl/Lua (#3359)
* Add HateListClosestClient available for scripting.

* Add other methods.

* Use pre-existing constants.

* Typos

* Update mob.h

---------

Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
2023-05-15 21:23:19 -04:00
Alex King
0e582eda82
[Quest API] Add HasSpellEffect() to Perl/Lua (#3319)
* [Quest API] Add HasSpellEffect() to Perl/Lua

# Perl
- Add `$mob->HasSpellEffect(effect_id)`.

# Lua
- Add `mob:HasSpellEffect(effect_id)`.

# Notes
- Allows operators to see if a Mob has an effect ID from any of their buffs.

* Update mob.cpp
2023-04-29 20:09:00 -05:00
Alex King
6a393bf0c3
[Quest API] Add GetDefaultRaceSize() overloads to Perl/Lua (#3320)
# Perl
- Add `$mob->GetDefaultRaceSize(race_id)`.
- Add `$mob->GetDefaultRaceSize(race_id, gender_id)`.

# Lua
- Add `mob:GetDefaultRaceSize(race_id)`.
- Add `mob:GetDefaultRaceSize(race_id, gender_id)`.

# Notes
- This allows you to get a default size for a race and gender that isn't the current mob's race and gender.
2023-04-29 19:53:49 -05:00
Alex King
57a15d473f
[Quest API] Add GetBuffSpellIDs() to Perl/Lua (#3273)
# Perl
- Add `$mob->GetBuffSpellIDs()`.

# Lua
- Add `$mob->GetBuffSpellIDs()`.

# Notes
- These methods allow operators to get a list of a mob's buff IDs without having to loop through their buffs themselves.
2023-04-09 10:58:35 -04:00
Alex King
6960a1a682
[Bug Fix] Fix issues with Lua tables not starting at index 1 (#3160)
* [Bug Fix] Fix issues with Lua tables not starting at index 1

# Notes
- This would cause the first item in the table to be inaccessible since Lua tables start at index `1` instead of index `0`.
- All other spots using Lua tables have their indexes starting at `1`.

* Update lua_general.cpp
2023-03-30 06:02:53 -04:00
Alex King
26c267db1b
[Cleanup] "equipped" not "equiped", "dual" not "duel". (#3149)
* [Cleanup] "equipped" not "equiped", "dual" not "duel".

# Notes
- These are spelled incorrectly.

* Update spdat.h

* Formatting further.

* Update api_service.cpp
2023-03-27 17:55:37 -04:00
Alex King
9d1ace627c
[Feature] Add support for -1 extradmgskill to allow all skills to be scaled. (#3136)
* [Feature] Add support for -1 extradmgskill to allow all skills to be scaled.

- `$mob->GetSkillDmgAmt(skill_id)` now uses `int` instead of `uint16`.

- `statbonuses:GetSkillDamageAmount(skill_id)` now uses `-1` properly.
- `mob:GetSkillDmgAmt(skill_id)` now uses `int` instead of `uint16`.

- A `-1` value in `extradmgskill` denotes the ability to scale all skills at once.
- Consolidated `AddItemBonuses()`, `AdditiveWornBonuses()`, `CalcItemBonuses()`, and `CalcRecommendedLevelBonus()` to mob-based methods to avoid code duplication.
- Bots, NPCs, and Mercs can now use additive worn effects if the rule is enabled, as well as all other proper stat bonuses that only clients had before.
- No SQL update required to change `extradmgskill` and `extradmgamt` to `int` as they already are this type in the database, just had to adjust `item_data.h` and `shareddb.cpp`.

* Update mob.cpp

* Cleanup.

* Cleanup.

* Move #include <vector> to header.

* Add method for GetExtraDamageSkills

* fix additembonuses

* Update bonuses.cpp

* Update mob.cpp

* Out of bounds.

* Update bonuses.cpp

---------

Co-authored-by: Aeadoin <109764533+Aeadoin@users.noreply.github.com>
2023-03-25 20:26:01 -04:00
Alex King
4fe44f4cb6
[Quest API] Add Timer related methods to Mobs in Perl/Lua (#3133)
* [Quest API] Add Timer related methods to Mobs in Perl/Lua

# Perl
- Add `quest::ispausedtimer(timer_name)`.
- Add `quest::pausetimer(timer_name)`.
- Add `quest::resumetimer(timer_name)`.
- Add `$mob->GetRemainingTimeMS(timer_name)`.
- Add `$mob->GetTimerDurationMS(timer_name)`.
- Add `$mob->HasTimer(timer_name)`.
- Add `$mob->IsPausedTimer(timer_name)`.
- Add `$mob->PauseTimer(timer_name)`.
- Add `$mob->ResumeTimer(timer_name)`.
- Add `$mob->SetTimer(timer_name)`.
- Add `$mob->SetTimerMS(timer_name)`.
- Add `$mob->StopTimer(timer_name)`.

# Lua
- Add `mob:GetRemainingTimeMS(timer_name)`.
- Add `mob:GetTimerDurationMS(timer_name)`.
- Add `mob:HasTimer(timer_name)`.
- Add `mob:IsPausedTimer(timer_name)`.
- Add `mob:PauseTimer(timer_name)`.
- Add `mob:ResumeTimer(timer_name)`.
- Add `mob:SetTimer(timer_name)`.
- Add `mob:SetTimerMS(timer_name)`.
- Add `mob:StopTimer(timer_name)`.

# Notes
- The mob-based methods allow operators to loop entity list or whatever to set, stop, resume, pause, etc for timers.

* StopAllTimers()

* Update questmgr.cpp
2023-03-20 16:18:51 -04:00
Alex King
02ada0e496
[Quest API] Add SendIllusion overloads/parameters to Perl/Lua (#3059)
* [Quest API] Add SendIllusion methods to Perl.

# Perl
- Add `$mob->SendIllusion(race, gender, texture, helmtexture, face, hairstyle, haircolor, beard, beardcolor, drakkin_heritage, drakkin_tattoo, drakkin_details, size, target)`.
- Add `$mob->SendIllusionPacket(illusion_table_ref)`.

* Change defaults.

* Remove debug message

* Cleanup.

* Cleanup

* Update perl_mob.cpp
2023-03-15 20:37:37 -04:00
Alex King
7c819539c8
[Quest API] Add Spell GetActX methods to Perl/Lua (#3056)
# Perl
- Add `$mob->GetActDoTDamage(spell_id, value, target)`.
- Add `$mob->GetActDoTDamage(spell_id, value, target, from_buff_tic)`.
- Add `$mob->GetActReflectedSpellDamage(spell_id, value, effectiveness)`.
- Add `$mob->GetActSpellDamage(spell_id, value, target)`.
- Add `$mob->GetActSpellHealing(spell_id, value, target)`.
- Add `$mob->GetActSpellHealing(spell_id, value, target, from_buff_tic)`.

# Lua
- Add `mob:GetActDoTDamage(spell_id, value, target)`.
- Add `mob:GetActDoTDamage(spell_id, value, target, from_buff_tic)`.
- Add `mob:GetActReflectedSpellDamage(spell_id, value, effectiveness)`.
- Add `mob:GetActSpellCasttime(spell_id, cast_time)`.
- Add `mob:GetActSpellCost(spell_id, cost)`.
- Add `mob:GetActSpellDamage(spell_id, value)`.
- Add `mob:GetActSpellDamage(spell_id, value, target)`.
- Add `mob:GetActSpellDuration(spell_id, duration)`.
- Add `mob:GetActSpellHealing(spell_id, value)`.
- Add `mob:GetActSpellHealing(spell_id, value, target)`.
- Add `mob:GetActSpellHealing(spell_id, value, target, from_buff_tic)`.
- Add `mob:GetActSpellRange(spell_id, range)`.

 # Notes
- Allows operators to get various spell related values.
2023-03-12 15:36:43 -04:00
Alex King
5702f7bcd1
[Quest API] Add IsFindable() and IsTrackable() to Perl/Lua (#2996)
# Perl
- Add `$mob->IsFindable()`.
- Add `$mob->IsTrackable()`.

# Lua
- Add `mob:IsFindable()`.
- Add `mob:IsTrackable()`.

# Notes
- Allows operators to see if a mob is findable or trackable.
2023-02-28 21:26:11 -05:00
Alex King
ff4ccfa98f
[Quest API] Add GetDefaultRaceSize() to Perl/Lua (#2993)
# Perl
- Add `$mob->GetDefaultRaceSize()`.

# Lua
- Add `mob:GetDefaultRaceSize()`.

# Notes
- Allows operators to get the default race size of a race if they want to use it in a script.
2023-02-26 21:35:03 -05:00
Alex King
3335cacac1
[Bots] Cleanup and remove preprocessors. (#2757)
* [Bots] Cleanup and remove preprocessors.

- Removes every `#ifdef BOTS` we have and locks bots behind `Bots:AllowBots` rule.
- Bot updates are now done by default similar to regular database updates.
- Modify `CMakeLists.txt`, `.drone.yml`, and `BUILD.md` to match the removal of `EQEMU_ENABLE_BOTS`.

* Cleanup

- Add SQL for enabling bots for servers with bots.
- Add message that tells players/operators bots are disabled.

* Suggested changes.

* Bot injection stuff

* Change SQL to bot SQL.

* Tweaks

* Remove `is_bot`

* Update version.h

* Update main.cpp

* Update database.cpp

* Fix name availability crash

* Remove bots from update script

Co-authored-by: Akkadius <akkadius1@gmail.com>
2023-01-20 12:35:33 -06:00
Alex King
f5523b40d2
[Quest API] Add CampAllBots() to Perl/Lua. (#2732)
# Perl
- Add `$client->CampAllBots()`.
- Add `$client->CampAllBots(class_id)`.

# Lua
- Add `client:CampAllBots()`.
- Add `client:CampAllBots(class_id)`.

# Notes
- Adds constants for `NO_CLASS` which is class `0` and uses `RACE_DOUG_0` for any spots that use race ID `0`.
- Cleans up magic number usage of race/class of `0`.
2023-01-14 09:14:50 -06:00
Alex King
1531650b3a
[Quest API] Add Augment Slot Type/Visible to GetItemStat (#2686)
* [Quest API] Add Augment Slot Type/Visible to GetItemStat

# Notes
- Adds the ability to get an item's augment slot types and augment slot visibility information.

* const
2023-01-01 11:35:15 -05:00
Alex King
7e7485be77
[Quest API] Add BuffCount() Overloads to Perl/Lua. (#2679)
# Perl
- Add `$mob->BuffCount(is_beneficial)`.
- Add `$mob->BuffCount(is_beneficial, is_detrimental)`.

# Lua
- Add `mob:BuffCount(is_beneficial)`.
- Add `mob:BuffCount(is_beneficial, is_detrimental)`.

 # Notes
- Allows operators to count only beneficial or detrimental buffs a mob has instead of always counting all buffs.
2022-12-29 11:58:38 -05:00
Alex King
d1430f6834
[Quest API] Add IsAttackAllowed() to Perl/Lua. (#2672)
# Perl
- Add `$mob->IsAttackAllowed(target)`.
- Add `$mob->IsAttackAllowed(target, is_spell_attack)`.

# Lua
- Add `mob:IsAttackAllowed(target)`.

# Notes
- Lua had `mob:IsAttackAllowed(target, is_spell_attack)` but not the other overload.
- Perl had neither.
2022-12-25 16:17:46 -05:00
Chris Miles
c236c57a2c
[C++20] Enable C++20 + Fixes + FMT 9.1 (#2664)
* [CPP] Enable and build compliance with cpp20

* Windows build fix

* bump fmt version

* Updated fmt to 9.1, updated cmake minimum and verified preprocessor stuff works.

* Missing :

* Fix warning: top-level comma expression in array subscript is deprecated

* Fix warning: top-level comma expression in array subscript is deprecated

Co-authored-by: KimLS <KimLS@peqtgc.com>
2022-12-20 21:52:36 -06:00
Alex King
1d06a4117a
[Quest API] Add DoAnim Overloads to Perl/Lua. (#2627)
# Perl
- Add `$mob->DoAnim(animation_id, animation_speed, ackreq)`.
- Add `$mob->DoAnim(animation_id, animation_speed, ackreq, filter)`.
- Add `quest::doanim(animation_id, animation_speed)`.
- Add `quest::doanim(animation_id, animation_speed, ackreq)`.
- Add `quest::doanim(animation_id, animation_speed, ackreq, filter)`.

# Lua
- Add `eq.do_anim(animation_id)`.
- Add `eq.do_anim(animation_id, animation_speed)`.
- Add `eq.do_anim(animation_id, animation_speed, ackreq)`.
- Add `eq.do_anim(animation_id, animation_speed, ackreq, filter)`.

# Notes
- Adds overloads and cleans up spots where `animation_speed` was named `type` erroneously.
2022-12-10 17:30:40 -06:00
Alex King
91ea6462f2
[Quest API] Add CopyHateList() to Perl/Lua. (#2623)
* [Quest API] Add CopyHateList() to Perl/Lua.

# Perl
- Add `$mob->CopyHateList(to_mob)`.

# Lua
- Add `mob:CopyHateList(to_mob)`.

# Notes
- Allows operators to easily copy and entire hatelist from one mob to another.

* Update mob.cpp
2022-12-06 08:38:51 -05:00
Alex King
9a35cacf27
[Quest API] Add EVENT_PAYLOAD to Perl/Lua. (#2611)
* [Quest API] Add EVENT_PAYLOAD to Perl/Lua.

# Perl
- Add `$bot->SendPayload(payload_id)`.
- Add `$bot->SendPayload(payload_id, payload_value)`.
- Add `$client->SendPayload(payload_id)`.
- Add `$client->SendPayload(payload_id, payload_value)`.
- Add `$mob->SendPayload(payload_id)`.
- Add `$mob->SendPayload(payload_id, payload_value)`.
- Add `$npc->SendPayload(payload_id)`.
- Add `$npc->SendPayload(payload_id, payload_value)`.

# Lua
- Add `bot:SendPayload(payload_id)`.
- Add `bot:SendPayload(payload_id, payload_value)`.
- Add `client:SendPayload(payload_id)`.
- Add `client:SendPayload(payload_id, payload_value)`.
- Add `mob:SendPayload(payload_id)`.
- Add `mob:SendPayload(payload_id, payload_value)`.
- Add `npc:SendPayload(payload_id)`.
- Add `npc:SendPayload(payload_id, payload_value)`.

# Notes
- Allows operators to send payload IDs with a payload value, the value can be a comma separated value, JSON, etc.
- The idea is to allow a more configurable event for operators to send information to/from entities.

* Cleanup parser events.
2022-12-04 17:47:49 -05:00
Alex King
7abc084cd1
[Quest API] Add Entity Variable Methods to Perl/Lua. (#2609)
* [Quest API] Add Entity Variable Methods to Perl/Lua.

# Perl
- Add `$mob->ClearEntityVariables()`.
- Add `$mob->DeleteEntityVariable(variable_name)`.
- Add `$object->ClearEntityVariables()`.
- Add `$object->DeleteEntityVariable(variable_name)`.

# Lua
- Add `mob:ClearEntityVariables()`.
- Add `mob:DeleteEntityVariable(variable_name)`.
- Add `object:ClearEntityVariables()`.
- Add `object:DeleteEntityVariable(variable_name)`.

# Notes
- Allows operators to clear all entity variables or delete one by name, previously you just had to set to an empty value to clear after being set.

* Cleanup.
2022-12-04 12:18:27 -05:00
Alex King
a9cfacf54b
[Quest API] Add WearChange Overloads to Perl/Lua. (#2600)
* [Quest API] Add WearChange Overloads to Perl/Lua.

# Perl
- Add `$mob->WearChange(slot, texture)`.

# Lua
- Add `mob:WearChange(slot, texture)`.
- Add `mob:WearChange(slot, texture, color, heros_forge_model)`.

# Notes
- These overloads allow you to not have to send color.
- Lua didn't have an overload with Hero's Forge Model.

* Fix variable types.
2022-11-30 21:31:22 -05:00
Alex King
31d57342e1
[Quest API] Add Entity Variable Methods to Perl/Lua. (#2579)
* [Quest API] Add Entity Variable Methods to Perl/Lua.

# Perl
- Add `$mob->GetEntityVariables()`.
- Add `$object->GetEntityVariables()`.

# Lua
- Add `mob:GetEntityVariables()`.
- Add `object:GetEntityVariables()`.

# Notes
- Convert all overloads and methods to use `std::string` for entity variables.
- Allows operators to get a list of a Mob's entity variables.

* Update loottables.cpp
2022-11-26 16:24:01 -05:00
Kinglykrab
0c56586f3b
[Quest API] Add Client Spell Methods to Perl/Lua. (#2550)
* [Quest API] Add Client Spell Methods to Perl/Lua.

# Perl
- Add `$client->ApplySpell(spell_id)`.
- Add `$client->ApplySpell(spell_id, duration)`.
- Add `$client->ApplySpell(spell_id, duration, allow_pets)`.
- Add `$client->ApplySpell(spell_id, duration, allow_pets, is_raid_group_only)`.
- Add `$client->ApplySpell(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`.
- Add `$client->ApplySpellGroup(spell_id)`.
- Add `$client->ApplySpellGroup(spell_id, duration)`.
- Add `$client->ApplySpellGroup(spell_id, duration, allow_pets)`.
- Add `$client->ApplySpellGroup(spell_id, duration, allow_pets, is_raid_group_only)`.
- Add `$client->ApplySpellGroup(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`.
- Add `$client->ApplySpellRaid(spell_id)`.
- Add `$client->ApplySpellRaid(spell_id, duration)`.
- Add `$client->ApplySpellRaid(spell_id, duration, allow_pets)`.
- Add `$client->ApplySpellRaid(spell_id, duration, allow_pets, is_raid_group_only)`.
- Add `$client->ApplySpellRaid(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`.
- Add `$client->SetSpellDuration(spell_id)`.
- Add `$client->SetSpellDuration(spell_id, duration)`.
- Add `$client->SetSpellDuration(spell_id, duration, allow_pets)`.
- Add `$client->SetSpellDuration(spell_id, duration, allow_pets, is_raid_group_only)`.
- Add `$client->SetSpellDuration(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`.
- Add `$client->SetSpellDurationGroup(spell_id)`.
- Add `$client->SetSpellDurationGroup(spell_id, duration)`.
- Add `$client->SetSpellDurationGroup(spell_id, duration, allow_pets)`.
- Add `$client->SetSpellDurationGroup(spell_id, duration, allow_pets, is_raid_group_only)`.
- Add `$client->SetSpellDurationGroup(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`.
- Add `$client->SetSpellDurationRaid(spell_id)`.
- Add `$client->SetSpellDurationRaid(spell_id, duration)`.
- Add `$client->SetSpellDurationRaid(spell_id, duration, allow_pets)`.
- Add `$client->SetSpellDurationRaid(spell_id, duration, allow_pets, is_raid_group_only)`.
- Add `$client->SetSpellDurationRaid(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`.

# Lua
- Add `client:ApplySpell(spell_id)`.
- Add `client:ApplySpell(spell_id, duration)`.
- Add `client:ApplySpell(spell_id, duration, allow_pets)`.
- Add `client:ApplySpell(spell_id, duration, allow_pets, is_raid_group_only)`.
- Add `client:ApplySpell(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`.
- Add `client:ApplySpellGroup(spell_id)`.
- Add `client:ApplySpellGroup(spell_id, duration)`.
- Add `client:ApplySpellGroup(spell_id, duration, allow_pets)`.
- Add `client:ApplySpellGroup(spell_id, duration, allow_pets, is_raid_group_only)`.
- Add `client:ApplySpellGroup(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`.
- Add `client:ApplySpellRaid(spell_id)`.
- Add `client:ApplySpellRaid(spell_id, duration)`.
- Add `client:ApplySpellRaid(spell_id, duration, allow_pets)`.
- Add `client:ApplySpellRaid(spell_id, duration, allow_pets, is_raid_group_only)`.
- Add `client:ApplySpellRaid(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`.
- Add `client:SetSpellDuration(spell_id)`.
- Add `client:SetSpellDuration(spell_id, duration)`.
- Add `client:SetSpellDuration(spell_id, duration, allow_pets)`.
- Add `client:SetSpellDuration(spell_id, duration, allow_pets, is_raid_group_only)`.
- Add `client:SetSpellDuration(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`.
- Add `client:SetSpellDurationGroup(spell_id)`.
- Add `client:SetSpellDurationGroup(spell_id, duration)`.
- Add `client:SetSpellDurationGroup(spell_id, duration, allow_pets)`.
- Add `client:SetSpellDurationGroup(spell_id, duration, allow_pets, is_raid_group_only)`.
- Add `client:SetSpellDurationGroup(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`.
- Add `client:SetSpellDurationRaid(spell_id)`.
- Add `client:SetSpellDurationRaid(spell_id, duration)`.
- Add `client:SetSpellDurationRaid(spell_id, duration, allow_pets)`.
- Add `client:SetSpellDurationRaid(spell_id, duration, allow_pets, is_raid_group_only)`.
- Add `client:SetSpellDurationRaid(spell_id, duration, allow_pets, is_raid_group_only, allow_bots)`.

# Notes
- Allows operators extremely easy shorthands to cast on entire groups and raid groups and optionally include their bots and pets.
- Default functionality for Raid is that it only casts on your group, set `is_raid_group_only` to `false` to cast on the entire Raid.

* Cleanup.

* Remove Raid parameter from Solo/Group methods.
2022-11-22 09:11:36 -05:00
Kinglykrab
0003f6f863
[Quest API] Add Area Damage Methods to Perl/Lua. (#2549)
* [Quest API] Add Area Damage Methods to Perl/Lua.

# Perl
- Add `$mob->DamageArea(damage)`.
- Add `$mob->DamageArea(damage, distance)`.
- Add `$mob->DamageAreaBots(damage)`.
- Add `$mob->DamageAreaBots(damage, distance)`.
- Add `$mob->DamageAreaClients(damage)`.
- Add `$mob->DamageAreaClients(damage, distance)`.
- Add `$mob->DamageAreaNPCs(damage)`.
- Add `$mob->DamageAreaNPCs(damage, distance)`.
- Add `$mob->DamageAreaPercentage(damage)`.
- Add `$mob->DamageAreaPercentage(damage, distance)`.
- Add `$mob->DamageAreaBotsPercentage(damage)`.
- Add `$mob->DamageAreaBotsPercentage(damage, distance)`.
- Add `$mob->DamageAreaClientsPercentage(damage)`.
- Add `$mob->DamageAreaClientsPercentage(damage, distance)`.
- Add `$mob->DamageAreaNPCsPercentage(damage)`.
- Add `$mob->DamageAreaNPCsPercentage(damage, distance)`.

# Lua
- Add `mob:DamageArea(damage)`.
- Add `mob:DamageArea(damage, distance)`.
- Add `mob:DamageAreaBots(damage)`.
- Add `mob:DamageAreaBots(damage, distance)`.
- Add `mob:DamageAreaClients(damage)`.
- Add `mob:DamageAreaClients(damage, distance)`.
- Add `mob:DamageAreaNPCs(damage)`.
- Add `mob:DamageAreaNPCs(damage, distance)`.
- Add `mob:DamageAreaPercentage(damage)`.
- Add `mob:DamageAreaPercentage(damage, distance)`.
- Add `mob:DamageAreaBotsPercentage(damage)`.
- Add `mob:DamageAreaBotsPercentage(damage, distance)`.
- Add `mob:DamageAreaClientsPercentage(damage)`.
- Add `mob:DamageAreaClientsPercentage(damage, distance)`.
- Add `mob:DamageAreaNPCsPercentage(damage)`.
- Add `mob:DamageAreaNPCsPercentage(damage, distance)`.

# Notes
- Cleanup parameter order of damage methods.
- These methods allow you to damage all Bots, Clients, Mobs, or NPCs in a zone or by distance from the Mob.
- Fix math with percentage damage.

* Update entity.cpp
2022-11-16 21:11:01 -06:00
Kinglykrab
856aa51cb8
[Bots] Add support for Bot scripting. (#2515)
* [Bots] Add support for Bot scripting.

# Perl
- Add support for `zone/bot.pl` and `zone/bot_v#.pl`.
- Add support for `global/global_bot.pl`.
- Add `$bot->SignalBot(signal_id)` to Perl.
- Add `$bot->OwnerMessage(message)` to Perl.
- Add `$entity_list->SignalAllBotsByOwnerCharacterID(character_id, signal_id)` to Perl.
- Add `$entity_list->SignalBotByBotID(bot_id, signal_id)` to Perl.
- Add `$entity_list->SignalBotByBotName(bot_name, signal_id)` to Perl.
- Add `EVENT_SPELL_EFFECT_BOT` to Perl.
- Add `EVENT_SPELL_EFFECT_BUFF_TIC_BOT` to Perl.

# Lua
- Add support for `zone/bot.lua` and `zone/bot_v#.lua`.
- Add support for `global/global_bot.lua`.
- Add `bot:SignalBot(signal_id)` to Lua.
- Add `bot:OwnerMessage(message)` to Lua.
- Add `entity_list:SignalAllBotsByOwnerCharacterID(character_id, signal_id)` to Lua.
- Add `entity_list:SignalBotByBotID(bot_id, signal_id)` to Lua.
- Add `entity_list:SignalBotByBotName(bot_name, signal_id)` to Lua.
- Add `EVENT_SPELL_EFFECT_BOT` to Lua.
- Add `EVENT_SPELL_EFFECT_BUFF_TIC_BOT` to Lua.

# Supported Bot Events
1. `EVENT_CAST`
2. `EVENT_CAST_BEGIN`
3. `EVENT_CAST_ON`
4. `EVENT_COMBAT`
5. `EVENT_DEATH`
6. `EVENT_DEATH_COMPLETE`
7. `EVENT_SAY`
8. `EVENT_SIGNAL`
9. `EVENT_SLAY`
10. `EVENT_SLAY_NPC`
11. `EVENT_SPAWN`
12. `EVENT_TARGET_CHANGE`
13. `EVENT_TIMER`
14. `EVENT_USE_SKILL`

# Common
- Convert NPC pointers in common events to Mob pointers so bots are supported.
- Convert signal IDs to `int` where it wasn't already, allowing negative signals to be sent properly.

* Add EVENT_POPUP_RESPONSE.

* Cleanup and fix EVENT_COMBAT/EVENT_SLAY/EVENT_NPC_SLAY.

* Fix DoNPCEmote calls.

* Update attack.cpp

* Update event_codes.h

* Update bot_command.cpp
2022-11-16 21:02:16 -06:00
Kinglykrab
bb58a9cd20
[Quest API] Add Marquee methods to Perl/Lua. (#2544)
* [Quest API] Add zonemarquee to Perl/Lua.

# Perl
- Add `quest::zonemarquee(type, priority, fade_in, fade_out, duration, message)` to Perl.

# Lua
- Add `eq.zone_marquee(type, priority, fade_in, fade_out, duration, message)` to Lua.

# Notes
- Allows operators to easily send a zone-wide marquee, similar to `quest::ze`/`eq.zone_emote`.

* Update lua_general.cpp

* Add other methods.

* Add entity list marquee

* Update client.cpp

* Add more shorthands.
2022-11-16 07:23:39 -06:00
Kinglykrab
8c994fef97
[Quest API] Add Mob Hate Methods to Perl/Lua. (#2548)
* [Quest API] Add Mob Hate Methods to Perl/Lua.

# Perl
- Add `$mob->DamageHateList(damage)` to Perl.
- Add `$mob->DamageHateList(damage, distance)` to Perl.
- Add `$mob->DamageHateListPercentage(damage)` to Perl.
- Add `$mob->DamageHateListPercentage(damage, distance)` to Perl.
- Add `$mob->DamageHateListBots(damage)` to Perl.
- Add `$mob->DamageHateListBots(damage, distance)` to Perl.
- Add `$mob->DamageHateListBotsPercentage(damage)` to Perl.
- Add `$mob->DamageHateListBotsPercentage(damage, distance)` to Perl.
- Add `$mob->DamageHateListClients(damage)` to Perl.
- Add `$mob->DamageHateListClients(damage, distance)` to Perl.
- Add `$mob->DamageHateListClientsPercentage(damage)` to Perl.
- Add `$mob->DamageHateListClientsPercentage(damage, distance)` to Perl.
- Add `$mob->DamageHateListNPCs(damage)` to Perl.
- Add `$mob->DamageHateListNPCs(damage, distance)` to Perl.
- Add `$mob->DamageHateListNPCsPercentage(damage)` to Perl.
- Add `$mob->DamageHateListNPCsPercentage(damage, distance)` to Perl.
- Add `$mob->GetHateListBots()` to Perl.
- Add `$mob->GetHateListBots(distance)` to Perl.
- Add `$mob->GetHateListClients()` to Perl.
- Add `$mob->GetHateListClients(distance)` to Perl.
- Add `$mob->GetHateListNPCs()` to Perl.
- Add `$mob->GetHateListNPCs(distance)` to Perl.

# Lua
- Add `mob:DamageHateList(damage)` to Lua.
- Add `mob:DamageHateList(damage, distance)` to Lua.
- Add `mob:DamageHateListPercentage(damage)` to Lua.
- Add `mob:DamageHateListPercentage(damage, distance)` to Lua.
- Add `mob:DamageHateListBots(damage)` to Lua.
- Add `mob:DamageHateListBots(damage, distance)` to Lua.
- Add `mob:DamageHateListBotsPercentage(damage)` to Lua.
- Add `mob:DamageHateListBotsPercentage(damage, distance)` to Lua.
- Add `mob:DamageHateListClients(damage)` to Lua.
- Add `mob:DamageHateListClients(damage, distance)` to Lua.
- Add `mob:DamageHateListClientsPercentage(damage)` to Lua.
- Add `mob:DamageHateListClientsPercentage(damage, distance)` to Lua.
- Add `mob:DamageHateListNPCs(damage)` to Lua.
- Add `mob:DamageHateListNPCs(damage, distance)` to Lua.
- Add `mob:DamageHateListNPCsPercentage(damage)` to Lua.
- Add `mob:DamageHateListNPCsPercentage(damage, distance)` to Lua.
- Add `mob:GetHateListBots()` to Lua.
- Add `mob:GetHateListBots(distance)` to Lua.
- Add `mob:GetHateListClients()` to Lua.
- Add `mob:GetHateListClients(distance)` to Lua.
- Add `mob:GetHateListNPCs()` to Lua.
- Add `mob:GetHateListNPCs(distance)` to Lua.

# Notes
- Offers an extreme amount of short hands when grabbing hate list entities by a specific type or damaging a specific type of entity on an NPC's hatelist.
- Should save operators having to use `GetHateList()` then loop it to get the entries they want to do something.

* Cleanup.
2022-11-16 07:16:47 -06:00
Kinglykrab
8f1b87c5e4
[Quest API] Add Owner methods to Perl/Lua. (#2542)
* [Quest API] Add Owner methods to Perl/Lua.

# Perl
- Add `$mob->GetOwner()` to Perl.

# Lua
- Add `mob:GetOwnerID()` to Lua.

# Notes
- `GetOwner()` exists in Lua, but not Perl.
- `GetOwnerID()` exists in Perl, but not Lua.

* Update lua_mob.cpp
2022-11-14 18:03:26 -05:00
Kinglykrab
e72ec4ae56
[Quest API] Add RandomizeFeature() overloads to Perl/Lua. (#2532)
# Perl
- Add `$mob->RandomizeFeatures()` to Perl.
- Add `$mob->RandomizeFeatures(send_illusion)` to Perl.
- Add `$mob->RandomizeFeatures(send_illusion, set_variables)` to Perl.

# Lua
- Add `mob:RandomizeFeatures()` to Lua.
- Add `mob:RandomizeFeatures(send_illusion)` to Lua.
- Add `mob:RandomizeFeatures(send_illusion, set_variables)` to Lua.

# Notes
- Previous overload required `send_illusion` and `set_variables` despite both default values being `true`, this will allow you to just send nothing if you want both to be `true`.
- Change `RandomizeFeatures()` type to `bool` from `void` to match source method, returns `false` when used on a race that has no features to randomize.
- This allows operators to do something different if the NPC can't use this method.
2022-11-14 16:59:17 -05:00
Kinglykrab
31e5622dad
[Quest API] Add CloneAppearance() to Perl/Lua. (#2531)
* [Quest API] Add CloneAppearance() to Perl/Lua.

# Perl
- Add `$client->CloneAppearance(other)` to Perl.
- Add `$client->CloneAppearance(other, clone_name)` to Perl.

# Lua
- Add `client:CloneAppearance(other)` to Lua.
- Add `client:CloneAppearance(other, clone_name)` to Lua.

# Notes
- Allows operators to easily clone appearance between mobs in a script without relying on a plugin or module.

* Update mob_appearance.cpp

* Update mob.cpp
2022-11-14 14:05:05 -05:00
Kinglykrab
a3928ec504
[Quest API] Add GetUltimateOwner() to Perl/Lua. (#2516)
# Perl
- Add `$mob->GetUltimateOwner()` to Perl.

# Lua
- Add `mob:GetUltimateOwner()` to Lua.

# Notes
- Allows operators to get ultimate owner of something like a pet's pet or a pet's swarm pet.
2022-11-05 08:35:14 -04:00
hg
16ee25224d
[Feature] Add special ability to block /open (#2506)
This adds the IMMUNE_OPEN (53) special ability to prevent /open on
LDON_TREASURE classes.
2022-10-29 19:48:14 -04:00
hg
793d4bc3a4
[Quest API] Use Floating Point for CameraEffect Intensity (#2337)
This was implemented in a very odd way. The intensity is just a float.

This is a breaking api change but low-impact (intensity will be
different).

To convert old values to new values with same intensity:

  0: 0.03125
  1: 0.05625
  2: 0.1
  3: 0.175
  4: 0.3
  5: 0.5
  6: 0.9
  7: 1.6
  8: 2.8
  9: 4.8
 10: 8.0
2022-07-30 19:18:20 -05:00
Kinglykrab
11369247b1
[INT64] Further int64 cleanup in Perl SetHP() and GetSpellHPBonuses() in Perl/Lua. (#2222) 2022-05-29 16:36:32 -05:00
Kinglykrab
8f3ac74196
[INT64] Fix int64 for OOC Regen and GetHP(), GetMaxHP(), GetItemHPBonuses() in Perl/Lua. (#2218)
* [INT64] Fix int64 for OOC Regen and GetHP(), GetMaxHP(), GetItemHPBonuses() in Perl/Lua.
- These all had int64 values and were overflowing, returning garbage data.

* Update npc.cpp
2022-05-29 14:33:30 -04:00
Chris Miles
209b0eb273
[int64] Hate Fixes (#2163)
* Hate fixes

* Update perl_hateentry.cpp

* Update perl_hateentry.cpp
2022-05-09 20:49:43 -05:00