Compare commits

...

47 Commits

Author SHA1 Message Date
Alex King e9e8143778 [Release] 22.17.0 (#3476)
## [22.17.0] - 07/03/2023

### Cleanup/Feature

* Add support for bots to #showstats/#mystats ([#3427](https://github.com/EQEmu/Server/pull/3427)) @Kinglykrab 2023-07-01

### Code

* Remove LoadItemDBFieldNames() from common/misc.cpp and common/misc.h ([#3473](https://github.com/EQEmu/Server/pull/3473)) @Kinglykrab 2023-07-04
* Remove handle_npc_single_npc from zone/lua_parser_events.cpp and zone/lua_parser_events.h ([#3467](https://github.com/EQEmu/Server/pull/3467)) @Kinglykrab 2023-07-03

### Database

* Set multi statements off when returning early ([#3462](https://github.com/EQEmu/Server/pull/3462)) @Akkadius 2023-07-01

### Feature

* Add Strings::BeginsWith() and Strings::EndsWith() ([#3471](https://github.com/EQEmu/Server/pull/3471)) @Kinglykrab 2023-07-03

### Fixes

* Add check for underscores in botcreate command ([#3458](https://github.com/EQEmu/Server/pull/3458)) @tuday2 2023-06-29
* EVENT_LANGUAGE_SKILL_UP in Lua was using EVENT_SKILL_UP logic ([#3466](https://github.com/EQEmu/Server/pull/3466)) @Kinglykrab 2023-07-03
* Fix _PutItem having a slot_id of -1 on mobs with no items ([#3474](https://github.com/EQEmu/Server/pull/3474)) @Kinglykrab 2023-07-04
* Fix data type of GetAggroCount() ([#3470](https://github.com/EQEmu/Server/pull/3470)) @Kinglykrab 2023-07-03

### Logging

* Fix logging crash when % are sent through query logs ([#3461](https://github.com/EQEmu/Server/pull/3461)) @Akkadius 2023-07-01

### Quest API

* Add ClearAccountFlag() and GetAccountFlags() to Perl/Lua ([#3469](https://github.com/EQEmu/Server/pull/3469)) @Kinglykrab 2023-07-03
* Add GetClassAbbreviation() and GetRaceAbbreviation() to Perl/Lua ([#3463](https://github.com/EQEmu/Server/pull/3463)) @Kinglykrab 2023-07-02
* Add GetClassPlural() and GetRacePlural() to Perl/Lua ([#3468](https://github.com/EQEmu/Server/pull/3468)) @Kinglykrab 2023-07-03
* Add GetCloseMobList() and CalculateDistance() overload to Perl/Lua ([#3455](https://github.com/EQEmu/Server/pull/3455)) @Kinglykrab 2023-07-02
* Add Hate Entry Methods to Perl ([#3459](https://github.com/EQEmu/Server/pull/3459)) @Kinglykrab 2023-07-02
* Add ItemData Class to Perl ([#3465](https://github.com/EQEmu/Server/pull/3465)) @Kinglykrab 2023-07-02
* Add Spawn2 Class to Perl ([#3456](https://github.com/EQEmu/Server/pull/3456)) @Kinglykrab 2023-07-02
* Add StatBonuses Class to Perl ([#3460](https://github.com/EQEmu/Server/pull/3460)) @Kinglykrab 2023-07-02
* Add missing Item Methods to Perl/Lua. ([#3464](https://github.com/EQEmu/Server/pull/3464)) @Kinglykrab 2023-07-02
2023-07-03 19:46:15 -05:00
Alex King bc71997518 [Bug Fix] Fix _PutItem having a slot_id of -1 on mobs with no items (#3474)
# Notes
- This was causing an insane amount of error logs because we were always using `PutItem`, even with a `slot_id` of `-1`.
2023-07-03 20:33:21 -04:00
Alex King 4a9a9fa197 [Cleanup] Remove LoadItemDBFieldNames() from common/misc.cpp and common/misc.h (#3473)
# Notes
- This is unused.
2023-07-03 19:20:34 -05:00
Alex King ee14aed8de [Feature] Add Strings::BeginsWith() and Strings::EndsWith() (#3471)
* [Strings] Add Strings::BeginsWith() and Strings::EndsWith()

# Notes
- These are useful so that we don't have to manually calculate size or perform a substring.

* Update questmgr.cpp

* Update client.cpp
2023-07-03 09:40:44 -04: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 dc28c8d485 [Bug Fix] Fix data type of GetAggroCount() (#3470)
# Notes
- This is an `unsigned int`, not an `int`, so this fixes that.
2023-07-03 00:10:27 -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 5519c3e781 [Cleanup] Remove handle_npc_single_npc from zone/lua_parser_events.cpp and zone/lua_parser_events.h (#3467)
# Notes
- This is unused.
2023-07-02 23:56:04 -05:00
Alex King 9401323708 [Bug Fix] EVENT_LANGUAGE_SKILL_UP in Lua was using EVENT_SKILL_UP logic (#3466)
# Notes
- `EVENT_LANGUAGE_SKILL_UP` only takes `3` values whereas `EVENT_SKILL_UP` takes `4`.
2023-07-02 20:41:53 -04:00
Alex King 251993c61b [Quest API] Add ItemData Class to Perl (#3465)
* [Quest API] Add ItemData Class to Perl

- Add `$questitem->GetItem()`.
- Add `$questitem->GetUnscaledItem()`.
- Add `$questitemdata->GetAGI()`.
- Add `$questitemdata->GetAC()`.
- Add `$questitemdata->GetCHA()`.
- Add `$questitemdata->GetDEX()`.
- Add `$questitemdata->GetINT()`.
- Add `$questitemdata->GetSTA()`.
- Add `$questitemdata->GetSTR()`.
- Add `$questitemdata->GetAWis()`.
- Add `$questitemdata->GetAccuracy()`.
- Add `$questitemdata->GetArtifactFlag()`.
- Add `$questitemdata->GetAttack()`.
- Add `$questitemdata->GetAttuneable()`.
- Add `$questitemdata->GetAugmentDistiller()`.
- Add `$questitemdata->GetAugmentRestrict()`.
- Add `$questitemdata->GetAugmentSlotType(slot_id)`.
- Add `$questitemdata->GetAugmentSlotUnk2(slot_id)`.
- Add `$questitemdata->GetAugmentSlotVisible(slot_id)`.
- Add `$questitemdata->GetAugmentType()`.
- Add `$questitemdata->GetAvoidance()`.
- Add `$questitemdata->GetBackstabDamage()`.
- Add `$questitemdata->GetBagSize()`.
- Add `$questitemdata->GetBagSlots()`.
- Add `$questitemdata->GetBagType()`.
- Add `$questitemdata->GetBagWeightReduction()`.
- Add `$questitemdata->GetBaneDamageAmount()`.
- Add `$questitemdata->GetBaneDamageBody()`.
- Add `$questitemdata->GetBaneDamageRace()`.
- Add `$questitemdata->GetBaneDamageRaceAmount()`.
- Add `$questitemdata->GetBardEffect()`.
- Add `$questitemdata->GetBardLevel()`.
- Add `$questitemdata->GetBardLevel2()`.
- Add `$questitemdata->GetBardType()`.
- Add `$questitemdata->GetBardSkillType()`.
- Add `$questitemdata->GetBardSkillValue()`.
- Add `$questitemdata->GetBenefitFlag()`.
- Add `$questitemdata->GetBook()`.
- Add `$questitemdata->GetBookType()`.
- Add `$questitemdata->GetCR()`.
- Add `$questitemdata->GetCastTime()`.
- Add `$questitemdata->GetCastTime_()`.
- Add `$questitemdata->GetCharmFile()`.
- Add `$questitemdata->GetCharmFileID()`.
- Add `$questitemdata->GetClairvoyance()`.
- Add `$questitemdata->GetClasses()`.
- Add `$questitemdata->GetClickName()`.
- Add `$questitemdata->GetClickEffect()`.
- Add `$questitemdata->GetClickLevel()`.
- Add `$questitemdata->GetClickLevel2()`.
- Add `$questitemdata->GetClickType()`.
- Add `$questitemdata->GetColor()`.
- Add `$questitemdata->GetCombatEffects()`.
- Add `$questitemdata->GetCorruption()`.
- Add `$questitemdata->GetDR()`.
- Add `$questitemdata->GetDSMitigation()`.
- Add `$questitemdata->GetDamage()`.
- Add `$questitemdata->GetDamageShield()`.
- Add `$questitemdata->GetDeity()`.
- Add `$questitemdata->GetDelay()`.
- Add `$questitemdata->GetDOTShielding()`.
- Add `$questitemdata->GetElementalDamageAmount()`.
- Add `$questitemdata->GetElementalDamageType()`.
- Add `$questitemdata->GetEliteMaterial()`.
- Add `$questitemdata->GetEndurance()`.
- Add `$questitemdata->GetEnduranceRegen()`.
- Add `$questitemdata->GetExpendableArrow()`.
- Add `$questitemdata->GetExtraDamageAmount()`.
- Add `$questitemdata->GetExtraDamageSkill()`.
- Add `$questitemdata->GetFR()`.
- Add `$questitemdata->GetFVNoDrop()`.
- Add `$questitemdata->GetFactionAmount1()`.
- Add `$questitemdata->GetFactionAmount2()`.
- Add `$questitemdata->GetFactionAmount3()`.
- Add `$questitemdata->GetFactionAmount4()`.
- Add `$questitemdata->GetFactionModifier1()`.
- Add `$questitemdata->GetFactionModifier2()`.
- Add `$questitemdata->GetFactionModifier3()`.
- Add `$questitemdata->GetFactionModifier4()`.
- Add `$questitemdata->GetFavor()`.
- Add `$questitemdata->GetFilename()`.
- Add `$questitemdata->GetFocusEffect()`.
- Add `$questitemdata->GetFocusName()`.
- Add `$questitemdata->GetFocusLevel()`.
- Add `$questitemdata->GetFocusLevel2()`.
- Add `$questitemdata->GetFocusType()`.
- Add `$questitemdata->GetFulfilment()`.
- Add `$questitemdata->GetGuildFavor()`.
- Add `$questitemdata->GetHP()`.
- Add `$questitemdata->GetHaste()`.
- Add `$questitemdata->GetHealAmount()`.
- Add `$questitemdata->GetHeroicAGI()`.
- Add `$questitemdata->GetHeroicCR()`.
- Add `$questitemdata->GetHeroicCHA()`.
- Add `$questitemdata->GetHeroicCorruption()`.
- Add `$questitemdata->GetHeroicDR()`.
- Add `$questitemdata->GetHeroicDEX()`.
- Add `$questitemdata->GetHeroicFR()`.
- Add `$questitemdata->GetHeroicINT()`.
- Add `$questitemdata->GetHeroicMR()`.
- Add `$questitemdata->GetHeroicPR()`.
- Add `$questitemdata->GetHeroicSTA()`.
- Add `$questitemdata->GetHeroicSTR()`.
- Add `$questitemdata->GetHeroicWIS()`.
- Add `$questitemdata->GetID()`.
- Add `$questitemdata->GetIDFile()`.
- Add `$questitemdata->GetIcon()`.
- Add `$questitemdata->GetItemClass()`.
- Add `$questitemdata->GetItemType()`.
- Add `$questitemdata->GetLDoNPrice()`.
- Add `$questitemdata->GetLDoNSellBackRate()`.
- Add `$questitemdata->GetLDoNSold()`.
- Add `$questitemdata->GetLDoNTheme()`.
- Add `$questitemdata->GetLight()`.
- Add `$questitemdata->GetLore()`.
- Add `$questitemdata->GetLoreFlag()`.
- Add `$questitemdata->GetLoreGroup()`.
- Add `$questitemdata->GetMR()`.
- Add `$questitemdata->GetMagic()`.
- Add `$questitemdata->GetMana()`.
- Add `$questitemdata->GetManaRegen()`.
- Add `$questitemdata->GetMaterial()`.
- Add `$questitemdata->GetMaximumCharges()`.
- Add `$questitemdata->GetMinimumStatus()`.
- Add `$questitemdata->GetName()`.
- Add `$questitemdata->GetNoDrop()`.
- Add `$questitemdata->GetNoPet()`.
- Add `$questitemdata->GetNoRent()`.
- Add `$questitemdata->GetNoTransfer()`.
- Add `$questitemdata->GetPR()`.
- Add `$questitemdata->GetPendingLoreFlag()`.
- Add `$questitemdata->GetPointType()`.
- Add `$questitemdata->GetPotionBelt()`.
- Add `$questitemdata->GetPotionBeltSlots()`.
- Add `$questitemdata->GetPrice()`.
- Add `$questitemdata->GetProcEffect()`.
- Add `$questitemdata->GetProcName()`.
- Add `$questitemdata->GetProcRate()`.
- Add `$questitemdata->GetProcLevel()`.
- Add `$questitemdata->GetProcLevel2()`.
- Add `$questitemdata->GetProcType()`.
- Add `$questitemdata->GetPurity()`.
- Add `$questitemdata->GetQuestItemFlag()`.
- Add `$questitemdata->GetRaces()`.
- Add `$questitemdata->GetRange()`.
- Add `$questitemdata->GetRecLevel()`.
- Add `$questitemdata->GetRecSkill()`.
- Add `$questitemdata->GetRecastDelay()`.
- Add `$questitemdata->GetRecastType()`.
- Add `$questitemdata->GetRegen()`.
- Add `$questitemdata->GetReqLevel()`.
- Add `$questitemdata->GetScriptFileID()`.
- Add `$questitemdata->GetScrollEffect()`.
- Add `$questitemdata->GetScrollName()`.
- Add `$questitemdata->GetScrollLevel()`.
- Add `$questitemdata->GetScrollLevel2()`.
- Add `$questitemdata->GetScrollType()`.
- Add `$questitemdata->GetSellRate()`.
- Add `$questitemdata->GetShielding()`.
- Add `$questitemdata->GetSize()`.
- Add `$questitemdata->GetSkillModifierType()`.
- Add `$questitemdata->GetSkillModifierValue()`.
- Add `$questitemdata->GetSlots()`.
- Add `$questitemdata->GetSpellDamage()`.
- Add `$questitemdata->GetSpellShield()`.
- Add `$questitemdata->GetStackSize()`.
- Add `$questitemdata->GetStackable()`.
- Add `$questitemdata->GetStrikeThrough()`.
- Add `$questitemdata->GetStunResist()`.
- Add `$questitemdata->GetSummonedFlag()`.
- Add `$questitemdata->GetTradeskills()`.
- Add `$questitemdata->GetWeight()`.
- Add `$questitemdata->GetWornName()`.
- Add `$questitemdata->GetWornEffect()`.
- Add `$questitemdata->GetWornLevel()`.
- Add `$questitemdata->GetWornLevel2()`.
- Add `$questitemdata->GetWornType()`.

- Fixed data type of parameters in a handful of methods.

- Allows operators to directly interact with item data without the need for `quest::getitemstat` or DBI or anything of the sort.

* Update perl_questitem.cpp

* Update lua_iteminst.cpp

* Update lua_iteminst.h

* Update lua_iteminst.h
2023-07-02 11:26:49 -04: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
Alex King 6a80bcecc7 [Quest API] Add missing Item Methods to Perl/Lua. (#3464)
# Perl
- Add `$questitem->AddEXP(exp)`.
- Add `$questitem->ClearTimers()`.
- Add `$questitem->Clone()`.
- Add `$questitem->DeleteCustomData(identifier)`.
- Add `$questitem->GetAugmentItemID(slot_id)`.
- Add `$questitem->GetAugmentType()`.
- Add `$questitem->GetColor()`.
- Add `$questitem->GetCustomData(identifier)`.
- Add `$questitem->GetCustomDataString()`.
- Add `$questitem->GetEXP()`.
- Add `$questitem->GetItem(slot_id)`.
- Add `$questitem->GetItemID(slot_id)`.
- Add `$questitem->GetItemScriptID()`.
- Add `$questitem->GetKillsNeeded()`.
- Add `$questitem->GetMaxEvolveLevel()`.
- Add `$questitem->GetPrice()`.
- Add `$questitem->GetTotalItemCount()`.
- Add `$questitem->IsAmmo()`.
- Add `$questitem->IsAugmentable()`.
- Add `$questitem->IsAugmented()`.
- Add `$questitem->IsEquipable(slot_id)`.
- Add `$questitem->IsEquipable(race_bitmask, class_bitmask)`.
- Add `$questitem->IsExpendable()`.
- Add `$questitem->IsInstanceNoDrop()`.
- Add `$questitem->IsWeapon()`.
- Add `$questitem->SetAttuned(is_attuned)`.
- Add `$questitem->SetColor(color)`.
- Add `$questitem->SetCustomData(identifier, bool_value)`.
- Add `$questitem->SetCustomData(identifier, float_value)`.
- Add `$questitem->SetCustomData(identifier, int_value)`.
- Add `$questitem->SetCustomData(identifier, string_value)`.
- Add `$questitem->SetEXP(exp)`.
- Add `$questitem->SetInstanceNoDrop(is_attuned)`.
- Add `$questitem->SetPrice(price)`.
- Add `$questitem->SetScaling(is_scaling)`.
- Add `$questitem->SetTimer(timer_name, timer)`.
- Add `$questitem->StopTimer(timer_name)`.

# Lua
- Add `iteminst:GetName()`.
- Add `iteminst:IsAttuned()`.
- Add `iteminst:ItemSay(text)`.
- Add `iteminst:ItemSay(text, language_id)`.
- Add `iteminst:SetAttuned(is_attuned)`.

# Notes
- Cleaned up return types and parameter types that were mismatched.
- Removed `SetItem` from Lua as it wasn't used.
- Removed unused parameter in `GetUnscaledItem` in Lua.
- I plan to add Perl ItemData support after this makes its way in, so the missing methods like the `GetItem` overload will be added then.
2023-07-02 10:27:05 -04:00
Alex King 6324e3687a [Quest API] Add GetClassAbbreviation() and GetRaceAbbreviation() to Perl/Lua (#3463)
# Perl
- Add `$bot->GetClassAbbreviation()`.
- Add `$bot->GetRaceAbbreviation()`.
- Add `$client->GetClassAbbreviation()`.
- Add `$client->GetRaceAbbreviation()`.

# Lua
- Add `bot:GetClassAbbreviation()`.
- Add `bot:GetRaceAbbreviation()`.
- Add `client:GetClassAbbreviation()`.
- Add `client:GetRaceAbbreviation()`.

# Notes
- Allows operators to easily get a player race/class abbreviation, example being `Warrior` as `WAR`.
2023-07-02 10:26:51 -04:00
Alex King d16ac99033 [Quest API] Add StatBonuses Class to Perl (#3460)
* [Quest API] Add StatBonuses Class to Perl

# Perl
- Add `$mob->GetAABonuses()`.
- Add `$mob->GetItemBonuses()`.
- Add `$mob->GetSpellBonuses()`.
- Add `$statbonuses->GetAbsorbMagicAttack(slot)`.
- Add `$statbonuses->GetAC()`.
- Add `$statbonuses->GetAccuracy(slot)`.
- Add `$statbonuses->GetAdjustedCastingSkill()`.
- Add `$statbonuses->GetAggroRange()`.
- Add `$statbonuses->GetAGI()`.
- Add `$statbonuses->GetAGICapModifier()`.
- Add `$statbonuses->GetAlterNPCLevel()`.
- Add `$statbonuses->GetAmbidexterity()`.
- Add `$statbonuses->GetAmplification()`.
- Add `$statbonuses->GetAntiGate()`.
- Add `$statbonuses->GetArcheryDamageModifier()`.
- Add `$statbonuses->GetAssassinate(slot)`.
- Add `$statbonuses->GetAssassinateLevel(slot)`.
- Add `$statbonuses->GetAssistRange()`.
- Add `$statbonuses->GetAStacker(slot)`.
- Add `$statbonuses->GetATK()`.
- Add `$statbonuses->GetAvoidMeleeChance()`.
- Add `$statbonuses->GetAvoidMeleeChanceEffect()`.
- Add `$statbonuses->GetBaseMovementSpeed()`.
- Add `$statbonuses->GetBerserkSPA()`.
- Add `$statbonuses->GetBindWound()`.
- Add `$statbonuses->GetBlockBehind()`.
- Add `$statbonuses->GetBrassModifier()`.
- Add `$statbonuses->GetBStacker(slot)`.
- Add `$statbonuses->GetBuffSlotIncrease()`.
- Add `$statbonuses->GetCHA()`.
- Add `$statbonuses->GetCHACapModifier()`.
- Add `$statbonuses->GetChannelChanceItems()`.
- Add `$statbonuses->GetChannelChanceSpells()`.
- Add `$statbonuses->GetCharmBreakChance()`.
- Add `$statbonuses->GetClairvoyance()`.
- Add `$statbonuses->GetCombatStability()`.
- Add `$statbonuses->GetConsumeProjectile()`.
- Add `$statbonuses->GetCorrup()`.
- Add `$statbonuses->GetCorrupCapModifier()`.
- Add `$statbonuses->GetCR()`.
- Add `$statbonuses->GetCRCapModifier()`.
- Add `$statbonuses->GetCripplingBlowChance()`.
- Add `$statbonuses->GetCriticalDamageModifier(slot)`.
- Add `$statbonuses->GetCriticalDoTChance()`.
- Add `$statbonuses->GetCriticalDOTDecay()`.
- Add `$statbonuses->GetCriticalHealChance()`.
- Add `$statbonuses->GetCriticalHealDecay()`.
- Add `$statbonuses->GetCriticalHealOverTime()`.
- Add `$statbonuses->GetCriticalHitChance(slot)`.
- Add `$statbonuses->GetCriticalMend()`.
- Add `$statbonuses->GetCriticalRegenDecay()`.
- Add `$statbonuses->GetCriticalSpellChance()`.
- Add `$statbonuses->GetCStacker(slot)`.
- Add `$statbonuses->GetDamageModifier(slot)`.
- Add `$statbonuses->GetDamageModifier2(slot)`.
- Add `$statbonuses->GetDamageShield()`.
- Add `$statbonuses->GetDamageShieldSpellID()`.
- Add `$statbonuses->GetDamageShieldType()`.
- Add `$statbonuses->GetDeathSave(slot)`.
- Add `$statbonuses->GetDelayDeath()`.
- Add `$statbonuses->GetDEX()`.
- Add `$statbonuses->GetDEXCapModifier()`.
- Add `$statbonuses->GetDistanceRemoval()`.
- Add `$statbonuses->GetDivineAura()`.
- Add `$statbonuses->GetDivineSaveChance(slot)`.
- Add `$statbonuses->GetDodgeChance()`.
- Add `$statbonuses->GetDOTCriticalDamageIncrease()`.
- Add `$statbonuses->GetDoTShielding()`.
- Add `$statbonuses->GetDoubleAttackChance()`.
- Add `$statbonuses->GetDoubleRangedAttack()`.
- Add `$statbonuses->GetDoubleRiposte()`.
- Add `$statbonuses->GetDoubleSpecialAttack()`.
- Add `$statbonuses->GetDR()`.
- Add `$statbonuses->GetDRCapModifier()`.
- Add `$statbonuses->GetDSMitigation()`.
- Add `$statbonuses->GetDSMitigationOffHand()`.
- Add `$statbonuses->GetDStacker(slot)`.
- Add `$statbonuses->GetDualWieldChance()`.
- Add `$statbonuses->GetEffectiveCastingLevel()`.
- Add `$statbonuses->GetEndurancePercentCap(slot)`.
- Add `$statbonuses->GetEndurance()`.
- Add `$statbonuses->GetEnduranceReduction()`.
- Add `$statbonuses->GetEnduranceRegen()`.
- Add `$statbonuses->GetExtraXTargets()`.
- Add `$statbonuses->GetExtraAttackChance()`.
- Add `$statbonuses->GetFactionModifierPercent()`.
- Add `$statbonuses->GetFearless()`.
- Add `$statbonuses->GetFeignedCastOnChance()`.
- Add `$statbonuses->GetFinishingBlow(slot)`.
- Add `$statbonuses->GetFinishingBlowLevel(slot)`.
- Add `$statbonuses->GetFlurryChance()`.
- Add `$statbonuses->GetFocusEffects(slot)`.
- Add `$statbonuses->GetFocusEffectsWorn(slot)`.
- Add `$statbonuses->GetForageAdditionalItems()`.
- Add `$statbonuses->GetFR()`.
- Add `$statbonuses->GetFRCapModifier()`.
- Add `$statbonuses->GetFrenziedDevastation()`.
- Add `$statbonuses->GetFrontalBackstabChance()`.
- Add `$statbonuses->GetFrontalBackstabMinimumDamage()`.
- Add `$statbonuses->GetFrontalStunResist()`.
- Add `$statbonuses->GetGiveDoubleAttack()`.
- Add `$statbonuses->GetGiveDoubleRiposte(slot)`.
- Add `$statbonuses->GetGivePetGroupTarget()`.
- Add `$statbonuses->GetGravityEffect()`.
- Add `$statbonuses->GetHaste()`.
- Add `$statbonuses->GetHasteType2()`.
- Add `$statbonuses->GetHasteType3()`.
- Add `$statbonuses->GetHateModifier()`.
- Add `$statbonuses->GetHeadShot(slot)`.
- Add `$statbonuses->GetHeadShotLevel(slot)`.
- Add `$statbonuses->GetHealAmt()`.
- Add `$statbonuses->GetHealRate()`.
- Add `$statbonuses->GetHeroicAGI()`.
- Add `$statbonuses->GetHeroicCHA()`.
- Add `$statbonuses->GetHeroicCorrup()`.
- Add `$statbonuses->GetHeroicCR()`.
- Add `$statbonuses->GetHeroicDEX()`.
- Add `$statbonuses->GetHeroicDR()`.
- Add `$statbonuses->GetHeroicFR()`.
- Add `$statbonuses->GetHeroicINT()`.
- Add `$statbonuses->GetHeroicMR()`.
- Add `$statbonuses->GetHeroicPR()`.
- Add `$statbonuses->GetHeroicSTA()`.
- Add `$statbonuses->GetHeroicSTR()`.
- Add `$statbonuses->GetHeroicWIS()`.
- Add `$statbonuses->GetHitChance()`.
- Add `$statbonuses->GetHitChanceEffect(slot)`.
- Add `$statbonuses->GetHP()`.
- Add `$statbonuses->GetHPPercentCap(slot)`.
- Add `$statbonuses->GetHPRegen()`.
- Add `$statbonuses->GetHPToManaConvert()`.
- Add `$statbonuses->GetHundredHands()`.
- Add `$statbonuses->GetIllusionPersistence()`.
- Add `$statbonuses->GetImmuneToFlee()`.
- Add `$statbonuses->GetImprovedReclaimEnergy()`.
- Add `$statbonuses->GetImprovedTauntslot()`.
- Add `$statbonuses->GetIncreaseBlockChance()`.
- Add `$statbonuses->GetIncreaseChanceMemoryWipe()`.
- Add `$statbonuses->GetIncreaseRunSpeedCap()`.
- Add `$statbonuses->GetInhibitMelee()`.
- Add `$statbonuses->GetINT()`.
- Add `$statbonuses->GetINTCapModifier()`.
- Add `$statbonuses->GetIsBlind()`.
- Add `$statbonuses->GetIsFeared()`.
- Add `$statbonuses->GetItemATKCap()`.
- Add `$statbonuses->GetItemHPRegenCap()`.
- Add `$statbonuses->GetItemManaRegenCap()`.
- Add `$statbonuses->GetLimitToSkill(slot)`.
- Add `$statbonuses->GetMagicWeapon()`.
- Add `$statbonuses->GetMana()`.
- Add `$statbonuses->GetManaAbsorbPercentDamage(slot)`.
- Add `$statbonuses->GetManaPercentCap(slot)`.
- Add `$statbonuses->GetManaRegen()`.
- Add `$statbonuses->GetMasteryOfPast()`.
- Add `$statbonuses->GetMaxBindWound()`.
- Add `$statbonuses->GetMaxHP()`.
- Add `$statbonuses->GetMaxHPChange()`.
- Add `$statbonuses->GetMeleeLifetap()`.
- Add `$statbonuses->GetMeleeMitigation()`.
- Add `$statbonuses->GetMeleeMitigationEffect()`.
- Add `$statbonuses->GetMeleeRune(slot)`.
- Add `$statbonuses->GetMeleeSkillCheck()`.
- Add `$statbonuses->GetMeleeSkillCheckSkill()`.
- Add `$statbonuses->GetMeleeThresholdGuard(slot)`.
- Add `$statbonuses->GetMetabolism()`.
- Add `$statbonuses->GetMinimumDamageModifier(slot)`.
- Add `$statbonuses->GetMitigateDOTRune(slot)`.
- Add `$statbonuses->GetMitigateMeleeRune(slot)`.
- Add `$statbonuses->GetMitigateSpellRune(slot)`.
- Add `$statbonuses->GetMovementSpeed()`.
- Add `$statbonuses->GetMR()`.
- Add `$statbonuses->GetMRCapModifier()`.
- Add `$statbonuses->GetNegateAttacks(slot)`.
- Add `$statbonuses->GetNegateEffects()`.
- Add `$statbonuses->GetNegateIfCombat()`.
- Add `$statbonuses->GetNoBreakAESneak()`.
- Add `$statbonuses->GetOffhandRiposteFail()`.
- Add `$statbonuses->GetPackrat()`.
- Add `$statbonuses->GetParryChance()`.
- Add `$statbonuses->GetPCPetFlurry(slot)`.
- Add `$statbonuses->GetPCPetRampage(slot)`.
- Add `$statbonuses->GetPercussionModifier()`.
- Add `$statbonuses->GetPersistentCasting()`.
- Add `$statbonuses->GetPetAvoidance()`.
- Add `$statbonuses->GetPetCriticalHit()`.
- Add `$statbonuses->GetPetFlurry()`.
- Add `$statbonuses->GetPetMaxHP()`.
- Add `$statbonuses->GetPetMeleeMitigation()`.
- Add `$statbonuses->GetPR()`.
- Add `$statbonuses->GetPRCapModifier()`.
- Add `$statbonuses->GetProcChance()`.
- Add `$statbonuses->GetProcChanceSPA()`.
- Add `$statbonuses->GetRaiseSkillCap(slot)`.
- Add `$statbonuses->GetReduceFallDamage()`.
- Add `$statbonuses->GetReduceTradeskillFail(slot)`.
- Add `$statbonuses->GetReflectChance()`.
- Add `$statbonuses->GetResistFearChance()`.
- Add `$statbonuses->GetResistSpellChance()`.
- Add `$statbonuses->GetReverseDamageShield()`.
- Add `$statbonuses->GetReverseDamageShieldSpellID()`.
- Add `$statbonuses->GetReverseDamageShieldType()`.
- Add `$statbonuses->GetRiposteChance()`.
- Add `$statbonuses->GetRoot(slot)`.
- Add `$statbonuses->GetRootBreakChance()`.
- Add `$statbonuses->GetSalvageChance()`.
- Add `$statbonuses->GetSanctuary()`.
- Add `$statbonuses->GetScreech()`.
- Add `$statbonuses->GetSecondaryDamageIncrease()`.
- Add `$statbonuses->GetSeeInvis()`.
- Add `$statbonuses->GetSEResist(slot)`.
- Add `$statbonuses->GetShieldBlock()`.
- Add `$statbonuses->GetShieldEquipDamageModifier()`.
- Add `$statbonuses->GetShroudOfStealth()`.
- Add `$statbonuses->GetSingingModifier()`.
- Add `$statbonuses->GetSkillAttackProc(slot)`.
- Add `$statbonuses->GetSkillDamageAmount(slot)`.
- Add `$statbonuses->GetSkillDamageAmount2(slot)`.
- Add `$statbonuses->GetSkillDamageTaken(slot)`.
- Add `$statbonuses->GetSkillModifier(slot)`.
- Add `$statbonuses->GetSkillModifierMax(slot)`.
- Add `$statbonuses->GetSkillProc(slot)`.
- Add `$statbonuses->GetSkillProcSuccess(slot)`.
- Add `$statbonuses->GetSkillReuseTime(slot)`.
- Add `$statbonuses->GetSlayUndead(slot)`.
- Add `$statbonuses->GetSongModifierCap()`.
- Add `$statbonuses->GetSongRange()`.
- Add `$statbonuses->GetSpellCriticalDamageIncreaseNOStack()`.
- Add `$statbonuses->GetSpellCriticalDamageIncrease()`.
- Add `$statbonuses->GetSpellDamageShield()`.
- Add `$statbonuses->GetSpellDamage()`.
- Add `$statbonuses->GetSpellOnDeath(slot)`.
- Add `$statbonuses->GetSpellOnKill(slot)`.
- Add `$statbonuses->GetSpellProcChance()`.
- Add `$statbonuses->GetSpellShield()`.
- Add `$statbonuses->GetSpellThresholdGuard(slot)`.
- Add `$statbonuses->GetSpellTriggers(slot)`.
- Add `$statbonuses->GetSTA()`.
- Add `$statbonuses->GetSTACapModifier()`.
- Add `$statbonuses->GetSTR()`.
- Add `$statbonuses->GetSTRCapModifier()`.
- Add `$statbonuses->GetStrikeThrough()`.
- Add `$statbonuses->GetStringedModifier()`.
- Add `$statbonuses->GetStunBashChance()`.
- Add `$statbonuses->GetStunResist()`.
- Add `$statbonuses->GetTradeSkillMastery()`.
- Add `$statbonuses->GetTriggerMeleeThreshold()`.
- Add `$statbonuses->GetTriggerOnValueAmount()`.
- Add `$statbonuses->GetTriggerSpellThreshold()`.
- Add `$statbonuses->GetTripleAttackChance()`.
- Add `$statbonuses->GetTripleBackstab()`.
- Add `$statbonuses->GetTwoHandBluntBlock()`.
- Add `$statbonuses->GetUnfailingDivinity()`.
- Add `$statbonuses->GetVampirism()`.
- Add `$statbonuses->GetVoiceGraft()`.
- Add `$statbonuses->GetWindModifier()`.
- Add `$statbonuses->GetWIS()`.
- Add `$statbonuses->GetWISCapModifier()`.
- Add `$statbonuses->GetXPRateModifier()`.

# Notes
- Adds methods to get mob's stat bonuses to Mob methods.
- Adds support for stat bonuses class to Perl similar to Lua.

* Update perl_stat_bonuses.cpp

* Update perl_stat_bonuses.cpp
2023-07-02 10:26:46 -04:00
Alex King e12368f002 [Quest API] Add Hate Entry Methods to Perl (#3459)
# Perl
- Add `$hate_entry->GetFrenzy()`.
- Add `$hate_entry->SetDamage(value)`.
- Add `$hate_entry->SetEnt(mob)`.
- Add `$hate_entry->SetFrenzy(is_frenzy)`.
- Add `$hate_entry->SetHate(value)`.

# Lua
- Convert `hate_entry:GetFrenzy()` to `bool` instead of `int`, as `is_entity_frenzy` is a `bool`.
2023-07-02 10:26:37 -04:00
Alex King a13fa07e68 [Quest API] Add Spawn2 Class to Perl (#3456)
# Perl
- Add `$spawn->Depop()`.
- Add `$spawn->Disable()`.
- Add `$spawn->Enable()`.
- Add `$spawn->ForceDespawn()`.
- Add `$spawn->GetCurrentNPCID()`.
- Add `$spawn->GetHeading()`.
- Add `$spawn->GetID()`.
- Add `$spawn->GetKillCount()`.
- Add `$spawn->GetRespawnTimer()`.
- Add `$spawn->GetSpawnCondition()`.
- Add `$spawn->GetSpawnGroupID()`.
- Add `$spawn->GetVariance()`.
- Add `$spawn->GetX()`.
- Add `$spawn->GetY()`.
- Add `$spawn->GetZ()`.
- Add `$spawn->IsEnabled()`.
- Add `$spawn->IsNPCPointerValid()`.
- Add `$spawn->LoadGrid()`.
- Add `$spawn->Repop()`.
- Add `$spawn->Repop(delay)`.
- Add `$spawn->Reset()`.
- Add `$spawn->SetCurrentNPCID(npc_id)`.
- Add `$spawn->SetNPCPointer(npc_pointer)`.
- Add `$spawn->SetRespawnTimer(new_respawn_time)`.
- Add `$spawn->SetTimer(duration)`.
- Add `$spawn->SetVariance(variance)`.

# Notes
- Adds support for Spawn2 class to Perl.
2023-07-02 10:26:32 -04:00
Chris Miles 7873ad3771 [Database] Set multi statements off when returning early (#3462) 2023-07-01 19:49:09 -04:00
Chris Miles dfadc237e5 [Logging] Fix logging crash when % are sent through query logs (#3461) 2023-07-01 19:49:01 -04:00
Alex King a1f2764978 [Cleanup/Feature] Add support for bots to #showstats/#mystats (#3427)
* Initial Push

* Update classes.cpp

* Update mob.cpp

* Update mob.cpp

* Update showstats.cpp

* Update mystats.cpp

* Remove unused variables.

* Update mob.cpp

* Update class.cpp

* Update race.cpp

* Update mob.h
2023-07-01 19:47:54 -04:00
Jonathan Sider 927d379e75 [Bug Fix] Add check for underscores in botcreate command (#3458)
* Update bot_command.cpp with botcreate check

Check for underscores in bot names as the server will replace with a space and add to the database. The bot can't be deleted/summoned or changed except by editing the database

* Update bot_command.cpp

* Update bot_command.cpp

---------

Co-authored-by: Alex King <89047260+Kinglykrab@users.noreply.github.com>
2023-06-28 20:18:44 -04:00
Chris Miles a1f154749c [Release] 22.16.0 (#3457) 2023-06-28 17:51:05 -04:00
Alex King 42a2e19e73 [Commands] Consolidate #findX commands to a singular #find Command (#3452)
* Push up example for Kingly

* Update aa.cpp

* Update find.cpp

* Bulk push.

* Update aa.cpp

* Cleanup

* Repository method.

* Static aliasing

* Aliases

* Fix alias error.

* Update zone.cpp

* Update command.cpp

* Update find.cpp

---------

Co-authored-by: Akkadius <akkadius1@gmail.com>
2023-06-27 21:53:20 -05:00
mibastian c56b2e3e03 [Fix] Fix error in 023_01_21_bots_raid_members.sql (#3453)
world process did not start. An strace showed something wrong in 023_01_21_bots_raid_members.sql.  Seemed like a snap&paste error.
2023-06-27 21:52:27 -05:00
Alex King b05f1d3218 [Bug Fix] Merchant Open Flag set only for regular Merchants (#3454)
* [Bug Fix] Merchant Open Flag set only for regular Merchants

* Update npc.cpp
2023-06-27 16:23:48 -04:00
Alex King a004924112 [Bug Fix] Fix NPC Item Stat Bonuses (#3444)
* [Bug Fix] Fix NPC Item Stat Bonuses

# Notes
- Due to https://github.com/EQEmu/Server/pull/3136 NPCs/Mercs were not receiving stat bonuses from their items, this fixes that.

* Update npc.h

* Changes.

* Cleanup

* Cleanup

* Update loottables.cpp

* Update npc.cpp

* Update loottables.cpp
2023-06-26 00:22:10 -04:00
Alex King 8d986c95cd [Commands] Add #finddeity Command (#3435)
# Notes
- Add `#finddeity` command.
- Remove `ConvertDeityTypeBitToDeityType` as it's unused.
- Rename `ConvertDeityTypeToDeityTypeBit` to `GetDeityBitmask`.
2023-06-25 23:00:32 -05:00
Alex King ef7a3cae17 [Commands] Cleanup #showbuffs Command (#3439)
* [Commands] Cleanup #showbuffs Command

# Notes
- Cleaned up messages and logic.
- Removed unnecessary itembonuses/spellbonuses stuff.
- Removed `Mob::ShowBuffList` as it's just a copy of this method.

* Update mob.cpp

* Further cleanup.

* Update mob.cpp

* Update mob.cpp
2023-06-25 22:59:47 -05:00
Alex King 050aba65b6 [Commands] Cleanup #viewcurrencies Command (#3441)
# Notes
- Utilize Dialogue Window table for cleanliness and readability.
2023-06-24 20:26:41 -04:00
Alex King 9154c90418 [Commands] Add #findlanguage Command (#3434)
# Notes
- Add `#findlanguage` command.
2023-06-24 20:26:29 -04:00
Alex King d558f9ece2 [Rules] Add ClientPetsUserOwnerNameInLastName rule (#3442)
* [Rules] Add ClientPetsUserOwnerNameInLastName rule

# Notes
- This rule defaults to `true` and maintains `Kinglykrab's Pet` as my pet's name, disabling allows you to manually modify the last name or have pets with no last name.

* Update npc.cpp
2023-06-24 20:01:40 -04:00
Alex King 327dacdbe1 [Cleanup] Remove GetACAvoid() from zone/merc.h (#3447)
- This is unused.
2023-06-24 20:00:56 -04:00
Alex King f2ff4245c0 [Commands] Consolidate #merchant_close_shop and #merchant_open_shop to #merchantshop (#3433)
* [Commands] Consolidate #merchant_close_shop and #merchant_open_shop to #merchantshop

# Notes
- `#merchant_close_shop` and `#merchant_open_shop` are now consolidated into `#merchantshop`.
- Command now works on any type of merchant instead of just regular merchants.
- Can be used on Merchants, Discord Merchants, Adventure Merchants, Norrath's Keepers Merchants, Dark Reign Merchants, and Alternate Currency Merchants.

* Update merchantshop.cpp

* Update merchantshop.cpp

* Update merchantshop.cpp
2023-06-24 13:14:19 -05:00
Alex King 3ceb743195 [Commands] Add #showspells Command (#3429)
* [Commands] Add #showspells Command

# Notes
- Add `#showspells` command to show your or your target's memorized spells or learned disciplines.

* Update client.cpp
2023-06-24 13:13:02 -05:00
Alex King 021f04c17d [Cleanup] Remove command_unlock from zone/command.h (#3431)
# Notes
- This is unused.
2023-06-24 13:10:19 -05:00
Alex King f7e2dbdce6 [Cleanup] Remove command_packetprofile from zone/command.h (#3432)
* [Cleanup] Remove command_packetprofile from zone/command.h

# Notes
- This is unused.

* Update command.h
2023-06-24 13:10:05 -05:00
Alex King 2a679f1002 [Cleanup] Remove command_showpetspell in zone/command.h (#3430)
# Notes
- This is unused.
2023-06-24 13:09:51 -05:00
Alex King 8c9849ec73 [Commands] Delete #showbonusstats Command (#3437)
# Notes
- Never seen this used, also missing 99% of the bonuses data.
2023-06-24 13:09:39 -05:00
Alex King 10086ce97c [Commands] Delete #spellinfo Command (#3438)
# Notes
- Never seen this used, also missing 99% of the spell data.
2023-06-24 13:09:23 -05:00
Alex King 223ae22f73 [Cleanup] Delete common/worldconn.cpp (#3436)
# Notes
- This is unused.
2023-06-24 13:05:45 -05:00
Alex King 4330494f57 [Commands] Cleanup #shownpcgloballoot and #showzonegloballoot Commands (#3440)
# Notes
- Cleanup messages and logic.
- Utilize Dialogue Window tables.
2023-06-24 13:03:37 -05:00
Alex King 64ae7e4529 [Cleanup] Remove _ClearWaypints() from zone/npc.h (#3445)
# Notes
- This is unused.
2023-06-24 12:58:28 -05:00
Alex King 58c3e267e1 [Cleanup] Remove GetACMit() from zone/merc.h (#3446)
# Notes
- This is unused.
2023-06-24 12:58:13 -05:00
Alex King 598483a1a4 [Cleanup] Remove acmod() from zone/merc.h (#3448)
# Notes
- This is unused.
2023-06-24 12:57:43 -05:00
Alex King c1122022b9 [Cleanup] Remove DatabaseCastAccepted() from zone/npc.cpp and zone/npc.h (#3449)
* [Cleanup] Remove DatabaseCastAccepted() from zone/npc.cpp and zone/npc.h

# Notes
- This is unused.

* Update npc.h
2023-06-24 12:57:21 -05:00
Chris Miles f2c4babd8d [Database] Fix database version checking edge case issue (#3428) 2023-06-22 18:00:23 -05:00
Akkadius 5249b065d3 [Release] 22.15.3 2023-06-19 19:15:42 -05:00
Alex King 9312261444 [Bug Fix] Fix improper condition in Water LOS checks (#3426)
# Notes
- Oversight on my part, should've been `==`, not `&&`.
2023-06-19 18:53:19 -04:00
121 changed files with 7784 additions and 3393 deletions
+98
View File
@@ -1,3 +1,101 @@
## [22.17.0] - 07/03/2023
### Cleanup/Feature
* Add support for bots to #showstats/#mystats ([#3427](https://github.com/EQEmu/Server/pull/3427)) @Kinglykrab 2023-07-01
### Code
* Remove LoadItemDBFieldNames() from common/misc.cpp and common/misc.h ([#3473](https://github.com/EQEmu/Server/pull/3473)) @Kinglykrab 2023-07-04
* Remove handle_npc_single_npc from zone/lua_parser_events.cpp and zone/lua_parser_events.h ([#3467](https://github.com/EQEmu/Server/pull/3467)) @Kinglykrab 2023-07-03
### Database
* Set multi statements off when returning early ([#3462](https://github.com/EQEmu/Server/pull/3462)) @Akkadius 2023-07-01
### Feature
* Add Strings::BeginsWith() and Strings::EndsWith() ([#3471](https://github.com/EQEmu/Server/pull/3471)) @Kinglykrab 2023-07-03
### Fixes
* Add check for underscores in botcreate command ([#3458](https://github.com/EQEmu/Server/pull/3458)) @tuday2 2023-06-29
* EVENT_LANGUAGE_SKILL_UP in Lua was using EVENT_SKILL_UP logic ([#3466](https://github.com/EQEmu/Server/pull/3466)) @Kinglykrab 2023-07-03
* Fix _PutItem having a slot_id of -1 on mobs with no items ([#3474](https://github.com/EQEmu/Server/pull/3474)) @Kinglykrab 2023-07-04
* Fix data type of GetAggroCount() ([#3470](https://github.com/EQEmu/Server/pull/3470)) @Kinglykrab 2023-07-03
### Logging
* Fix logging crash when % are sent through query logs ([#3461](https://github.com/EQEmu/Server/pull/3461)) @Akkadius 2023-07-01
### Quest API
* Add ClearAccountFlag() and GetAccountFlags() to Perl/Lua ([#3469](https://github.com/EQEmu/Server/pull/3469)) @Kinglykrab 2023-07-03
* Add GetClassAbbreviation() and GetRaceAbbreviation() to Perl/Lua ([#3463](https://github.com/EQEmu/Server/pull/3463)) @Kinglykrab 2023-07-02
* Add GetClassPlural() and GetRacePlural() to Perl/Lua ([#3468](https://github.com/EQEmu/Server/pull/3468)) @Kinglykrab 2023-07-03
* Add GetCloseMobList() and CalculateDistance() overload to Perl/Lua ([#3455](https://github.com/EQEmu/Server/pull/3455)) @Kinglykrab 2023-07-02
* Add Hate Entry Methods to Perl ([#3459](https://github.com/EQEmu/Server/pull/3459)) @Kinglykrab 2023-07-02
* Add ItemData Class to Perl ([#3465](https://github.com/EQEmu/Server/pull/3465)) @Kinglykrab 2023-07-02
* Add Spawn2 Class to Perl ([#3456](https://github.com/EQEmu/Server/pull/3456)) @Kinglykrab 2023-07-02
* Add StatBonuses Class to Perl ([#3460](https://github.com/EQEmu/Server/pull/3460)) @Kinglykrab 2023-07-02
* Add missing Item Methods to Perl/Lua. ([#3464](https://github.com/EQEmu/Server/pull/3464)) @Kinglykrab 2023-07-02
## [22.16.0] - 06/27/2023
### Code
* Default skill type to Hand to Hand in #npcedit meleetype ([#3422](https://github.com/EQEmu/Server/pull/3422)) @Kinglykrab 2023-06-19
* Delete common/worldconn.cpp ([#3436](https://github.com/EQEmu/Server/pull/3436)) @Kinglykrab 2023-06-24
* Remove DatabaseCastAccepted() from zone/npc.cpp and zone/npc.h ([#3449](https://github.com/EQEmu/Server/pull/3449)) @Kinglykrab 2023-06-24
* Remove GetACAvoid() from zone/merc.h ([#3447](https://github.com/EQEmu/Server/pull/3447)) @Kinglykrab 2023-06-25
* Remove GetACMit() from zone/merc.h ([#3446](https://github.com/EQEmu/Server/pull/3446)) @Kinglykrab 2023-06-24
* Remove _ClearWaypints() from zone/npc.h ([#3445](https://github.com/EQEmu/Server/pull/3445)) @Kinglykrab 2023-06-24
* Remove acmod() from zone/merc.h ([#3448](https://github.com/EQEmu/Server/pull/3448)) @Kinglykrab 2023-06-24
* Remove command_packetprofile from zone/command.h ([#3432](https://github.com/EQEmu/Server/pull/3432)) @Kinglykrab 2023-06-24
* Remove command_showpetspell in zone/command.h ([#3430](https://github.com/EQEmu/Server/pull/3430)) @Kinglykrab 2023-06-24
* Remove command_unlock from zone/command.h ([#3431](https://github.com/EQEmu/Server/pull/3431)) @Kinglykrab 2023-06-24
### Commands
* Add #finddeity Command ([#3435](https://github.com/EQEmu/Server/pull/3435)) @Kinglykrab 2023-06-26
* Add #findlanguage Command ([#3434](https://github.com/EQEmu/Server/pull/3434)) @Kinglykrab 2023-06-25
* Add #showspells Command ([#3429](https://github.com/EQEmu/Server/pull/3429)) @Kinglykrab 2023-06-24
* Add missing subcommands to #npcedit ([#3423](https://github.com/EQEmu/Server/pull/3423)) @Kinglykrab 2023-06-19
* Cleanup #showbuffs Command ([#3439](https://github.com/EQEmu/Server/pull/3439)) @Kinglykrab 2023-06-26
* Cleanup #shownpcgloballoot and #showzonegloballoot Commands ([#3440](https://github.com/EQEmu/Server/pull/3440)) @Kinglykrab 2023-06-24
* Cleanup #viewcurrencies Command ([#3441](https://github.com/EQEmu/Server/pull/3441)) @Kinglykrab 2023-06-25
* Consolidate #findX commands to a singular #find Command ([#3452](https://github.com/EQEmu/Server/pull/3452)) @Kinglykrab 2023-06-28
* Consolidate #merchant_close_shop and #merchant_open_shop to #merchantshop ([#3433](https://github.com/EQEmu/Server/pull/3433)) @Kinglykrab 2023-06-24
* Delete #showbonusstats Command ([#3437](https://github.com/EQEmu/Server/pull/3437)) @Kinglykrab 2023-06-24
* Delete #spellinfo Command ([#3438](https://github.com/EQEmu/Server/pull/3438)) @Kinglykrab 2023-06-24
### Database
* Fix database version checking edge case issue ([#3428](https://github.com/EQEmu/Server/pull/3428)) @Akkadius 2023-06-22
* Fix multi-statement error reporting ([#3425](https://github.com/EQEmu/Server/pull/3425)) @Akkadius 2023-06-19
* Implement native database migrations in server ([#2857](https://github.com/EQEmu/Server/pull/2857)) @Akkadius 2023-06-19
### Fixes
* Fix NPC Item Stat Bonuses ([#3444](https://github.com/EQEmu/Server/pull/3444)) @Kinglykrab 2023-06-26
* Fix error in 023_01_21_bots_raid_members.sql ([#3453](https://github.com/EQEmu/Server/pull/3453)) @mibastian 2023-06-28
* Fix possible crash with #npcedit weapon ([#3421](https://github.com/EQEmu/Server/pull/3421)) @Kinglykrab 2023-06-19
* Merchant Open Flag set only for regular Merchants ([#3454](https://github.com/EQEmu/Server/pull/3454)) @Kinglykrab 2023-06-27
### Readme
* Update new location of database updates ([#3424](https://github.com/EQEmu/Server/pull/3424)) @joligario 2023-06-19
### Rules
* Add ClientPetsUserOwnerNameInLastName rule ([#3442](https://github.com/EQEmu/Server/pull/3442)) @Kinglykrab 2023-06-25
## [22.15.3] - 06/19/2023
### Fixes
* Fix improper condition in Water LOS checks ([#3426](https://github.com/EQEmu/Server/pull/3426)) @Kinglykrab 2023-06-19
## [22.15.2] - 06/19/2023
### Database
+49
View File
@@ -17,6 +17,7 @@
*/
#include "../common/global_define.h"
#include "../common/classes.h"
#include "data_verification.h"
const char *GetClassIDName(uint8 class_id, uint8 level)
{
@@ -750,3 +751,51 @@ uint8 ClassArmorType(uint8 class_id)
return ARMOR_TYPE_UNKNOWN;
}
}
const std::string GetPlayerClassAbbreviation(uint8 class_id)
{
if (!EQ::ValueWithin(class_id, WARRIOR, BERSERKER)) {
return std::string("UNK");
}
switch (class_id) {
case WARRIOR:
return "WAR";
case CLERIC:
return "CLR";
case PALADIN:
return "PAL";
case RANGER:
return "RNG";
case SHADOWKNIGHT:
return "SHD";
case DRUID:
return "DRU";
case MONK:
return "MNK";
case BARD:
return "BRD";
case ROGUE:
return "ROG";
case SHAMAN:
return "SHM";
case NECROMANCER:
return "NEC";
case WIZARD:
return "WIZ";
case MAGICIAN:
return "MAG";
case ENCHANTER:
return "ENC";
case BEASTLORD:
return "BST";
case BERSERKER:
return "BER";
}
return std::string("UNK");
}
bool IsPlayerClass(uint8 class_id) {
return EQ::ValueWithin(class_id, WARRIOR, BERSERKER);
}
+4
View File
@@ -19,6 +19,7 @@
#define CLASSES_CH
#include "../common/types.h"
#include <string>
#define NO_CLASS 0
#define WARRIOR 1
@@ -127,6 +128,9 @@
const char* GetClassIDName(uint8 class_id, uint8 level = 0);
const char* GetPlayerClassName(uint32 player_class_value, uint8 level = 0);
bool IsPlayerClass(uint8 class_id);
const std::string GetPlayerClassAbbreviation(uint8 class_id);
uint32 GetPlayerClassValue(uint8 class_id);
uint32 GetPlayerClassBit(uint8 class_id);
+10 -6
View File
@@ -46,7 +46,7 @@ void DatabaseUpdate::CheckDbUpdates()
InjectBotsVersionColumn();
auto v = GetDatabaseVersions();
auto b = GetBinaryDatabaseVersions();
if (CheckVersions(v, b)) {
if (CheckVersionsUpToDate(v, b)) {
return;
}
@@ -247,7 +247,7 @@ DatabaseUpdate *DatabaseUpdate::SetDatabase(Database *db)
return this;
}
bool DatabaseUpdate::CheckVersions(DatabaseVersion v, DatabaseVersion b)
bool DatabaseUpdate::CheckVersionsUpToDate(DatabaseVersion v, DatabaseVersion b)
{
LogInfo("{}", Strings::Repeat("-", BREAK_LENGTH));
@@ -259,7 +259,7 @@ bool DatabaseUpdate::CheckVersions(DatabaseVersion v, DatabaseVersion b)
(v.server_database_version == b.server_database_version) ? "up to date" : "checking updates"
);
if (b.bots_database_version > 0) {
if (RuleB(Bots, Enabled) && b.bots_database_version > 0) {
LogInfo(
"{:>8} | database [{}] binary [{}] {}",
"Bots",
@@ -273,8 +273,12 @@ bool DatabaseUpdate::CheckVersions(DatabaseVersion v, DatabaseVersion b)
LogInfo("{}", Strings::Repeat("-", BREAK_LENGTH));
return (v.server_database_version == b.server_database_version) &&
(v.bots_database_version == b.bots_database_version);
// server database version is required
bool server_up_to_date = v.server_database_version == b.server_database_version;
// bots database version is optional, if not enabled then it is always up-to-date
bool bots_up_to_date = RuleB(Bots, Enabled) ? v.bots_database_version == b.bots_database_version : true;
return server_up_to_date && bots_up_to_date;
}
// checks to see if there are pending updates
@@ -284,7 +288,7 @@ bool DatabaseUpdate::HasPendingUpdates()
auto v = GetDatabaseVersions();
auto b = GetBinaryDatabaseVersions();
return !CheckVersions(v, b);
return !CheckVersionsUpToDate(v, b);
}
void DatabaseUpdate::InjectBotsVersionColumn()
+1 -1
View File
@@ -30,7 +30,7 @@ public:
bool HasPendingUpdates();
private:
Database *m_database;
static bool CheckVersions(DatabaseVersion v, DatabaseVersion b);
static bool CheckVersionsUpToDate(DatabaseVersion v, DatabaseVersion b);
void InjectBotsVersionColumn();
};
+4 -5
View File
@@ -4642,11 +4642,10 @@ ADD COLUMN `avoidance` int(11) unsigned NOT NULL DEFAULT 0 AFTER `heal_scale`;
.condition = "empty",
.match = "",
.sql = R"(
ALTER TABLE `npc_scale_global_base`
MODIFY COLUMN `hp` bigint(20) NOT NULL DEFAULT 0 AFTER `ac`,
MODIFY COLUMN `hp_regen_rate` bigint(20) NOT NULL DEFAULT 0 AFTER `max_dmg`,
ADD COLUMN `hp_regen_per_second` bigint(20) NOT NULL DEFAULT 0 AFTER `hp_regen_rate`,
ADD COLUMN `avoidance` int(11) unsigned NOT NULL DEFAULT 0 AFTER `heal_scale`;
DROP INDEX `PRIMARY` ON `raid_members`;
CREATE UNIQUE INDEX `UNIQUE` ON `raid_members`(`name`);
ALTER TABLE `raid_members` ADD COLUMN `bot_id` int(4) NOT NULL DEFAULT 0 AFTER `charid`;
ALTER TABLE `raid_members` ADD COLUMN `id` BIGINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT FIRST;
)"
},
+4
View File
@@ -365,6 +365,8 @@ MySQLRequestResult DBcore::QueryDatabaseMulti(const std::string &query)
mysql_free_result(res);
}
SetMultiStatementsOff();
return r;
}
}
@@ -418,6 +420,8 @@ MySQLRequestResult DBcore::QueryDatabaseMulti(const std::string &query)
r.SetErrorMessage(error_message);
r.SetErrorNumber(mysql_errno(mysql));
SetMultiStatementsOff();
// we handle errors elsewhere
return r;
}
+69 -119
View File
@@ -11,7 +11,7 @@
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
@@ -19,131 +19,81 @@
#include "deity.h"
EQ::deity::DeityTypeBit EQ::deity::ConvertDeityTypeToDeityTypeBit(DeityType deity_type)
EQ::deity::DeityTypeBit EQ::deity::GetDeityBitmask(DeityType deity_type)
{
switch (deity_type) {
case DeityBertoxxulous:
return bit_DeityBertoxxulous;
case DeityBrellSirilis:
return bit_DeityBrellSirilis;
case DeityCazicThule:
return bit_DeityCazicThule;
case DeityErollisiMarr:
return bit_DeityErollisiMarr;
case DeityBristlebane:
return bit_DeityBristlebane;
case DeityInnoruuk:
return bit_DeityInnoruuk;
case DeityKarana:
return bit_DeityKarana;
case DeityMithanielMarr:
return bit_DeityMithanielMarr;
case DeityPrexus:
return bit_DeityPrexus;
case DeityQuellious:
return bit_DeityQuellious;
case DeityRallosZek:
return bit_DeityRallosZek;
case DeityRodcetNife:
return bit_DeityRodcetNife;
case DeitySolusekRo:
return bit_DeitySolusekRo;
case DeityTheTribunal:
return bit_DeityTheTribunal;
case DeityTunare:
return bit_DeityTunare;
case DeityVeeshan:
return bit_DeityVeeshan;
case DeityAgnostic_LB:
case DeityAgnostic:
return bit_DeityAgnostic;
default:
return bit_DeityAll;
};
case DeityBertoxxulous:
return bit_DeityBertoxxulous;
case DeityBrellSirilis:
return bit_DeityBrellSirilis;
case DeityCazicThule:
return bit_DeityCazicThule;
case DeityErollisiMarr:
return bit_DeityErollisiMarr;
case DeityBristlebane:
return bit_DeityBristlebane;
case DeityInnoruuk:
return bit_DeityInnoruuk;
case DeityKarana:
return bit_DeityKarana;
case DeityMithanielMarr:
return bit_DeityMithanielMarr;
case DeityPrexus:
return bit_DeityPrexus;
case DeityQuellious:
return bit_DeityQuellious;
case DeityRallosZek:
return bit_DeityRallosZek;
case DeityRodcetNife:
return bit_DeityRodcetNife;
case DeitySolusekRo:
return bit_DeitySolusekRo;
case DeityTheTribunal:
return bit_DeityTheTribunal;
case DeityTunare:
return bit_DeityTunare;
case DeityVeeshan:
return bit_DeityVeeshan;
case DeityAgnostic_LB:
case DeityAgnostic:
return bit_DeityAgnostic;
default:
return bit_DeityAll;
}
}
EQ::deity::DeityType EQ::deity::ConvertDeityTypeBitToDeityType(DeityTypeBit deity_type_bit)
const std::map<EQ::deity::DeityType, std::string>& EQ::deity::GetDeityMap()
{
switch (deity_type_bit) {
case bit_DeityAgnostic:
return DeityAgnostic;
case bit_DeityBertoxxulous:
return DeityBertoxxulous;
case bit_DeityBrellSirilis:
return DeityBrellSirilis;
case bit_DeityCazicThule:
return DeityCazicThule;
case bit_DeityErollisiMarr:
return DeityErollisiMarr;
case bit_DeityBristlebane:
return DeityBristlebane;
case bit_DeityInnoruuk:
return DeityInnoruuk;
case bit_DeityKarana:
return DeityKarana;
case bit_DeityMithanielMarr:
return DeityMithanielMarr;
case bit_DeityPrexus:
return DeityPrexus;
case bit_DeityQuellious:
return DeityQuellious;
case bit_DeityRallosZek:
return DeityRallosZek;
case bit_DeityRodcetNife:
return DeityRodcetNife;
case bit_DeitySolusekRo:
return DeitySolusekRo;
case bit_DeityTheTribunal:
return DeityTheTribunal;
case bit_DeityTunare:
return DeityTunare;
case bit_DeityVeeshan:
return DeityVeeshan;
default:
return DeityUnknown;
static const std::map<EQ::deity::DeityType, std::string> deity_map = {
{ DeityAgnostic, "Agnostic" },
{ DeityAgnostic_LB, "Agnostic" },
{ DeityBertoxxulous, "Bertoxxulous" },
{ DeityBrellSirilis, "Brell Serilis" },
{ DeityBristlebane, "Bristlebane" },
{ DeityCazicThule, "Cazic-Thule" },
{ DeityErollisiMarr, "Erollisi Marr" },
{ DeityInnoruuk, "Innoruuk" },
{ DeityKarana, "Karana" },
{ DeityMithanielMarr, "Mithaniel Marr" },
{ DeityPrexus, "Prexus" },
{ DeityQuellious, "Quellious" },
{ DeityRallosZek, "Rallos Zek" },
{ DeityRodcetNife, "Rodcet Nife" },
{ DeitySolusekRo, "Solusek Ro" },
{ DeityTheTribunal, "The Tribunal" },
{ DeityTunare, "Tunare" },
{ DeityVeeshan, "Veeshan" }
};
return deity_map;
}
const char* EQ::deity::DeityName(DeityType deity_type)
std::string EQ::deity::GetDeityName(DeityType deity_type)
{
switch (deity_type) {
case DeityBertoxxulous:
return "Bertoxxulous";
case DeityBrellSirilis:
return "Brell Serilis";
case DeityCazicThule:
return "Cazic-Thule";
case DeityErollisiMarr:
return "Erollisi Marr";
case DeityBristlebane:
return "Bristlebane";
case DeityInnoruuk:
return "Innoruuk";
case DeityKarana:
return "Karana";
case DeityMithanielMarr:
return "Mithaniel Marr";
case DeityPrexus:
return "Prexus";
case DeityQuellious:
return "Quellious";
case DeityRallosZek:
return "Rallos Zek";
case DeityRodcetNife:
return "Rodcet Nife";
case DeitySolusekRo:
return "Solusek Ro";
case DeityTheTribunal:
return "The Tribunal";
case DeityTunare:
return "Tunare";
case DeityVeeshan:
return "Veeshan";
case DeityAgnostic_LB:
case DeityAgnostic:
return "Agnostic";
default:
return "Unknown";
};
if (EQ::deity::GetDeityMap().find(deity_type) != EQ::deity::GetDeityMap().end()) {
return EQ::deity::GetDeityMap().find(deity_type)->second;
}
return std::string();
}
+22 -21
View File
@@ -21,6 +21,8 @@
#define COMMON_DEITY_H
#include "types.h"
#include <map>
#include <string>
namespace EQ
@@ -49,30 +51,29 @@ namespace EQ
};
enum DeityTypeBit : uint32 {
bit_DeityNone = 0x00000000,
bit_DeityAgnostic = 0x00000001,
bit_DeityBertoxxulous = 0x00000002,
bit_DeityBrellSirilis = 0x00000004,
bit_DeityCazicThule = 0x00000008,
bit_DeityErollisiMarr = 0x00000010,
bit_DeityBristlebane = 0x00000020,
bit_DeityInnoruuk = 0x00000040,
bit_DeityKarana = 0x00000080,
bit_DeityAgnostic = 0x00000001,
bit_DeityBertoxxulous = 0x00000002,
bit_DeityBrellSirilis = 0x00000004,
bit_DeityCazicThule = 0x00000008,
bit_DeityErollisiMarr = 0x00000010,
bit_DeityBristlebane = 0x00000020,
bit_DeityInnoruuk = 0x00000040,
bit_DeityKarana = 0x00000080,
bit_DeityMithanielMarr = 0x00000100,
bit_DeityPrexus = 0x00000200,
bit_DeityQuellious = 0x00000400,
bit_DeityRallosZek = 0x00000800,
bit_DeityRodcetNife = 0x00001000,
bit_DeitySolusekRo = 0x00002000,
bit_DeityTheTribunal = 0x00004000,
bit_DeityTunare = 0x00008000,
bit_DeityVeeshan = 0x00010000,
bit_DeityAll = 0xFFFFFFFF
bit_DeityPrexus = 0x00000200,
bit_DeityQuellious = 0x00000400,
bit_DeityRallosZek = 0x00000800,
bit_DeityRodcetNife = 0x00001000,
bit_DeitySolusekRo = 0x00002000,
bit_DeityTheTribunal = 0x00004000,
bit_DeityTunare = 0x00008000,
bit_DeityVeeshan = 0x00010000,
bit_DeityAll = UINT32_MAX
};
extern DeityTypeBit ConvertDeityTypeToDeityTypeBit(DeityType deity_type);
extern DeityType ConvertDeityTypeBitToDeityType(DeityTypeBit deity_type_bit);
extern const char* DeityName(DeityType deity_type);
extern DeityTypeBit GetDeityBitmask(DeityType deity_type);
extern std::string GetDeityName(DeityType deity_type);
extern const std::map<DeityType, std::string>& GetDeityMap();
} /*deity*/
+2
View File
@@ -446,6 +446,8 @@ void EQEmuLogSys::Out(
// remove this when we remove all legacy logs
bool ignore_log_legacy_format = (
log_category == Logs::Netcode ||
log_category == Logs::MySQLQuery ||
log_category == Logs::MySQLError ||
log_category == Logs::PacketServerClient ||
log_category == Logs::PacketClientServer ||
log_category == Logs::PacketServerToServer
+3 -3
View File
@@ -353,7 +353,7 @@ bool EQ::InventoryProfile::SwapItem(
fail_state = swapRaceClass;
return false;
}
if (deity_id && source_item->Deity && !(deity::ConvertDeityTypeToDeityTypeBit((deity::DeityType)deity_id) & source_item->Deity)) {
if (deity_id && source_item->Deity && !(deity::GetDeityBitmask((deity::DeityType)deity_id) & source_item->Deity)) {
fail_state = swapDeity;
return false;
}
@@ -379,7 +379,7 @@ bool EQ::InventoryProfile::SwapItem(
fail_state = swapRaceClass;
return false;
}
if (deity_id && destination_item->Deity && !(deity::ConvertDeityTypeToDeityTypeBit((deity::DeityType)deity_id) & destination_item->Deity)) {
if (deity_id && destination_item->Deity && !(deity::GetDeityBitmask((deity::DeityType)deity_id) & destination_item->Deity)) {
fail_state = swapDeity;
return false;
}
@@ -1444,7 +1444,7 @@ int16 EQ::InventoryProfile::_PutItem(int16 slot_id, ItemInstance* inst)
}
if (result == INVALID_INDEX) {
LogError("InventoryProfile::_PutItem: Invalid slot_id specified ({}) with parent slot id ({})", slot_id, parentSlot);
LogError("Invalid slot_id specified ({}) with parent slot id ({})", slot_id, parentSlot);
InventoryProfile::MarkDirty(inst); // Slot not found, clean up
}
+2
View File
@@ -48,5 +48,7 @@
#define LANG_HADAL 26
#define LANG_UNKNOWN 27
#define MAX_LANGUAGE_SKILL 100
#endif
-117
View File
@@ -214,123 +214,6 @@ std::string x;
return i;
}
void LoadItemDBFieldNames() {
DBFieldNames[0]="N/A"; // Charges
DBFieldNames[1]="unknown002"; // ?
DBFieldNames[2]="N/A"; // Current Equip Slot
DBFieldNames[3]="unknown004";
DBFieldNames[4]="unknown005"; // ?
DBFieldNames[5]="itemclass"; // "Item Type (0=common, 1=container, 2=book)"
DBFieldNames[6]="name"; // Name
DBFieldNames[7]="lore"; // "Lore Name (*=lore, &=summoned, #=artifact)"
DBFieldNames[8]="idfile"; // IDFile
DBFieldNames[9]="id"; // ItemNumber
DBFieldNames[10]="weight"; // Weight
DBFieldNames[11]="norent"; // "NoRent (0=norent, 255=not norent)"
DBFieldNames[12]="nodrop"; // "NoDrop (0=nodrop, 255=not nodrop)"
DBFieldNames[13]="size"; // "Size (0=tiny, 1=small, 2=medium, 3=large, 4=giant)"
DBFieldNames[14]="slots"; // EquipSlots
DBFieldNames[15]="cost"; // Cost
DBFieldNames[16]="icon"; // IconNumber
DBFieldNames[17]="unknown018";
DBFieldNames[18]="unknown019";
DBFieldNames[19]="unknown020"; // ?
DBFieldNames[20]="tradeskills"; // "Tradeskill Item (1=is a tradeskill item, 0=not)"
DBFieldNames[21]="cr"; // SvCold
DBFieldNames[22]="dr"; // SvDisease
DBFieldNames[23]="pr"; // SvPoison
DBFieldNames[24]="mr"; // SvMagic
DBFieldNames[25]="fr"; // SvFire
DBFieldNames[26]="astr"; // STR
DBFieldNames[27]="asta"; // STA
DBFieldNames[28]="aagi"; // AGI
DBFieldNames[29]="adex"; // DEX
DBFieldNames[30]="acha"; // CHA
DBFieldNames[31]="aint"; // INT
DBFieldNames[32]="awis"; // WIS
DBFieldNames[33]="hp"; // HP
DBFieldNames[34]="mana"; // Mana
DBFieldNames[35]="ac"; // AC
DBFieldNames[36]="deity"; // Deity
DBFieldNames[37]="skillmodvalue"; // Skill Mod Value
DBFieldNames[38]="skillmodtype"; // Skill Mod Type
DBFieldNames[39]="banedmgrace"; // Bane Dmg Race
DBFieldNames[40]="banedmgamt"; // Band Dmg
DBFieldNames[41]="banedmgbody"; // Band Dmg Body
DBFieldNames[42]="magic"; // "Magic (0=not magic, 1=magic)"
DBFieldNames[43]="casttime2"; // Casttime appears twice
DBFieldNames[44]="hasteproclvl"; // "Level (Haste value, rather)"
DBFieldNames[45]="reqlevel"; // Required Level
DBFieldNames[46]="bardtype"; // Bard Type
DBFieldNames[47]="bardvalue"; // Bard Type Amount
DBFieldNames[48]="light"; // Light
DBFieldNames[49]="delay"; // Attack Delay
DBFieldNames[50]="reclevel"; // Recommended Level
DBFieldNames[51]="recskill"; // Recommended Skill
DBFieldNames[52]="elemdmgamt"; // "Elemental Dmg Type (1=magic, 2=fire, 3=cold, 4=poison, 5=disease)"
DBFieldNames[53]="elemdmgtype"; // Elemental Dmg
DBFieldNames[54]="effecttype"; // "Effect Type (0=combat, 1=clicky, 2=Worn, 3=Expendable charges, 4=Must Equip Clicky, 5=clicky)"
DBFieldNames[55]="range"; // Range
DBFieldNames[56]="damage"; // Damage
DBFieldNames[57]="color"; // Color
DBFieldNames[58]="classes"; // Classes
DBFieldNames[59]="races"; // Races
DBFieldNames[60]="unknown061";
DBFieldNames[61]="spellid"; // SpellId
DBFieldNames[62]="maxcharges"; // MaxCharges
DBFieldNames[63]="itemtype"; // "Skill (ItemType: 1hs, etc)"
DBFieldNames[64]="material"; // Material
DBFieldNames[65]="sellrate"; // ** Sell Rate
DBFieldNames[66]="unknown067";
DBFieldNames[67]="casttime"; // CastTime (milliseconds)
DBFieldNames[68]="unknown069";
DBFieldNames[69]="unknown070"; // ?
DBFieldNames[70]="focusid"; // Focus Effect Spell Id
DBFieldNames[71]="combateffects"; // CombatEffects
DBFieldNames[72]="shielding"; // Shielding
DBFieldNames[73]="stunresist"; // StunResist
DBFieldNames[74]="strikethrough"; // StrikeThrough
DBFieldNames[75]="unknown076";
DBFieldNames[76]="unknown077"; // ?
DBFieldNames[77]="spellshield"; // Spell Shield
DBFieldNames[78]="avoidance"; // Avoidance
DBFieldNames[79]="accuracy"; // Accuracy
DBFieldNames[80]="factionmod1"; // Faction Mod Index 1
DBFieldNames[81]="factionmod2"; // Faction Mod Index 2
DBFieldNames[82]="factionmod3"; // Faction Mod Index 3
DBFieldNames[83]="factionmod4"; // Faction Mod Index 4
DBFieldNames[84]="factionamt1"; // Faction Mod Value 1
DBFieldNames[85]="factionamt2"; // Faction Mod Value 2
DBFieldNames[86]="factionamt3"; // Faction Mod Value 3
DBFieldNames[87]="factionamt4"; // Faction Mod Value 4
DBFieldNames[88]="unknown089";
DBFieldNames[89]="charmfile"; // ** Charm File
DBFieldNames[90]="unknown091";
DBFieldNames[91]="augslot1type"; // Slot1Type
DBFieldNames[92]="augslot2type"; // Slot2Type
DBFieldNames[93]="augslot3type"; // Slot3Type
DBFieldNames[94]="augslot4type"; // Slot4Type
DBFieldNames[95]="augslot5type"; // Slot5Type
DBFieldNames[96]="ldonpointtheme";
DBFieldNames[97]="ldonpointcost"; // ?
DBFieldNames[98]="unknown099";
DBFieldNames[99]="bagtype"; // bag type
DBFieldNames[100]="bagslots"; // bag slots
DBFieldNames[101]="bagsize"; // bag size capacity
DBFieldNames[102]="bagwr"; // bag weight reduction
DBFieldNames[103]="booktype"; // "book type (0=rolled up note, 1=book)"
DBFieldNames[104]="unknown105";
DBFieldNames[105]="filename"; // Book Filename
DBFieldNames[106]="unknown107";
DBFieldNames[107]="unknown108";
DBFieldNames[108]="loreflag";
DBFieldNames[109]="unknown111";
DBFieldNames[110]="unknown112";
DBFieldNames[111]="unknown113";
DBFieldNames[112]="unknown114";
DBFieldNames[113]="unknown115"; // ? (end quote)
}
void dump_message_column(unsigned char *buffer, unsigned long length, std::string leader, FILE *to)
{
unsigned long i,j;
-2
View File
@@ -15,8 +15,6 @@ bool ItemParse(const char *data, int length, std::map<int,std::map<int,std::stri
int Tokenize(std::string s, std::map<int,std::string> & tokens, char delim='|');
void LoadItemDBFieldNames();
#ifndef WIN32
int print_stacktrace();
#endif
+60 -5
View File
@@ -17,6 +17,7 @@
*/
#include "../common/races.h"
#include "data_verification.h"
const char* GetRaceIDName(uint16 race_id)
{
@@ -67,7 +68,7 @@ const char* GetRaceIDName(uint16 race_id)
// return "Froglok";
//case DRAKKIN:
// return "Drakkin";
// RoF2 Race Labels
case RT_ABHORRENT:
return "Abhorrent";
@@ -1696,7 +1697,7 @@ bool PlayerAppearance::IsValidBeardColor(uint16 race_id, uint8 gender_id, uint8
{
if (beard_color_value == 0xFF)
return true;
switch (BINDRG(race_id, gender_id)) {
case GNOME_MALE:
if (beard_color_value <= 24)
@@ -1783,7 +1784,7 @@ bool PlayerAppearance::IsValidEyeColor(uint16 race_id, uint8 gender_id, uint8 ey
case VAHSHIR_FEMALE:
if (eye_color_value <= 9)
return true;
break;
break;
case TROLL_MALE:
case TROLL_FEMALE:
if (eye_color_value <= 10)
@@ -2109,7 +2110,7 @@ bool PlayerAppearance::IsValidTexture(uint16 race_id, uint8 gender_id, uint8 tex
{
if (texture_value == 0xFF)
return true;
if (use_luclin) {
switch (BINDRG(race_id, gender_id)) {
case HUMAN_MALE:
@@ -2243,4 +2244,58 @@ const char* GetGenderName(uint32 gender_id) {
gender_name = "Neuter";
}
return gender_name;
}
}
const std::string GetPlayerRaceAbbreviation(uint16 race_id)
{
if (!IsPlayerRace(race_id)) {
return std::string("UNK");
}
switch (race_id) {
case RACE_HUMAN_1:
return "HUM";
case RACE_BARBARIAN_2:
return "BAR";
case RACE_ERUDITE_3:
return "ERU";
case RACE_WOOD_ELF_4:
return "ELF";
case RACE_HIGH_ELF_5:
return "HIE";
case RACE_DARK_ELF_6:
return "DEF";
case RACE_HALF_ELF_7:
return "HEF";
case RACE_DWARF_8:
return "DWF";
case RACE_TROLL_9:
return "TRL";
case RACE_OGRE_10:
return "OGR";
case RACE_HALFLING_11:
return "HFL";
case RACE_GNOME_12:
return "GNM";
case RACE_IKSAR_128:
return "IKS";
case RACE_VAH_SHIR_130:
return "VAH";
case RACE_FROGLOK_330:
return "FRG";
case RACE_DRAKKIN_522:
return "DRK";
}
return std::string("UNK");
}
bool IsPlayerRace(uint16 race_id) {
return (
EQ::ValueWithin(race_id, RACE_HUMAN_1, RACE_GNOME_12) ||
race_id == RACE_IKSAR_128 ||
race_id == RACE_VAH_SHIR_130 ||
race_id == RACE_FROGLOK_330 ||
race_id == RACE_DRAKKIN_522
);
}
+4
View File
@@ -19,6 +19,7 @@
#ifndef RACES_H
#define RACES_H
#include "../common/types.h"
#include <string>
#define MALE 0
#define FEMALE 1
@@ -853,6 +854,9 @@ const char* GetRaceIDName(uint16 race_id);
const char* GetPlayerRaceName(uint32 player_race_value);
const char* GetGenderName(uint32 gender_id);
bool IsPlayerRace(uint16 race_id);
const std::string GetPlayerRaceAbbreviation(uint16 race_id);
uint32 GetPlayerRaceValue(uint16 race_id);
uint32 GetPlayerRaceBit(uint16 race_id);
@@ -44,7 +44,35 @@ public:
*/
// Custom extended repository methods here
static void ClearFlag(
Database& db,
AccountFlagsRepository::AccountFlags e
) {
AccountFlagsRepository::DeleteWhere(
database,
fmt::format(
"p_accid = {} AND p_flag = '{}'",
e.p_accid,
Strings::Escape(e.p_flag)
)
);
}
static void ReplaceFlag(
Database& db,
AccountFlagsRepository::AccountFlags e
) {
db.QueryDatabase(
fmt::format(
"REPLACE INTO {} ({}) VALUES ({}, '{}', '{}')",
TableName(),
ColumnsRaw(),
e.p_accid,
Strings::Escape(e.p_flag),
Strings::Escape(e.p_value)
)
);
}
};
#endif //EQEMU_ACCOUNT_FLAGS_REPOSITORY_H
@@ -16,6 +16,7 @@
#include "../../strings.h"
#include <ctime>
class BaseItemsRepository {
public:
struct Items {
@@ -122,7 +123,7 @@ public:
int32_t pr;
int32_t procrate;
int32_t races;
int32_t range;
int32_t range_;
int32_t reclevel;
int32_t recskill;
int32_t reqlevel;
@@ -417,7 +418,7 @@ public:
"pr",
"procrate",
"races",
"range",
"`range`",
"reclevel",
"recskill",
"reqlevel",
@@ -708,7 +709,7 @@ public:
"pr",
"procrate",
"races",
"range",
"`range`",
"reclevel",
"recskill",
"reqlevel",
@@ -1033,7 +1034,7 @@ public:
e.pr = 0;
e.procrate = 0;
e.races = 0;
e.range = 0;
e.range_ = 0;
e.reclevel = 0;
e.recskill = 0;
e.reqlevel = 0;
@@ -1240,8 +1241,9 @@ public:
{
auto results = db.QueryDatabase(
fmt::format(
"{} WHERE id = {} LIMIT 1",
"{} WHERE {} = {} LIMIT 1",
BaseSelect(),
PrimaryKey(),
items_id
)
);
@@ -1353,7 +1355,7 @@ public:
e.pr = static_cast<int32_t>(atoi(row[100]));
e.procrate = static_cast<int32_t>(atoi(row[101]));
e.races = static_cast<int32_t>(atoi(row[102]));
e.range = static_cast<int32_t>(atoi(row[103]));
e.range_ = static_cast<int32_t>(atoi(row[103]));
e.reclevel = static_cast<int32_t>(atoi(row[104]));
e.recskill = static_cast<int32_t>(atoi(row[105]));
e.reqlevel = static_cast<int32_t>(atoi(row[106]));
@@ -1671,7 +1673,7 @@ public:
v.push_back(columns[100] + " = " + std::to_string(e.pr));
v.push_back(columns[101] + " = " + std::to_string(e.procrate));
v.push_back(columns[102] + " = " + std::to_string(e.races));
v.push_back(columns[103] + " = " + std::to_string(e.range));
v.push_back(columns[103] + " = " + std::to_string(e.range_));
v.push_back(columns[104] + " = " + std::to_string(e.reclevel));
v.push_back(columns[105] + " = " + std::to_string(e.recskill));
v.push_back(columns[106] + " = " + std::to_string(e.reqlevel));
@@ -1977,7 +1979,7 @@ public:
v.push_back(std::to_string(e.pr));
v.push_back(std::to_string(e.procrate));
v.push_back(std::to_string(e.races));
v.push_back(std::to_string(e.range));
v.push_back(std::to_string(e.range_));
v.push_back(std::to_string(e.reclevel));
v.push_back(std::to_string(e.recskill));
v.push_back(std::to_string(e.reqlevel));
@@ -2291,7 +2293,7 @@ public:
v.push_back(std::to_string(e.pr));
v.push_back(std::to_string(e.procrate));
v.push_back(std::to_string(e.races));
v.push_back(std::to_string(e.range));
v.push_back(std::to_string(e.range_));
v.push_back(std::to_string(e.reclevel));
v.push_back(std::to_string(e.recskill));
v.push_back(std::to_string(e.reqlevel));
@@ -2609,7 +2611,7 @@ public:
e.pr = static_cast<int32_t>(atoi(row[100]));
e.procrate = static_cast<int32_t>(atoi(row[101]));
e.races = static_cast<int32_t>(atoi(row[102]));
e.range = static_cast<int32_t>(atoi(row[103]));
e.range_ = static_cast<int32_t>(atoi(row[103]));
e.reclevel = static_cast<int32_t>(atoi(row[104]));
e.recskill = static_cast<int32_t>(atoi(row[105]));
e.reqlevel = static_cast<int32_t>(atoi(row[106]));
@@ -2918,7 +2920,7 @@ public:
e.pr = static_cast<int32_t>(atoi(row[100]));
e.procrate = static_cast<int32_t>(atoi(row[101]));
e.races = static_cast<int32_t>(atoi(row[102]));
e.range = static_cast<int32_t>(atoi(row[103]));
e.range_ = static_cast<int32_t>(atoi(row[103]));
e.reclevel = static_cast<int32_t>(atoi(row[104]));
e.recskill = static_cast<int32_t>(atoi(row[105]));
e.reqlevel = static_cast<int32_t>(atoi(row[106]));
+28
View File
@@ -44,7 +44,35 @@ public:
*/
// Custom extended repository methods here
static std::vector<int32> GetItemIDsBySearchCriteria(
Database& db,
std::string search_string,
int query_limit = 0
)
{
auto query = fmt::format(
"SELECT `id` FROM {} WHERE LOWER(`name`) LIKE '%%{}%%' ORDER BY id ASC",
TableName(),
search_string
);
if (query_limit >= 1) {
query += fmt::format(" LIMIT {}", query_limit);
}
std::vector<int32> item_id_list;
auto results = db.QueryDatabase(query);
if (!results.Success() || !results.RowCount()) {
return item_id_list;
}
for (auto row : results) {
item_id_list.emplace_back(Strings::ToInt(row[0]));
}
return item_id_list;
}
};
#endif //EQEMU_ITEMS_REPOSITORY_H
+1
View File
@@ -256,6 +256,7 @@ RULE_BOOL(Pets, UnTargetableSwarmPet, false, "Setting whether swarm pets should
RULE_REAL(Pets, PetPowerLevelCap, 10, "Maximum number of levels a player pet can go up with pet power")
RULE_BOOL(Pets, CanTakeNoDrop, false, "Setting whether anyone can give no-drop items to pets")
RULE_BOOL(Pets, LivelikeBreakCharmOnInvis, true, "Default: true will break charm on any type of invis (hide/ivu/iva/etc) false will only break if the pet can not see you (ex. you have an undead pet and cast IVU")
RULE_BOOL(Pets, ClientPetsUseOwnerNameInLastName, true, "Disable this to keep client pet's last names from being owner_name's pet")
RULE_CATEGORY_END()
RULE_CATEGORY(GM)
+23
View File
@@ -695,8 +695,31 @@ std::string Strings::ConvertToDigit(int n, const std::string& suffix)
return NUM_TO_ENGLISH_X[n] + suffix;
}
}
bool Strings::BeginsWith(const std::string& subject, const std::string& search)
{
if (subject.length() < search.length()) {
return false;
}
return subject.starts_with(search);
}
bool Strings::EndsWith(const std::string& subject, const std::string& search)
{
if (subject.length() < search.length()) {
return false;
}
return subject.ends_with(search);
}
bool Strings::Contains(const std::string& subject, const std::string& search)
{
if (subject.length() < search.length()) {
return false;
}
return subject.find(search) != std::string::npos;
}
+2
View File
@@ -128,6 +128,8 @@ public:
static bool ToBool(const std::string& bool_string);
static inline bool EqualFold(const std::string &string_one, const std::string &string_two) { return strcasecmp(string_one.c_str(), string_two.c_str()) == 0; }
static std::string Random(size_t length);
static bool BeginsWith(const std::string& subject, const std::string& search);
static bool EndsWith(const std::string& subject, const std::string& search);
template<typename T>
static std::string
+1 -1
View File
@@ -25,7 +25,7 @@
// Build variables
// these get injected during the build pipeline
#define CURRENT_VERSION "22.15.2-dev" // always append -dev to the current version for custom-builds
#define CURRENT_VERSION "22.17.0-dev" // always append -dev to the current version for custom-builds
#define LOGIN_VERSION "0.8.0"
#define COMPILE_DATE __DATE__
#define COMPILE_TIME __TIME__
-87
View File
@@ -1,87 +0,0 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2006 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../common/global_define.h"
#include "../common/eqemu_logsys.h"
#include <iomanip>
#include "worldconn.h"
#include "eqemu_config.h"
#include "md5.h"
#include "servertalk.h"
WorldConnection::WorldConnection(EmuTCPConnection::ePacketMode mode, const char *password)
: m_password(password)
{
tcpc.SetPacketMode(mode);
pTryReconnect = true;
pConnected = false;
}
WorldConnection::~WorldConnection() {
}
bool WorldConnection::SendPacket(ServerPacket* pack) {
if (!Connected())
return false;
return tcpc.SendPacket(pack);
}
void WorldConnection::OnConnected() {
const EQEmuConfig *Config=EQEmuConfig::get();
LogNetcode("[WORLD] Connected to World: [{}]:[{}]", Config->WorldIP.c_str(), Config->WorldTCPPort);
auto pack = new ServerPacket(ServerOP_ZAAuth, 16);
MD5::Generate((const uchar*) m_password.c_str(), m_password.length(), pack->pBuffer);
SendPacket(pack);
safe_delete(pack);
}
void WorldConnection::Process() {
//persistent connection....
if (!Connected()) {
pConnected = tcpc.Connected();
if (pConnected) {
OnConnected();
}
else
return;
}
}
void WorldConnection::AsyncConnect() {
const EQEmuConfig *Config=EQEmuConfig::get();
tcpc.AsyncConnect(Config->WorldIP.c_str(), Config->WorldTCPPort);
}
bool WorldConnection::Connect() {
const EQEmuConfig *Config=EQEmuConfig::get();
char errbuf[TCPConnection_ErrorBufferSize];
if (tcpc.Connect(Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf)) {
return true;
} else {
LogNetcode("[WORLD] WorldConnection connect: Connecting to the server [{}]:[{}] failed: [{}]", Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf);
}
return false;
}
void WorldConnection::Disconnect() {
tcpc.Disconnect();
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "eqemu-server",
"version": "22.15.2",
"version": "22.17.0",
"repository": {
"type": "git",
"url": "https://github.com/EQEmu/Server.git"
@@ -586,7 +586,8 @@ sub get_reserved_cpp_variable_names {
return (
"class",
"int",
"key"
"key",
"range"
);
}
+3
View File
@@ -118,8 +118,11 @@ SET(zone_sources
perl_perlpacket.cpp
perl_player_corpse.cpp
perl_questitem.cpp
perl_questitem_data.cpp
perl_raids.cpp
perl_spawn.cpp
perl_spell.cpp
perl_stat_bonuses.cpp
perlpacket.cpp
petitions.cpp
pets.cpp
+2 -1
View File
@@ -146,7 +146,8 @@ void Mob::CalcItemBonuses(StatBonuses* b) {
int16 i;
for (i = EQ::invslot::BONUS_BEGIN; i <= EQ::invslot::BONUS_SKILL_END; i++) {
const EQ::ItemInstance* inst = GetInv().GetItem(i);
const auto* inst = GetInv().GetItem(i);
if (!inst) {
continue;
}
+8 -2
View File
@@ -5316,7 +5316,7 @@ void bot_command_view_combos(Client *c, const Seperator *sep)
const uint16 bot_race = static_cast<uint16>(Strings::ToUnsignedInt(sep->arg[1]));
const std::string race_name = GetRaceIDName(bot_race);
if (!Mob::IsPlayerRace(bot_race)) {
if (!IsPlayerRace(bot_race)) {
c->Message(
Chat::White,
fmt::format(
@@ -5512,6 +5512,12 @@ void bot_subcommand_bot_create(Client *c, const Seperator *sep)
std::string bot_name = sep->arg[1];
bot_name = Strings::UcFirst(bot_name);
if (Strings::Contains(bot_name, "_")) {
c->Message(Chat::White, "Bot name cannot contain underscores!");
return;
}
if (arguments < 2 || !sep->IsNumber(2)) {
c->Message(Chat::White, "Invalid class!");
return;
@@ -8894,7 +8900,7 @@ uint32 helper_bot_create(Client *bot_owner, std::string bot_name, uint8 bot_clas
return bot_id;
}
if (!Bot::IsValidRaceClassCombo(bot_race, bot_class) && bot_owner->IsPlayerRace(bot_race)) {
if (!Bot::IsValidRaceClassCombo(bot_race, bot_class) && IsPlayerRace(bot_race)) {
const std::string bot_race_name = GetRaceIDName(bot_race);
const std::string bot_class_name = GetClassIDName(bot_class);
const auto view_saylink = Saylink::Silent(
+206 -741
View File
File diff suppressed because it is too large Load Diff
+17 -12
View File
@@ -131,6 +131,12 @@ enum {
HideCorpseNPC = 5
};
typedef enum
{
Disciplines,
Spells
} ShowSpellType;
typedef enum
{
Empty = 0,
@@ -669,6 +675,8 @@ public:
inline const int32 GetInstanceID() const { return zone->GetInstanceID(); }
void SetZoning(bool in) { bZoning = in; }
void ShowSpells(Client* c, ShowSpellType show_spell_type);
FACTION_VALUE GetReverseFactionCon(Mob* iOther);
FACTION_VALUE GetFactionLevel(uint32 char_id, uint32 npc_id, uint32 p_race, uint32 p_class, uint32 p_deity, int32 pFaction, Mob* tnpc);
bool ReloadCharacterFaction(Client *c, uint32 facid, uint32 charid);
@@ -764,7 +772,6 @@ public:
void SetLanguageSkill(int langid, int value);
void SetHoTT(uint32 mobid);
void ShowSkillsWindow();
void SendStatsWindow(Client* client, bool use_window);
uint16 MaxSkill(EQ::skills::SkillType skillid, uint16 class_, uint16 level) const;
inline uint16 MaxSkill(EQ::skills::SkillType skillid) const { return MaxSkill(skillid, GetClass(), GetLevel()); }
@@ -1087,7 +1094,7 @@ public:
uint16 GetMaxSkillAfterSpecializationRules(EQ::skills::SkillType skillid, uint16 maxSkill);
void SendPopupToClient(const char *Title, const char *Text, uint32 PopupID = 0, uint32 Buttons = 0, uint32 Duration = 0);
void SendFullPopup(const char *Title, const char *Text, uint32 PopupID = 0, uint32 NegativeID = 0, uint32 Buttons = 0, uint32 Duration = 0, const char *ButtonName0 = 0, const char *ButtonName1 = 0, uint32 SoundControls = 0);
void SendWindow(uint32 PopupID, uint32 NegativeID, uint32 Buttons, const char *ButtonName0, const char *ButtonName1, uint32 Duration, int title_type, Client* target, const char *Title, const char *Text, ...);
void SendWindow(uint32 button_one_id, uint32 button_two_id, uint32 button_type, const char* button_one_text, const char* button_two_text, uint32 duration, int title_type, Mob* target, const char* title, const char* text, ...);
bool PendingTranslocate;
time_t TranslocateTime;
bool PendingSacrifice;
@@ -1340,7 +1347,7 @@ public:
bool CanEnterZone(const std::string& zone_short_name = "", int16 instance_version = -1);
int GetAggroCount();
uint32 GetAggroCount();
void IncrementAggroCount(bool raid_target = false);
void DecrementAggroCount();
void SendPVPStats();
@@ -1353,8 +1360,8 @@ public:
uint32 GetLDoNLossesTheme(uint32 t);
uint32 GetLDoNPointsTheme(uint32 t);
void UpdateLDoNWinLoss(uint32 theme_id, bool win = false, bool remove = false);
void CheckLDoNHail(Mob *target);
void CheckEmoteHail(Mob *target, const char* message);
void CheckLDoNHail(NPC* n);
void CheckEmoteHail(NPC* n, const char* message);
void HandleLDoNOpen(NPC *target);
void HandleLDoNSenseTraps(NPC *target, uint16 skill, uint8 type);
@@ -1552,8 +1559,6 @@ public:
Timer* GetMercTimer() { return &merc_timer; };
Timer* GetPickLockTimer() { return &pick_lock_timer; };
const char* GetRacePlural(Client* client);
const char* GetClassPlural(Client* client);
void SendWebLink(const char* website);
void SendMarqueeMessage(uint32 type, std::string message, uint32 duration = 3000);
void SendMarqueeMessage(uint32 type, uint32 priority, uint32 fade_in, uint32 fade_out, uint32 duration, std::string message);
@@ -1576,8 +1581,10 @@ public:
int32 GetActWIS() { return( std::min(GetMaxWIS(), GetWIS()) ); }
int32 GetActCHA() { return( std::min(GetMaxCHA(), GetCHA()) ); }
void LoadAccountFlags();
void SetAccountFlag(std::string flag, std::string val);
std::string GetAccountFlag(std::string flag);
void ClearAccountFlag(const std::string& flag);
void SetAccountFlag(const std::string& flag, const std::string& value);
std::string GetAccountFlag(const std::string& flag);
std::vector<std::string> GetAccountFlags();
void SetGMStatus(int16 new_status);
void Consume(const EQ::ItemData *item, uint8 type, int16 slot, bool auto_consume);
void PlayMP3(const char* fname);
@@ -1589,8 +1596,6 @@ public:
void SetInvulnerableEnvironmentDamage(bool val) { invulnerable_environment_damage = val; }
void SetIntoxication(int32 in_intoxication);
void ShowNumHits(); // work around function for numhits not showing on buffs
void ApplyWeaponsStance();
void TogglePassiveAlternativeAdvancement(const AA::Rank &rank, uint32 ability_id);
bool UseTogglePassiveHotkey(const AA::Rank &rank);
@@ -1900,7 +1905,7 @@ private:
int8 last_reported_mana_percent;
int8 last_reported_endurance_percent;
unsigned int AggroCount; // How many mobs are aggro on us.
uint32 AggroCount; // How many mobs are aggro on us.
bool ooc_regen;
float AreaHPRegen;
+4 -4
View File
@@ -649,7 +649,7 @@ int64 Client::CalcBaseMana()
int64 Client::CalcBaseManaRegen()
{
uint8 clevel = GetLevel();
int32 regen = 0;
int64 regen = 0;
if (IsSitting() || (GetHorseId() != 0)) {
if (HasSkill(EQ::skills::SkillMeditate)) {
regen = (((GetSkill(EQ::skills::SkillMeditate) / 10) + (clevel - (clevel / 4))) / 4) + 4;
@@ -666,7 +666,7 @@ int64 Client::CalcBaseManaRegen()
int64 Client::CalcManaRegen(bool bCombat)
{
int regen = 0;
int64 regen = 0;
auto level = GetLevel();
// so the new formulas break down with older skill caps where you don't have the skill until 4 or 8
// so for servers that want to use the old skill progression they can set this rule so they
@@ -688,9 +688,9 @@ int64 Client::CalcManaRegen(bool bCombat)
}
}
if (old)
regen = std::max(regen, 2);
regen = std::max(regen, static_cast<int64>(2));
} else if (old) {
regen = std::max(regen, 1);
regen = std::max(regen, static_cast<int64>(1));
}
}
+20 -11
View File
@@ -2120,6 +2120,11 @@ void Client::Handle_OP_AdventureMerchantRequest(const EQApplicationPacket *app)
(tmp->GetClass() != DISCORD_MERCHANT) && (tmp->GetClass() != NORRATHS_KEEPERS_MERCHANT) && (tmp->GetClass() != DARK_REIGN_MERCHANT)))
return;
if (!tmp->CastToNPC()->IsMerchantOpen()) {
tmp->SayString(zone->random.Int(MERCHANT_CLOSED_ONE, MERCHANT_CLOSED_THREE));
return;
}
//you have to be somewhat close to them to be properly using them
if (DistanceSquared(m_Position, tmp->GetPosition()) > USE_NPC_RANGE2)
return;
@@ -9142,8 +9147,14 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
}
else if (inst->IsClassCommon())
{
if (!RuleB(Skills, RequireTomeHandin) && item->ItemType == EQ::item::ItemTypeSpell && (strstr((const char*)item->Name, "Tome of ") || strstr((const char*)item->Name, "Skill: ")))
{
if (
!RuleB(Skills, RequireTomeHandin) &&
item->ItemType == EQ::item::ItemTypeSpell &&
(
Strings::BeginsWith(item->Name, "Tome of ") ||
Strings::BeginsWith(item->Name, "Skill: ")
)
) {
DeleteItemInInventory(slot_id, 1, true);
TrainDiscipline(item->ID);
}
@@ -10707,7 +10718,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
case PET_HEALTHREPORT: {
if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) {
MessageString(Chat::PetResponse, PET_REPORT_HP, ConvertArrayF(mypet->GetHPRatio(), val1));
mypet->ShowBuffList(this);
mypet->ShowBuffs(this);
}
break;
}
@@ -11457,10 +11468,9 @@ void Client::Handle_OP_PopupResponse(const EQApplicationPacket *app)
break;
case POPUPID_UPDATE_SHOWSTATSWINDOW:
if (GetTarget() && GetTarget()->IsClient()) {
GetTarget()->CastToClient()->SendStatsWindow(this, true);
}
else {
if (GetTarget() && GetTarget()->IsOfClientBot()) {
GetTarget()->SendStatsWindow(this, true);
} else {
SendStatsWindow(this, true);
}
return;
@@ -14021,9 +14031,8 @@ void Client::Handle_OP_ShopRequest(const EQApplicationPacket *app)
if (tmp->Charmed())
action = 0;
// 1199 I don't have time for that now. etc
if (!tmp->CastToNPC()->IsMerchantOpen()) {
tmp->SayString(zone->random.Int(1199, 1202));
tmp->SayString(zone->random.Int(MERCHANT_CLOSED_ONE, MERCHANT_CLOSED_THREE));
action = 0;
}
@@ -14428,8 +14437,8 @@ void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app)
if (nt) {
if (GetGM() || (!nt->IsInvisible(this) && (DistanceSquared(m_Position, nt->GetPosition()) <= TARGETING_RANGE*TARGETING_RANGE))) {
if (nt->GetBodyType() == BT_NoTarget2 ||
nt->GetBodyType() == BT_Special ||
if (nt->GetBodyType() == BT_NoTarget2 ||
nt->GetBodyType() == BT_Special ||
nt->GetBodyType() == BT_NoTarget) {
can_target = false;
}
+1 -1
View File
@@ -2413,7 +2413,7 @@ bool Client::CheckWaterAutoFireLoS(Mob* m)
}
return (
zone->watermap->InLiquid(GetPosition()) &&
zone->watermap->InLiquid(GetPosition()) ==
zone->watermap->InLiquid(m->GetPosition())
);
}
+57 -43
View File
@@ -137,19 +137,7 @@ int command_init(void)
command_add("factionassociation", "[factionid] [amount] - triggers a faction hits via association", AccountStatus::GMLeadAdmin, command_faction_association) ||
command_add("feature", "Change your or your target's feature's temporarily", AccountStatus::QuestTroupe, command_feature) ||
command_add("size", "Change your targets size (alias of #feature size)", AccountStatus::QuestTroupe, command_feature) ||
command_add("findaa", "[Search Criteria] - Search for an AA", AccountStatus::Guide, command_findaa) ||
command_add("findaliases", "[Search Criteria]- Searches for available command aliases, by alias or command", AccountStatus::Player, command_findaliases) ||
command_add("findcharacter", "[Search Criteria] - Search for a character", AccountStatus::Guide, command_findcharacter) ||
command_add("findclass", "[Search Criteria] - Search for a class", AccountStatus::Guide, command_findclass) ||
command_add("findcurrency", "[Search Criteria] - Search for an alternate currency", AccountStatus::Guide, command_findcurrency) ||
command_add("findfaction", "[Search Criteria] - Search for a faction", AccountStatus::Guide, command_findfaction) ||
command_add("findnpctype", "[Search Criteria] - Search database NPC types", AccountStatus::GMAdmin, command_findnpctype) ||
command_add("findrace", "[Search Criteria] - Search for a race", AccountStatus::Guide, command_findrace) ||
command_add("findrecipe", "[Search Criteria] - Search for a recipe", AccountStatus::Guide, command_findrecipe) ||
command_add("findskill", "[Search Criteria] - Search for a skill", AccountStatus::Guide, command_findskill) ||
command_add("findspell", "[Search Criteria] - Search for a spell", AccountStatus::Guide, command_findspell) ||
command_add("findtask", "[Search Criteria] - Search for a task", AccountStatus::Guide, command_findtask) ||
command_add("findzone", "[Search Criteria] - Search database zones", AccountStatus::GMAdmin, command_findzone) ||
command_add("find", "Search command used to find various things", AccountStatus::Guide, command_find) ||
command_add("fixmob", "[race|gender|texture|helm|face|hair|haircolor|beard|beardcolor|heritage|tattoo|detail] [next|prev] - Manipulate appearance of your target", AccountStatus::QuestTroupe, command_fixmob) ||
command_add("flag", "[Status] [Account Name] - Refresh your admin status, or set an account's Admin status if arguments provided", AccountStatus::Player, command_flag) ||
command_add("flagedit", "Edit zone flags on your target. Use #flagedit help for more info.", AccountStatus::GMAdmin, command_flagedit) ||
@@ -189,7 +177,6 @@ int command_init(void)
command_add("invul", "[On|Off]] - Turn player target's or your invulnerable flag on or off", AccountStatus::QuestTroupe, command_invul) ||
command_add("ipban", "[IP] - Ban IP", AccountStatus::GMMgmt, command_ipban) ||
command_add("iplookup", "[charname] - Look up IP address of charname", AccountStatus::GMMgmt, command_iplookup) ||
command_add("itemsearch", "[Search Criteria] - Search for an item", AccountStatus::Steward, command_itemsearch) ||
command_add("kick", "[Character Name] - Disconnect a player by name", AccountStatus::GMLeadAdmin, command_kick) ||
command_add("kill", "Kill your target", AccountStatus::GMAdmin, command_kill) ||
command_add("killallnpcs", "[npc_name] - Kills all npcs by search name, leave blank for all attackable NPC's", AccountStatus::GMMgmt, command_killallnpcs) ||
@@ -205,8 +192,7 @@ int command_init(void)
command_add("mana", "Fill your or your target's mana", AccountStatus::Guide, command_mana) ||
command_add("maxskills", "Maxes skills for you or your player target.", AccountStatus::GMMgmt, command_max_all_skills) ||
command_add("memspell", "[Spell ID] [Spell Gem] - Memorize a Spell by ID to the specified Spell Gem for you or your target", AccountStatus::Guide, command_memspell) ||
command_add("merchant_close_shop", "Closes a merchant shop", AccountStatus::GMAdmin, command_merchantcloseshop) ||
command_add("merchant_open_shop", "Opens a merchants shop", AccountStatus::GMAdmin, command_merchantopenshop) ||
command_add("merchantshop", "Closes or opens your target merchant's shop", AccountStatus::GMAdmin, command_merchantshop) ||
command_add("modifynpcstat", "[Stat] [Value] - Modifies an NPC's stats temporarily.", AccountStatus::GMLeadAdmin, command_modifynpcstat) ||
command_add("motd", "[Message of the Day] - Set Message of the Day (leave empty to have no Message of the Day)", AccountStatus::GMLeadAdmin, command_motd) ||
command_add("movechar", "[Character ID|Character Name] [Zone ID|Zone Short Name] - Move an offline character to the specified zone", AccountStatus::Guide, command_movechar) ||
@@ -293,11 +279,10 @@ int command_init(void)
command_add("setstartzone", "[Zone ID|Zone Short Name] - Sets your or your target's starting zone (Use '0' or 'Reset' to allow the player use of /setstartcity)", AccountStatus::QuestTroupe, command_setstartzone) ||
command_add("setstat", "Sets the stats to a specific value.", AccountStatus::Max, command_setstat) ||
command_add("setxp", "[value] - Set your or your player target's experience", AccountStatus::GMAdmin, command_setxp) ||
command_add("showbonusstats", "[item|spell|all] Shows bonus stats for target from items or spells. Shows both by default.", AccountStatus::Guide, command_showbonusstats) ||
command_add("showbuffs", "List buffs active on your target or you if no target", AccountStatus::Guide, command_showbuffs) ||
command_add("shownumhits", "Shows buffs numhits for yourself.", AccountStatus::Player, command_shownumhits) ||
command_add("shownpcgloballoot", "Show global loot entries for your target NPC", AccountStatus::Guide, command_shownpcgloballoot) ||
command_add("showskills", "[Start Skill ID] [All] - Show the values of your or your player target's skills in a popup 50 at a time, use 'all' as second argument to show non-usable skill's values", AccountStatus::Guide, command_showskills) ||
command_add("showspells", "[disciplines|spells] - Show your or your target's memorized spells or learned disciplines", AccountStatus::GMAdmin, command_showspells) ||
command_add("showspellslist", "Shows spell list of targeted NPC", AccountStatus::GMAdmin, command_showspellslist) ||
command_add("showstats", "Show details about you or your target", AccountStatus::Guide, command_showstats) ||
command_add("showzonegloballoot", "Show global loot entries for your current zone", AccountStatus::Guide, command_showzonegloballoot) ||
@@ -307,7 +292,6 @@ int command_init(void)
command_add("spawneditmass", "[Search Criteria] [Edit Option] [Edit Value] [Apply] Mass editing spawn command (Apply is optional, 0 = False, 1 = True, default is False)", AccountStatus::GMLeadAdmin, command_spawneditmass) ||
command_add("spawnfix", "Find targeted NPC in database based on its X/Y/heading and update the database to make it spawn at your current location/heading.", AccountStatus::GMAreas, command_spawnfix) ||
command_add("spawnstatus", "[All|Disabled|Enabled|Spawn ID] - Show respawn timer status", AccountStatus::GMAdmin, command_spawnstatus) ||
command_add("spellinfo", "[spellid] - Get detailed info about a spell", AccountStatus::Steward, command_spellinfo) ||
command_add("stun", "[duration] - Stuns you or your target for duration", AccountStatus::GMAdmin, command_stun) ||
command_add("summon", "[Character Name] - Summons your corpse, NPC, or player target, or by character name if specified", AccountStatus::QuestTroupe, command_summon) ||
command_add("summonburiedplayercorpse", "Summons the target's oldest buried corpse, if any exist.", AccountStatus::GMAdmin, command_summonburiedplayercorpse) ||
@@ -377,6 +361,51 @@ int command_init(void)
std::vector<std::pair<std::string, uint8>> injected_command_settings;
std::vector<std::string> orphaned_command_settings;
// static aliases
struct StaticAlias {
std::string command;
std::vector<std::string> aliases;
};
std::vector<StaticAlias> static_aliases = {
{
.command = "find",
.aliases = {
"fi",
"fn",
"fs",
"fz",
"findaa",
"findcharacter",
"findclass",
"findcurrency",
"finddeity",
"findfaction",
"finditem",
"findlanguage",
"findnpc",
"findnpctype",
"findrace",
"findrecipe",
"findskill",
"findspell",
"findtask",
"findzone",
}
},
};
// inject static aliases
for (auto& cs : command_settings) {
for (const auto& sa : static_aliases) {
if (cs.first == sa.command) {
for (const auto& alias : sa.aliases) {
cs.second.second.emplace_back(alias);
}
}
}
}
for (const auto& cs : command_settings) {
auto cl = commandlist.find(cs.first);
if (cl == commandlist.end()) {
@@ -388,7 +417,7 @@ int command_init(void)
}
}
if (orphaned_command_settings.size()) {
if (!orphaned_command_settings.empty()) {
if (!database.UpdateOrphanedCommandSettings(orphaned_command_settings)) {
LogInfo("Failed to process 'Orphaned Commands' update operation.");
}
@@ -398,16 +427,16 @@ int command_init(void)
for (const auto& w : working_cl) {
auto cs = command_settings.find(w.first);
if (cs == command_settings.end()) {
injected_command_settings.emplace_back(std::pair<std::string, uint8>(w.first, w.second->admin));
injected_command_settings.emplace_back(w.first, w.second->admin);
LogInfo(
"New Command [{}] found... Adding to `command_settings` table with admin [{}]...",
"New Command [{}] found. Adding to `command_settings` table with admin [{}]...",
w.first,
w.second->admin
);
if (w.second->admin == AccountStatus::Player) {
LogCommands(
"command_init(): Warning: Command [{}] defaulting to admin level 0!",
"Warning: Command [{}] defaulting to admin level 0!",
w.first
);
}
@@ -417,7 +446,7 @@ int command_init(void)
w.second->admin = cs->second.first;
LogCommands(
"command_init(): - Command [{}] set to admin level [{}]",
"Command [{}] set to admin level [{}]",
w.first,
cs->second.first
);
@@ -451,7 +480,7 @@ int command_init(void)
}
}
if (injected_command_settings.size()) {
if (!injected_command_settings.empty()) {
if (!database.UpdateInjectedCommandSettings(injected_command_settings)) {
LogInfo("Failed to process 'Injected Commands' update operation.");
}
@@ -982,18 +1011,7 @@ void command_bot(Client *c, const Seperator *sep)
#include "gm_commands/exptoggle.cpp"
#include "gm_commands/faction.cpp"
#include "gm_commands/feature.cpp"
#include "gm_commands/findaa.cpp"
#include "gm_commands/findcharacter.cpp"
#include "gm_commands/findclass.cpp"
#include "gm_commands/findcurrency.cpp"
#include "gm_commands/findfaction.cpp"
#include "gm_commands/findnpctype.cpp"
#include "gm_commands/findrace.cpp"
#include "gm_commands/findrecipe.cpp"
#include "gm_commands/findskill.cpp"
#include "gm_commands/findspell.cpp"
#include "gm_commands/findtask.cpp"
#include "gm_commands/findzone.cpp"
#include "gm_commands/find.cpp"
#include "gm_commands/fixmob.cpp"
#include "gm_commands/flag.cpp"
#include "gm_commands/flagedit.cpp"
@@ -1031,7 +1049,6 @@ void command_bot(Client *c, const Seperator *sep)
#include "gm_commands/invul.cpp"
#include "gm_commands/ipban.cpp"
#include "gm_commands/iplookup.cpp"
#include "gm_commands/itemsearch.cpp"
#include "gm_commands/kick.cpp"
#include "gm_commands/kill.cpp"
#include "gm_commands/killallnpcs.cpp"
@@ -1046,8 +1063,7 @@ void command_bot(Client *c, const Seperator *sep)
#include "gm_commands/mana.cpp"
#include "gm_commands/max_all_skills.cpp"
#include "gm_commands/memspell.cpp"
#include "gm_commands/merchantcloseshop.cpp"
#include "gm_commands/merchantopenshop.cpp"
#include "gm_commands/merchantshop.cpp"
#include "gm_commands/modifynpcstat.cpp"
#include "gm_commands/motd.cpp"
#include "gm_commands/movechar.cpp"
@@ -1132,11 +1148,10 @@ void command_bot(Client *c, const Seperator *sep)
#include "gm_commands/setstartzone.cpp"
#include "gm_commands/setstat.cpp"
#include "gm_commands/setxp.cpp"
#include "gm_commands/showbonusstats.cpp"
#include "gm_commands/showbuffs.cpp"
#include "gm_commands/shownpcgloballoot.cpp"
#include "gm_commands/shownumhits.cpp"
#include "gm_commands/showskills.cpp"
#include "gm_commands/showspells.cpp"
#include "gm_commands/showspellslist.cpp"
#include "gm_commands/showstats.cpp"
#include "gm_commands/showzonegloballoot.cpp"
@@ -1146,7 +1161,6 @@ void command_bot(Client *c, const Seperator *sep)
#include "gm_commands/spawneditmass.cpp"
#include "gm_commands/spawnfix.cpp"
#include "gm_commands/spawnstatus.cpp"
#include "gm_commands/spellinfo.cpp"
#include "gm_commands/faction_association.cpp"
#include "gm_commands/stun.cpp"
#include "gm_commands/summon.cpp"
+3 -27
View File
@@ -87,19 +87,7 @@ void command_exptoggle(Client *c, const Seperator *sep);
void command_faction(Client *c, const Seperator *sep);
void command_faction_association(Client *c, const Seperator *sep);
void command_feature(Client *c, const Seperator *sep);
void command_findaa(Client *c, const Seperator *sep);
void command_findaliases(Client *c, const Seperator *sep);
void command_findcharacter(Client *c, const Seperator *sep);
void command_findclass(Client *c, const Seperator *sep);
void command_findcurrency(Client *c, const Seperator *sep);
void command_findfaction(Client *c, const Seperator *sep);
void command_findnpctype(Client *c, const Seperator *sep);
void command_findrace(Client *c, const Seperator *sep);
void command_findrecipe(Client *c, const Seperator *sep);
void command_findskill(Client *c, const Seperator *sep);
void command_findspell(Client *c, const Seperator *sep);
void command_findtask(Client *c, const Seperator *sep);
void command_findzone(Client *c, const Seperator *sep);
void command_find(Client *c, const Seperator *sep);
void command_fixmob(Client *c, const Seperator *sep);
void command_flag(Client *c, const Seperator *sep);
void command_flagedit(Client *c, const Seperator *sep);
@@ -139,7 +127,6 @@ void command_invsnapshot(Client *c, const Seperator *sep);
void command_invul(Client *c, const Seperator *sep);
void command_ipban(Client *c, const Seperator *sep);
void command_iplookup(Client *c, const Seperator *sep);
void command_itemsearch(Client *c, const Seperator *sep);
void command_kick(Client *c, const Seperator *sep);
void command_killallnpcs(Client *c, const Seperator *sep);
void command_kill(Client *c, const Seperator *sep);
@@ -155,8 +142,7 @@ void command_makepet(Client *c, const Seperator *sep);
void command_mana(Client *c, const Seperator *sep);
void command_max_all_skills(Client *c, const Seperator *sep);
void command_memspell(Client *c, const Seperator *sep);
void command_merchantcloseshop(Client *c, const Seperator *sep);
void command_merchantopenshop(Client *c, const Seperator *sep);
void command_merchantshop(Client *c, const Seperator *sep);
void command_modifynpcstat(Client *c, const Seperator *sep);
void command_motd(Client *c, const Seperator *sep);
void command_movechar(Client *c, const Seperator *sep);
@@ -182,11 +168,6 @@ void command_nukebuffs(Client *c, const Seperator *sep);
void command_nukeitem(Client *c, const Seperator *sep);
void command_object(Client *c, const Seperator *sep);
void command_oocmute(Client *c, const Seperator *sep);
#ifdef PACKET_PROFILER
void command_packetprofile(Client *c, const Seperator *sep);
#endif
void command_path(Client *c, const Seperator *sep);
void command_peekinv(Client *c, const Seperator *sep);
void command_peqzone(Client *c, const Seperator *sep);
@@ -198,7 +179,6 @@ void command_petitems(Client *c, const Seperator *sep);
void command_petitioninfo(Client *c, const Seperator *sep);
void command_picklock(Client *c, const Seperator *sep);
void command_profanity(Client *c, const Seperator *sep);
void command_proximity(Client *c, const Seperator *sep);
void command_push(Client *c, const Seperator *sep);
void command_pvp(Client *c, const Seperator *sep);
@@ -246,12 +226,10 @@ void command_setskillall(Client *c, const Seperator *sep);
void command_setstartzone(Client *c, const Seperator *sep);
void command_setstat(Client *c, const Seperator *sep);
void command_setxp(Client *c, const Seperator *sep);
void command_showbonusstats(Client *c, const Seperator *sep);
void command_showbuffs(Client *c, const Seperator *sep);
void command_shownumhits(Client *c, const Seperator *sep);
void command_shownpcgloballoot(Client *c, const Seperator *sep);
void command_showpetspell(Client *c, const Seperator *sep);
void command_showskills(Client *c, const Seperator *sep);
void command_showspells(Client *c, const Seperator *sep);
void command_showspellslist(Client *c, const Seperator *sep);
void command_showstats(Client *c, const Seperator *sep);
void command_showzonegloballoot(Client *c, const Seperator *sep);
@@ -261,7 +239,6 @@ void command_spawn(Client *c, const Seperator *sep);
void command_spawneditmass(Client *c, const Seperator *sep);
void command_spawnfix(Client *c, const Seperator *sep);
void command_spawnstatus(Client *c, const Seperator *sep);
void command_spellinfo(Client *c, const Seperator *sep);
void command_stun(Client *c, const Seperator *sep);
void command_summon(Client *c, const Seperator *sep);
void command_summonburiedplayercorpse(Client *c, const Seperator *sep);
@@ -282,7 +259,6 @@ void command_trapinfo(Client *c, const Seperator *sep);
void command_tune(Client *c, const Seperator *sep);
void command_undye(Client *c, const Seperator *sep);
void command_unfreeze(Client *c, const Seperator *sep);
void command_unlock(Client *c, const Seperator *sep);
void command_unmemspell(Client *c, const Seperator *sep);
void command_unmemspells(Client *c, const Seperator *sep);
void command_unscribespell(Client *c, const Seperator *sep);
+4 -4
View File
@@ -622,8 +622,8 @@ bool Client::TrainDiscipline(uint32 itemid) {
const std::string item_name = item->Name;
if (
item_name.substr(0, 5) != std::string("Tome ") &&
item_name.substr(0, 7) != std::string("Skill: ")
!Strings::BeginsWith(item_name, "Tome of ") &&
!Strings::BeginsWith(item_name, "Skill: ")
) {
Message(Chat::Red, "This item is not a tome.");
//summon them the item back...
@@ -709,8 +709,8 @@ bool Client::MemorizeSpellFromItem(uint32 item_id) {
const std::string item_name = item->Name;
if (
item_name.substr(0, 7) != std::string("Spell: ") &&
item_name.substr(0, 6) != std::string("Song: ")
!Strings::BeginsWith(item_name, "Spell: ") &&
!Strings::BeginsWith(item_name, "Song: ")
) {
Message(Chat::Red, "This item is not a scroll.");
SummonItem(item_id);
+6
View File
@@ -46,7 +46,10 @@ void perl_register_group();
void perl_register_raid();
void perl_register_inventory();
void perl_register_questitem();
void perl_register_questitem_data();
void perl_register_spawn();
void perl_register_spell();
void perl_register_stat_bonuses();
void perl_register_hateentry();
void perl_register_object();
void perl_register_doors();
@@ -1068,7 +1071,10 @@ void PerlembParser::MapFunctions()
perl_register_raid();
perl_register_inventory();
perl_register_questitem();
perl_register_questitem_data();
perl_register_spawn();
perl_register_spell();
perl_register_stat_bonuses();
perl_register_hateentry();
perl_register_object();
perl_register_doors();
+1 -1
View File
@@ -539,7 +539,7 @@ public:
inline const std::unordered_map<uint16, Object *> &GetObjectList() { return object_list; }
inline const std::unordered_map<uint16, Doors *> &GetDoorsList() { return door_list; }
std::unordered_map<uint16, Mob *> &GetCloseMobList(Mob *mob, float distance = 0);
std::unordered_map<uint16, Mob *> &GetCloseMobList(Mob *mob, float distance = 0.0f);
void DepopAll(int NPCTypeID, bool StartSpawnTimer = true);
+57 -41
View File
@@ -2,6 +2,7 @@
#include "npc.h"
#include "client.h"
#include "zone.h"
#include "dialogue_window.h"
extern Zone *zone;
@@ -21,62 +22,77 @@ std::vector<int> GlobalLootManager::GetGlobalLootTables(NPC *mob) const
return tables;
}
void GlobalLootManager::ShowZoneGlobalLoot(Client *to) const
void GlobalLootManager::ShowZoneGlobalLoot(Client *c) const
{
int table_number = 1;
std::string global_loot_table;
global_loot_table += DialogueWindow::TableRow(
fmt::format(
"{}{}{}",
DialogueWindow::TableCell("ID"),
DialogueWindow::TableCell("Table Name"),
DialogueWindow::TableCell("Loottable ID")
)
);
for (auto &e : m_entries) {
to->Message(
Chat::White,
global_loot_table += DialogueWindow::TableRow(
fmt::format(
"Table {} | Name: {}",
table_number,
e.GetDescription()
).c_str()
"{}{}{}",
DialogueWindow::TableCell(Strings::Commify(e.GetID())),
DialogueWindow::TableCell(e.GetDescription()),
DialogueWindow::TableCell(Strings::Commify(e.GetLootTableID()))
)
);
to->Message(
Chat::White,
fmt::format(
"Table {} | Global Table ID: {} Loot Table ID: {}",
table_number,
e.GetID(),
e.GetLootTableID()
).c_str()
);
table_number++;
}
global_loot_table = DialogueWindow::Table(global_loot_table);
c->SendPopupToClient(
fmt::format(
"Global Loot for {} ({})",
zone->GetLongName(),
zone->GetZoneID()
).c_str(),
global_loot_table.c_str()
);
}
void GlobalLootManager::ShowNPCGlobalLoot(Client *to, NPC *who) const
void GlobalLootManager::ShowNPCGlobalLoot(Client *c, NPC *t) const
{
int table_number = 1;
std::string global_loot_table;
global_loot_table += DialogueWindow::TableRow(
fmt::format(
"{}{}{}",
DialogueWindow::TableCell("ID"),
DialogueWindow::TableCell("Table Name"),
DialogueWindow::TableCell("Loottable ID")
)
);
for (auto &e : m_entries) {
if (e.PassesRules(who)) {
to->Message(
Chat::White,
if (e.PassesRules(t)) {
global_loot_table += DialogueWindow::TableRow(
fmt::format(
"Table {} | Name: {}",
table_number,
e.GetDescription()
).c_str()
"{}{}{}",
DialogueWindow::TableCell(Strings::Commify(e.GetID())),
DialogueWindow::TableCell(e.GetDescription()),
DialogueWindow::TableCell(Strings::Commify(e.GetLootTableID()))
)
);
to->Message(
Chat::White,
fmt::format(
"Table {} | Global Table ID: {} Loot Table ID: {}",
table_number,
e.GetID(),
e.GetLootTableID()
).c_str()
);
table_number++;
}
}
global_loot_table = DialogueWindow::Table(global_loot_table);
c->SendPopupToClient(
fmt::format(
"Global Loot for {}",
c->GetTargetDescription(t)
).c_str(),
global_loot_table.c_str()
);
}
bool GlobalLootEntry::PassesRules(NPC *mob) const
+97
View File
@@ -0,0 +1,97 @@
#include "../client.h"
#include "find/aa.cpp"
#include "find/character.cpp"
#include "find/class.cpp"
#include "find/currency.cpp"
#include "find/deity.cpp"
#include "find/faction.cpp"
#include "find/item.cpp"
#include "find/language.cpp"
#include "find/npctype.cpp"
#include "find/race.cpp"
#include "find/recipe.cpp"
#include "find/skill.cpp"
#include "find/spell.cpp"
#include "find/task.cpp"
#include "find/zone.cpp"
void command_find(Client *c, const Seperator *sep)
{
// Cmd represents a command
// variables are short to save space horizontally
// when adding a new sub-command, add it to the vector below
struct Cmd {
std::string cmd{}; // command
std::string u{}; // usage
void (*fn)(Client *c, const Seperator *sep) = nullptr; // function
std::vector<std::string> a{}; // aliases
};
std::vector<Cmd> commands = {
Cmd{.cmd = "aa", .u = "aa [Search Criteria]", .fn = FindAA, .a = {"#findaa"}},
Cmd{.cmd = "character", .u = "character [Search Criteria]", .fn = FindCharacter, .a = {"#findcharacter"}},
Cmd{.cmd = "class", .u = "class [Search Criteria]", .fn = FindClass, .a = {"#findclass"}},
Cmd{.cmd = "currency", .u = "currency [Search Criteria]", .fn = FindCurrency, .a = {"#findcurrency"}},
Cmd{.cmd = "deity", .u = "deity [Search Criteria]", .fn = FindDeity, .a = {"#finddeity"}},
Cmd{.cmd = "faction", .u = "faction [Search Criteria]", .fn = FindFaction, .a = {"#findfaction"}},
Cmd{.cmd = "item", .u = "item [Search Criteria]", .fn = FindItem, .a = {"#fi", "#finditem"}},
Cmd{.cmd = "language", .u = "language [Search Criteria]", .fn = FindLanguage, .a = {"#findlanguage"}},
Cmd{
.cmd = "npctype", .u = "npctype [Search Criteria]", .fn = FindNPCType, .a = {
"#fn",
"#findnpc",
"#findnpctype"
}
},
Cmd{.cmd = "race", .u = "race [Search Criteria]", .fn = FindRace, .a = {"#findrace"}},
Cmd{.cmd = "recipe", .u = "recipe [Search Criteria]", .fn = FindRecipe, .a = {"#findrecipe"}},
Cmd{.cmd = "skill", .u = "skill [Search Criteria]", .fn = FindSkill, .a = {"#findskill"}},
Cmd{.cmd = "spell", .u = "spell [Search Criteria]", .fn = FindSpell, .a = {"#fs", "#findspell"}},
Cmd{.cmd = "task", .u = "task [Search Criteria]", .fn = FindTask, .a = {"#findtask"}},
Cmd{.cmd = "zone", .u = "zone [Search Criteria]", .fn = FindZone, .a = {"#fz", "#findzone"}},
};
// Check for arguments
const auto arguments = sep->argnum;
if (!arguments) {
for (const auto &cmd: commands) {
c->Message(Chat::White, fmt::format("Usage: #find {}", cmd.u).c_str());
}
return;
}
// look for alias or command
for (const auto &cmd: commands) {
// Check for alias first
for (const auto &alias: cmd.a) {
if (!alias.empty() && alias == Strings::ToLower(sep->arg[0])) {
// build string from sep args
std::vector<std::string> args = {};
// skip the first arg
for (auto i = 1; i <= arguments; i++) {
args.emplace_back(sep->arg[i]);
}
// build the rewrite string
std::string rewrite = fmt::format("#find {} {}", cmd.cmd, Strings::Join(args, " "));
// rewrite to #find <sub-command <args>
c->SendGMCommand(rewrite);
return;
}
}
// Check for command
if (cmd.cmd == Strings::ToLower(sep->arg[1])) {
cmd.fn(c, sep);
return;
}
}
// Command not found
c->Message(Chat::White, "Command not found. Usage: #find [command]");
for (const auto &cmd: commands) {
c->Message(Chat::White, fmt::format("Usage: #find {}", cmd.u).c_str());
}
}
+88
View File
@@ -0,0 +1,88 @@
#include "../../client.h"
void FindAA(Client *c, const Seperator *sep)
{
if (sep->IsNumber(2)) {
const auto aa_id = Strings::ToInt(sep->arg[2]);
const auto& aa_name = zone->GetAAName(aa_id);
if (!aa_name.empty()) {
c->Message(
Chat::White,
fmt::format(
"AA {} | {}",
Strings::Commify(aa_id),
aa_name
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"AA ID {} was not found.",
Strings::Commify(aa_id)
).c_str()
);
return;
}
const auto& search_criteria = Strings::ToLower(sep->argplus[2]);
auto found_count = 0;
std::map<int, std::string> ordered_aas;
for (const auto &a: zone->aa_abilities) {
ordered_aas[a.second.get()->first->id] = a.second.get()->name;
}
for (const auto &a: ordered_aas) {
const auto& aa_name = zone->GetAAName(a.first);
if (!aa_name.empty()) {
const auto& aa_name_lower = Strings::ToLower(aa_name);
if (!Strings::Contains(aa_name_lower, search_criteria)) {
continue;
}
c->Message(
Chat::White,
fmt::format(
"AA {} | {}",
Strings::Commify(a.first),
aa_name
).c_str()
);
found_count++;
if (found_count == 50) {
break;
}
}
}
if (found_count == 50) {
c->Message(
Chat::White,
fmt::format(
"50 AAs were found matching '{}', max reached.",
sep->argplus[2]
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"{} AA{} found matching '{}'.",
found_count,
found_count != 1 ? "s" : "",
sep->argplus[2]
).c_str()
);
}
+95
View File
@@ -0,0 +1,95 @@
#include "../../client.h"
#include "../../common/repositories/character_data_repository.h"
void FindCharacter(Client *c, const Seperator *sep)
{
if (sep->IsNumber(2)) {
const auto character_id = Strings::ToUnsignedInt(sep->arg[2]);
const auto& e = CharacterDataRepository::FindOne(content_db, character_id);
if (!e.id) {
c->Message(
Chat::White,
fmt::format(
"Character ID {} does not exist or is invalid.",
Strings::Commify(character_id)
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"Character ID {} | {}",
Strings::Commify(character_id),
e.name
).c_str()
);
return;
}
const auto search_criteria = Strings::ToLower(sep->argplus[2]);
const auto& l = CharacterDataRepository::GetWhere(
content_db,
fmt::format(
"LOWER(`name`) LIKE '%%{}%%' ORDER BY `id` ASC LIMIT 50",
search_criteria
)
);
if (l.empty()) {
c->Message(
Chat::White,
fmt::format(
"No characters found matching '{}'.",
sep->argplus[2]
).c_str()
);
}
auto found_count = 0;
for (const auto& e : l) {
c->Message(
Chat::White,
fmt::format(
"Character ID {} | {}",
Strings::Commify(e.id),
e.name
).c_str()
);
found_count++;
if (found_count == 50) {
break;
}
}
if (found_count == 50) {
c->Message(
Chat::White,
fmt::format(
"50 Characters found matching '{}', max reached.",
sep->argplus[2]
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"{} Character{} found matching '{}'.",
found_count,
found_count != 1 ? "s" : "",
sep->argplus[2]
).c_str()
);
}
+80
View File
@@ -0,0 +1,80 @@
#include "../../client.h"
void FindClass(Client *c, const Seperator *sep)
{
if (sep->IsNumber(2)) {
const auto class_id = Strings::ToInt(sep->arg[2]);
if (EQ::ValueWithin(class_id, WARRIOR, BERSERKER)) {
const std::string& class_name = GetClassIDName(class_id);
c->Message(
Chat::White,
fmt::format(
"Class {} | {}{}",
class_id,
class_name,
(
IsPlayerClass(class_id) ?
fmt::format(
" ({})",
Strings::Commify(GetPlayerClassBit(class_id))
) :
""
)
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"Class ID {} was not found.",
class_id
).c_str()
);
return;
}
const auto& search_criteria = Strings::ToLower(sep->argplus[2]);
auto found_count = 0;
for (uint16 class_id = WARRIOR; class_id <= MERCENARY_MASTER; class_id++) {
const std::string& class_name = GetClassIDName(class_id);
const auto& class_name_lower = Strings::ToLower(class_name);
if (!Strings::Contains(class_name_lower, search_criteria)) {
continue;
}
c->Message(
Chat::White,
fmt::format(
"Class {} | {}{}",
class_id,
class_name,
(
IsPlayerClass(class_id) ?
fmt::format(
" | ({})",
Strings::Commify(GetPlayerClassBit(class_id))
) :
""
)
).c_str()
);
found_count++;
}
c->Message(
Chat::White,
fmt::format(
"{} Class{} found matching '{}'.",
found_count,
found_count != 1 ? "es" : "",
sep->argplus[2]
).c_str()
);
}
+131
View File
@@ -0,0 +1,131 @@
#include "../../client.h"
void FindCurrency(Client *c, const Seperator *sep)
{
const auto can_summon_items = c->Admin() >= GetCommandStatus(c, "summonitem");
if (sep->IsNumber(2)) {
const auto item_id = Strings::ToUnsignedInt(sep->arg[2]);
const auto currency_id = zone->GetCurrencyID(item_id);
if (!currency_id) {
c->Message(
Chat::White,
fmt::format(
"There is no currency with an item ID of {}.",
Strings::Commify(item_id)
).c_str()
);
return;
}
const auto item_data = database.GetItem(item_id);
if (!item_data) {
c->Message(
Chat::White,
fmt::format(
"Item ID {} does not exist.",
Strings::Commify(item_id)
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"Currency {} | {}{}",
currency_id,
database.CreateItemLink(item_id),
(
can_summon_items ?
fmt::format(
" | {}",
Saylink::Silent(
fmt::format(
"#summonitem {} {}",
item_id,
item_data->StackSize
),
"Summon"
)
) :
""
)
).c_str()
);
return;
}
const auto& search_criteria = Strings::ToLower(sep->argplus[2]);
auto found_count = 0;
for (const auto& e : zone->AlternateCurrencies) {
const auto item_data = database.GetItem(e.item_id);
if (!item_data) {
continue;
}
const auto& item_name = Strings::ToLower(item_data->Name);
if (!Strings::Contains(item_name, search_criteria)) {
continue;
}
c->Message(
Chat::White,
fmt::format(
"Currency {} | {}{}",
e.id,
database.CreateItemLink(e.item_id),
(
can_summon_items ?
fmt::format(
" | {}",
Saylink::Silent(
fmt::format(
"#summonitem {} {}",
e.item_id,
item_data->StackSize
),
"Summon"
)
) :
""
)
).c_str()
);
found_count++;
if (found_count == 50) {
break;
}
}
if (found_count == 50) {
c->Message(
Chat::White,
fmt::format(
"50 Currencies found matching '{}', max reached.",
sep->argplus[2]
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"{} Currenc{} found matching '{}'.",
found_count,
found_count != 1 ? "ies" : "y",
sep->argplus[2]
).c_str()
);
}
+69
View File
@@ -0,0 +1,69 @@
#include "../../client.h"
void FindDeity(Client *c, const Seperator *sep)
{
if (sep->IsNumber(2)) {
const auto deity_id = static_cast<EQ::deity::DeityType>(Strings::ToInt(sep->arg[2]));
const auto& deity_name = EQ::deity::GetDeityName(deity_id);
if (!deity_name.empty()) {
const auto deity_bit = EQ::deity::GetDeityBitmask(deity_id);
c->Message(
Chat::White,
fmt::format(
"Deity {} | {} ({})",
deity_id,
deity_name,
Strings::Commify(deity_bit)
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"Deity ID {} was not found.",
deity_id
).c_str()
);
return;
}
const auto& search_criteria = Strings::ToLower(sep->argplus[2]);
auto found_count = 0;
for (const auto& d : EQ::deity::GetDeityMap()) {
const auto& deity_name_lower = Strings::ToLower(d.second);
if (!Strings::Contains(deity_name_lower, search_criteria)) {
continue;
}
const auto deity_bit = EQ::deity::GetDeityBitmask(d.first);
c->Message(
Chat::White,
fmt::format(
"Deity {} | {} ({})",
d.first,
d.second,
Strings::Commify(deity_bit)
).c_str()
);
found_count++;
}
c->Message(
Chat::White,
fmt::format(
"{} Deit{} found matching '{}'.",
found_count,
found_count != 1 ? "ies" : "y",
sep->argplus[2]
).c_str()
);
}
+84
View File
@@ -0,0 +1,84 @@
#include "../../client.h"
void FindFaction(Client *c, const Seperator *sep)
{
if (sep->IsNumber(2)) {
const auto faction_id = Strings::ToInt(sep->arg[2]);
const auto& faction_name = content_db.GetFactionName(faction_id);
if (!faction_name.empty()) {
c->Message(
Chat::White,
fmt::format(
"Faction {} | {}",
Strings::Commify(faction_id),
faction_name
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"Faction ID {} was not found.",
Strings::Commify(faction_id)
).c_str()
);
return;
}
const auto& search_criteria = Strings::ToLower(sep->argplus[2]);
auto found_count = 0;
const auto max_faction_id = content_db.GetMaxFaction();
for (uint32 faction_id = 0; faction_id < max_faction_id; faction_id++) {
const auto& faction_name = content_db.GetFactionName(faction_id);
const auto& faction_name_lower = Strings::ToLower(faction_name);
if (faction_name.empty()) {
continue;
}
if (!Strings::Contains(faction_name_lower, search_criteria)) {
continue;
}
c->Message(
Chat::White,
fmt::format(
"Faction {} | {}",
Strings::Commify(faction_id),
faction_name
).c_str()
);
found_count++;
if (found_count == 50) {
break;
}
}
if (found_count == 50) {
c->Message(
Chat::White,
fmt::format(
"50 Factions found matching '{}', max reached.",
sep->argplus[2]
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"{} Faction{} found matching '{}'.",
found_count,
found_count != 1 ? "s" : "",
sep->argplus[2]
).c_str()
);
}
+135
View File
@@ -0,0 +1,135 @@
#include "../../client.h"
#include "../../common/repositories/items_repository.h"
void FindItem(Client *c, const Seperator *sep)
{
if (sep->IsNumber(2)) {
const auto item_id = Strings::ToUnsignedInt(sep->arg[2]);
const auto* item = database.GetItem(item_id);
if (item) {
auto summon_links = Saylink::Silent(
fmt::format(
"#si {}",
item_id
),
"X"
);
if (item->Stackable && item->StackSize > 1) {
summon_links += fmt::format(
" | {}",
Saylink::Silent(
fmt::format(
"#si {} {}",
item_id,
item->StackSize
),
std::to_string(item->StackSize)
)
);
}
c->Message(
Chat::White,
fmt::format(
"{} | {}",
database.CreateItemLink(item_id),
summon_links
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"Item ID {} not found",
item_id
).c_str()
);
return;
}
const auto& search_criteria = Strings::ToLower(sep->argplus[2]);
const auto& l = ItemsRepository::GetItemIDsBySearchCriteria(content_db, search_criteria, 50);
if (l.empty()) {
c->Message(
Chat::White,
fmt::format(
"No items were found matching '{}'.",
sep->argplus[2]
).c_str()
);
return;
}
auto found_count = 0;
for (const auto& e : l) {
const auto *item = database.GetItem(e);
auto summon_links = Saylink::Silent(
fmt::format(
"#si {}",
e
),
"X"
);
if (item->Stackable && item->StackSize > 1) {
summon_links += fmt::format(
" | {}",
Saylink::Silent(
fmt::format(
"#si {} {}",
e,
item->StackSize
),
std::to_string(item->StackSize)
)
);
}
c->Message(
Chat::White,
fmt::format(
"{} | {}",
database.CreateItemLink(e),
summon_links
).c_str()
);
found_count++;
if (found_count == 50) {
break;
}
}
if (found_count == 50) {
c->Message(
Chat::White,
fmt::format(
"50 Items found matching '{}', max reached.",
sep->argplus[2]
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"{} Item{} found matching '{}'.",
found_count,
found_count != 1 ? "s" :"",
sep->argplus[2]
).c_str()
);
}
+64
View File
@@ -0,0 +1,64 @@
#include "../../client.h"
#include "../../common/languages.h"
void FindLanguage(Client *c, const Seperator *sep)
{
if (sep->IsNumber(2)) {
const auto language_id = Strings::ToInt(sep->arg[2]);
if (EQ::ValueWithin(language_id, LANG_COMMON_TONGUE, LANG_UNKNOWN)) {
c->Message(
Chat::White,
fmt::format(
"Language {} | {}",
language_id,
EQ::constants::GetLanguageName(language_id)
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"Language ID {} was not found.",
language_id
).c_str()
);
return;
}
const auto& search_criteria = Strings::ToLower(sep->argplus[2]);
auto found_count = 0;
for (const auto& l : EQ::constants::GetLanguageMap()) {
const auto& language_name_lower = Strings::ToLower(l.second);
if (!Strings::Contains(language_name_lower, search_criteria)) {
continue;
}
c->Message(
Chat::White,
fmt::format(
"Language {} | {}",
l.first,
l.second
).c_str()
);
found_count++;
}
c->Message(
Chat::White,
fmt::format(
"{} Language{} found matching '{}'.",
found_count,
found_count != 1 ? "s" : "",
sep->argplus[2]
).c_str()
);
}
+94
View File
@@ -0,0 +1,94 @@
#include "../../client.h"
void FindNPCType(Client *c, const Seperator *sep)
{
std::string query = "SELECT `id`, `name` FROM npc_types WHERE ";
const std::string& search_criteria = sep->argplus[2];
if (sep->IsNumber(2)) {
const auto npc_id = Strings::ToUnsignedInt(sep->arg[2]);
query += fmt::format(
"id = {}",
npc_id
);
} else {
query += fmt::format(
"`name` LIKE '%%{}%%'",
Strings::Escape(search_criteria)
);
}
query += " ORDER BY `id` ASC LIMIT 50";
auto results = content_db.QueryDatabase(query);
if (!results.Success() || !results.RowCount()) {
c->Message(
Chat::White,
fmt::format(
"No NPCs matching '{}' were found.",
search_criteria
).c_str()
);
return;
}
const auto can_spawn_npcs = c->Admin() >= GetCommandStatus(c, "#npctypespawn");
auto found_count = 0;
for (auto row : results) {
auto found_number = (found_count + 1);
if (found_count == 50) {
break;
}
c->Message(
Chat::White,
fmt::format(
"NPC {} | {}{}",
Strings::Commify(row[0]),
row[1],
(
can_spawn_npcs ?
fmt::format(
" | {}",
Saylink::Silent(
fmt::format(
"#npctypespawn {}",
row[0]
),
"Spawn"
)
) :
""
)
).c_str()
);
found_count++;
}
if (found_count == 50) {
c->Message(
Chat::White,
fmt::format(
"50 NPCs found matching '{}', max reached.",
search_criteria
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"{} NPC{} found matching '{}'.",
found_count,
found_count != 1 ? "s" : "",
search_criteria
).c_str()
);
}
+96
View File
@@ -0,0 +1,96 @@
#include "../../client.h"
void FindRace(Client *c, const Seperator *sep)
{
if (sep->IsNumber(2)) {
const auto race_id = static_cast<uint16>(Strings::ToUnsignedInt(sep->arg[2]));
const std::string& race_name = GetRaceIDName(race_id);
if (EQ::ValueWithin(race_id, RACE_HUMAN_1, RACE_PEGASUS_732)) {
c->Message(
Chat::White,
fmt::format(
"Race {} | {}{}",
race_id,
race_name,
(
IsPlayerRace(race_id) ?
fmt::format(
" ({})",
Strings::Commify(GetPlayerRaceBit(race_id))
) :
""
)
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"Race ID {} was not found.",
race_id
).c_str()
);
return;
}
const auto& search_criteria = Strings::ToLower(sep->argplus[2]);
auto found_count = 0;
for (uint16 race_id = RACE_HUMAN_1; race_id <= RACE_PEGASUS_732; race_id++) {
std::string race_name = GetRaceIDName(race_id);
auto race_name_lower = Strings::ToLower(race_name);
if (!Strings::Contains(race_name_lower, search_criteria)) {
continue;
}
c->Message(
Chat::White,
fmt::format(
"Race {} | {}{}",
race_id,
race_name,
(
IsPlayerRace(race_id) ?
fmt::format(
" ({})",
Strings::Commify(GetPlayerRaceBit(race_id))
) :
""
)
).c_str()
);
found_count++;
if (found_count == 50) {
break;
}
}
if (found_count == 50) {
c->Message(
Chat::White,
fmt::format(
"50 Races found matching '{}', max reached.",
sep->argplus[2]
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"{} Race{} found matching '{}'.",
found_count,
found_count != 1 ? "s" : "",
sep->argplus[2]
).c_str()
);
}
+130
View File
@@ -0,0 +1,130 @@
#include "../../client.h"
#include "../../command.h"
#include "../../common/repositories/tradeskill_recipe_repository.h"
void FindRecipe(Client *c, const Seperator *sep)
{
const auto can_view_recipes = c->Admin() >= GetCommandStatus(c, "viewrecipe");
if (sep->IsNumber(2)) {
const auto recipe_id = static_cast<uint16>(Strings::ToUnsignedInt(sep->arg[2]));
const auto& l = TradeskillRecipeRepository::GetWhere(
database,
fmt::format("id = {}", recipe_id)
);
if (l.empty() || !l[0].id) {
c->Message(
Chat::White,
fmt::format(
"Recipe ID {} could not be found.",
Strings::Commify(recipe_id)
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"Recipe {} | {}{}",
Strings::Commify(recipe_id),
l[0].name,
(
can_view_recipes ?
fmt::format(
" | {}",
Saylink::Silent(
fmt::format(
"#viewrecipe {}",
l[0].id
),
"View"
)
) :
""
)
).c_str()
);
return;
}
const auto& search_criteria = Strings::ToLower(sep->argplus[2]);
auto found_count = 0;
const auto& l = TradeskillRecipeRepository::GetWhere(
database,
fmt::format(
"LOWER(`name`) LIKE '%%{}%%' ORDER BY `id` ASC",
search_criteria
)
);
if (l.empty() || !l[0].id) {
c->Message(
Chat::White,
fmt::format(
"No recipes were found matching '{}'.",
sep->argplus[2]
).c_str()
);
return;
}
for (const auto& e : l) {
c->Message(
Chat::White,
fmt::format(
"Recipe {} | {}{}",
Strings::Commify(e.id),
e.name,
(
can_view_recipes ?
fmt::format(
" | {}",
Saylink::Silent(
fmt::format(
"#viewrecipe {}",
e.id
),
"View"
)
) :
""
)
).c_str()
);
if (found_count == 50) {
break;
}
found_count++;
}
if (found_count == 50) {
c->Message(
Chat::White,
fmt::format(
"50 Recipes found matching '{}', max reached.",
sep->argplus[2]
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"{} Recipe{} found matching '{}'.",
found_count,
found_count != 1 ? "s" : "",
sep->argplus[2]
).c_str()
);
}
+83
View File
@@ -0,0 +1,83 @@
#include "../../client.h"
void FindSkill(Client *c, const Seperator *sep)
{
if (sep->IsNumber(2)) {
const auto skill_id = Strings::ToInt(sep->arg[2]);
if (EQ::ValueWithin(skill_id, EQ::skills::Skill1HBlunt, EQ::skills::SkillCount)) {
for (const auto& s : EQ::skills::GetSkillTypeMap()) {
if (skill_id == s.first) {
c->Message(
Chat::White,
fmt::format(
"Skill {} | {}",
s.first,
s.second
).c_str()
);
break;
}
}
return;
}
c->Message(
Chat::White,
fmt::format(
"Skill ID {} was not found.",
skill_id
).c_str()
);
return;
}
const auto& search_criteria = Strings::ToLower(sep->argplus[2]);
auto found_count = 0;
for (const auto& s : EQ::skills::GetSkillTypeMap()) {
const auto& skill_name_lower = Strings::ToLower(s.second);
if (!Strings::Contains(skill_name_lower, sep->argplus[2])) {
continue;
}
c->Message(
Chat::White,
fmt::format(
"Skill {} | {}",
s.first,
s.second
).c_str()
);
found_count++;
if (found_count == 50) {
break;
}
}
if (found_count == 50) {
c->Message(
Chat::White,
fmt::format(
"50 Skills were found matching '{}', max reached.",
sep->argplus[2]
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"{} Skill{} found matching '{}'.",
found_count,
found_count != 1 ? "s" : "",
sep->argplus[2]
).c_str()
);
}
+104
View File
@@ -0,0 +1,104 @@
#include "../../client.h"
void FindSpell(Client *c, const Seperator *sep)
{
if (SPDAT_RECORDS <= 0) {
c->Message(Chat::White, "Spells not loaded.");
return;
}
const auto can_cast_spells = c->Admin() >= GetCommandStatus(c, "castspell");
if (sep->IsNumber(2)) {
const auto spell_id = Strings::ToUnsignedInt(sep->arg[2]);
if (!IsValidSpell(spell_id)) {
c->Message(
Chat::White,
fmt::format(
"Spell ID {} was not found.",
Strings::Commify(spell_id)
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"Spell {} | {}",
Strings::Commify(spell_id),
spells[spell_id].name
).c_str()
);
return;
}
const auto& search_criteria = Strings::ToLower(sep->argplus[2]);
auto found_count = 0;
for (uint32 spell_id = 0; spell_id < SPDAT_RECORDS; spell_id++) {
if (IsValidSpell(spell_id)) {
const auto& current_spell = spells[spell_id];
const std::string& spell_name = current_spell.name;
const auto& spell_name_lower = Strings::ToLower(spell_name);
if (!Strings::Contains(spell_name_lower, search_criteria)) {
continue;
}
c->Message(
Chat::White,
fmt::format(
"Spell {} | {}{}",
Strings::Commify(spell_id),
spell_name,
(
can_cast_spells ?
fmt::format(
" | {}",
Saylink::Silent(
fmt::format(
"#castspell {}",
spell_id
),
"Cast"
)
) :
""
)
).c_str()
);
found_count++;
if (found_count == 50) {
break;
}
}
}
if (found_count == 50) {
c->Message(
Chat::White,
fmt::format(
"50 Spells found matching '{}', max reached.",
sep->argplus[2]
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"{} Spell{} found matching '{}'.",
found_count,
found_count != 1 ? "s" : "",
sep->argplus[2]
).c_str()
);
}
+109
View File
@@ -0,0 +1,109 @@
#include "../../client.h"
void FindTask(Client *c, const Seperator *sep)
{
if (!RuleB(TaskSystem, EnableTaskSystem)) {
c->Message(Chat::White, "This command cannot be used while the Task system is disabled.");
return;
}
const auto can_assign_tasks = c->Admin() >= GetCommandStatus(c, "task");
if (sep->IsNumber(2)) {
const auto task_id = Strings::ToUnsignedInt(sep->arg[2]);
const auto& task_name = task_manager->GetTaskName(task_id);
if (task_name.empty()) {
c->Message(
Chat::White,
fmt::format(
"Task ID {} was not found.",
Strings::Commify(task_id)
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"Task {} | {}",
Strings::Commify(task_id),
task_name
).c_str()
);
return;
}
const auto& search_criteria = Strings::ToLower(sep->argplus[2]);
auto found_count = 0;
for (const auto& t : task_manager->GetTaskData()) {
const auto& task_name = t.second.title;
const auto& task_name_lower = Strings::ToLower(task_name);
if (!Strings::Contains(task_name_lower, search_criteria)) {
continue;
}
c->Message(
Chat::White,
fmt::format(
"Task {} | {}{}",
Strings::Commify(t.first),
task_name,
(
can_assign_tasks ?
fmt::format(
" | {}{}",
Saylink::Silent(
fmt::format(
"#task assign {}",
t.first
),
"Assign"
),
Saylink::Silent(
fmt::format(
"#task uncomplete {}",
t.first
),
"Uncomplete"
)
) :
""
)
).c_str()
);
found_count++;
if (found_count == 50) {
break;
}
}
if (found_count == 50) {
c->Message(
Chat::White,
fmt::format(
"50 Tasks were found matching '{}', max reached.",
sep->argplus[2]
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"{} Task{} found matching '{}'.",
found_count,
found_count != 1 ? "s" : "",
sep->argplus[2]
).c_str()
);
}
+132
View File
@@ -0,0 +1,132 @@
#include "../../client.h"
#include "../../common/content/world_content_service.h"
void FindZone(Client *c, const Seperator *sep)
{
std::string query = "SELECT zoneidnumber, short_name, long_name, version FROM zone WHERE ";
const auto is_expansion_search = !strcasecmp(sep->arg[2], "expansion");
const auto is_id_search = Strings::IsNumber(sep->arg[2]);
const auto is_short_name_search = !is_expansion_search && !is_id_search;
std::string search_string;
std::string search_type;
if (is_expansion_search) {
query += fmt::format(
"expansion = {}",
Strings::ToInt(sep->arg[3])
);
search_string = Expansion::ExpansionName[Strings::ToInt(sep->arg[3])];
search_type = "Expansion";
} else if (is_id_search) {
query += fmt::format(
"zoneidnumber = {}",
Strings::ToUnsignedInt(sep->arg[2])
);
search_string = sep->arg[2];
search_type = "Expansion";
} else if (is_short_name_search) {
query += fmt::format(
"LOWER(`long_name`) LIKE '%%{}%%' OR LOWER(`short_name`) LIKE '%%{}%%'",
Strings::Escape(Strings::ToLower(sep->argplus[2])),
Strings::Escape(Strings::ToLower(sep->argplus[2]))
);
search_string = sep->argplus[2];
search_type = "Expansion";
}
query += " ORDER BY `zoneidnumber` ASC LIMIT 50";
auto results = content_db.QueryDatabase(query);
if (!results.Success() || !results.RowCount()) {
c->Message(Chat::White, "No zones were found matching your search criteria.");
c->Message(Chat::White, query.c_str());
return;
}
auto found_count = 0;
for (auto row : results) {
const auto zone_id = Strings::ToUnsignedInt(row[0]);
const std::string& short_name = row[1];
const std::string& long_name = row[2];
const auto version = Strings::ToInt(row[3]);
c->Message(
Chat::White,
fmt::format(
"{}{} {} ({}) (ID {}){}",
(
version == 0 ?
fmt::format(
"{} | ",
Saylink::Silent(
fmt::format(
"#zone {}",
short_name
),
"Zone"
)
) :
""
),
fmt::format(
"{} |",
Saylink::Silent(
fmt::format(
"#gmzone {} {}",
short_name,
version
),
"GM Zone"
)
),
long_name,
short_name,
zone_id,
(
version != 0 ?
fmt::format(
" (Version {})",
version
) :
""
)
).c_str()
);
found_count++;
if (found_count == 50) {
break;
}
}
if (found_count == 50) {
c->Message(
Chat::White,
fmt::format(
"50 Zones found matching '{}' of '{}'.",
search_type,
search_string
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"{} Zone{} found matching '{}' of '{}'.",
found_count,
found_count != 1 ? "s" : "",
search_type,
search_string
).c_str()
);
}
-100
View File
@@ -1,100 +0,0 @@
#include "../client.h"
void command_findaa(Client *c, const Seperator *sep)
{
auto arguments = sep->argnum;
if (!arguments) {
c->Message(Chat::White, "Command Syntax: #findaa [Search Criteria]");
return;
}
if (sep->IsNumber(1)) {
int aa_id = Strings::ToInt(sep->arg[1]);
auto aa_name = zone->GetAAName(aa_id);
if (!aa_name.empty()) {
c->Message(
Chat::White,
fmt::format(
"AA {}: {}",
aa_id,
aa_name
).c_str()
);
} else {
c->Message(
Chat::White,
fmt::format(
"AA ID {} was not found.",
aa_id
).c_str()
);
}
} else {
const auto search_criteria = Strings::ToLower(sep->argplus[1]);
if (!search_criteria.empty()) {
std::map<int, std::string> ordered_aas;
for (const auto& a : zone->aa_abilities) {
ordered_aas[a.second.get()->first->id] = a.second.get()->name;
}
int found_count = 0;
for (const auto& a : ordered_aas) {
auto aa_name = zone->GetAAName(a.first);
if (!aa_name.empty()) {
auto aa_name_lower = Strings::ToLower(aa_name);
if (aa_name_lower.find(search_criteria) == std::string::npos) {
continue;
}
c->Message(
Chat::White,
fmt::format(
"AA {}: {}",
a.first,
aa_name
).c_str()
);
found_count++;
if (found_count == 50) {
break;
}
}
}
if (!found_count) {
c->Message(
Chat::White,
fmt::format(
"No AAs were found matching '{}'.",
search_criteria
).c_str()
);
return;
}
if (found_count == 50) {
c->Message(
Chat::White,
fmt::format(
"50 AAs were found matching '{}', max reached.",
search_criteria
).c_str()
);
} else {
auto skill_message = found_count == 1 ? "An AA was" : fmt::format("{} AAs were", found_count);
c->Message(
Chat::White,
fmt::format(
"{} found matching '{}'.",
skill_message,
search_criteria
).c_str()
);
}
}
}
}
-93
View File
@@ -1,93 +0,0 @@
#include "../client.h"
#include "../../common/repositories/character_data_repository.h"
void command_findcharacter(Client *c, const Seperator *sep)
{
const auto arguments = sep->argnum;
if (!arguments) {
c->Message(Chat::White, "Usage: #findcharacter [Search Criteria]");
return;
}
if (sep->IsNumber(1)) {
const auto character_id = Strings::ToUnsignedInt(sep->arg[1]);
const auto& e = CharacterDataRepository::FindOne(content_db, character_id);
if (!e.id) {
c->Message(
Chat::White,
fmt::format(
"Character ID {} does not exist or is invalid.",
character_id
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"Character ID {} | {}",
character_id,
e.name
).c_str()
);
} else {
const auto search_criteria = Strings::ToLower(sep->argplus[1]);
const auto& l = CharacterDataRepository::GetWhere(
content_db,
fmt::format(
"LOWER(`name`) LIKE '%%{}%%'",
search_criteria
).c_str()
);
if (l.empty()) {
c->Message(
Chat::White,
fmt::format(
"No characters found matching '{}'.",
sep->argplus[1]
).c_str()
);
}
auto found_count = 0;
for (const auto& e : l) {
c->Message(
Chat::White,
fmt::format(
"Character ID {} | {}",
e.id,
e.name
).c_str()
);
found_count++;
if (found_count == 50) {
break;
}
}
if (found_count == 50) {
c->Message(
Chat::White,
fmt::format(
"50 Characters found matching '{}', max reached.",
sep->argplus[1]
).c_str()
);
} else {
c->Message(
Chat::White,
fmt::format(
"{} Character{} found matching '{}'.",
found_count,
found_count != 1 ? "s" : "",
sep->argplus[1]
).c_str()
);
}
}
}
-92
View File
@@ -1,92 +0,0 @@
#include "../client.h"
void command_findclass(Client *c, const Seperator *sep)
{
int arguments = sep->argnum;
if (!arguments) {
c->Message(Chat::White, "Command Syntax: #findclass [Search Criteria]");
return;
}
if (sep->IsNumber(1)) {
int class_id = Strings::ToInt(sep->arg[1]);
if (class_id >= WARRIOR && class_id <= MERCENARY_MASTER) {
std::string class_name = GetClassIDName(class_id);
c->Message(
Chat::White,
fmt::format(
"Class {} | {}{}",
class_id,
class_name,
(
c->IsPlayerClass(class_id) ?
fmt::format(
" ({})",
GetPlayerClassBit(class_id)
) :
""
)
).c_str()
);
}
else {
c->Message(
Chat::White,
fmt::format(
"Class ID {} was not found.",
class_id
).c_str()
);
}
} else {
auto search_criteria = Strings::ToLower(sep->argplus[1]);
int found_count = 0;
for (uint16 class_id = WARRIOR; class_id <= MERCENARY_MASTER; class_id++) {
std::string class_name = GetClassIDName(class_id);
auto class_name_lower = Strings::ToLower(class_name);
if (
search_criteria.length() &&
class_name_lower.find(search_criteria) == std::string::npos
) {
continue;
}
c->Message(
Chat::White,
fmt::format(
"Class {} | {}{}",
class_id,
class_name,
(
c->IsPlayerClass(class_id) ?
fmt::format(
" ({})",
GetPlayerClassBit(class_id)
) :
""
)
).c_str()
);
found_count++;
if (found_count == 50) {
break;
}
}
if (found_count == 50) {
c->Message(Chat::White, "50 Classes found, max reached.");
} else {
c->Message(
Chat::White,
fmt::format(
"{} Class{} found.",
found_count,
found_count != 1 ? "es" : ""
).c_str()
);
}
}
}
-134
View File
@@ -1,134 +0,0 @@
#include "../client.h"
void command_findcurrency(Client *c, const Seperator *sep)
{
const auto arguments = sep->argnum;
if (!arguments) {
c->Message(Chat::White, "Usage: #findcurrency [Search Criteria]");
return;
}
const auto can_summon_items = c->Admin() >= GetCommandStatus(c, "summonitem");
if (sep->IsNumber(1)) {
const auto item_id = Strings::ToUnsignedInt(sep->arg[1]);
const auto currency_id = zone->GetCurrencyID(item_id);
if (!currency_id) {
c->Message(
Chat::White,
fmt::format(
"There is no currency with an item ID of {}.",
item_id
).c_str()
);
return;
}
const auto item_data = database.GetItem(item_id);
if (!item_data) {
c->Message(
Chat::White,
fmt::format(
"Item ID {} does not exist.",
item_id
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"Currency {} | {} ({}){}",
currency_id,
database.CreateItemLink(item_id),
item_id,
(
can_summon_items ?
fmt::format(
" | {}",
Saylink::Silent(
fmt::format(
"#summonitem {} {}",
item_id,
item_data->StackSize
),
"Summon"
)
) :
""
)
).c_str()
);
return;
}
const std::string search_criteria = sep->argplus[1];
uint32 found_count = 0;
for (const auto& e : zone->AlternateCurrencies) {
const auto item_data = database.GetItem(e.item_id);
if (!item_data) {
continue;
}
const std::string item_name = Strings::ToLower(item_data->Name);
if (Strings::Contains(item_name, Strings::ToLower(search_criteria))) {
c->Message(
Chat::White,
fmt::format(
"Currency {} | {} ({}){}",
e.id,
database.CreateItemLink(e.item_id),
e.item_id,
(
can_summon_items ?
fmt::format(
" | {}",
Saylink::Silent(
fmt::format(
"#summonitem {} {}",
e.item_id,
item_data->StackSize
),
"Summon"
)
) :
""
)
).c_str()
);
found_count++;
}
}
if (!found_count) {
c->Message(
Chat::White,
fmt::format(
"No currencies were found matching '{}'.",
search_criteria
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"{} currenc{} found matching '{}'.",
found_count,
found_count != 1 ? "ies were" : "y was",
search_criteria
).c_str()
);
}
-89
View File
@@ -1,89 +0,0 @@
#include "../client.h"
void command_findfaction(Client *c, const Seperator *sep)
{
int arguments = sep->argnum;
if (arguments == 0) {
c->Message(Chat::White, "Command Syntax: #findfaction [search criteria]");
return;
}
if (sep->IsNumber(1)) {
int faction_id = Strings::ToInt(sep->arg[1]);
auto faction_name = content_db.GetFactionName(faction_id);
if (!faction_name.empty()) {
c->Message(
Chat::White,
fmt::format(
"Faction {}: {}",
faction_id,
faction_name
).c_str()
);
}
else {
c->Message(
Chat::White,
fmt::format(
"Faction ID {} was not found.",
faction_id
).c_str()
);
}
}
else {
std::string search_criteria = Strings::ToLower(sep->argplus[1]);
int found_count = 0;
int max_faction_id = content_db.GetMaxFaction();
for (int faction_id = 0; faction_id < max_faction_id; faction_id++) {
std::string faction_name = content_db.GetFactionName(faction_id);
std::string faction_name_lower = Strings::ToLower(faction_name);
if (faction_name.empty()) {
continue;
}
if (faction_name.find(search_criteria) == std::string::npos) {
continue;
}
c->Message(
Chat::White,
fmt::format(
"Faction {}: {}",
faction_id,
faction_name
).c_str()
);
found_count++;
if (found_count == 20) {
break;
}
}
if (found_count == 20) {
c->Message(Chat::White, "20 Factions found... max reached.");
}
else {
auto faction_message = (
found_count > 0 ?
(
found_count == 1 ?
"A Faction was" :
fmt::format("{} Factions were", found_count)
) :
"No Factions were"
);
c->Message(
Chat::White,
fmt::format(
"{} found.",
faction_message
).c_str()
);
}
}
}
-77
View File
@@ -1,77 +0,0 @@
#include "../client.h"
void command_findnpctype(Client *c, const Seperator *sep)
{
int arguments = sep->argnum;
if (!arguments) {
c->Message(Chat::White, "Usage: #findnpctype [Search Criteria]");
return;
}
std::string query;
std::string search_criteria = sep->arg[1];
if (sep->IsNumber(1)) {
query = fmt::format(
"SELECT id, name FROM npc_types WHERE id = {}",
search_criteria
);
}
else {
query = fmt::format(
"SELECT id, name FROM npc_types WHERE name LIKE '%%{}%%'",
search_criteria
);
}
auto results = content_db.QueryDatabase(query);
if (!results.Success() || !results.RowCount()) {
c->Message(
Chat::White,
fmt::format(
"No matches found for '{}'.",
search_criteria
).c_str()
);
return;
}
int found_count = 0;
for (auto row : results) {
int found_number = (found_count + 1);
if (found_count == 20) {
break;
}
c->Message(
Chat::White,
fmt::format(
"NPC {} | {} ({})",
found_number,
row[1],
row[0]
).c_str()
);
found_count++;
}
if (found_count == 20) {
c->Message(Chat::White, "20 NPCs were found, max reached.");
}
else {
auto npc_message = (
found_count == 1 ?
"An NPC was" :
fmt::format("{} NPCs were", found_count)
);
c->Message(
Chat::White,
fmt::format(
"{} found.",
npc_message
).c_str()
);
}
}
-94
View File
@@ -1,94 +0,0 @@
#include "../client.h"
void command_findrace(Client *c, const Seperator *sep)
{
int arguments = sep->argnum;
if (!arguments) {
c->Message(Chat::White, "Command Syntax: #findrace [Search Criteria]");
return;
}
if (sep->IsNumber(1)) {
auto race_id = static_cast<uint16>(Strings::ToUnsignedInt(sep->arg[1]));
std::string race_name = GetRaceIDName(race_id);
if (
race_id >= RACE_HUMAN_1 &&
race_id <= RACE_PEGASUS_732
) {
c->Message(
Chat::White,
fmt::format(
"Race {} | {}{}",
race_id,
race_name,
(
c->IsPlayerRace(race_id) ?
fmt::format(
" ({})",
GetPlayerRaceBit(race_id)
) :
""
)
).c_str()
);
} else {
c->Message(
Chat::White,
fmt::format(
"Race ID {} was not found.",
race_id
).c_str()
);
}
} else {
auto search_criteria = Strings::ToLower(sep->argplus[1]);
int found_count = 0;
for (uint16 race_id = RACE_HUMAN_1; race_id <= RACE_PEGASUS_732; race_id++) {
std::string race_name = GetRaceIDName(race_id);
auto race_name_lower = Strings::ToLower(race_name);
if (
search_criteria.length() &&
race_name_lower.find(search_criteria) == std::string::npos
) {
continue;
}
c->Message(
Chat::White,
fmt::format(
"Race {} | {}{}",
race_id,
race_name,
(
c->IsPlayerRace(race_id) ?
fmt::format(
" ({})",
GetPlayerRaceBit(race_id)
) :
""
)
).c_str()
);
found_count++;
if (found_count == 50) {
break;
}
}
if (found_count == 50) {
c->Message(Chat::White, "50 Races found, max reached.");
} else {
c->Message(
Chat::White,
fmt::format(
"{} Race{} found.",
found_count,
found_count != 1 ? "s" : ""
).c_str()
);
}
}
}
-96
View File
@@ -1,96 +0,0 @@
#include "../client.h"
#include "../command.h"
#include "../../common/repositories/tradeskill_recipe_repository.h"
void command_findrecipe(Client *c, const Seperator *sep)
{
int arguments = sep->argnum;
if (!arguments) {
c->Message(Chat::White, "Command Syntax: #findrecipe [Search Criteria]");
return;
}
if (sep->IsNumber(1)) {
auto recipe_id = static_cast<uint16>(Strings::ToUnsignedInt(sep->arg[1]));
auto r = TradeskillRecipeRepository::GetWhere(
database,
fmt::format("id = {}", recipe_id)
);
if (r.empty() || !r[0].id) {
c->Message(
Chat::White,
fmt::format(
"Recipe ID {} could not be found.",
Strings::Commify(std::to_string(recipe_id))
).c_str()
);
return;
}
bool can_view_recipes = c->Admin() >= GetCommandStatus(c, "viewrecipe");
c->Message(
Chat::White,
fmt::format(
"Recipe {} | {}{}",
Strings::Commify(std::to_string(recipe_id)),
r[0].name,
can_view_recipes ? fmt::format(" | {}", Saylink::Silent(fmt::format("#viewrecipe {}", r[0].id), "View")) : ""
).c_str()
);
} else {
auto search_criteria = Strings::ToLower(sep->argplus[1]);
int found_count = 0;
auto rl = TradeskillRecipeRepository::GetWhere(
database,
fmt::format("`name` LIKE '%{}%' ORDER BY `id` ASC", search_criteria)
);
if (rl.empty() || !rl[0].id) {
c->Message(
Chat::White,
fmt::format(
"No recipes were found matching '{}'.",
search_criteria
).c_str()
);
return;
}
bool can_view_recipes = c->Admin() >= GetCommandStatus(c, "viewrecipe");
for (const auto& r : rl) {
c->Message(
Chat::White,
fmt::format(
"Recipe {} | {}{}",
Strings::Commify(std::to_string(r.id)),
r.name,
can_view_recipes ? fmt::format(" | {}", Saylink::Silent(fmt::format("#viewrecipe {}", r.id), "View")) : ""
).c_str()
);
if (found_count == 50) {
break;
}
found_count++;
}
if (found_count == 50) {
c->Message(Chat::White, "50 Recipes found, max reached.");
} else {
c->Message(
Chat::White,
fmt::format(
"{} Recipe{} found.",
found_count,
found_count != 1 ? "s" : ""
).c_str()
);
}
}
}
-90
View File
@@ -1,90 +0,0 @@
#include "../client.h"
void command_findskill(Client *c, const Seperator *sep)
{
int arguments = sep->argnum;
if (arguments == 0) {
c->Message(Chat::White, "Command Syntax: #findskill [search criteria]");
return;
}
std::map<EQ::skills::SkillType, std::string> skills = EQ::skills::GetSkillTypeMap();
if (sep->IsNumber(1)) {
int skill_id = Strings::ToInt(sep->arg[1]);
if (skill_id >= EQ::skills::Skill1HBlunt && skill_id < EQ::skills::SkillCount) {
for (auto skill : skills) {
if (skill_id == skill.first) {
c->Message(
Chat::White,
fmt::format(
"Skill {}: {}",
skill.first,
skill.second
).c_str()
);
break;
}
}
}
else {
c->Message(
Chat::White,
fmt::format(
"Skill ID {} was not found.",
skill_id
).c_str()
);
}
}
else {
std::string search_criteria = Strings::ToLower(sep->argplus[1]);
if (!search_criteria.empty()) {
int found_count = 0;
for (auto skill : skills) {
std::string skill_name_lower = Strings::ToLower(skill.second);
if (skill_name_lower.find(search_criteria) == std::string::npos) {
continue;
}
c->Message(
Chat::White,
fmt::format(
"Skill {}: {}",
skill.first,
skill.second
).c_str()
);
found_count++;
if (found_count == 20) {
break;
}
}
if (found_count == 20) {
c->Message(Chat::White, "20 Skills were found, max reached.");
}
else {
auto skill_message = (
found_count > 0 ?
(
found_count == 1 ?
"A Skill was" :
fmt::format("{} Skills were", found_count)
) :
"No Skills were"
);
c->Message(
Chat::White,
fmt::format(
"{} found.",
skill_message
).c_str()
);
}
}
}
}
-90
View File
@@ -1,90 +0,0 @@
#include "../client.h"
void command_findspell(Client *c, const Seperator *sep)
{
if (SPDAT_RECORDS <= 0) {
c->Message(Chat::White, "Spells not loaded");
return;
}
int arguments = sep->argnum;
if (arguments == 0) {
c->Message(Chat::White, "Command Syntax: #findspell [search criteria]");
return;
}
if (sep->IsNumber(1)) {
int spell_id = Strings::ToInt(sep->arg[1]);
if (!IsValidSpell(spell_id)) {
c->Message(
Chat::White,
fmt::format(
"Spell ID {} was not found.",
spell_id
).c_str()
);
}
else {
c->Message(
Chat::White,
fmt::format(
"Spell {}: {}",
spell_id,
spells[spell_id].name
).c_str()
);
}
}
else {
std::string search_criteria = Strings::ToLower(sep->argplus[1]);
int found_count = 0;
for (int spell_id = 0; spell_id < SPDAT_RECORDS; spell_id++) {
auto current_spell = spells[spell_id];
if (current_spell.name[0] != 0) {
std::string spell_name = current_spell.name;
std::string spell_name_lower = Strings::ToLower(spell_name);
if (search_criteria.length() > 0 && spell_name_lower.find(search_criteria) == std::string::npos) {
continue;
}
c->Message(
Chat::White,
fmt::format(
"Spell {}: {}",
spell_id,
spell_name
).c_str()
);
found_count++;
if (found_count == 20) {
break;
}
}
}
if (found_count == 20) {
c->Message(Chat::White, "20 Spells found... max reached.");
}
else {
auto spell_message = (
found_count > 0 ?
(
found_count == 1 ?
"A Spell was" :
fmt::format("{} Spells were", found_count)
) :
"No Spells were"
);
c->Message(
Chat::White,
fmt::format(
"{} found.",
spell_message
).c_str()
);
}
}
}
-90
View File
@@ -1,90 +0,0 @@
#include "../client.h"
void command_findtask(Client *c, const Seperator *sep)
{
if (RuleB(TaskSystem, EnableTaskSystem)) {
int arguments = sep->argnum;
if (arguments == 0) {
c->Message(Chat::White, "Command Syntax: #findtask [search criteria]");
return;
}
if (sep->IsNumber(1)) {
auto task_id = Strings::ToUnsignedInt(sep->arg[1]);
auto task_name = task_manager->GetTaskName(task_id);
std::string task_message = (
!task_name.empty() ?
fmt::format(
"Task {}: {}",
task_id,
task_name
) :
fmt::format(
"Task ID {} was not found.",
task_id
)
);
c->Message(
Chat::White,
task_message.c_str()
);
}
else {
std::string search_criteria = Strings::ToLower(sep->argplus[1]);
if (!search_criteria.empty()) {
int found_count = 0;
for (const auto &task: task_manager->GetTaskData()) {
auto task_name = task.second.title;
std::string task_name_lower = Strings::ToLower(task_name);
if (task_name_lower.find(search_criteria) == std::string::npos) {
continue;
}
c->Message(
Chat::White,
fmt::format(
"Task {}: {}",
task.first,
task_name
).c_str()
);
found_count++;
if (found_count == 20) {
break;
}
}
if (found_count == 20) {
c->Message(Chat::White, "20 Tasks were found, max reached.");
}
else {
auto task_message = (
found_count > 0 ?
(
found_count == 1 ?
"A Task was" :
fmt::format("{} Tasks were", found_count)
) :
"No Tasks were"
);
c->Message(
Chat::White,
fmt::format(
"{} found.",
task_message
).c_str()
);
}
}
}
}
else {
c->Message(Chat::White, "This command cannot be used while the Task system is disabled.");
}
}
-98
View File
@@ -1,98 +0,0 @@
#include "../client.h"
void command_findzone(Client *c, const Seperator *sep)
{
if (sep->arg[1][0] == 0) {
c->Message(Chat::White, "Usage: #findzone [search criteria]");
c->Message(Chat::White, "Usage: #findzone expansion [expansion number]");
return;
}
std::string query;
int id = Strings::ToInt((const char *) sep->arg[1]);
std::string arg1 = sep->arg[1];
if (arg1 == "expansion") {
query = fmt::format(
"SELECT zoneidnumber, short_name, long_name, version FROM zone WHERE expansion = {}",
sep->arg[2]
);
}
else {
/**
* If id evaluates to 0, then search as if user entered a string
*/
if (id == 0) {
query = fmt::format(
"SELECT zoneidnumber, short_name, long_name, version FROM zone WHERE long_name LIKE '%{}%' OR `short_name` LIKE '%{}%'",
Strings::Escape(sep->arg[1]),
Strings::Escape(sep->arg[1])
);
}
else {
query = fmt::format(
"SELECT zoneidnumber, short_name, long_name, version FROM zone WHERE zoneidnumber = {}",
id
);
}
}
auto results = content_db.QueryDatabase(query);
if (!results.Success()) {
c->Message(Chat::White, "Error querying database.");
c->Message(Chat::White, query.c_str());
return;
}
int count = 0;
const int maxrows = 100;
for (auto row = results.begin(); row != results.end(); ++row) {
std::string zone_id = row[0];
std::string short_name = row[1];
std::string long_name = row[2];
int version = Strings::ToInt(row[3]);
if (++count > maxrows) {
c->Message(Chat::White, "%i zones shown. Too many results.", maxrows);
break;
}
std::string command_zone = Saylink::Silent("#zone " + short_name, "zone");
std::string command_gmzone = Saylink::Silent(
fmt::format(
"#gmzone {} {}",
short_name,
version
),
"gmzone"
);
c->Message(
Chat::White,
fmt::format(
"[{}] [{}] [{}] ID ({}) Version ({}) [{}]",
(version == 0 ? command_zone : "zone"),
command_gmzone,
short_name,
zone_id,
version,
long_name
).c_str()
);
}
if (count <= maxrows) {
c->Message(
Chat::White,
"Query complete. %i rows shown. %s",
count,
(arg1 == "expansion" ? "(expansion search)" : ""));
}
else if (count == 0) {
c->Message(Chat::White, "No matches found for %s.", sep->arg[1]);
}
}
-121
View File
@@ -1,121 +0,0 @@
#include "../client.h"
void command_itemsearch(Client *c, const Seperator *sep)
{
if (sep->arg[1][0] == 0) {
c->Message(Chat::White, "Usage: #itemsearch [search string]");
}
else {
const char *search_criteria = sep->argplus[1];
const EQ::ItemData *item = nullptr;
EQ::SayLinkEngine linker;
linker.SetLinkType(EQ::saylink::SayLinkItemData);
if (Seperator::IsNumber(search_criteria)) {
item = database.GetItem(Strings::ToInt(search_criteria));
if (item) {
linker.SetItemData(item);
std::string item_id = std::to_string(item->ID);
std::string saylink_commands =
"[" +
Saylink::Silent(
"#si " + item_id,
"X"
) +
"] ";
if (item->Stackable && item->StackSize > 1) {
std::string stack_size = std::to_string(item->StackSize);
saylink_commands +=
"[" +
Saylink::Silent(
"#si " + item_id + " " + stack_size,
stack_size
) +
"]";
}
c->Message(
Chat::White,
fmt::format(
" Summon {} [{}] [{}]",
saylink_commands,
linker.GenerateLink(),
item->ID
).c_str()
);
}
else {
c->Message(
Chat::White,
fmt::format(
"Item {} not found",
search_criteria
).c_str()
);
}
return;
}
int count = 0;
char sName[64];
char sCriteria[255];
strn0cpy(sCriteria, search_criteria, sizeof(sCriteria));
strupr(sCriteria);
char *pdest;
uint32 it = 0;
while ((item = database.IterateItems(&it))) {
strn0cpy(sName, item->Name, sizeof(sName));
strupr(sName);
pdest = strstr(sName, sCriteria);
if (pdest != nullptr) {
linker.SetItemData(item);
std::string item_id = std::to_string(item->ID);
std::string saylink_commands =
"[" +
Saylink::Silent(
"#si " + item_id,
"X"
) +
"] ";
if (item->Stackable && item->StackSize > 1) {
std::string stack_size = std::to_string(item->StackSize);
saylink_commands +=
"[" +
Saylink::Silent(
"#si " + item_id + " " + stack_size,
stack_size
) +
"]";
}
c->Message(
Chat::White,
fmt::format(
" Summon {} [{}] [{}]",
saylink_commands,
linker.GenerateLink(),
item->ID
).c_str()
);
++count;
}
if (count == 50) {
break;
}
}
if (count == 50) {
c->Message(Chat::White, "50 items shown...too many results.");
}
else {
c->Message(Chat::White, "%i items found", count);
}
}
}
-13
View File
@@ -1,13 +0,0 @@
#include "../client.h"
void command_merchantcloseshop(Client *c, const Seperator *sep)
{
Mob *merchant = c->GetTarget();
if (!merchant || merchant->GetClass() != MERCHANT) {
c->Message(Chat::White, "You must target a merchant to close their shop.");
return;
}
merchant->CastToNPC()->MerchantCloseShop();
}
-13
View File
@@ -1,13 +0,0 @@
#include "../client.h"
void command_merchantopenshop(Client *c, const Seperator *sep)
{
Mob *merchant = c->GetTarget();
if (!merchant || merchant->GetClass() != MERCHANT) {
c->Message(Chat::White, "You must target a merchant to open their shop.");
return;
}
merchant->CastToNPC()->MerchantOpenShop();
}
+52
View File
@@ -0,0 +1,52 @@
#include "../client.h"
void command_merchantshop(Client *c, const Seperator *sep)
{
const auto m = c->GetTarget();
if (
!m ||
!m->IsNPC() ||
(
m->GetClass() != MERCHANT &&
m->GetClass() != DISCORD_MERCHANT &&
m->GetClass() != ADVENTURE_MERCHANT &&
m->GetClass() != NORRATHS_KEEPERS_MERCHANT &&
m->GetClass() != DARK_REIGN_MERCHANT &&
m->GetClass() != ALT_CURRENCY_MERCHANT
)
) {
c->Message(Chat::White, "You must target a merchant.");
return;
}
const auto arguments = sep->argnum;
if (!arguments) {
c->Message(Chat::White, "#merchantshop close - Close your targeted merchant's shop");
c->Message(Chat::White, "#merchantshop open - Open your targeted merchant's shop");
return;
}
const bool is_close = !strcasecmp(sep->arg[1], "close");
const bool is_open = !strcasecmp(sep->arg[1], "open");
if (!is_close && !is_open) {
c->Message(Chat::White, "#merchantshop close - Close your targeted merchant's shop");
c->Message(Chat::White, "#merchantshop open - Open your targeted merchant's shop");
return;
}
if (is_close) {
m->CastToNPC()->MerchantCloseShop();
} else if (is_open) {
m->CastToNPC()->MerchantOpenShop();
}
c->Message(
Chat::White,
fmt::format(
"{} shop for {}.",
is_close ? "Closed" : "Opened",
c->GetTargetDescription(m)
).c_str()
);
}
+12 -9
View File
@@ -2,16 +2,19 @@
void command_mystats(Client *c, const Seperator *sep)
{
if (c->GetTarget() && c->GetPet()) {
if (c->GetTarget()->IsPet() && c->GetTarget() == c->GetPet()) {
c->GetTarget()->ShowStats(c);
}
else {
c->ShowStats(c);
}
Mob* t = c;
if (c->GetTarget()) {
t = c->GetTarget();
}
else {
c->ShowStats(c);
if (
(t->IsPet() && t == c->GetPet()) ||
(t->IsBot() && t->CastToBot()->GetOwner() && t->CastToBot()->GetOwner() == c)
) {
t->ShowStats(c);
return;
}
c->ShowStats(c);
}
-49
View File
@@ -1,49 +0,0 @@
#include "../client.h"
void command_showbonusstats(Client *c, const Seperator *sep)
{
if (c->GetTarget() == 0) {
c->Message(Chat::White, "ERROR: No target!");
}
else if (!c->GetTarget()->IsMob() && !c->GetTarget()->IsClient()) {
c->Message(Chat::White, "ERROR: Target is not a Mob or Player!");
}
else {
bool bAll = false;
if (sep->arg[1][0] == '\0' || strcasecmp(sep->arg[1], "all") == 0) {
bAll = true;
}
if (bAll || (strcasecmp(sep->arg[1], "item") == 0)) {
c->Message(Chat::White, "Target Item Bonuses:");
c->Message(
Chat::White,
" Accuracy: %i%% Divine Save: %i%%",
c->GetTarget()->GetItemBonuses().Accuracy,
c->GetTarget()->GetItemBonuses().DivineSaveChance
);
c->Message(
Chat::White,
" Flurry: %i%% HitChance: %i%%",
c->GetTarget()->GetItemBonuses().FlurryChance,
c->GetTarget()->GetItemBonuses().HitChance / 15
);
}
if (bAll || (strcasecmp(sep->arg[1], "spell") == 0)) {
c->Message(Chat::White, " Target Spell Bonuses:");
c->Message(
Chat::White,
" Accuracy: %i%% Divine Save: %i%%",
c->GetTarget()->GetSpellBonuses().Accuracy,
c->GetTarget()->GetSpellBonuses().DivineSaveChance
);
c->Message(
Chat::White,
" Flurry: %i%% HitChance: %i%% ",
c->GetTarget()->GetSpellBonuses().FlurryChance,
c->GetTarget()->GetSpellBonuses().HitChance / 15
);
}
c->Message(Chat::White, " Effective Casting Level: %i", c->GetTarget()->GetCasterLevel(0));
}
}
+5 -5
View File
@@ -2,11 +2,11 @@
void command_showbuffs(Client *c, const Seperator *sep)
{
if (c->GetTarget() == 0) {
c->CastToMob()->ShowBuffs(c);
}
else {
c->GetTarget()->CastToMob()->ShowBuffs(c);
Mob* t = c;
if (c->GetTarget()) {
t = c->GetTarget();
}
t->ShowBuffs(c);
}
+2 -11
View File
@@ -7,17 +7,8 @@ void command_shownpcgloballoot(Client *c, const Seperator *sep)
return;
}
auto target = c->GetTarget()->CastToNPC();
const auto t = c->GetTarget()->CastToNPC();
c->Message(
Chat::White,
fmt::format(
"Global loot for {} ({}).",
target->GetCleanName(),
target->GetNPCTypeID()
).c_str()
);
zone->ShowNPCGlobalLoot(c, target);
zone->ShowNPCGlobalLoot(c, t);
}
-8
View File
@@ -1,8 +0,0 @@
#include "../client.h"
void command_shownumhits(Client *c, const Seperator *sep)
{
c->ShowNumHits();
return;
}
+37
View File
@@ -0,0 +1,37 @@
#include "../client.h"
void command_showspells(Client *c, const Seperator *sep)
{
const auto arguments = sep->argnum;
if (!arguments) {
c->Message(Chat::White, "Usages: #showspells disciplines - Show your or your target's learned disciplines");
c->Message(Chat::White, "Usages: #showspells spells - Show your or your target's memorized spells");
return;
}
auto t = c;
if (c->GetTarget() && c->GetTarget()->IsClient()) {
t = c->GetTarget()->CastToClient();
}
const auto is_disciplines = !strcasecmp(sep->arg[1], "disciplines");
const auto is_spells = !strcasecmp(sep->arg[1], "spells");
if (
!is_disciplines &&
!is_spells
) {
c->Message(Chat::White, "Usages: #showspells disciplines - Show your or your target's learned disciplines");
c->Message(Chat::White, "Usages: #showspells spells - Show your or your target's memorized spells");
}
ShowSpellType show_spell_type;
if (is_disciplines) {
show_spell_type = ShowSpellType::Disciplines;
} else if (is_spells) {
show_spell_type = ShowSpellType::Spells;
}
t->ShowSpells(c, show_spell_type);
}
+5 -5
View File
@@ -2,11 +2,11 @@
void command_showstats(Client *c, const Seperator *sep)
{
if (c->GetTarget() != 0) {
c->GetTarget()->ShowStats(c);
}
else {
c->ShowStats(c);
Mob* t = c;
if (c->GetTarget()) {
t = c->GetTarget();
}
t->ShowStats(c);
}
-9
View File
@@ -2,15 +2,6 @@
void command_showzonegloballoot(Client *c, const Seperator *sep)
{
c->Message(
Chat::White,
fmt::format(
"Global loot for {} ({}).",
zone->GetLongName(),
zone->GetZoneID()
).c_str()
);
zone->ShowZoneGlobalLoot(c);
}
-154
View File
@@ -1,154 +0,0 @@
#include "../client.h"
void command_spellinfo(Client *c, const Seperator *sep)
{
if (sep->arg[1][0] == 0) {
c->Message(Chat::White, "Usage: #spellinfo [spell_id]");
}
else {
int32_t spell_id = Strings::ToInt(sep->arg[1]);
const struct SPDat_Spell_Struct *s = &spells[spell_id];
c->Message(Chat::White, "Spell info for spell #%d:", spell_id);
c->Message(Chat::White, " name: %s", s->name);
c->Message(Chat::White, " player_1: %s", s->player_1);
c->Message(Chat::White, " teleport_zone: %s", s->teleport_zone);
c->Message(Chat::White, " you_cast: %s", s->you_cast);
c->Message(Chat::White, " other_casts: %s", s->other_casts);
c->Message(Chat::White, " cast_on_you: %s", s->cast_on_you);
c->Message(Chat::White, " spell_fades: %s", s->spell_fades);
c->Message(Chat::White, " range: %f", s->range);
c->Message(Chat::White, " aoe_range: %f", s->aoe_range);
c->Message(Chat::White, " push_back: %f", s->push_back);
c->Message(Chat::White, " push_up: %f", s->push_up);
c->Message(Chat::White, " cast_time: %d", s->cast_time);
c->Message(Chat::White, " recovery_time: %d", s->recovery_time);
c->Message(Chat::White, " recast_time: %d", s->recast_time);
c->Message(Chat::White, " buff_duration_formula: %d", s->buff_duration_formula);
c->Message(Chat::White, " buff_duration: %d", s->buff_duration);
c->Message(Chat::White, " AEDuration: %d", s->aoe_duration);
c->Message(Chat::White, " mana: %d", s->mana);
c->Message(
Chat::White,
" base[12]: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d",
s->base_value[0],
s->base_value[1],
s->base_value[2],
s->base_value[3],
s->base_value[4],
s->base_value[5],
s->base_value[6],
s->base_value[7],
s->base_value[8],
s->base_value[9],
s->base_value[10],
s->base_value[11]
);
c->Message(
Chat::White,
" base22[12]: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d",
s->limit_value[0],
s->limit_value[1],
s->limit_value[2],
s->limit_value[3],
s->limit_value[4],
s->limit_value[5],
s->limit_value[6],
s->limit_value[7],
s->limit_value[8],
s->limit_value[9],
s->limit_value[10],
s->limit_value[11]
);
c->Message(
Chat::White,
" max[12]: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d",
s->max_value[0],
s->max_value[1],
s->max_value[2],
s->max_value[3],
s->max_value[4],
s->max_value[5],
s->max_value[6],
s->max_value[7],
s->max_value[8],
s->max_value[9],
s->max_value[10],
s->max_value[11]
);
c->Message(
Chat::White,
" components[4]: %d, %d, %d, %d",
s->component[0],
s->component[1],
s->component[2],
s->component[3]
);
c->Message(
Chat::White,
" component_counts[4]: %d, %d, %d, %d",
s->component_count[0],
s->component_count[1],
s->component_count[2],
s->component_count[3]
);
c->Message(
Chat::White,
" NoexpendReagent[4]: %d, %d, %d, %d",
s->no_expend_reagent[0],
s->no_expend_reagent[1],
s->no_expend_reagent[2],
s->no_expend_reagent[3]
);
c->Message(
Chat::White,
" formula[12]: 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x",
s->formula[0],
s->formula[1],
s->formula[2],
s->formula[3],
s->formula[4],
s->formula[5],
s->formula[6],
s->formula[7],
s->formula[8],
s->formula[9],
s->formula[10],
s->formula[11]
);
c->Message(Chat::White, " goodEffect: %d", s->good_effect);
c->Message(Chat::White, " Activated: %d", s->activated);
c->Message(Chat::White, " resisttype: %d", s->resist_type);
c->Message(
Chat::White,
" effectid[12]: 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x",
s->effect_id[0],
s->effect_id[1],
s->effect_id[2],
s->effect_id[3],
s->effect_id[4],
s->effect_id[5],
s->effect_id[6],
s->effect_id[7],
s->effect_id[8],
s->effect_id[9],
s->effect_id[10],
s->effect_id[11]
);
c->Message(Chat::White, " targettype: %d", s->target_type);
c->Message(Chat::White, " basediff: %d", s->base_difficulty);
c->Message(Chat::White, " skill: %d", s->skill);
c->Message(Chat::White, " zonetype: %d", s->zone_type);
c->Message(Chat::White, " EnvironmentType: %d", s->environment_type);
c->Message(Chat::White, " TimeOfDay: %d", s->time_of_day);
c->Message(
Chat::White, " classes[15]: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d",
s->classes[0], s->classes[1], s->classes[2], s->classes[3], s->classes[4],
s->classes[5], s->classes[6], s->classes[7], s->classes[8], s->classes[9],
s->classes[10], s->classes[11], s->classes[12], s->classes[13], s->classes[14]
);
c->Message(Chat::White, " CastingAnim: %d", s->casting_animation);
c->Message(Chat::White, " SpellAffectIndex: %d", s->spell_affect_index);
c->Message(Chat::White, " RecourseLink: %d", s->recourse_link);
}
}
+2 -2
View File
@@ -20,7 +20,7 @@ void command_texture(Client *c, const Seperator *sep)
target = c->GetTarget();
}
if (Mob::IsPlayerRace(target->GetModel())) { // Player Races Wear Armor, so Wearchange is sent instead
if (IsPlayerRace(target->GetModel())) { // Player Races Wear Armor, so Wearchange is sent instead
for (
int texture_slot = EQ::textures::textureBegin;
texture_slot <= EQ::textures::LastTintableTexture;
@@ -44,7 +44,7 @@ void command_texture(Client *c, const Seperator *sep)
c->GetTargetDescription(target, TargetDescriptionType::UCSelf),
texture,
(
Mob::IsPlayerRace(target->GetModel()) ?
IsPlayerRace(target->GetModel()) ?
"" :
fmt::format(
" Helmet Texture: {}",
+77 -75
View File
@@ -2,34 +2,44 @@
void command_viewcurrencies(Client *c, const Seperator *sep)
{
Client *target = c;
auto t = c;
if (c->GetTarget() && c->GetTarget()->IsClient()) {
target = c->GetTarget()->CastToClient();
t = c->GetTarget()->CastToClient();
}
auto platinum = (
target->GetMoney(3, 0) +
target->GetMoney(3, 1) +
target->GetMoney(3, 2) +
target->GetMoney(3, 3)
const auto platinum = (
t->GetMoney(3, 0) +
t->GetMoney(3, 1) +
t->GetMoney(3, 2) +
t->GetMoney(3, 3)
);
auto gold = (
target->GetMoney(2, 0) +
target->GetMoney(2, 1) +
target->GetMoney(2, 2)
const auto gold = (
t->GetMoney(2, 0) +
t->GetMoney(2, 1) +
t->GetMoney(2, 2)
);
auto silver = (
target->GetMoney(1, 0) +
target->GetMoney(1, 1) +
target->GetMoney(1, 2)
const auto silver = (
t->GetMoney(1, 0) +
t->GetMoney(1, 1) +
t->GetMoney(1, 2)
);
auto copper = (
target->GetMoney(0, 0) +
target->GetMoney(0, 1) +
target->GetMoney(0, 2)
const auto copper = (
t->GetMoney(0, 0) +
t->GetMoney(0, 1) +
t->GetMoney(0, 2)
);
std::string currency_table;
currency_table += DialogueWindow::TableRow(
fmt::format(
"{}{}",
DialogueWindow::TableCell("Currency"),
DialogueWindow::TableCell("Amount")
)
);
if (
@@ -38,90 +48,82 @@ void command_viewcurrencies(Client *c, const Seperator *sep)
silver ||
copper
) {
c->Message(
Chat::White,
currency_table += DialogueWindow::TableRow(
fmt::format(
"Money for {} | {}",
c->GetTargetDescription(target, TargetDescriptionType::UCSelf),
Strings::Money(
platinum,
gold,
silver,
copper
)
).c_str()
"{}{}",
DialogueWindow::TableCell("Money"),
DialogueWindow::TableCell(Strings::Money(platinum, gold, silver, copper))
)
);
}
auto ebon_crystals = target->GetEbonCrystals();
const auto ebon_crystals = t->GetEbonCrystals();
if (ebon_crystals) {
c->Message(
Chat::White,
currency_table += DialogueWindow::TableRow(
fmt::format(
"{} for {} | {}",
database.CreateItemLink(RuleI(Zone, EbonCrystalItemID)),
c->GetTargetDescription(target, TargetDescriptionType::UCSelf),
ebon_crystals
).c_str()
"{}{}",
DialogueWindow::TableCell("Ebon Crystals"),
DialogueWindow::TableCell(Strings::Commify(ebon_crystals))
)
);
}
auto radiant_crystals = target->GetRadiantCrystals();
const auto radiant_crystals = t->GetRadiantCrystals();
if (radiant_crystals) {
c->Message(
Chat::White,
currency_table += DialogueWindow::TableRow(
fmt::format(
"{} for {} | {}",
database.CreateItemLink(RuleI(Zone, RadiantCrystalItemID)),
c->GetTargetDescription(target, TargetDescriptionType::UCSelf),
radiant_crystals
).c_str()
"{}{}",
DialogueWindow::TableCell("Radiant Crystals"),
DialogueWindow::TableCell(Strings::Commify(radiant_crystals))
)
);
}
for (const auto& ac : zone->AlternateCurrencies) {
auto currency_value = target->GetAlternateCurrencyValue(ac.id);
for (const auto& a : zone->AlternateCurrencies) {
const auto currency_value = t->GetAlternateCurrencyValue(a.id);
if (currency_value) {
c->Message(
Chat::White,
const auto* d = database.GetItem(a.item_id);
currency_table += DialogueWindow::TableRow(
fmt::format(
"{} for {} | {}",
database.CreateItemLink(ac.item_id),
c->GetTargetDescription(target, TargetDescriptionType::UCSelf),
currency_value
).c_str()
"{}{}",
DialogueWindow::TableCell(d->Name),
DialogueWindow::TableCell(Strings::Commify(currency_value))
)
);
}
}
for (
uint32 ldon_currency_id = LDoNThemes::GUK;
ldon_currency_id <= LDoNThemes::TAK;
ldon_currency_id++
) {
auto ldon_currency_value = target->GetLDoNPointsTheme(ldon_currency_id);
for (const auto& l : EQ::constants::GetLDoNThemeMap()) {
const auto ldon_currency_value = t->GetLDoNPointsTheme(l.first);
if (ldon_currency_value) {
c->Message(
Chat::White,
currency_table += DialogueWindow::TableRow(
fmt::format(
"{} for {} | {}",
EQ::constants::GetLDoNThemeName(ldon_currency_id),
c->GetTargetDescription(target, TargetDescriptionType::UCSelf),
ldon_currency_value
).c_str()
"{}{}",
DialogueWindow::TableCell(l.second),
DialogueWindow::TableCell(Strings::Commify(ldon_currency_value))
)
);
}
}
auto pvp_points = target->GetPVPPoints();
auto pvp_points = t->GetPVPPoints();
if (pvp_points) {
c->Message(
Chat::White,
currency_table += DialogueWindow::TableRow(
fmt::format(
"PVP Points for {} | {}",
c->GetTargetDescription(target, TargetDescriptionType::UCSelf),
pvp_points
).c_str()
"{}{}",
DialogueWindow::TableCell("PVP Points"),
DialogueWindow::TableCell(Strings::Commify(pvp_points))
)
);
}
currency_table = DialogueWindow::Table(currency_table);
c->SendPopupToClient(
fmt::format(
"Currency for {}",
c->GetTargetDescription(t, TargetDescriptionType::UCSelf)
).c_str(),
currency_table.c_str()
);
}
+25 -4
View File
@@ -299,7 +299,7 @@ void NPC::AddLootDrop(
uint32 aug6
)
{
if (item2 == nullptr) {
if (!item2) {
return;
}
@@ -363,11 +363,27 @@ void NPC::AddLootDrop(
bool found = false; // track if we found an empty slot we fit into
int foundslot = INVALID_INDEX; // for multi-slot items
const auto* inst = database.CreateItem(
item2->ID,
loot_drop.item_charges,
aug1,
aug2,
aug3,
aug4,
aug5,
aug6
);
if (!inst) {
return;
}
if (loot_drop.equip_item > 0) {
uint8 eslot = 0xFF;
char newid[20];
const EQ::ItemData* compitem = nullptr;
int32 foundslot = -1; // for multi-slot items
// Equip rules are as follows:
// If the item has the NoPet flag set it will not be equipped.
@@ -511,10 +527,15 @@ void NPC::AddLootDrop(
}
}
if (itemlist != nullptr) {
if (itemlist) {
if (foundslot != INVALID_INDEX) {
GetInv().PutItem(foundslot, *inst);
}
itemlist->push_back(item);
} else {
safe_delete(item);
}
else safe_delete(item);
if (found) {
CalcBonuses();
+12
View File
@@ -494,6 +494,16 @@ void Lua_Bot::AddItem(const luabind::object& item_table) {
}
}
std::string Lua_Bot::GetClassAbbreviation() {
Lua_Safe_Call_String();
return GetPlayerClassAbbreviation(self->GetClass());
}
std::string Lua_Bot::GetRaceAbbreviation() {
Lua_Safe_Call_String();
return GetPlayerRaceAbbreviation(self->GetBaseRace());
}
luabind::scope lua_register_bot() {
return luabind::class_<Lua_Bot, Lua_Mob>("Bot")
.def(luabind::constructor<>())
@@ -541,6 +551,7 @@ luabind::scope lua_register_bot() {
.def("GetBotID", (uint32(Lua_Bot::*)(void))&Lua_Bot::GetBotID)
.def("GetBotItem", (Lua_ItemInst(Lua_Bot::*)(uint16))&Lua_Bot::GetBotItem)
.def("GetBotItemIDBySlot", (uint32(Lua_Bot::*)(uint16))&Lua_Bot::GetBotItemIDBySlot)
.def("GetClassAbbreviation", (std::string(Lua_Bot::*)(void))&Lua_Bot::GetClassAbbreviation)
.def("GetExpansionBitmask", (int(Lua_Bot::*)(void))&Lua_Bot::GetExpansionBitmask)
.def("GetGroup", (Lua_Group(Lua_Bot::*)(void))&Lua_Bot::GetGroup)
.def("GetHealAmount", (int(Lua_Bot::*)(void))&Lua_Bot::GetHealAmount)
@@ -548,6 +559,7 @@ luabind::scope lua_register_bot() {
.def("GetItemAt", (Lua_ItemInst(Lua_Bot::*)(int16))&Lua_Bot::GetItemAt)
.def("GetItemIDAt", (int(Lua_Bot::*)(int16))&Lua_Bot::GetItemIDAt)
.def("GetOwner", (Lua_Mob(Lua_Bot::*)(void))&Lua_Bot::GetOwner)
.def("GetRaceAbbreviation", (std::string(Lua_Bot::*)(void))&Lua_Bot::GetRaceAbbreviation)
.def("GetRawItemAC", (int(Lua_Bot::*)(void))&Lua_Bot::GetRawItemAC)
.def("GetSpellDamage", (int(Lua_Bot::*)(void))&Lua_Bot::GetSpellDamage)
.def("HasAugmentEquippedByID", (bool(Lua_Bot::*)(uint32))&Lua_Bot::HasAugmentEquippedByID)
+3
View File
@@ -1,3 +1,4 @@
\
#ifndef EQEMU_LUA_BOT_H
#define EQEMU_LUA_BOT_H
#ifdef LUA_EQEMU
@@ -65,6 +66,8 @@ public:
Lua_ItemInst GetItemAt(int16 slot_id);
int GetItemIDAt(int16 slot_id);
void SendSpellAnim(uint16 target_id, uint16 spell_id);
std::string GetClassAbbreviation();
std::string GetRaceAbbreviation();
void ApplySpell(int spell_id);
void ApplySpell(int spell_id, int duration);
+45 -10
View File
@@ -1449,7 +1449,7 @@ void Lua_Client::UnFreeze() {
self->SendAppearancePacket(AT_Anim, ANIM_STAND);
}
int Lua_Client::GetAggroCount() {
uint32 Lua_Client::GetAggroCount() {
Lua_Safe_Call_Int();
return self->GetAggroCount();
}
@@ -1509,16 +1509,36 @@ bool Lua_Client::HasSpellScribed(int spell_id) {
return self->HasSpellScribed(spell_id);
}
void Lua_Client::SetAccountFlag(std::string flag, std::string val) {
void Lua_Client::ClearAccountFlag(const std::string& flag) {
Lua_Safe_Call_Void();
self->SetAccountFlag(flag, val);
self->ClearAccountFlag(flag);
}
std::string Lua_Client::GetAccountFlag(std::string flag) {
void Lua_Client::SetAccountFlag(const std::string& flag, const std::string& value) {
Lua_Safe_Call_Void();
self->SetAccountFlag(flag, value);
}
std::string Lua_Client::GetAccountFlag(const std::string& flag) {
Lua_Safe_Call_String();
return self->GetAccountFlag(flag);
}
luabind::object Lua_Client::GetAccountFlags(lua_State* L) {
auto t = luabind::newtable(L);
if (d_) {
auto self = reinterpret_cast<NativeType*>(d_);
auto l = self->GetAccountFlags();
int i = 1;
for (const auto& e : l) {
t[i] = e;
i++;
}
}
return t;
}
Lua_Group Lua_Client::GetGroup() {
Lua_Safe_Call_Class(Lua_Group);
return self->GetGroup();
@@ -2831,7 +2851,7 @@ luabind::object Lua_Client::GetPEQZoneFlags(lua_State* L) {
if (d_) {
auto self = reinterpret_cast<NativeType*>(d_);
auto l = self->GetPEQZoneFlags();
auto i = 1;
int i = 1;
for (const auto& f : l) {
t[i] = f;
i++;
@@ -2846,7 +2866,7 @@ luabind::object Lua_Client::GetZoneFlags(lua_State* L) {
if (d_) {
auto self = reinterpret_cast<NativeType*>(d_);
auto l = self->GetZoneFlags();
auto i = 1;
int i = 1;
for (const auto& f : l) {
t[i] = f;
i++;
@@ -3060,6 +3080,18 @@ uint32 Lua_Client::GetEXPForLevel(uint16 check_level)
return self->GetEXPForLevel(check_level);
}
std::string Lua_Client::GetClassAbbreviation()
{
Lua_Safe_Call_String();
return GetPlayerClassAbbreviation(self->GetBaseClass());
}
std::string Lua_Client::GetRaceAbbreviation()
{
Lua_Safe_Call_String();
return GetPlayerRaceAbbreviation(self->GetBaseRace());
}
luabind::scope lua_register_client() {
return luabind::class_<Lua_Client, Lua_Mob>("Client")
.def(luabind::constructor<>())
@@ -3124,6 +3156,7 @@ luabind::scope lua_register_client() {
.def("CheckIncreaseSkill", (void(Lua_Client::*)(int,Lua_Mob,int))&Lua_Client::CheckIncreaseSkill)
.def("CheckSpecializeIncrease", (void(Lua_Client::*)(int))&Lua_Client::CheckSpecializeIncrease)
.def("ClearCompassMark",(void(Lua_Client::*)(void))&Lua_Client::ClearCompassMark)
.def("ClearAccountFlag", (void(Lua_Client::*)(const std::string&))&Lua_Client::ClearAccountFlag)
.def("ClearPEQZoneFlag", (void(Lua_Client::*)(uint32))&Lua_Client::ClearPEQZoneFlag)
.def("ClearZoneFlag", (void(Lua_Client::*)(uint32))&Lua_Client::ClearZoneFlag)
.def("Connected", (bool(Lua_Client::*)(void))&Lua_Client::Connected)
@@ -3178,8 +3211,9 @@ luabind::scope lua_register_client() {
.def("GetAAPoints", (int(Lua_Client::*)(void))&Lua_Client::GetAAPoints)
.def("GetAFK", (int(Lua_Client::*)(void))&Lua_Client::GetAFK)
.def("GetAccountAge", (int(Lua_Client::*)(void))&Lua_Client::GetAccountAge)
.def("GetAccountFlag", (std::string(Lua_Client::*)(std::string))&Lua_Client::GetAccountFlag)
.def("GetAggroCount", (int(Lua_Client::*)(void))&Lua_Client::GetAggroCount)
.def("GetAccountFlag", (std::string(Lua_Client::*)(const std::string&))&Lua_Client::GetAccountFlag)
.def("GetAccountFlags", (luabind::object(Lua_Client::*)(lua_State*))&Lua_Client::GetAccountFlags)
.def("GetAggroCount", (uint32(Lua_Client::*)(void))&Lua_Client::GetAggroCount)
.def("GetAllMoney", (uint64(Lua_Client::*)(void))&Lua_Client::GetAllMoney)
.def("GetAlternateCurrencyValue", (int(Lua_Client::*)(uint32))&Lua_Client::GetAlternateCurrencyValue)
.def("GetAnon", (int(Lua_Client::*)(void))&Lua_Client::GetAnon)
@@ -3212,6 +3246,7 @@ luabind::scope lua_register_client() {
.def("GetCarriedMoney", (uint64(Lua_Client::*)(void))&Lua_Client::GetCarriedMoney)
.def("GetCarriedPlatinum", (uint32(Lua_Client::*)(void))&Lua_Client::GetCarriedPlatinum)
.def("GetCharacterFactionLevel", (int(Lua_Client::*)(int))&Lua_Client::GetCharacterFactionLevel)
.def("GetClassAbbreviation", (std::string(Lua_Client::*)(void))&Lua_Client::GetClassAbbreviation)
.def("GetClassBitmask", (int(Lua_Client::*)(void))&Lua_Client::GetClassBitmask)
.def("GetClientMaxLevel", (int(Lua_Client::*)(void))&Lua_Client::GetClientMaxLevel)
.def("GetClientVersion", (int(Lua_Client::*)(void))&Lua_Client::GetClientVersion)
@@ -3278,6 +3313,7 @@ luabind::scope lua_register_client() {
.def("GetRadiantCrystals", (uint32(Lua_Client::*)(void))&Lua_Client::GetRadiantCrystals)
.def("GetRaid", (Lua_Raid(Lua_Client::*)(void))&Lua_Client::GetRaid)
.def("GetRaidPoints", (uint32(Lua_Client::*)(void))&Lua_Client::GetRaidPoints)
.def("GetRaceAbbreviation", (std::string(Lua_Client::*)(void))&Lua_Client::GetRaceAbbreviation)
.def("GetRawItemAC", (int(Lua_Client::*)(void))&Lua_Client::GetRawItemAC)
.def("GetRawSkill", (int(Lua_Client::*)(int))&Lua_Client::GetRawSkill)
.def("GetRecipeMadeCount", (int(Lua_Client::*)(uint32))&Lua_Client::GetRecipeMadeCount)
@@ -3456,8 +3492,7 @@ luabind::scope lua_register_client() {
.def("SetAATitle", (void(Lua_Client::*)(std::string))&Lua_Client::SetAATitle)
.def("SetAATitle", (void(Lua_Client::*)(std::string,bool))&Lua_Client::SetAATitle)
.def("SetAFK", (void(Lua_Client::*)(uint8))&Lua_Client::SetAFK)
.def("SetAccountFlag", (void(Lua_Client::*)(std::string,std::string))&Lua_Client::SetAccountFlag)
.def("SetAccountFlag", (void(Lua_Client::*)(std::string,std::string))&Lua_Client::SetAccountFlag)
.def("SetAccountFlag", (void(Lua_Client::*)(const std::string&,const std::string&))&Lua_Client::SetAccountFlag)
.def("SetAlternateCurrencyValue", (void(Lua_Client::*)(uint32,int))&Lua_Client::SetAlternateCurrencyValue)
.def("SetAnon", (void(Lua_Client::*)(uint8))&Lua_Client::SetAnon)
.def("SetBaseClass", (void(Lua_Client::*)(int))&Lua_Client::SetBaseClass)
+7 -3
View File
@@ -367,7 +367,7 @@ public:
void AssignToInstance(int instance_id);
void Freeze();
void UnFreeze();
int GetAggroCount();
uint32 GetAggroCount();
uint64 GetCarriedMoney();
uint32 GetCarriedPlatinum();
uint64 GetAllMoney();
@@ -380,8 +380,10 @@ public:
int GetAlternateCurrencyValue(uint32 currency);
void SendWebLink(const char *site);
bool HasSpellScribed(int spell_id);
void SetAccountFlag(std::string flag, std::string val);
std::string GetAccountFlag(std::string flag);
void ClearAccountFlag(const std::string& flag);
void SetAccountFlag(const std::string& flag, const std::string& value);
std::string GetAccountFlag(const std::string& flag);
luabind::object GetAccountFlags(lua_State* L);
int GetAccountAge();
Lua_Group GetGroup();
Lua_Raid GetRaid();
@@ -469,6 +471,8 @@ public:
bool IsAutoAttackEnabled();
bool IsAutoFireEnabled();
uint32 GetEXPForLevel(uint16 check_level);
std::string GetClassAbbreviation();
std::string GetRaceAbbreviation();
void ApplySpell(int spell_id);
void ApplySpell(int spell_id, int duration);
+58
View File
@@ -635,6 +635,62 @@ Lua_Bot Lua_EntityList::GetRandomBot(float x, float y, float z, float distance,
return self->GetRandomBot(glm::vec3(x, y, z), distance, exclude_bot);
}
Lua_Mob_List Lua_EntityList::GetCloseMobList(Lua_Mob mob) {
Lua_Safe_Call_Class(Lua_Mob_List);
Lua_Mob_List ret;
const auto& l = self->GetCloseMobList(mob);
ret.entries.reserve(l.size());
for (const auto& e : l) {
ret.entries.emplace_back(Lua_Mob(e.second));
}
return ret;
}
Lua_Mob_List Lua_EntityList::GetCloseMobList(Lua_Mob mob, float distance) {
Lua_Safe_Call_Class(Lua_Mob_List);
Lua_Mob_List ret;
const auto& l = self->GetCloseMobList(mob);
ret.entries.reserve(l.size());
for (const auto& e : l) {
if (mob.CalculateDistance(e.second) <= distance) {
ret.entries.emplace_back(Lua_Mob(e.second));
}
}
return ret;
}
Lua_Mob_List Lua_EntityList::GetCloseMobList(Lua_Mob mob, float distance, bool ignore_self) {
Lua_Safe_Call_Class(Lua_Mob_List);
Lua_Mob_List ret;
const auto& l = self->GetCloseMobList(mob);
ret.entries.reserve(l.size());
for (const auto& e : l) {
if (ignore_self && e.second == mob) {
continue;
}
if (mob.CalculateDistance(e.second) <= distance) {
ret.entries.emplace_back(Lua_Mob(e.second));
}
}
return ret;
}
luabind::scope lua_register_entity_list() {
return luabind::class_<Lua_EntityList>("EntityList")
.def(luabind::constructor<>())
@@ -665,6 +721,8 @@ luabind::scope lua_register_entity_list() {
.def("GetClientByName", (Lua_Client(Lua_EntityList::*)(const char*))&Lua_EntityList::GetClientByName)
.def("GetClientByWID", (Lua_Client(Lua_EntityList::*)(uint32))&Lua_EntityList::GetClientByWID)
.def("GetClientList", (Lua_Client_List(Lua_EntityList::*)(void))&Lua_EntityList::GetClientList)
.def("GetCloseMobList", (Lua_Mob_List(Lua_EntityList::*)(Lua_Mob))&Lua_EntityList::GetCloseMobList)
.def("GetCloseMobList", (Lua_Mob_List(Lua_EntityList::*)(Lua_Mob,float))&Lua_EntityList::GetCloseMobList)
.def("GetCorpseByID", (Lua_Corpse(Lua_EntityList::*)(int))&Lua_EntityList::GetCorpseByID)
.def("GetCorpseByName", (Lua_Corpse(Lua_EntityList::*)(const char*))&Lua_EntityList::GetCorpseByName)
.def("GetCorpseByOwner", (Lua_Corpse(Lua_EntityList::*)(Lua_Client))&Lua_EntityList::GetCorpseByOwner)
+3
View File
@@ -139,6 +139,9 @@ public:
void SignalAllBotsByOwnerName(std::string owner_name, int signal_id);
void SignalBotByBotID(uint32 bot_id, int signal_id);
void SignalBotByBotName(std::string bot_name, int signal_id);
Lua_Mob_List GetCloseMobList(Lua_Mob mob);
Lua_Mob_List GetCloseMobList(Lua_Mob mob, float distance);
Lua_Mob_List GetCloseMobList(Lua_Mob mob, float distance, bool ignore_self);
};
#endif
+2 -2
View File
@@ -37,8 +37,8 @@ void Lua_HateEntry::SetHate(int64 value) {
self->stored_hate_amount = value;
}
int Lua_HateEntry::GetFrenzy() {
Lua_Safe_Call_Int();
bool Lua_HateEntry::GetFrenzy() {
Lua_Safe_Call_Bool();
return self->is_entity_frenzy;
}
+1 -1
View File
@@ -24,7 +24,7 @@ public:
void SetDamage(int64 value);
int64 GetHate();
void SetHate(int64 value);
int GetFrenzy();
bool GetFrenzy();
void SetFrenzy(bool value);
};
+9 -9
View File
@@ -475,34 +475,34 @@ uint32 Lua_Item::GetAugType() {
return self->AugType;
}
int Lua_Item::GetAugSlotType(int i) {
int Lua_Item::GetAugSlotType(uint8 slot_id) {
Lua_Safe_Call_Int();
if(i >= 5 || i < 0) {
if (!EQ::ValueWithin(slot_id, EQ::invaug::SOCKET_BEGIN, EQ::invaug::SOCKET_END)) {
return 0;
}
return self->AugSlotType[i];
return self->AugSlotType[slot_id];
}
int Lua_Item::GetAugSlotVisible(int i) {
int Lua_Item::GetAugSlotVisible(uint8 slot_id) {
Lua_Safe_Call_Int();
if(i >= 5 || i < 0) {
if (!EQ::ValueWithin(slot_id, EQ::invaug::SOCKET_BEGIN, EQ::invaug::SOCKET_END)) {
return 0;
}
return self->AugSlotVisible[i];
return self->AugSlotVisible[slot_id];
}
int Lua_Item::GetAugSlotUnk2(int i) {
int Lua_Item::GetAugSlotUnk2(uint8 slot_id) {
Lua_Safe_Call_Int();
if(i >= 5 || i < 0) {
if (!EQ::ValueWithin(slot_id, EQ::invaug::SOCKET_BEGIN, EQ::invaug::SOCKET_END)) {
return 0;
}
return self->AugSlotUnk2[i];
return self->AugSlotUnk2[slot_id];
}
uint32 Lua_Item::GetLDoNTheme() {
+3 -3
View File
@@ -121,9 +121,9 @@ public:
int GetFactionAmt4();
const char *GetCharmFile();
uint32 GetAugType();
int GetAugSlotType(int i);
int GetAugSlotVisible(int i);
int GetAugSlotUnk2(int i);
int GetAugSlotType(uint8 slot_id);
int GetAugSlotVisible(uint8 slot_id);
int GetAugSlotUnk2(uint8 slot_id);
uint32 GetLDoNTheme();
uint32 GetLDoNPrice();
uint32 GetLDoNSold();
+52 -19
View File
@@ -3,6 +3,7 @@
#include <luabind/luabind.hpp>
#include <luabind/object.hpp>
#include "../common/languages.h"
#include "masterentity.h"
#include "lua_iteminst.h"
#include "lua_item.h"
@@ -55,12 +56,12 @@ bool Lua_ItemInst::IsStackable() {
return self->IsStackable();
}
bool Lua_ItemInst::IsEquipable(int race, int class_) {
bool Lua_ItemInst::IsEquipable(uint16 race_bitmask, uint16 class_bitmask) {
Lua_Safe_Call_Bool();
return self->IsEquipable(race, class_);
return self->IsEquipable(race_bitmask, class_bitmask);
}
bool Lua_ItemInst::IsEquipable(int slot_id) {
bool Lua_ItemInst::IsEquipable(int16 slot_id) {
Lua_Safe_Call_Bool();
return self->IsEquipable(slot_id);
}
@@ -80,9 +81,9 @@ bool Lua_ItemInst::IsExpendable() {
return self->IsExpendable();
}
Lua_ItemInst Lua_ItemInst::GetItem(int slot) {
Lua_ItemInst Lua_ItemInst::GetItem(uint8 slot_id) {
Lua_Safe_Call_Class(Lua_ItemInst);
return Lua_ItemInst(self->GetItem(slot));
return Lua_ItemInst(self->GetItem(slot_id));
}
Lua_Item Lua_ItemInst::GetItem() {
@@ -90,29 +91,29 @@ Lua_Item Lua_ItemInst::GetItem() {
return Lua_Item(self->GetItem());
}
Lua_Item Lua_ItemInst::GetUnscaledItem(int slot) {
Lua_Item Lua_ItemInst::GetUnscaledItem() {
Lua_Safe_Call_Class(Lua_Item);
return self->GetUnscaledItem();
}
uint32 Lua_ItemInst::GetItemID(int slot) {
uint32 Lua_ItemInst::GetItemID(uint8 slot_id) {
Lua_Safe_Call_Int();
return self->GetItemID(slot);
return self->GetItemID(slot_id);
}
int Lua_ItemInst::GetTotalItemCount() {
uint8 Lua_ItemInst::GetTotalItemCount() {
Lua_Safe_Call_Int();
return self->GetTotalItemCount();
}
Lua_ItemInst Lua_ItemInst::GetAugment(int slot) {
Lua_ItemInst Lua_ItemInst::GetAugment(uint8 slot_id) {
Lua_Safe_Call_Class(Lua_ItemInst);
return self->GetAugment(slot);
return self->GetAugment(slot_id);
}
uint32 Lua_ItemInst::GetAugmentItemID(int slot) {
uint32 Lua_ItemInst::GetAugmentItemID(uint8 slot_id) {
Lua_Safe_Call_Int();
return self->GetAugmentItemID(slot);
return self->GetAugmentItemID(slot_id);
}
bool Lua_ItemInst::IsAugmented() {
@@ -175,11 +176,21 @@ bool Lua_ItemInst::IsInstNoDrop() {
return self->IsAttuned();
}
bool Lua_ItemInst::IsAttuned() {
Lua_Safe_Call_Bool();
return self->IsAttuned();
}
void Lua_ItemInst::SetInstNoDrop(bool flag) {
Lua_Safe_Call_Void();
return self->SetAttuned(flag);
}
void Lua_ItemInst::SetAttuned(bool flag) {
Lua_Safe_Call_Void();
return self->SetAttuned(flag);
}
std::string Lua_ItemInst::GetCustomDataString() {
Lua_Safe_Call_String();
return self->GetCustomDataString();
@@ -240,12 +251,12 @@ void Lua_ItemInst::AddExp(uint32 exp) {
self->AddExp(exp);
}
int Lua_ItemInst::GetMaxEvolveLvl() {
int8 Lua_ItemInst::GetMaxEvolveLvl() {
Lua_Safe_Call_Int();
return self->GetMaxEvolveLvl();
}
uint32 Lua_ItemInst::GetKillsNeeded(int current_level) {
uint32 Lua_ItemInst::GetKillsNeeded(uint8 current_level) {
Lua_Safe_Call_Int();
return self->GetKillsNeeded(current_level);
}
@@ -290,6 +301,23 @@ int Lua_ItemInst::RemoveTaskDeliveredItems() {
return self->RemoveTaskDeliveredItems();
}
std::string Lua_ItemInst::GetName() {
Lua_Safe_Call_String();
return self->GetItem()->Name;
}
void Lua_ItemInst::ItemSay(const char* text) // @categories Inventory and Items
{
Lua_Safe_Call_Void();
quest_manager.GetInitiator()->ChannelMessageSend(self->GetItem()->Name, 0, ChatChannel_Say, LANG_COMMON_TONGUE, MAX_LANGUAGE_SKILL, text);
}
void Lua_ItemInst::ItemSay(const char* text, uint8 language_id) // @categories Inventory and Items
{
Lua_Safe_Call_Void();
quest_manager.GetInitiator()->ChannelMessageSend(self->GetItem()->Name, 0, ChatChannel_Say, language_id, MAX_LANGUAGE_SKILL, text);
}
luabind::scope lua_register_iteminst() {
return luabind::class_<Lua_ItemInst>("ItemInst")
.def(luabind::constructor<>())
@@ -313,26 +341,31 @@ luabind::scope lua_register_iteminst() {
.def("GetExp", (uint32(Lua_ItemInst::*)(void))&Lua_ItemInst::GetExp)
.def("GetID", (uint32(Lua_ItemInst::*)(void))&Lua_ItemInst::GetID)
.def("GetItem", (Lua_Item(Lua_ItemInst::*)(void))&Lua_ItemInst::GetItem)
.def("GetItem", (Lua_ItemInst(Lua_ItemInst::*)(int))&Lua_ItemInst::GetItem)
.def("GetItem", (Lua_ItemInst(Lua_ItemInst::*)(uint8))&Lua_ItemInst::GetItem)
.def("GetItemID", (uint32(Lua_ItemInst::*)(int))&Lua_ItemInst::GetItemID)
.def("GetItemScriptID", (uint32(Lua_ItemInst::*)(void))&Lua_ItemInst::GetItemScriptID)
.def("GetKillsNeeded", (uint32(Lua_ItemInst::*)(int))&Lua_ItemInst::GetKillsNeeded)
.def("GetMaxEvolveLvl", (int(Lua_ItemInst::*)(void))&Lua_ItemInst::GetMaxEvolveLvl)
.def("GetName", (std::string(Lua_ItemInst::*)(void))&Lua_ItemInst::GetName)
.def("GetPrice", (uint32(Lua_ItemInst::*)(void))&Lua_ItemInst::GetPrice)
.def("GetTaskDeliveredCount", &Lua_ItemInst::GetTaskDeliveredCount)
.def("GetTotalItemCount", (int(Lua_ItemInst::*)(void))&Lua_ItemInst::GetTotalItemCount)
.def("GetTotalItemCount", (uint8(Lua_ItemInst::*)(void))&Lua_ItemInst::GetTotalItemCount)
.def("GetUnscaledItem", (Lua_ItemInst(Lua_ItemInst::*)(int))&Lua_ItemInst::GetUnscaledItem)
.def("IsAmmo", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsAmmo)
.def("IsAttuned", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsAttuned)
.def("IsAugmentable", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsAugmentable)
.def("IsAugmented", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsAugmented)
.def("IsEquipable", (bool(Lua_ItemInst::*)(int))&Lua_ItemInst::IsEquipable)
.def("IsEquipable", (bool(Lua_ItemInst::*)(int,int))&Lua_ItemInst::IsEquipable)
.def("IsEquipable", (bool(Lua_ItemInst::*)(int16))&Lua_ItemInst::IsEquipable)
.def("IsEquipable", (bool(Lua_ItemInst::*)(uint16,uint16))&Lua_ItemInst::IsEquipable)
.def("IsExpendable", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsExpendable)
.def("IsInstNoDrop", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsInstNoDrop)
.def("IsStackable", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsStackable)
.def("IsType", (bool(Lua_ItemInst::*)(int))&Lua_ItemInst::IsType)
.def("IsWeapon", (bool(Lua_ItemInst::*)(void))&Lua_ItemInst::IsWeapon)
.def("ItemSay", (void(Lua_ItemInst::*)(const char*))&Lua_ItemInst::ItemSay)
.def("ItemSay", (void(Lua_ItemInst::*)(const char*, uint8))&Lua_ItemInst::ItemSay)
.def("RemoveTaskDeliveredItems", &Lua_ItemInst::RemoveTaskDeliveredItems)
.def("SetAttuned", (void(Lua_ItemInst::*)(bool))&Lua_ItemInst::SetAttuned)
.def("SetCharges", (void(Lua_ItemInst::*)(int))&Lua_ItemInst::SetCharges)
.def("SetColor", (void(Lua_ItemInst::*)(uint32))&Lua_ItemInst::SetColor)
.def("SetCustomData", (void(Lua_ItemInst::*)(const std::string&,bool))&Lua_ItemInst::SetCustomData)
+15 -11
View File
@@ -37,19 +37,18 @@ public:
bool IsType(int item_class);
bool IsStackable();
bool IsEquipable(int race, int class_);
bool IsEquipable(int slot_id);
bool IsEquipable(uint16 race_bitmask, uint16 class_bitmask);
bool IsEquipable(int16 slot_id);
bool IsAugmentable();
int GetAugmentType();
bool IsExpendable();
Lua_ItemInst GetItem(int slot);
Lua_ItemInst GetItem(uint8 slot_id);
Lua_Item GetItem();
void SetItem(Lua_Item item);
Lua_Item GetUnscaledItem(int slot);
uint32 GetItemID(int slot);
int GetTotalItemCount();
Lua_ItemInst GetAugment(int slot);
uint32 GetAugmentItemID(int slot);
Lua_Item GetUnscaledItem();
uint32 GetItemID(uint8 slot_id);
uint8 GetTotalItemCount();
Lua_ItemInst GetAugment(uint8 slot_id);
uint32 GetAugmentItemID(uint8 slot_id);
bool IsAugmented();
bool IsWeapon();
bool IsAmmo();
@@ -62,7 +61,9 @@ public:
void SetColor(uint32 color);
uint32 GetColor();
bool IsInstNoDrop();
bool IsAttuned();
void SetInstNoDrop(bool flag);
void SetAttuned(bool flag);
std::string GetCustomDataString();
void SetCustomData(const std::string &identifier, const std::string &value);
void SetCustomData(const std::string &identifier, int value);
@@ -75,8 +76,8 @@ public:
uint32 GetExp();
void SetExp(uint32 exp);
void AddExp(uint32 exp);
int GetMaxEvolveLvl();
uint32 GetKillsNeeded(int current_level);
int8 GetMaxEvolveLvl();
uint32 GetKillsNeeded(uint8 current_level);
Lua_ItemInst Clone();
void SetTimer(std::string name, uint32 time);
void StopTimer(std::string name);
@@ -85,6 +86,9 @@ public:
int CountAugmentByID(uint32 item_id);
int GetTaskDeliveredCount();
int RemoveTaskDeliveredItems();
std::string GetName();
void ItemSay(const char* text);
void ItemSay(const char* text, uint8 language_id);
private:
bool cloned_;
+85 -2
View File
@@ -18,6 +18,10 @@
struct SpecialAbilities { };
struct Lua_Mob_List {
std::vector<Lua_Mob> entries;
};
const char *Lua_Mob::GetName() {
Lua_Safe_Call_String();
return self->GetName();
@@ -1265,6 +1269,11 @@ float Lua_Mob::CalculateDistance(double x, double y, double z) {
return self->CalculateDistance(static_cast<float>(x), static_cast<float>(y), static_cast<float>(z));
}
float Lua_Mob::CalculateDistance(Lua_Mob mob) {
Lua_Safe_Call_Real();
return self->CalculateDistance(mob);
}
void Lua_Mob::SendTo(double x, double y, double z) {
Lua_Safe_Call_Void();
self->SendTo(static_cast<float>(x), static_cast<float>(y), static_cast<float>(z));
@@ -2744,7 +2753,7 @@ luabind::object Lua_Mob::GetEntityVariables(lua_State* L) {
if (d_) {
auto self = reinterpret_cast<NativeType*>(d_);
auto l = self->GetEntityVariables();
auto i = 1;
int i = 1;
for (const auto& v : l) {
t[i] = v;
i++;
@@ -3035,7 +3044,7 @@ luabind::object Lua_Mob::GetBuffSpellIDs(lua_State* L) {
if (d_) {
auto self = reinterpret_cast<NativeType*>(d_);
auto l = self->GetBuffSpellIDs();
auto i = 1;
int i = 1;
for (const auto& v : l) {
t[i] = v;
i++;
@@ -3050,6 +3059,74 @@ bool Lua_Mob::HasSpellEffect(int effect_id) {
return self->HasSpellEffect(effect_id);
}
Lua_Mob_List Lua_Mob::GetCloseMobList() {
Lua_Safe_Call_Class(Lua_Mob_List);
Lua_Mob_List ret;
const auto& l = entity_list.GetCloseMobList(self);
ret.entries.reserve(l.size());
for (const auto& e : l) {
ret.entries.emplace_back(Lua_Mob(e.second));
}
return ret;
}
Lua_Mob_List Lua_Mob::GetCloseMobList(float distance) {
Lua_Safe_Call_Class(Lua_Mob_List);
Lua_Mob_List ret;
const auto& l = entity_list.GetCloseMobList(self);
ret.entries.reserve(l.size());
for (const auto& e : l) {
if (self->CalculateDistance(e.second) <= distance) {
ret.entries.emplace_back(Lua_Mob(e.second));
}
}
return ret;
}
Lua_Mob_List Lua_Mob::GetCloseMobList(float distance, bool ignore_self) {
Lua_Safe_Call_Class(Lua_Mob_List);
Lua_Mob_List ret;
const auto& l = entity_list.GetCloseMobList(self);
ret.entries.reserve(l.size());
for (const auto& e : l) {
if (ignore_self && e.second == self) {
continue;
}
if (self->CalculateDistance(e.second) <= distance) {
ret.entries.emplace_back(Lua_Mob(e.second));
}
}
return ret;
}
std::string Lua_Mob::GetClassPlural()
{
Lua_Safe_Call_String();
return self->GetClassPlural();
}
std::string Lua_Mob::GetRacePlural()
{
Lua_Safe_Call_String();
return self->GetRacePlural();
}
luabind::scope lua_register_mob() {
return luabind::class_<Lua_Mob, Lua_Entity>("Mob")
.def(luabind::constructor<>())
@@ -3083,6 +3160,7 @@ luabind::scope lua_register_mob() {
.def("BuffFadeBySlot", (void(Lua_Mob::*)(int,bool))&Lua_Mob::BuffFadeBySlot)
.def("BuffFadeBySpellID", (void(Lua_Mob::*)(int))&Lua_Mob::BuffFadeBySpellID)
.def("CalculateDistance", (float(Lua_Mob::*)(double,double,double))&Lua_Mob::CalculateDistance)
.def("CalculateDistance", (float(Lua_Mob::*)(Lua_Mob))&Lua_Mob::CalculateDistance)
.def("CalculateHeadingToTarget", (double(Lua_Mob::*)(double,double))&Lua_Mob::CalculateHeadingToTarget)
.def("CameraEffect", (void(Lua_Mob::*)(uint32,float))&Lua_Mob::CameraEffect)
.def("CameraEffect", (void(Lua_Mob::*)(uint32,float,Lua_Client))&Lua_Mob::CameraEffect)
@@ -3257,7 +3335,11 @@ luabind::scope lua_register_mob() {
.def("GetCasterLevel", &Lua_Mob::GetCasterLevel)
.def("GetClass", &Lua_Mob::GetClass)
.def("GetClassName", &Lua_Mob::GetClassName)
.def("GetClassPlural", &Lua_Mob::GetClassPlural)
.def("GetCleanName", &Lua_Mob::GetCleanName)
.def("GetCloseMobList", (Lua_Mob_List(Lua_Mob::*)(void))&Lua_Mob::GetCloseMobList)
.def("GetCloseMobList", (Lua_Mob_List(Lua_Mob::*)(float))&Lua_Mob::GetCloseMobList)
.def("GetCloseMobList", (Lua_Mob_List(Lua_Mob::*)(float,bool))&Lua_Mob::GetCloseMobList)
.def("GetCorruption", &Lua_Mob::GetCorruption)
.def("GetDEX", &Lua_Mob::GetDEX)
.def("GetDR", &Lua_Mob::GetDR)
@@ -3357,6 +3439,7 @@ luabind::scope lua_register_mob() {
.def("GetPhR", &Lua_Mob::GetPhR)
.def("GetRace", &Lua_Mob::GetRace)
.def("GetRaceName", &Lua_Mob::GetRaceName)
.def("GetRacePlural", &Lua_Mob::GetRacePlural)
.def("GetRemainingTimeMS", &Lua_Mob::GetRemainingTimeMS)
.def("GetResist", (int(Lua_Mob::*)(int))&Lua_Mob::GetResist)
.def("GetReverseFactionCon", (int(Lua_Mob::*)(Lua_Mob))&Lua_Mob::GetReverseFactionCon)
+7
View File
@@ -12,6 +12,7 @@ class Lua_StatBonuses;
class Lua_Bot;
class Lua_NPC;
class Lua_Client;
struct Lua_Mob_List;
namespace luabind {
struct scope;
@@ -287,6 +288,7 @@ public:
void NavigateTo(double x, double y, double z);
void StopNavigation();
float CalculateDistance(double x, double y, double z);
float CalculateDistance(Lua_Mob mob);
void SendTo(double x, double y, double z);
void SendToFixZ(double x, double y, double z);
void NPCSpecialAttacks(const char *parse, int perm);
@@ -549,6 +551,11 @@ public:
void StopTimer(const char* timer_name);
luabind::object GetBuffSpellIDs(lua_State* L);
bool HasSpellEffect(int effect_id);
Lua_Mob_List GetCloseMobList();
Lua_Mob_List GetCloseMobList(float distance);
Lua_Mob_List GetCloseMobList(float distance, bool ignore_self);
std::string GetClassPlural();
std::string GetRacePlural();
};
#endif
+1 -1
View File
@@ -173,7 +173,7 @@ luabind::object Lua_Object::GetEntityVariables(lua_State* L) {
if (d_) {
auto self = reinterpret_cast<NativeType*>(d_);
auto l = self->GetEntityVariables();
auto i = 1;
int i = 1;
for (const auto& v : l) {
t[i] = v;
i++;
+1 -1
View File
@@ -272,7 +272,7 @@ LuaParser::LuaParser() {
PlayerArgumentDispatch[EVENT_EQUIP_ITEM_CLIENT] = handle_player_equip_item;
PlayerArgumentDispatch[EVENT_UNEQUIP_ITEM_CLIENT] = handle_player_equip_item;
PlayerArgumentDispatch[EVENT_SKILL_UP] = handle_player_skill_up;
PlayerArgumentDispatch[EVENT_LANGUAGE_SKILL_UP] = handle_player_skill_up;
PlayerArgumentDispatch[EVENT_LANGUAGE_SKILL_UP] = handle_player_language_skill_up;
PlayerArgumentDispatch[EVENT_ALT_CURRENCY_MERCHANT_BUY] = handle_player_alt_currency_merchant;
PlayerArgumentDispatch[EVENT_ALT_CURRENCY_MERCHANT_SELL] = handle_player_alt_currency_merchant;
PlayerArgumentDispatch[EVENT_MERCHANT_BUY] = handle_player_merchant;

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