mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-30 15:55:45 +00:00
Compare commits
93 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1f25639dd3 | |||
| 2a176835b1 | |||
| fff3e77a6e | |||
| 6efb9ec228 | |||
| a663c822e8 | |||
| cf49b2fe49 | |||
| b45e0e80b5 | |||
| 3200145d01 | |||
| 53563b9720 | |||
| 1e22baf267 | |||
| d99c3145ad | |||
| 57243c6799 | |||
| 1100668f21 | |||
| 0cf454dc29 | |||
| 75391d96f4 | |||
| 81b07a5aa0 | |||
| 774aa99b29 | |||
| 756e835144 | |||
| c5c575b028 | |||
| 152e99444c | |||
| 795df5c597 | |||
| 18eff726d0 | |||
| f06a37a009 | |||
| ae53efc52c | |||
| 548eb65e1d | |||
| fede8760d4 | |||
| 6faa202b57 | |||
| c406710623 | |||
| 662c4012db | |||
| 849e7b910d | |||
| 8e33755f02 | |||
| dfaa929778 | |||
| 306b06745f | |||
| 108fc82ee0 | |||
| 577f61b082 | |||
| a01cf0718d | |||
| 90412ba61b | |||
| 5cbc380c62 | |||
| 6c289a7c71 | |||
| 57335b188f | |||
| 056e429100 | |||
| f548aeddb2 | |||
| 4ff9faa4e6 | |||
| 17fc350d46 | |||
| b18bc66b42 | |||
| 324bfd448e | |||
| 75560ee830 | |||
| 50db7637aa | |||
| 67fdc75df3 | |||
| 9993022418 | |||
| bd95ed44fd | |||
| 65fd323eab | |||
| 290c58741e | |||
| 39d0772a01 | |||
| 622fe50479 | |||
| f41a219309 | |||
| 23bc3c7fd6 | |||
| 3144ac1a28 | |||
| a5106420e8 | |||
| 5a42c4f667 | |||
| a3107cc54d | |||
| f0152cef66 | |||
| 21755a9f9e | |||
| b329515a07 | |||
| ff4b117cfa | |||
| e305ba852b | |||
| b8c91cf4f9 | |||
| cd82bd8472 | |||
| 20bed20f47 | |||
| c93054421f | |||
| b7a1fc6644 | |||
| 6bfb8fca2e | |||
| 9d6a7ad743 | |||
| 076b88be9a | |||
| 84a779c4df | |||
| 3fb479e612 | |||
| c1f4ee0e65 | |||
| 32f7dc3d1b | |||
| fa55fd1664 | |||
| c44c0d4efa | |||
| 50c63b95db | |||
| 612029de6e | |||
| dbc6346fe8 | |||
| 93a4153a4b | |||
| 434f270f68 | |||
| 5ba33b88bd | |||
| ce1de9997b | |||
| 8814ab26cd | |||
| 8c23eee42a | |||
| 5475615448 | |||
| 4a5559022f | |||
| 5be2041085 | |||
| 9f4d60ec36 |
+181
@@ -1,3 +1,184 @@
|
||||
## [22.14.1] - 06/18/2023
|
||||
|
||||
### Backups
|
||||
|
||||
* Move world database:dump to use MySQL credentials file ([#3410](https://github.com/EQEmu/Server/pull/3410)) @Akkadius 2023-06-17
|
||||
|
||||
### Binaries
|
||||
|
||||
* Add support for static linking (portable) binaries ([#3417](https://github.com/EQEmu/Server/pull/3417)) @Akkadius 2023-06-18
|
||||
|
||||
### CI
|
||||
|
||||
* Build static linux binaries ([#3419](https://github.com/EQEmu/Server/pull/3419)) @Akkadius 2023-06-18
|
||||
|
||||
### CLI
|
||||
|
||||
* Add `bots:enable` and `bots:disable` commands ([#3415](https://github.com/EQEmu/Server/pull/3415)) @Akkadius 2023-06-17
|
||||
* Add `mercs:enable` and `mercs:disable` commands ([#3416](https://github.com/EQEmu/Server/pull/3416)) @Akkadius 2023-06-18
|
||||
* Console menu validation fixes ([#3413](https://github.com/EQEmu/Server/pull/3413)) @Akkadius 2023-06-17
|
||||
|
||||
### Database
|
||||
|
||||
* Add query multi statement execution support ([#3414](https://github.com/EQEmu/Server/pull/3414)) @Akkadius 2023-06-17
|
||||
|
||||
### Feature
|
||||
|
||||
* Add Water Line of Sight Checks ([#3408](https://github.com/EQEmu/Server/pull/3408)) @nytmyr 2023-06-17
|
||||
|
||||
### Logging
|
||||
|
||||
* Logging improvements, console silencing, terminal coloring ([#3412](https://github.com/EQEmu/Server/pull/3412)) @Akkadius 2023-06-17
|
||||
|
||||
### Quest API
|
||||
|
||||
* Add convert_money_to_string() to Perl/Lua ([#3418](https://github.com/EQEmu/Server/pull/3418)) @Kinglykrab 2023-06-18
|
||||
|
||||
### Strings
|
||||
|
||||
* Add more test cases for string utils ([#3411](https://github.com/EQEmu/Server/pull/3411)) @Akkadius 2023-06-17
|
||||
|
||||
### Targeting
|
||||
|
||||
* Fix bug when using /tar on invalid target ([#3407](https://github.com/EQEmu/Server/pull/3407)) @noudess 2023-06-17
|
||||
|
||||
### Telnet
|
||||
|
||||
* Add cross zone/world wide cast and move functionality to Telnet ([#3409](https://github.com/EQEmu/Server/pull/3409)) @Kinglykrab 2023-06-17
|
||||
|
||||
## [22.13.1] - 06/13/2023
|
||||
|
||||
### Targeting
|
||||
|
||||
* Revert #3383 ([#3405](https://github.com/EQEmu/Server/pull/3405)) @noudess 2023-06-13
|
||||
|
||||
## [22.13.0] - 06/12/2023
|
||||
|
||||
### Code
|
||||
|
||||
* Add GMFind_Struct to packet structures ([#3402](https://github.com/EQEmu/Server/pull/3402)) @Kinglykrab 2023-06-12
|
||||
* Remove CHECK_LOS_STEP from zone/common.h ([#3398](https://github.com/EQEmu/Server/pull/3398)) @Kinglykrab 2023-06-12
|
||||
* Remove CheckCoordLosNoZLeaps() from zone/entity.cpp and zone/entity.h ([#3384](https://github.com/EQEmu/Server/pull/3384)) @Kinglykrab 2023-06-12
|
||||
* Remove CountTempPets() from zone/entity.cpp and zone/entity.h ([#3390](https://github.com/EQEmu/Server/pull/3390)) @Kinglykrab 2023-06-12
|
||||
* Remove Evade() from zone/entity.cpp and zone/entity.h ([#3394](https://github.com/EQEmu/Server/pull/3394)) @Kinglykrab 2023-06-12
|
||||
* Remove GateAllClients() from zone/entity.cpp and zone/entity.h ([#3391](https://github.com/EQEmu/Server/pull/3391)) @Kinglykrab 2023-06-12
|
||||
* Remove GetClient(ip, port) from zone/entity.h ([#3386](https://github.com/EQEmu/Server/pull/3386)) @Kinglykrab 2023-06-12
|
||||
* Remove GetClientCount() from zone/entity.cpp and zone/entity.h ([#3392](https://github.com/EQEmu/Server/pull/3392)) @Kinglykrab 2023-06-12
|
||||
* Remove GetGroupByBot(), GetRaidByMob(), and GetRaidByLeaderName() from zone/entity.cpp and zone/entity.h ([#3387](https://github.com/EQEmu/Server/pull/3387)) @Kinglykrab 2023-06-12
|
||||
* Remove InteractiveChat() and TakenAction() from zone/npc.h ([#3382](https://github.com/EQEmu/Server/pull/3382)) @Kinglykrab 2023-06-12
|
||||
* Remove LimitCheckBoth() from zone/entity.cpp and zone/entity.h ([#3393](https://github.com/EQEmu/Server/pull/3393)) @Kinglykrab 2023-06-12
|
||||
* Remove NPC::AddCash() from npc.cpp/npc.h ([#3380](https://github.com/EQEmu/Server/pull/3380)) @Kinglykrab 2023-06-09
|
||||
* Remove RemoveMob() and RemoveRaid() from zone/entity.cpp and zone/entity.h ([#3389](https://github.com/EQEmu/Server/pull/3389)) @Kinglykrab 2023-06-12
|
||||
* Remove SPECIALIZE_MANA_REDUCE from zone/common.h ([#3400](https://github.com/EQEmu/Server/pull/3400)) @Kinglykrab 2023-06-12
|
||||
* Remove SendAATimer() from zone/entity.h ([#3388](https://github.com/EQEmu/Server/pull/3388)) @Kinglykrab 2023-06-12
|
||||
* Remove WriteEntityIDs() from zone/entity.cpp and zone/entity.h ([#3395](https://github.com/EQEmu/Server/pull/3395)) @Kinglykrab 2023-06-12
|
||||
* Remove _BECOMENPCPET() and _NPCPET() from zone/common.h ([#3399](https://github.com/EQEmu/Server/pull/3399)) @Kinglykrab 2023-06-12
|
||||
* Remove pDBAsyncWorkID from zone/entity.h ([#3385](https://github.com/EQEmu/Server/pull/3385)) @Kinglykrab 2023-06-12
|
||||
* Remove struct DynamicZoneSafeReturn from zone/entity.h ([#3396](https://github.com/EQEmu/Server/pull/3396)) @Kinglykrab 2023-06-12
|
||||
* Remove struct TradeEntity from zone/common.h ([#3397](https://github.com/EQEmu/Server/pull/3397)) @Kinglykrab 2023-06-12
|
||||
|
||||
### Commands
|
||||
|
||||
* Assign #opcode to a #reload alias ([#3401](https://github.com/EQEmu/Server/pull/3401)) @Kinglykrab 2023-06-12
|
||||
|
||||
### Illusions
|
||||
|
||||
* RandomizeFeatures and SetGender were killing db texture ([#3376](https://github.com/EQEmu/Server/pull/3376)) @noudess 2023-06-06
|
||||
|
||||
### Logging
|
||||
|
||||
* Fixed statements that logged incorrect data ([#3381](https://github.com/EQEmu/Server/pull/3381)) @noudess 2023-06-07
|
||||
|
||||
### Quest API
|
||||
|
||||
* Add GetEXPForLevel() to Perl/Lua ([#3403](https://github.com/EQEmu/Server/pull/3403)) @Kinglykrab 2023-06-12
|
||||
* Add SendChannelMessage() to Perl/Lua ([#3378](https://github.com/EQEmu/Server/pull/3378)) @Kinglykrab 2023-06-04
|
||||
* Add several spell methods to Perl/Lua ([#3379](https://github.com/EQEmu/Server/pull/3379)) @Kinglykrab 2023-06-12
|
||||
|
||||
### Targeting
|
||||
|
||||
* /tar <bad target> should not untarget existing target ([#3383](https://github.com/EQEmu/Server/pull/3383)) @noudess 2023-06-12
|
||||
|
||||
## [22.12.0] - 05/29/2023
|
||||
|
||||
### Code
|
||||
|
||||
* Cleanup #setskill and #setskillall Commands ([#3367](https://github.com/EQEmu/Server/pull/3367)) @Kinglykrab 2023-05-25
|
||||
* Delete message.h ([#3348](https://github.com/EQEmu/Server/pull/3348)) @Kinglykrab 2023-05-17
|
||||
* Fix #spawn command NPCs having 0 health ([#3371](https://github.com/EQEmu/Server/pull/3371)) @Kinglykrab 2023-05-21
|
||||
* Remove CalcPetHp from spdat.h ([#3364](https://github.com/EQEmu/Server/pull/3364)) @Kinglykrab 2023-05-25
|
||||
* Remove CountNPC() and QueueManaged() from entity.cpp/entity.h ([#3346](https://github.com/EQEmu/Server/pull/3346)) @Kinglykrab 2023-05-17
|
||||
* Remove DumpMerchantList() from zone.cpp/zone.h ([#3343](https://github.com/EQEmu/Server/pull/3343)) @Kinglykrab 2023-05-17
|
||||
* Remove GetDamageReceived() and GetHealReceived() from combat_record.cpp/combat_record.h ([#3358](https://github.com/EQEmu/Server/pull/3358)) @Kinglykrab 2023-05-17
|
||||
* Remove GetEscapingEntOnHateList() from hate_list.cpp/hate_list.h ([#3353](https://github.com/EQEmu/Server/pull/3353)) @Kinglykrab 2023-05-17
|
||||
* Remove GetMaxRank() from aa_ability.cpp/aa_ability.h ([#3347](https://github.com/EQEmu/Server/pull/3347)) @Kinglykrab 2023-05-25
|
||||
* Remove IsEntityInFrenzyMode() from hate_list.cpp/hate_list.h ([#3352](https://github.com/EQEmu/Server/pull/3352)) @Kinglykrab 2023-05-17
|
||||
* Remove IsRaid() from raids.h ([#3361](https://github.com/EQEmu/Server/pull/3361)) @Kinglykrab 2023-05-25
|
||||
* Remove LoadSpawn2() and PopulateZoneSpawnListClose() from spawn2.cpp/zonedb.h ([#3344](https://github.com/EQEmu/Server/pull/3344)) @Kinglykrab 2023-05-25
|
||||
* Remove SetGraveyard() from zone.cpp/zone.h ([#3354](https://github.com/EQEmu/Server/pull/3354)) @Kinglykrab 2023-05-17
|
||||
* Remove SetTradeCash() from trading.cpp/common.h ([#3356](https://github.com/EQEmu/Server/pull/3356)) @Kinglykrab 2023-05-17
|
||||
* Remove TraderUpdate() from trading.cpp/client.h ([#3357](https://github.com/EQEmu/Server/pull/3357)) @Kinglykrab 2023-05-17
|
||||
* Remove TypeToSkill() from tradeskills.cpp/object.h ([#3355](https://github.com/EQEmu/Server/pull/3355)) @Kinglykrab 2023-05-17
|
||||
* Remove Z_AGGRO from spdat.h ([#3365](https://github.com/EQEmu/Server/pull/3365)) @Kinglykrab 2023-05-25
|
||||
* Remove numMembers from raids.h ([#3362](https://github.com/EQEmu/Server/pull/3362)) @Kinglykrab 2023-05-25
|
||||
* Set GetAugmentType() to int again ([#3335](https://github.com/EQEmu/Server/pull/3335)) @Kinglykrab 2023-05-08
|
||||
|
||||
### Commands
|
||||
|
||||
* Add #findcurrency Command ([#3368](https://github.com/EQEmu/Server/pull/3368)) @Kinglykrab 2023-05-25
|
||||
* Add entity variable command ([#3345](https://github.com/EQEmu/Server/pull/3345)) @Kinglykrab 2023-05-25
|
||||
* Cleanup #setanim ([#3350](https://github.com/EQEmu/Server/pull/3350)) @Kinglykrab 2023-05-25
|
||||
|
||||
### Feature
|
||||
|
||||
* Intoxication setter/getter for source, getter for Perl/Lua ([#3330](https://github.com/EQEmu/Server/pull/3330)) @JasXSL 2023-05-03
|
||||
|
||||
### Fixes
|
||||
|
||||
* #augmentitem bypasses augment restrictions ([#3332](https://github.com/EQEmu/Server/pull/3332)) @Kinglykrab 2023-05-07
|
||||
* Fix Heroic INT/WIS Bonuses ([#3341](https://github.com/EQEmu/Server/pull/3341)) @RekkasGit 2023-05-15
|
||||
* Fix duplicate messages in #npcedit ([#3372](https://github.com/EQEmu/Server/pull/3372)) @Kinglykrab 2023-05-21
|
||||
* Fix issue with Group Pointers/Member roles ([#3374](https://github.com/EQEmu/Server/pull/3374)) @Aeadoin 2023-05-25
|
||||
* Fix mob item bonus calc ([#3334](https://github.com/EQEmu/Server/pull/3334)) @Akkadius 2023-05-07
|
||||
* Fix typos in #zheader ([#3370](https://github.com/EQEmu/Server/pull/3370)) @Kinglykrab 2023-05-21
|
||||
* Mob scaling issue with min dmg set to zero while max dmg is not ([#3351](https://github.com/EQEmu/Server/pull/3351)) @RekkasGit 2023-05-20
|
||||
* NPC Armor Upgrade to a slot not handled correctly ([#3366](https://github.com/EQEmu/Server/pull/3366)) @noudess 2023-05-20
|
||||
* ReloadQuests() on Zone::Init() to avoid cached global quests/plugins ([#3333](https://github.com/EQEmu/Server/pull/3333)) @Kinglykrab 2023-05-07
|
||||
* Revert " ReloadQuests() on Zone::Init() to avoid cached global quests/plugins " ([#3333](https://github.com/EQEmu/Server/pull/3333)) @Akkadius 2023-05-08
|
||||
|
||||
### Memory Leak
|
||||
|
||||
* Fix large memory leak introduced in CalcItemBonuses ([#3331](https://github.com/EQEmu/Server/pull/3331)) @Akkadius 2023-05-07
|
||||
|
||||
### Messages
|
||||
|
||||
* Remove duplicate heal message for healing yourself ([#3329](https://github.com/EQEmu/Server/pull/3329)) @noudess 2023-05-03
|
||||
|
||||
### Performance
|
||||
|
||||
* Character bind is now bulk saved ([#3338](https://github.com/EQEmu/Server/pull/3338)) @Akkadius 2023-05-09
|
||||
* Character buffs now save in bulk ([#3336](https://github.com/EQEmu/Server/pull/3336)) @Akkadius 2023-05-09
|
||||
* Character pet bulk saving ([#3337](https://github.com/EQEmu/Server/pull/3337)) @Akkadius 2023-05-09
|
||||
* Character tribute is now bulk saved ([#3340](https://github.com/EQEmu/Server/pull/3340)) @Kinglykrab 2023-05-25
|
||||
* Mail key is now cached during player load ([#3339](https://github.com/EQEmu/Server/pull/3339)) @Akkadius 2023-05-09
|
||||
|
||||
### Pets
|
||||
|
||||
* Fix saving inconsistencies with pets ([#3375](https://github.com/EQEmu/Server/pull/3375)) @Akkadius 2023-05-25
|
||||
|
||||
### Quest API
|
||||
|
||||
* Add GetHateListClosest(), GetHateListClosestBot(), GetHateListClosestClient(), and GetHateListClosestNPC() methods/overloads to Perl/Lua ([#3359](https://github.com/EQEmu/Server/pull/3359)) @RekkasGit 2023-05-16
|
||||
* Add GetPet() to Perl ([#3309](https://github.com/EQEmu/Server/pull/3309)) @Kinglykrab 2023-05-08
|
||||
* Add Memorize and Scribe Spell Events to Perl/Lua ([#3363](https://github.com/EQEmu/Server/pull/3363)) @Kinglykrab 2023-05-25
|
||||
* Add zone data methods to Perl/Lua ([#3342](https://github.com/EQEmu/Server/pull/3342)) @Kinglykrab 2023-05-24
|
||||
* Cleanup The Darkened Sea Quest Methods Names ([#3369](https://github.com/EQEmu/Server/pull/3369)) @Kinglykrab 2023-05-21
|
||||
|
||||
### Rules
|
||||
|
||||
* Add World:MaximumQuestErrors Rule ([#3349](https://github.com/EQEmu/Server/pull/3349)) @Kinglykrab 2023-05-21
|
||||
* ResurrectionEffectBlock to prevent/allow/move buffs. ([#3288](https://github.com/EQEmu/Server/pull/3288)) @nytmyr 2023-05-08
|
||||
|
||||
## [22.11.0] - 04/29/2023
|
||||
|
||||
### Code
|
||||
|
||||
@@ -16,6 +16,15 @@ SET(CMAKE_CXX_STANDARD 20)
|
||||
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
SET(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
OPTION(EQEMU_BUILD_STATIC "Build with static linking" OFF)
|
||||
|
||||
IF (EQEMU_BUILD_STATIC)
|
||||
SET(BUILD_SHARED_LIBS OFF)
|
||||
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".a")
|
||||
MESSAGE(STATUS "Building with static linking")
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
|
||||
ENDIF(EQEMU_BUILD_STATIC)
|
||||
|
||||
IF(MSVC)
|
||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
|
||||
ADD_DEFINITIONS(-DNOMINMAX)
|
||||
@@ -307,6 +316,10 @@ ELSE()
|
||||
SET(ZLIB_LIBRARY_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/libs/zlibng")
|
||||
ENDIF()
|
||||
|
||||
IF (EQEMU_BUILD_STATIC)
|
||||
SET(ZLIB_LIBRARY_LIBS libz.a)
|
||||
ENDIF(EQEMU_BUILD_STATIC)
|
||||
|
||||
MESSAGE(STATUS "")
|
||||
MESSAGE(STATUS "**************************************************")
|
||||
MESSAGE(STATUS "* Library Usage *")
|
||||
|
||||
@@ -630,6 +630,20 @@ bool IsINTCasterClass(uint8 class_id)
|
||||
}
|
||||
}
|
||||
|
||||
bool IsHeroicINTCasterClass(uint8 class_id)
|
||||
{
|
||||
switch (class_id) {
|
||||
case NECROMANCER:
|
||||
case WIZARD:
|
||||
case MAGICIAN:
|
||||
case ENCHANTER:
|
||||
case SHADOWKNIGHT:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool IsWISCasterClass(uint8 class_id)
|
||||
{
|
||||
switch (class_id) {
|
||||
@@ -642,6 +656,21 @@ bool IsWISCasterClass(uint8 class_id)
|
||||
}
|
||||
}
|
||||
|
||||
bool IsHeroicWISCasterClass(uint8 class_id)
|
||||
{
|
||||
switch (class_id) {
|
||||
case CLERIC:
|
||||
case DRUID:
|
||||
case SHAMAN:
|
||||
case PALADIN:
|
||||
case BEASTLORD:
|
||||
case RANGER:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool IsPlateClass(uint8 class_id)
|
||||
{
|
||||
switch (class_id) {
|
||||
|
||||
+2
-1
@@ -140,7 +140,8 @@ bool IsHybridClass(uint8 class_id);
|
||||
bool IsCasterClass(uint8 class_id);
|
||||
bool IsINTCasterClass(uint8 class_id);
|
||||
bool IsWISCasterClass(uint8 class_id);
|
||||
|
||||
bool IsHeroicINTCasterClass(uint8 class_id);
|
||||
bool IsHeroicWISCasterClass(uint8 class_id);
|
||||
bool IsPlateClass(uint8 class_id);
|
||||
bool IsChainClass(uint8 class_id);
|
||||
bool IsLeatherClass(uint8 class_id);
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace EQEmuCommand {
|
||||
index++;
|
||||
}
|
||||
|
||||
if (!arguments_filled || argc == 2 || cmd[{"-h", "--help"}]) {
|
||||
if (!arguments_filled || (argc == 2 && !cmd[{"-h", "--help"}]) || (argc == 3 && cmd[{"-h", "--help"}])) {
|
||||
std::string arguments_string;
|
||||
for (auto &arg : arguments) {
|
||||
arguments_string += " " + arg;
|
||||
|
||||
@@ -2408,3 +2408,55 @@ uint8 Database::GetMinStatus(uint32 zone_id, uint32 instance_version)
|
||||
|
||||
return !zones.empty() ? zones[0].min_status : 0;
|
||||
}
|
||||
|
||||
void Database::SourceSqlFromUrl(std::string url)
|
||||
{
|
||||
try {
|
||||
uri request_uri(url);
|
||||
|
||||
LogHTTPDetail(
|
||||
"parsing url [{}] path [{}] host [{}] query_string [{}] protocol [{}] port [{}]",
|
||||
url,
|
||||
request_uri.get_path(),
|
||||
request_uri.get_host(),
|
||||
request_uri.get_query(),
|
||||
request_uri.get_scheme(),
|
||||
request_uri.get_port()
|
||||
);
|
||||
|
||||
LogInfo("Downloading and installing from [{}]", url);
|
||||
|
||||
// http get request
|
||||
httplib::Client cli(
|
||||
fmt::format(
|
||||
"{}://{}",
|
||||
request_uri.get_scheme(),
|
||||
request_uri.get_host()
|
||||
)
|
||||
);
|
||||
|
||||
cli.set_connection_timeout(0, 60000000); // 60 sec
|
||||
cli.set_read_timeout(60, 0); // 60 seconds
|
||||
cli.set_write_timeout(60, 0); // 60 seconds
|
||||
|
||||
if (auto res = cli.Get(request_uri.get_path())) {
|
||||
if (res->status == 200) {
|
||||
auto results = QueryDatabaseMulti(res->body);
|
||||
if (!results.ErrorMessage().empty()) {
|
||||
LogError("Error sourcing SQL [{}]", results.ErrorMessage());
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (res->status == 404) {
|
||||
LogError("Error retrieving URL [{}]", url);
|
||||
}
|
||||
}
|
||||
else {
|
||||
LogError("Error retrieving URL [{}]", url);
|
||||
}
|
||||
|
||||
}
|
||||
catch (std::invalid_argument iae) {
|
||||
LogError("URI parser error [{}]", iae.what());
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -263,7 +263,7 @@ public:
|
||||
void ClearInvSnapshots(bool from_now = false);
|
||||
|
||||
void SourceDatabaseTableFromUrl(std::string table_name, std::string url);
|
||||
|
||||
void SourceSqlFromUrl(std::string url);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -93,6 +93,8 @@ std::string DatabaseDumpService::GetMySQLVersion()
|
||||
return Strings::Trim(version_output);
|
||||
}
|
||||
|
||||
const std::string CREDENTIALS_FILE = "login.my.cnf";
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
@@ -101,21 +103,15 @@ std::string DatabaseDumpService::GetBaseMySQLDumpCommand()
|
||||
auto config = EQEmuConfig::get();
|
||||
if (IsDumpContentTables() && !config->ContentDbHost.empty()) {
|
||||
return fmt::format(
|
||||
"mysqldump -u {} -p{} -h {} --port={} {}",
|
||||
config->ContentDbUsername,
|
||||
config->ContentDbPassword,
|
||||
config->ContentDbHost,
|
||||
config->ContentDbPort,
|
||||
"mysqldump --defaults-extra-file={} {}",
|
||||
CREDENTIALS_FILE,
|
||||
config->ContentDbName
|
||||
);
|
||||
};
|
||||
|
||||
return fmt::format(
|
||||
"mysqldump -u {} -p{} -h {} --port={} {}",
|
||||
config->DatabaseUsername,
|
||||
config->DatabasePassword,
|
||||
config->DatabaseHost,
|
||||
config->DatabasePort,
|
||||
"mysqldump --defaults-extra-file={} {}",
|
||||
CREDENTIALS_FILE,
|
||||
config->DatabaseDB
|
||||
);
|
||||
}
|
||||
@@ -309,6 +305,8 @@ void DatabaseDumpService::DatabaseDump()
|
||||
if (tables_to_dump.empty()) {
|
||||
std::cerr << "No tables were specified" << std::endl;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
else {
|
||||
const auto execute_command = fmt::format(
|
||||
@@ -319,13 +317,14 @@ void DatabaseDumpService::DatabaseDump()
|
||||
pipe_file
|
||||
);
|
||||
|
||||
BuildCredentialsFile();
|
||||
std::string execution_result = Process::execute(execute_command);
|
||||
if (!execution_result.empty() && IsDumpOutputToConsole()) {
|
||||
std::cout << execution_result;
|
||||
}
|
||||
}
|
||||
|
||||
LogSys.EnableConsoleLogging();
|
||||
LogSys.LoadLogSettingsDefaults();
|
||||
|
||||
if (!pipe_file.empty()) {
|
||||
std::string file = fmt::format("{}.sql", GetDumpFileNameWithPath());
|
||||
@@ -350,10 +349,9 @@ void DatabaseDumpService::DatabaseDump()
|
||||
}
|
||||
|
||||
LogInfo("Database dump created at [{}.sql]", GetDumpFileNameWithPath());
|
||||
|
||||
if (IsDumpWithCompression() && !IsDumpOutputToConsole()) {
|
||||
if (HasCompressionBinary()) {
|
||||
LogInfo("Compression requested... Compressing dump [{}.sql]", GetDumpFileNameWithPath());
|
||||
LogInfo("Compression requested. Compressing dump [{}.sql]", GetDumpFileNameWithPath());
|
||||
|
||||
if (IsTarAvailable()) {
|
||||
Process::execute(
|
||||
@@ -387,6 +385,8 @@ void DatabaseDumpService::DatabaseDump()
|
||||
}
|
||||
}
|
||||
|
||||
RemoveCredentialsFile();
|
||||
|
||||
// LogDebug("[{}] dump-to-console", IsDumpOutputToConsole());
|
||||
// LogDebug("[{}] dump-path", GetSetDumpPath());
|
||||
// LogDebug("[{}] compression", (IsDumpWithCompression() ? "true" : "false"));
|
||||
@@ -566,4 +566,41 @@ void DatabaseDumpService::RemoveSqlBackup()
|
||||
if (File::Exists(file)) {
|
||||
std::filesystem::remove(file);
|
||||
}
|
||||
|
||||
RemoveCredentialsFile();
|
||||
}
|
||||
|
||||
void DatabaseDumpService::BuildCredentialsFile()
|
||||
{
|
||||
auto config = EQEmuConfig::get();
|
||||
std::ofstream out(CREDENTIALS_FILE);
|
||||
if (out.is_open()) {
|
||||
if (IsDumpContentTables() && !config->ContentDbHost.empty()) {
|
||||
out << "[mysqldump]" << std::endl;
|
||||
out << "user=" << config->ContentDbUsername << std::endl;
|
||||
out << "password=" << config->ContentDbPassword << std::endl;
|
||||
out << "host=" << config->ContentDbHost << std::endl;
|
||||
out << "port=" << config->ContentDbPort << std::endl;
|
||||
out << "default-character-set=utf8" << std::endl;
|
||||
}
|
||||
else {
|
||||
out << "[mysqldump]" << std::endl;
|
||||
out << "user=" << config->DatabaseUsername << std::endl;
|
||||
out << "password=" << config->DatabasePassword << std::endl;
|
||||
out << "host=" << config->DatabaseHost << std::endl;
|
||||
out << "port=" << config->DatabasePort << std::endl;
|
||||
out << "default-character-set=utf8" << std::endl;
|
||||
}
|
||||
out.close();
|
||||
}
|
||||
else {
|
||||
LogError("Failed to open credentials file for writing");
|
||||
}
|
||||
}
|
||||
|
||||
void DatabaseDumpService::RemoveCredentialsFile()
|
||||
{
|
||||
if (File::Exists(CREDENTIALS_FILE)) {
|
||||
std::filesystem::remove(CREDENTIALS_FILE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,6 +93,8 @@ private:
|
||||
std::string GetSetDumpPath();
|
||||
std::string GetQueryServTables();
|
||||
void RemoveSqlBackup();
|
||||
void BuildCredentialsFile();
|
||||
void RemoveCredentialsFile();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace DatabaseSchema {
|
||||
{"character_spells", "id"},
|
||||
{"character_task_timers", "character_id"},
|
||||
{"character_tasks", "charid"},
|
||||
{"character_tribute", "id"},
|
||||
{"character_tribute", "character_id"},
|
||||
{"completed_tasks", "charid"},
|
||||
{"data_buckets", "id"},
|
||||
{"faction_values", "char_id"},
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <iostream>
|
||||
#include <mysqld_error.h>
|
||||
#include <string.h>
|
||||
#include "strings.h"
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#define snprintf _snprintf
|
||||
@@ -305,3 +306,92 @@ void DBcore::SetMutex(Mutex *mutex)
|
||||
|
||||
DBcore::m_mutex = mutex;
|
||||
}
|
||||
|
||||
// executes multiple statements in one query
|
||||
// do not use this in application logic
|
||||
// this was built and maintained for database migrations only
|
||||
MySQLRequestResult DBcore::QueryDatabaseMulti(const std::string &query)
|
||||
{
|
||||
SetMultiStatementsOn();
|
||||
|
||||
BenchTimer timer;
|
||||
timer.reset();
|
||||
|
||||
LockMutex lock(m_mutex);
|
||||
|
||||
// Reconnect if we are not connected before hand.
|
||||
if (pStatus != Connected) {
|
||||
Open();
|
||||
}
|
||||
|
||||
int status = mysql_real_query(mysql, query.c_str(), query.length());
|
||||
if (status != 0) {
|
||||
unsigned int error_number = mysql_errno(mysql);
|
||||
|
||||
if (error_number == CR_SERVER_GONE_ERROR) {
|
||||
pStatus = Error;
|
||||
}
|
||||
|
||||
// error logging
|
||||
if (mysql_errno(mysql) > 0 && query.length() > 0 && mysql_errno(mysql) != 1065) {
|
||||
std::string error_raw = fmt::format("{}", mysql_error(mysql));
|
||||
std::string mysql_err = Strings::Trim(error_raw);
|
||||
std::string clean_query = Strings::Replace(query, "\n", "");
|
||||
LogMySQLQuery("[{}] ({}) query [{}]", mysql_err, mysql_errno(mysql), clean_query);
|
||||
}
|
||||
}
|
||||
|
||||
auto result = MySQLRequestResult{};
|
||||
|
||||
int index = 0;
|
||||
|
||||
// there could be a query with a semicolon in the actual data, this is best effort for
|
||||
// logging / display purposes
|
||||
// rare that we see this when this is only used in DDL statements
|
||||
auto pieces = Strings::Split(query, ";");
|
||||
|
||||
// process each statement result
|
||||
do {
|
||||
uint32 row_count = 0;
|
||||
MYSQL_RES *res = mysql_store_result(mysql);
|
||||
|
||||
result = MySQLRequestResult(
|
||||
res,
|
||||
(uint32) mysql_affected_rows(mysql),
|
||||
row_count,
|
||||
(uint32) mysql_field_count(mysql),
|
||||
(uint32) mysql_insert_id(mysql)
|
||||
);
|
||||
|
||||
if (pieces.size() >= index) {
|
||||
auto piece = pieces[index];
|
||||
LogMySQLQuery(
|
||||
"{} -- ({} row{} affected) ({}s)",
|
||||
piece,
|
||||
result.RowsAffected(),
|
||||
result.RowsAffected() == 1 ? "" : "s",
|
||||
std::to_string(timer.elapsed())
|
||||
);
|
||||
}
|
||||
|
||||
if (res) {
|
||||
row_count = (uint32) mysql_num_rows(res);
|
||||
mysql_free_result(res);
|
||||
}
|
||||
|
||||
// more results? -1 = no, >0 = error, 0 = yes (keep looping)
|
||||
if ((status = mysql_next_result(mysql)) > 0) {
|
||||
if (mysql_errno(mysql) > 0) {
|
||||
LogMySQLError("[{}] [{}]", mysql_errno(mysql), mysql_error(mysql));
|
||||
}
|
||||
|
||||
// we handle errors elsewhere
|
||||
return result;
|
||||
}
|
||||
index++;
|
||||
} while (status == 0);
|
||||
|
||||
SetMultiStatementsOff();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
+14
-1
@@ -25,6 +25,7 @@ public:
|
||||
eStatus GetStatus() { return pStatus; }
|
||||
MySQLRequestResult QueryDatabase(const char *query, uint32 querylen, bool retryOnFailureOnce = true);
|
||||
MySQLRequestResult QueryDatabase(const std::string& query, bool retryOnFailureOnce = true);
|
||||
MySQLRequestResult QueryDatabaseMulti(const std::string &query);
|
||||
void TransactionBegin();
|
||||
void TransactionCommit();
|
||||
void TransactionRollback();
|
||||
@@ -77,8 +78,20 @@ private:
|
||||
uint32 pPort;
|
||||
bool pSSL;
|
||||
|
||||
// allows multiple queries to be executed within the same query
|
||||
// do not use this under normal operation
|
||||
// we use this during database migrations only currently
|
||||
void SetMultiStatementsOn()
|
||||
{
|
||||
mysql_set_server_option(mysql, MYSQL_OPTION_MULTI_STATEMENTS_ON);
|
||||
}
|
||||
|
||||
// disables multiple statements to be executed in one query
|
||||
void SetMultiStatementsOff()
|
||||
{
|
||||
mysql_set_server_option(mysql, MYSQL_OPTION_MULTI_STATEMENTS_OFF);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1045,4 +1045,11 @@ enum ResurrectionActions
|
||||
Accept
|
||||
};
|
||||
|
||||
enum ScribeSpellActions
|
||||
{
|
||||
Scribe,
|
||||
Memorize,
|
||||
Unmemorize
|
||||
};
|
||||
|
||||
#endif /*COMMON_EQ_CONSTANTS_H*/
|
||||
|
||||
@@ -1793,6 +1793,17 @@ struct GMSummon_Struct {
|
||||
/*104*/ uint32 unknown2; // E0 E0 56 00
|
||||
};
|
||||
|
||||
struct GMFind_Struct {
|
||||
char charname[64];
|
||||
char gmname[64];
|
||||
uint32 success;
|
||||
uint32 zoneID;
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
uint32 unknown2;
|
||||
};
|
||||
|
||||
struct GMGoto_Struct { // x,y is swapped as compared to summon and makes sense as own packet
|
||||
/* 0*/ char charname[64];
|
||||
|
||||
|
||||
+90
-21
@@ -104,9 +104,9 @@ EQEmuLogSys *EQEmuLogSys::LoadLogSettingsDefaults()
|
||||
/**
|
||||
* RFC 5424
|
||||
*/
|
||||
log_settings[Logs::Error].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::Warning].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::Info].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::Error].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::Warning].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::Info].log_to_console = static_cast<uint8>(Logs::General);
|
||||
|
||||
/**
|
||||
* Set Category enabled status on defaults
|
||||
@@ -219,7 +219,7 @@ void EQEmuLogSys::ProcessConsoleMessage(
|
||||
int line
|
||||
)
|
||||
{
|
||||
bool is_error = (
|
||||
bool is_error = (
|
||||
log_category == Logs::LogCategory::Error ||
|
||||
log_category == Logs::LogCategory::MySQLError ||
|
||||
log_category == Logs::LogCategory::Crash ||
|
||||
@@ -261,7 +261,7 @@ void EQEmuLogSys::ProcessConsoleMessage(
|
||||
}
|
||||
|
||||
if (log_category == Logs::LogCategory::MySQLQuery) {
|
||||
auto s = Strings::Split(message, "--");
|
||||
auto s = Strings::Split(message, "--");
|
||||
if (s.size() > 1) {
|
||||
std::string query = Strings::Trim(s[0]);
|
||||
std::string meta = Strings::Trim(s[1]);
|
||||
@@ -297,19 +297,76 @@ void EQEmuLogSys::ProcessConsoleMessage(
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_upper) {
|
||||
(!is_error ? std::cout : std::cerr)
|
||||
<< rang::fgB::gray
|
||||
<< "["
|
||||
<< rang::style::bold
|
||||
<< rang::fgB::yellow
|
||||
<< e
|
||||
<< rang::fgB::gray
|
||||
<< "] "
|
||||
;
|
||||
// color matching in []
|
||||
// ex: [<red>variable] would produce [variable] with red inside brackets
|
||||
std::map<std::string, rang::fgB> colors = {
|
||||
{"<black>", rang::fgB::black},
|
||||
{"<green>", rang::fgB::green},
|
||||
{"<yellow>", rang::fgB::yellow},
|
||||
{"<blue>", rang::fgB::blue},
|
||||
{"<magenta>", rang::fgB::magenta},
|
||||
{"<cyan>", rang::fgB::cyan},
|
||||
{"<gray>", rang::fgB::gray},
|
||||
{"<red>", rang::fgB::red},
|
||||
};
|
||||
|
||||
bool match_color = false;
|
||||
for (auto &c: colors) {
|
||||
if (Strings::Contains(e, c.first)) {
|
||||
e = Strings::Replace(e, c.first, "");
|
||||
(!is_error ? std::cout : std::cerr)
|
||||
<< rang::fgB::gray
|
||||
<< "["
|
||||
<< rang::style::bold
|
||||
<< c.second
|
||||
<< e
|
||||
<< rang::style::reset
|
||||
<< rang::fgB::gray
|
||||
<< "] ";
|
||||
match_color = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
(!is_error ? std::cout : std::cerr) << rang::fgB::gray << "[" << e << "] ";
|
||||
|
||||
// string match to colors
|
||||
std::map<std::string, rang::fgB> matches = {
|
||||
{"missing", rang::fgB::red},
|
||||
{"error", rang::fgB::red},
|
||||
{"ok", rang::fgB::green},
|
||||
};
|
||||
|
||||
for (auto &c: matches) {
|
||||
if (Strings::Contains(e, c.first)) {
|
||||
(!is_error ? std::cout : std::cerr)
|
||||
<< rang::fgB::gray
|
||||
<< "["
|
||||
<< rang::style::bold
|
||||
<< c.second
|
||||
<< e
|
||||
<< rang::style::reset
|
||||
<< rang::fgB::gray
|
||||
<< "] ";
|
||||
match_color = true;
|
||||
}
|
||||
}
|
||||
|
||||
// if we don't match a color in either the string matching or
|
||||
// the color tag matching, we default to yellow inside brackets
|
||||
// if uppercase, does not get colored
|
||||
if (!match_color) {
|
||||
if (!is_upper) {
|
||||
(!is_error ? std::cout : std::cerr)
|
||||
<< rang::fgB::gray
|
||||
<< "["
|
||||
<< rang::style::bold
|
||||
<< rang::fgB::yellow
|
||||
<< e
|
||||
<< rang::style::reset
|
||||
<< rang::fgB::gray
|
||||
<< "] ";
|
||||
}
|
||||
else {
|
||||
(!is_error ? std::cout : std::cerr) << rang::fgB::gray << "[" << e << "] ";
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -523,6 +580,8 @@ void EQEmuLogSys::StartFileLogs(const std::string &log_name)
|
||||
*/
|
||||
void EQEmuLogSys::SilenceConsoleLogging()
|
||||
{
|
||||
std::copy(std::begin(log_settings), std::end(log_settings), std::begin(pre_silence_settings));
|
||||
|
||||
for (int log_index = Logs::AA; log_index != Logs::MaxCategoryID; log_index++) {
|
||||
log_settings[log_index].log_to_console = 0;
|
||||
log_settings[log_index].is_category_enabled = 0;
|
||||
@@ -536,10 +595,7 @@ void EQEmuLogSys::SilenceConsoleLogging()
|
||||
*/
|
||||
void EQEmuLogSys::EnableConsoleLogging()
|
||||
{
|
||||
for (int log_index = Logs::AA; log_index != Logs::MaxCategoryID; log_index++) {
|
||||
log_settings[log_index].log_to_console = Logs::General;
|
||||
log_settings[log_index].is_category_enabled = 1;
|
||||
}
|
||||
std::copy(std::begin(pre_silence_settings), std::end(pre_silence_settings), std::begin(log_settings));
|
||||
}
|
||||
|
||||
EQEmuLogSys *EQEmuLogSys::LoadLogDatabaseSettings()
|
||||
@@ -741,3 +797,16 @@ EQEmuLogSys *EQEmuLogSys::SetLogPath(const std::string &log_path)
|
||||
return this;
|
||||
}
|
||||
|
||||
void EQEmuLogSys::DisableMySQLErrorLogs()
|
||||
{
|
||||
log_settings[Logs::MySQLError].log_to_file = 0;
|
||||
log_settings[Logs::MySQLError].log_to_console = 0;
|
||||
log_settings[Logs::MySQLError].log_to_gmsay = 0;
|
||||
}
|
||||
|
||||
void EQEmuLogSys::EnableMySQLErrorLogs()
|
||||
{
|
||||
log_settings[Logs::MySQLError].log_to_file = 1;
|
||||
log_settings[Logs::MySQLError].log_to_console = 1;
|
||||
log_settings[Logs::MySQLError].log_to_gmsay = 1;
|
||||
}
|
||||
|
||||
@@ -324,6 +324,9 @@ public:
|
||||
*/
|
||||
LogSettings log_settings[Logs::LogCategory::MaxCategoryID]{};
|
||||
|
||||
// temporary bucket to re-load after silencing
|
||||
LogSettings pre_silence_settings[Logs::LogCategory::MaxCategoryID]{};
|
||||
|
||||
struct LogEnabled {
|
||||
bool log_to_file_enabled;
|
||||
bool log_to_console_enabled;
|
||||
@@ -374,6 +377,9 @@ public:
|
||||
[[nodiscard]] const std::string &GetLogPath() const;
|
||||
EQEmuLogSys * SetLogPath(const std::string &log_path);
|
||||
|
||||
void DisableMySQLErrorLogs();
|
||||
void EnableMySQLErrorLogs();
|
||||
|
||||
private:
|
||||
|
||||
// reference to database
|
||||
|
||||
@@ -108,7 +108,8 @@ namespace EQ
|
||||
bool AvailableWearSlot(uint32 aug_wear_slots) const;
|
||||
int8 AvailableAugmentSlot(int32 augment_type) const;
|
||||
bool IsAugmentSlotAvailable(int32 augment_type, uint8 slot) const;
|
||||
inline int32 GetAugmentType() const { return ((m_item) ? m_item->AugType : 0); }
|
||||
inline int GetAugmentType() const { return m_item ? m_item->AugType : 0; }
|
||||
inline uint32 GetAugmentRestriction() const { return m_item ? m_item->AugRestrict : 0; }
|
||||
|
||||
inline bool IsExpendable() const { return ((m_item) ? ((m_item->Click.Type == item::ItemEffectExpendable) || (m_item->ItemType == item::ItemTypePotion)) : false); }
|
||||
|
||||
|
||||
@@ -0,0 +1,354 @@
|
||||
/**
|
||||
* DO NOT MODIFY THIS FILE
|
||||
*
|
||||
* This repository was automatically generated and is NOT to be modified directly.
|
||||
* Any repository modifications are meant to be made to the repository extending the base.
|
||||
* Any modifications to base repositories are to be made by the generator only
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_CHARACTER_TRIBUTE_REPOSITORY_H
|
||||
#define EQEMU_BASE_CHARACTER_TRIBUTE_REPOSITORY_H
|
||||
|
||||
#include "../../database.h"
|
||||
#include "../../strings.h"
|
||||
#include <ctime>
|
||||
|
||||
|
||||
class BaseCharacterTributeRepository {
|
||||
public:
|
||||
struct CharacterTribute {
|
||||
int32_t id;
|
||||
uint32_t character_id;
|
||||
uint8_t tier;
|
||||
uint32_t tribute;
|
||||
};
|
||||
|
||||
static std::string PrimaryKey()
|
||||
{
|
||||
return std::string("id");
|
||||
}
|
||||
|
||||
static std::vector<std::string> Columns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"character_id",
|
||||
"tier",
|
||||
"tribute",
|
||||
};
|
||||
}
|
||||
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"character_id",
|
||||
"tier",
|
||||
"tribute",
|
||||
};
|
||||
}
|
||||
|
||||
static std::string ColumnsRaw()
|
||||
{
|
||||
return std::string(Strings::Implode(", ", Columns()));
|
||||
}
|
||||
|
||||
static std::string SelectColumnsRaw()
|
||||
{
|
||||
return std::string(Strings::Implode(", ", SelectColumns()));
|
||||
}
|
||||
|
||||
static std::string TableName()
|
||||
{
|
||||
return std::string("character_tribute");
|
||||
}
|
||||
|
||||
static std::string BaseSelect()
|
||||
{
|
||||
return fmt::format(
|
||||
"SELECT {} FROM {}",
|
||||
SelectColumnsRaw(),
|
||||
TableName()
|
||||
);
|
||||
}
|
||||
|
||||
static std::string BaseInsert()
|
||||
{
|
||||
return fmt::format(
|
||||
"INSERT INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static CharacterTribute NewEntity()
|
||||
{
|
||||
CharacterTribute e{};
|
||||
|
||||
e.id = 0;
|
||||
e.character_id = 0;
|
||||
e.tier = 0;
|
||||
e.tribute = 0;
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
static CharacterTribute GetCharacterTribute(
|
||||
const std::vector<CharacterTribute> &character_tributes,
|
||||
int character_tribute_id
|
||||
)
|
||||
{
|
||||
for (auto &character_tribute : character_tributes) {
|
||||
if (character_tribute.id == character_tribute_id) {
|
||||
return character_tribute;
|
||||
}
|
||||
}
|
||||
|
||||
return NewEntity();
|
||||
}
|
||||
|
||||
static CharacterTribute FindOne(
|
||||
Database& db,
|
||||
int character_tribute_id
|
||||
)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
character_tribute_id
|
||||
)
|
||||
);
|
||||
|
||||
auto row = results.begin();
|
||||
if (results.RowCount() == 1) {
|
||||
CharacterTribute e{};
|
||||
|
||||
e.id = static_cast<int32_t>(atoi(row[0]));
|
||||
e.character_id = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.tier = static_cast<uint8_t>(strtoul(row[2], nullptr, 10));
|
||||
e.tribute = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
return NewEntity();
|
||||
}
|
||||
|
||||
static int DeleteOne(
|
||||
Database& db,
|
||||
int character_tribute_id
|
||||
)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {} = {}",
|
||||
TableName(),
|
||||
PrimaryKey(),
|
||||
character_tribute_id
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int UpdateOne(
|
||||
Database& db,
|
||||
const CharacterTribute &e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
auto columns = Columns();
|
||||
|
||||
v.push_back(columns[1] + " = " + std::to_string(e.character_id));
|
||||
v.push_back(columns[2] + " = " + std::to_string(e.tier));
|
||||
v.push_back(columns[3] + " = " + std::to_string(e.tribute));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE {} SET {} WHERE {} = {}",
|
||||
TableName(),
|
||||
Strings::Implode(", ", v),
|
||||
PrimaryKey(),
|
||||
e.id
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static CharacterTribute InsertOne(
|
||||
Database& db,
|
||||
CharacterTribute e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.character_id));
|
||||
v.push_back(std::to_string(e.tier));
|
||||
v.push_back(std::to_string(e.tribute));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseInsert(),
|
||||
Strings::Implode(",", v)
|
||||
)
|
||||
);
|
||||
|
||||
if (results.Success()) {
|
||||
e.id = results.LastInsertedID();
|
||||
return e;
|
||||
}
|
||||
|
||||
e = NewEntity();
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
static int InsertMany(
|
||||
Database& db,
|
||||
const std::vector<CharacterTribute> &entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &e: entries) {
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.character_id));
|
||||
v.push_back(std::to_string(e.tier));
|
||||
v.push_back(std::to_string(e.tribute));
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> v;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseInsert(),
|
||||
Strings::Implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static std::vector<CharacterTribute> All(Database& db)
|
||||
{
|
||||
std::vector<CharacterTribute> all_entries;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{}",
|
||||
BaseSelect()
|
||||
)
|
||||
);
|
||||
|
||||
all_entries.reserve(results.RowCount());
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
CharacterTribute e{};
|
||||
|
||||
e.id = static_cast<int32_t>(atoi(row[0]));
|
||||
e.character_id = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.tier = static_cast<uint8_t>(strtoul(row[2], nullptr, 10));
|
||||
e.tribute = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static std::vector<CharacterTribute> GetWhere(Database& db, const std::string &where_filter)
|
||||
{
|
||||
std::vector<CharacterTribute> all_entries;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {}",
|
||||
BaseSelect(),
|
||||
where_filter
|
||||
)
|
||||
);
|
||||
|
||||
all_entries.reserve(results.RowCount());
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
CharacterTribute e{};
|
||||
|
||||
e.id = static_cast<int32_t>(atoi(row[0]));
|
||||
e.character_id = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.tier = static_cast<uint8_t>(strtoul(row[2], nullptr, 10));
|
||||
e.tribute = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
|
||||
return all_entries;
|
||||
}
|
||||
|
||||
static int DeleteWhere(Database& db, const std::string &where_filter)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"DELETE FROM {} WHERE {}",
|
||||
TableName(),
|
||||
where_filter
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int Truncate(Database& db)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"TRUNCATE TABLE {}",
|
||||
TableName()
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int64 GetMaxId(Database& db)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"SELECT COALESCE(MAX({}), 0) FROM {}",
|
||||
PrimaryKey(),
|
||||
TableName()
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||
}
|
||||
|
||||
static int64 Count(Database& db, const std::string &where_filter = "")
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"SELECT COUNT(*) FROM {} {}",
|
||||
TableName(),
|
||||
(where_filter.empty() ? "" : "WHERE " + where_filter)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_CHARACTER_TRIBUTE_REPOSITORY_H
|
||||
@@ -0,0 +1,50 @@
|
||||
#ifndef EQEMU_CHARACTER_TRIBUTE_REPOSITORY_H
|
||||
#define EQEMU_CHARACTER_TRIBUTE_REPOSITORY_H
|
||||
|
||||
#include "../database.h"
|
||||
#include "../strings.h"
|
||||
#include "base/base_character_tribute_repository.h"
|
||||
|
||||
class CharacterTributeRepository: public BaseCharacterTributeRepository {
|
||||
public:
|
||||
|
||||
/**
|
||||
* This file was auto generated and can be modified and extended upon
|
||||
*
|
||||
* Base repository methods are automatically
|
||||
* generated in the "base" version of this repository. The base repository
|
||||
* is immutable and to be left untouched, while methods in this class
|
||||
* are used as extension methods for more specific persistence-layer
|
||||
* accessors or mutators.
|
||||
*
|
||||
* Base Methods (Subject to be expanded upon in time)
|
||||
*
|
||||
* Note: Not all tables are designed appropriately to fit functionality with all base methods
|
||||
*
|
||||
* InsertOne
|
||||
* UpdateOne
|
||||
* DeleteOne
|
||||
* FindOne
|
||||
* GetWhere(std::string where_filter)
|
||||
* DeleteWhere(std::string where_filter)
|
||||
* InsertMany
|
||||
* All
|
||||
*
|
||||
* Example custom methods in a repository
|
||||
*
|
||||
* CharacterTributeRepository::GetByZoneAndVersion(int zone_id, int zone_version)
|
||||
* CharacterTributeRepository::GetWhereNeverExpires()
|
||||
* CharacterTributeRepository::GetWhereXAndY()
|
||||
* CharacterTributeRepository::DeleteWhereXAndY()
|
||||
*
|
||||
* Most of the above could be covered by base methods, but if you as a developer
|
||||
* find yourself re-using logic for other parts of the code, its best to just make a
|
||||
* method that can be re-used easily elsewhere especially if it can use a base repository
|
||||
* method and encapsulate filters there
|
||||
*/
|
||||
|
||||
// Custom extended repository methods here
|
||||
|
||||
};
|
||||
|
||||
#endif //EQEMU_CHARACTER_TRIBUTE_REPOSITORY_H
|
||||
+4
-1
@@ -297,6 +297,7 @@ RULE_BOOL(World, StartZoneSameAsBindOnCreation, true, "Should the start zone alw
|
||||
RULE_BOOL(World, EnforceCharacterLimitAtLogin, false, "Enforce the limit for characters that are online at login")
|
||||
RULE_BOOL(World, EnableDevTools, true, "Enable or Disable the Developer Tools globally (Most of the time you want this enabled)")
|
||||
RULE_BOOL(World, EnableChecksumVerification, false, "Enable or Disable the Checksum Verification for eqgame.exe and spells_us.txt")
|
||||
RULE_INT(World, MaximumQuestErrors, 30, "Changes the maximum number of quest errors that can be displayed in #questerrors, default is 30")
|
||||
RULE_CATEGORY_END()
|
||||
|
||||
RULE_CATEGORY(Zone)
|
||||
@@ -444,7 +445,8 @@ RULE_BOOL(Spells, IllusionsAlwaysPersist, false, "Allows Illusions to persist be
|
||||
RULE_BOOL(Spells, UseItemCastMessage, false, "Enable to use the \"item begins to glow\" messages when casting from an item.")
|
||||
RULE_BOOL(Spells, TargetsTargetRequiresCombatRange, true, "Disable to remove combat range requirement from Target's Target Spell Target Type")
|
||||
RULE_BOOL(Spells, NPCBuffLevelRestrictions, false, "Impose BuffLevelRestrictions on NPCs if true")
|
||||
RULE_BOOL(Spells, ResurrectionEffectsBlock, true, "If enabled, resurrection effects cannot be overwritten.")
|
||||
RULE_INT(Spells, ResurrectionEffectBlock, 2, "0 = allow overwrites/rule disabled. If set to 1 = Block all buffs that would overwrite Resurrection Effects. If set to 2 = Will not overwrite Resurrection Effects, instead moves new buff to an empty slot if available. Default is 2.")
|
||||
RULE_BOOL(Spells, WaterMatchRequiredForLoS, true, "Enable/Disable the requirement of both the attacker/victim being both in or out of water for spells LoS to pass.")
|
||||
RULE_CATEGORY_END()
|
||||
|
||||
RULE_CATEGORY(Combat)
|
||||
@@ -518,6 +520,7 @@ RULE_BOOL(Combat, EnableWarriorShielding, true, "Enable or disable Warrior Shiel
|
||||
RULE_BOOL(Combat, BackstabIgnoresElemental, false, "Enable or disable Elemental weapon damage affecting backstab damage, false by default.")
|
||||
RULE_BOOL(Combat, BackstabIgnoresBane, false, "Enable or disable Bane weapon damage affecting backstab damage, false by default.")
|
||||
RULE_BOOL(Combat, SummonMeleeRange, true, "Enable or disable summoning of a player when already in melee range of the summoner.")
|
||||
RULE_BOOL(Combat, WaterMatchRequiredForAutoFireLoS, true, "Enable/Disable the requirement of both the attacker/victim being both in or out of water for AutoFire LoS to pass.")
|
||||
RULE_CATEGORY_END()
|
||||
|
||||
RULE_CATEGORY(NPC)
|
||||
|
||||
+13
-12
@@ -235,18 +235,19 @@
|
||||
#define ServerOP_ReloadMerchants 0x4109
|
||||
#define ServerOP_ReloadNPCEmotes 0x4110
|
||||
#define ServerOP_ReloadObjects 0x4111
|
||||
#define ServerOP_ReloadPerlExportSettings 0x4112
|
||||
#define ServerOP_ReloadRules 0x4113
|
||||
#define ServerOP_ReloadStaticZoneData 0x4114
|
||||
#define ServerOP_ReloadTasks 0x4115
|
||||
#define ServerOP_ReloadTitles 0x4116
|
||||
#define ServerOP_ReloadTraps 0x4117
|
||||
#define ServerOP_ReloadVariables 0x4118
|
||||
#define ServerOP_ReloadVeteranRewards 0x4119
|
||||
#define ServerOP_ReloadWorld 0x4120
|
||||
#define ServerOP_ReloadZonePoints 0x4121
|
||||
#define ServerOP_ReloadDzTemplates 0x4122
|
||||
#define ServerOP_ReloadZoneData 0x4123
|
||||
#define ServerOP_ReloadOpcodes 0x4112
|
||||
#define ServerOP_ReloadPerlExportSettings 0x4113
|
||||
#define ServerOP_ReloadRules 0x4114
|
||||
#define ServerOP_ReloadStaticZoneData 0x4115
|
||||
#define ServerOP_ReloadTasks 0x4116
|
||||
#define ServerOP_ReloadTitles 0x4117
|
||||
#define ServerOP_ReloadTraps 0x4118
|
||||
#define ServerOP_ReloadVariables 0x4119
|
||||
#define ServerOP_ReloadVeteranRewards 0x4120
|
||||
#define ServerOP_ReloadWorld 0x4121
|
||||
#define ServerOP_ReloadZonePoints 0x4122
|
||||
#define ServerOP_ReloadDzTemplates 0x4123
|
||||
#define ServerOP_ReloadZoneData 0x4124
|
||||
|
||||
#define ServerOP_CZDialogueWindow 0x4500
|
||||
#define ServerOP_CZLDoNUpdate 0x4501
|
||||
|
||||
+31
-32
@@ -133,55 +133,54 @@ uint32 SharedDatabase::GetTotalTimeEntitledOnAccount(uint32 AccountID) {
|
||||
|
||||
void SharedDatabase::SetMailKey(int CharID, int IPAddress, int MailKey)
|
||||
{
|
||||
char MailKeyString[17];
|
||||
char mail_key[17];
|
||||
|
||||
if (RuleB(Chat, EnableMailKeyIPVerification) == true)
|
||||
sprintf(MailKeyString, "%08X%08X", IPAddress, MailKey);
|
||||
else
|
||||
sprintf(MailKeyString, "%08X", MailKey);
|
||||
if (RuleB(Chat, EnableMailKeyIPVerification) == true) {
|
||||
sprintf(mail_key, "%08X%08X", IPAddress, MailKey);
|
||||
}
|
||||
else {
|
||||
sprintf(mail_key, "%08X", MailKey);
|
||||
}
|
||||
|
||||
const std::string query = StringFormat("UPDATE character_data SET mailkey = '%s' WHERE id = '%i'",
|
||||
MailKeyString, CharID);
|
||||
const auto results = QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
LogError("SharedDatabase::SetMailKey({}, {}) : {}", CharID, MailKeyString, results.ErrorMessage().c_str());
|
||||
const std::string query = StringFormat(
|
||||
"UPDATE character_data SET mailkey = '%s' WHERE id = '%i'",
|
||||
mail_key, CharID
|
||||
);
|
||||
|
||||
const auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
LogError("SharedDatabase::SetMailKey({}, {}) : {}", CharID, mail_key, results.ErrorMessage().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
std::string SharedDatabase::GetMailKey(int CharID, bool key_only)
|
||||
SharedDatabase::MailKeys SharedDatabase::GetMailKey(int character_id)
|
||||
{
|
||||
const std::string query = StringFormat("SELECT `mailkey` FROM `character_data` WHERE `id`='%i' LIMIT 1", CharID);
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
const std::string query = StringFormat("SELECT `mailkey` FROM `character_data` WHERE `id`='%i' LIMIT 1", character_id);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
|
||||
Log(Logs::Detail, Logs::MySQLError, "Error retrieving mailkey from database: %s", results.ErrorMessage().c_str());
|
||||
return std::string();
|
||||
return MailKeys{};
|
||||
}
|
||||
|
||||
if (!results.RowCount()) {
|
||||
|
||||
Log(Logs::General, Logs::ClientLogin, "Error: Mailkey for character id [%i] does not exist or could not be found", CharID);
|
||||
return std::string();
|
||||
Log(Logs::General,
|
||||
Logs::ClientLogin,
|
||||
"Error: Mailkey for character id [%i] does not exist or could not be found",
|
||||
character_id
|
||||
);
|
||||
return MailKeys{};
|
||||
}
|
||||
|
||||
auto& row = results.begin();
|
||||
auto &row = results.begin();
|
||||
if (row != results.end()) {
|
||||
|
||||
std::string mail_key = row[0];
|
||||
|
||||
if (mail_key.length() > 8 && key_only) {
|
||||
return mail_key.substr(8);
|
||||
}
|
||||
else {
|
||||
return mail_key;
|
||||
}
|
||||
return MailKeys{
|
||||
.mail_key = mail_key.substr(8),
|
||||
.mail_key_full = mail_key
|
||||
};
|
||||
}
|
||||
else {
|
||||
|
||||
Log(Logs::General, Logs::MySQLError, "Internal MySQL error in SharedDatabase::GetMailKey(int, bool)");
|
||||
return std::string();
|
||||
}
|
||||
return MailKeys{};
|
||||
}
|
||||
|
||||
bool SharedDatabase::SaveCursor(uint32 char_id, std::list<EQ::ItemInstance*>::const_iterator &start, std::list<EQ::ItemInstance*>::const_iterator &end)
|
||||
|
||||
+5
-1
@@ -81,7 +81,11 @@ public:
|
||||
bool SetGMInvul(uint32 account_id, bool gminvul);
|
||||
bool SetGMFlymode(uint32 account_id, uint8 flymode);
|
||||
void SetMailKey(int CharID, int IPAddress, int MailKey);
|
||||
std::string GetMailKey(int CharID, bool key_only = false);
|
||||
struct MailKeys {
|
||||
std::string mail_key;
|
||||
std::string mail_key_full;
|
||||
};
|
||||
MailKeys GetMailKey(int character_id);
|
||||
bool SaveCursor(
|
||||
uint32 char_id,
|
||||
std::list<EQ::ItemInstance *>::const_iterator &start,
|
||||
|
||||
+1177
-700
File diff suppressed because it is too large
Load Diff
+101
-60
@@ -171,6 +171,37 @@
|
||||
#define SPELL_ILLUSION_MALE 1732
|
||||
#define SPELL_UNSUMMON_SELF 892
|
||||
#define SPELL_ANCIENT_LIFEBANE 2115
|
||||
#define SPELL_GMHP25K 6817
|
||||
#define SPELL_GMHP50K 6818
|
||||
#define SPELL_GMHP100K 6819
|
||||
#define SPELL_GMHP225K 6820
|
||||
#define SPELL_GMHP475K 6821
|
||||
#define SPELL_GMHP925K 6822
|
||||
#define SPELL_GMHP2M 6823
|
||||
#define SPELL_GMHP3M 6824
|
||||
#define SPELL_GMHP5M 39851
|
||||
#define SPELL_GUIDE_ACTING_ONE 778
|
||||
#define SPELL_GUIDE_ALLIANCE_ONE 810
|
||||
#define SPELL_GUIDE_CANCEL_MAGIC_ONE 811
|
||||
#define SPELL_GUIDE_JOURNEY_ONE 813
|
||||
#define SPELL_GUIDE_VISION_ONE 814
|
||||
#define SPELL_GUIDE_HEALTH_ONE 815
|
||||
#define SPELL_GUIDE_INVULNERABILITY_ONE 816
|
||||
#define SPELL_GUIDE_BOLT_ONE 817
|
||||
#define SPELL_GUIDE_MEMORY_BLUR_ONE 818
|
||||
#define SPELL_GUIDE_ACTING_TWO 1209
|
||||
#define SPELL_GUIDE_CANCEL_MAGIC_TWO 1211
|
||||
#define SPELL_GUIDE_JOURNEY_TWO 1212
|
||||
#define SPELL_GUIDE_VISION_TWO 1213
|
||||
#define SPELL_GUIDE_HEALTH_TWO 1214
|
||||
#define SPELL_GUIDE_INVULNERABILITY_TWO 1215
|
||||
#define SPELL_GUIDE_BOLT_TWO 1216
|
||||
#define SPELL_GUIDE_MEMORY_BLUR_TWO 1217
|
||||
#define SPELL_GUIDE_ALLIANCE_TWO 1219
|
||||
#define SPELL_GUIDE_EVACUATION 3921
|
||||
#define SPELL_GUIDE_LEVITATION 39852
|
||||
#define SPELL_GUIDE_SPELL_HASTE 39853
|
||||
#define SPELL_GUIDE_HASTE 39854
|
||||
|
||||
//spellgroup ids
|
||||
#define SPELLGROUP_FRENZIED_BURNOUT 2754
|
||||
@@ -201,8 +232,22 @@
|
||||
#define INSTRUMENT_LUTE 13011
|
||||
#define INSTRUMENT_HORN 13012
|
||||
|
||||
//option types for the rule Spells:ResurrectionEffectBlock
|
||||
#define RES_EFFECTS_CANNOT_STACK -1
|
||||
#define NO_RES_EFFECTS_BLOCK 0
|
||||
#define RES_EFFECTS_BLOCK 1
|
||||
#define RES_EFFECTS_BLOCK_WITH_BUFFS 2
|
||||
#define MOVE_NEW_SLOT 2
|
||||
|
||||
const int Z_AGGRO=10;
|
||||
#define PARTIAL_DEATH_SAVE 1
|
||||
#define FULL_DEATH_SAVE 2
|
||||
|
||||
#define MAX_FAST_HEAL_CASTING_TIME 2000
|
||||
#define MAX_VERY_FAST_HEAL_CASTING_TIME 1000
|
||||
|
||||
#define DETRIMENTAL_EFFECT 0
|
||||
#define BENEFICIAL_EFFECT 1
|
||||
#define BENEFICIAL_EFFECT_GROUP_ONLY 2
|
||||
|
||||
const uint32 MobAISpellRange=100; // max range of buffs
|
||||
|
||||
@@ -1160,7 +1205,7 @@ typedef enum {
|
||||
#define SE_LimitUseMin 422 // implemented, @Ff Minium amount of numhits for a spell to be focused, base: numhit amt
|
||||
#define SE_LimitUseType 423 // implemented, @Ff Focus will only affect if has this numhits type, base: numhit type
|
||||
#define SE_GravityEffect 424 // implemented - Pulls/pushes you toward/away the mob at a set pace
|
||||
//#define SE_Display 425 // *not implemented - Illusion: Flying Dragon(21626)
|
||||
#define SE_Display 425 // *not implemented - Illusion: Flying Dragon(21626)
|
||||
#define SE_IncreaseExtTargetWindow 426 // *not implmented[AA] - increases the capacity of your extended target window
|
||||
#define SE_SkillProcAttempt 427 // implemented - chance to proc when using a skill(ie taunt)
|
||||
#define SE_LimitToSkill 428 // implemented, @Procs, limits what combat skills will effect a skill proc, base: skill value, limit: none, max: none
|
||||
@@ -1443,7 +1488,7 @@ extern int32 SPDAT_RECORDS;
|
||||
bool IsTargetableAESpell(uint16 spell_id);
|
||||
bool IsSacrificeSpell(uint16 spell_id);
|
||||
bool IsLifetapSpell(uint16 spell_id);
|
||||
bool IsMezSpell(uint16 spell_id);
|
||||
bool IsMesmerizeSpell(uint16 spell_id);
|
||||
bool IsStunSpell(uint16 spell_id);
|
||||
bool IsSlowSpell(uint16 spell_id);
|
||||
bool IsHasteSpell(uint16 spell_id);
|
||||
@@ -1452,22 +1497,23 @@ bool IsPercentalHealSpell(uint16 spell_id);
|
||||
bool IsGroupOnlySpell(uint16 spell_id);
|
||||
bool IsBeneficialSpell(uint16 spell_id);
|
||||
bool IsDetrimentalSpell(uint16 spell_id);
|
||||
bool IsInvisSpell(uint16 spell_id);
|
||||
bool IsInvisibleSpell(uint16 spell_id);
|
||||
bool IsInvulnerabilitySpell(uint16 spell_id);
|
||||
bool IsCHDurationSpell(uint16 spell_id);
|
||||
bool IsCompleteHealDurationSpell(uint16 spell_id);
|
||||
bool IsPoisonCounterSpell(uint16 spell_id);
|
||||
bool IsDiseaseCounterSpell(uint16 spell_id);
|
||||
bool IsSummonItemSpell(uint16 spell_id);
|
||||
bool IsSummonSkeletonSpell(uint16 spell_id);
|
||||
bool IsSummonPetSpell(uint16 spell_id);
|
||||
bool IsSummonPCSpell(uint16 spell_id);
|
||||
bool IsPetSpell(uint16 spell_id);
|
||||
bool IsCharmSpell(uint16 spell_id);
|
||||
bool IsBlindSpell(uint16 spell_id);
|
||||
bool IsEffectHitpointsSpell(uint16 spell_id);
|
||||
bool IsReduceCastTimeSpell(uint16 spell_id);
|
||||
bool IsHealthSpell(uint16 spell_id);
|
||||
bool IsCastTimeReductionSpell(uint16 spell_id);
|
||||
bool IsIncreaseDurationSpell(uint16 spell_id);
|
||||
bool IsReduceManaSpell(uint16 spell_id);
|
||||
bool IsExtRangeSpell(uint16 spell_id);
|
||||
bool IsManaCostReductionSpell(uint16 spell_id);
|
||||
bool IsIncreaseRangeSpell(uint16 spell_id);
|
||||
bool IsImprovedHealingSpell(uint16 spell_id);
|
||||
bool IsImprovedDamageSpell(uint16 spell_id);
|
||||
bool IsAEDurationSpell(uint16 spell_id);
|
||||
@@ -1475,26 +1521,22 @@ bool IsPureNukeSpell(uint16 spell_id);
|
||||
bool IsAENukeSpell(uint16 spell_id);
|
||||
bool IsPBAENukeSpell(uint16 spell_id);
|
||||
bool IsAERainNukeSpell(uint16 spell_id);
|
||||
bool IsPartialCapableSpell(uint16 spell_id);
|
||||
bool IsPartialResistableSpell(uint16 spell_id);
|
||||
bool IsResistableSpell(uint16 spell_id);
|
||||
bool IsGroupSpell(uint16 spell_id);
|
||||
bool IsTGBCompatibleSpell(uint16 spell_id);
|
||||
bool IsBardSong(uint16 spell_id);
|
||||
bool IsEffectInSpell(uint16 spellid, int effect);
|
||||
uint16 GetTriggerSpellID(uint16 spell_id, uint32 effect);
|
||||
bool IsBlankSpellEffect(uint16 spellid, int effect_index);
|
||||
bool IsValidSpell(uint32 spellid);
|
||||
bool IsSummonSpell(uint16 spellid);
|
||||
bool IsEvacSpell(uint16 spellid);
|
||||
bool IsDamageSpell(uint16 spellid);
|
||||
bool IsFearSpell(uint16 spellid);
|
||||
bool IsCureSpell(uint16 spellid);
|
||||
bool BeneficialSpell(uint16 spell_id);
|
||||
bool GroupOnlySpell(uint16 spell_id);
|
||||
int GetSpellEffectIndex(uint16 spell_id, int effect);
|
||||
int CanUseSpell(uint16 spellid, int classa, int level);
|
||||
int GetMinLevel(uint16 spell_id);
|
||||
int GetSpellLevel(uint16 spell_id, int classa);
|
||||
bool IsEffectInSpell(uint16 spell_id, int effect_id);
|
||||
uint16 GetSpellTriggerSpellID(uint16 spell_id, int effect_id);
|
||||
bool IsBlankSpellEffect(uint16 spell_id, int effect_index);
|
||||
bool IsValidSpell(uint32 spell_id);
|
||||
bool IsSummonSpell(uint16 spell_id);
|
||||
bool IsDamageSpell(uint16 spell_id);
|
||||
bool IsFearSpell(uint16 spell_id);
|
||||
bool IsCureSpell(uint16 spell_id);
|
||||
int GetSpellEffectIndex(uint16 spell_id, int effect_id);
|
||||
uint8 GetSpellMinimumLevel(uint16 spell_id);
|
||||
uint8 GetSpellLevel(uint16 spell_id, uint8 class_id);
|
||||
int CalcBuffDuration_formula(int level, int formula, int duration);
|
||||
int32 CalculatePoisonCounters(uint16 spell_id);
|
||||
int32 CalculateDiseaseCounters(uint16 spell_id);
|
||||
@@ -1505,10 +1547,11 @@ bool IsDisciplineBuff(uint16 spell_id);
|
||||
bool IsDiscipline(uint16 spell_id);
|
||||
bool IsCombatSkill(uint16 spell_id);
|
||||
bool IsResurrectionEffects(uint16 spell_id);
|
||||
int8 GetSpellResurrectionSicknessCheck(uint16 spell_id_one, uint16 spell_id_two);
|
||||
bool IsRuneSpell(uint16 spell_id);
|
||||
bool IsMagicRuneSpell(uint16 spell_id);
|
||||
bool IsManaTapSpell(uint16 spell_id);
|
||||
bool IsAllianceSpellLine(uint16 spell_id);
|
||||
bool IsAllianceSpell(uint16 spell_id);
|
||||
bool IsDeathSaveSpell(uint16 spell_id);
|
||||
bool IsFullDeathSaveSpell(uint16 spell_id);
|
||||
bool IsPartialDeathSaveSpell(uint16 spell_id);
|
||||
@@ -1517,10 +1560,10 @@ bool IsSuccorSpell(uint16 spell_id);
|
||||
bool IsTeleportSpell(uint16 spell_id);
|
||||
bool IsTranslocateSpell(uint16 spell_id);
|
||||
bool IsGateSpell(uint16 spell_id);
|
||||
bool IsPlayerIllusionSpell(uint16 spell_id); // seveian 2008-09-23
|
||||
bool IsIllusionSpell(uint16 spell_id);
|
||||
bool IsLDoNObjectSpell(uint16 spell_id);
|
||||
int32 GetSpellResistType(uint16 spell_id);
|
||||
int32 GetSpellTargetType(uint16 spell_id);
|
||||
int GetSpellResistType(uint16 spell_id);
|
||||
int GetSpellTargetType(uint16 spell_id);
|
||||
bool IsHealOverTimeSpell(uint16 spell_id);
|
||||
bool IsCompleteHealSpell(uint16 spell_id);
|
||||
bool IsFastHealSpell(uint16 spell_id);
|
||||
@@ -1535,38 +1578,36 @@ bool IsSelfConversionSpell(uint16 spell_id);
|
||||
bool IsBuffSpell(uint16 spell_id);
|
||||
bool IsPersistDeathSpell(uint16 spell_id);
|
||||
bool IsSuspendableSpell(uint16 spell_id);
|
||||
uint32 GetMorphTrigger(uint32 spell_id);
|
||||
bool IsCastonFadeDurationSpell(uint16 spell_id);
|
||||
bool IsPowerDistModSpell(uint16 spell_id);
|
||||
uint32 GetPartialMeleeRuneReduction(uint32 spell_id);
|
||||
uint32 GetPartialMagicRuneReduction(uint32 spell_id);
|
||||
uint32 GetPartialMeleeRuneAmount(uint32 spell_id);
|
||||
uint32 GetPartialMagicRuneAmount(uint32 spell_id);
|
||||
bool NoDetrimentalSpellAggro(uint16 spell_id);
|
||||
bool IsStackableDot(uint16 spell_id);
|
||||
bool IsBardOnlyStackEffect(int effect);
|
||||
bool IsCastWhileInvis(uint16 spell_id);
|
||||
bool IsEffectIgnoredInStacking(int spa);
|
||||
bool IsFocusLimit(int spa);
|
||||
bool SpellRequiresTarget(int target_type);
|
||||
bool IsVirusSpell(int32 spell_id);
|
||||
int GetViralMinSpreadTime(int32 spell_id);
|
||||
int GetViralMaxSpreadTime(int32 spell_id);
|
||||
int GetViralSpreadRange(int32 spell_id);
|
||||
bool IsInstrumentModAppliedToSpellEffect(int32 spell_id, int effect);
|
||||
bool IsPulsingBardSong(int32 spell_id);
|
||||
uint32 GetProcLimitTimer(int32 spell_id, int proc_type);
|
||||
bool IgnoreCastingRestriction(int32 spell_id);
|
||||
int CalcPetHp(int levelb, int classb, int STA = 75);
|
||||
int GetSpellEffectDescNum(uint16 spell_id);
|
||||
DmgShieldType GetDamageShieldType(uint16 spell_id, int32 DSType = 0);
|
||||
bool DetrimentalSpellAllowsRest(uint16 spell_id);
|
||||
uint32 GetNimbusEffect(uint16 spell_id);
|
||||
int32 GetFuriousBash(uint16 spell_id);
|
||||
bool IsCastOnFadeDurationSpell(uint16 spell_id);
|
||||
bool IsDistanceModifierSpell(uint16 spell_id);
|
||||
int GetSpellPartialMeleeRuneReduction(uint16 spell_id);
|
||||
int GetSpellPartialMagicRuneReduction(uint16 spell_id);
|
||||
int GetSpellPartialMeleeRuneAmount(uint16 spell_id);
|
||||
int GetSpellPartialMagicRuneAmount(uint16 spell_id);
|
||||
bool IsNoDetrimentalSpellAggroSpell(uint16 spell_id);
|
||||
bool IsStackableDOT(uint16 spell_id);
|
||||
bool IsBardOnlyStackEffect(int effect_id);
|
||||
bool IsCastWhileInvisibleSpell(uint16 spell_id);
|
||||
bool IsEffectIgnoredInStacking(int effect_id);
|
||||
bool IsFocusLimit(int effect_id);
|
||||
bool IsTargetRequiredForSpell(uint16 spell_id);
|
||||
bool IsVirusSpell(uint16 spell_id);
|
||||
int GetSpellViralMinimumSpreadTime(uint16 spell_id);
|
||||
int GetSpellViralMaximumSpreadTime(uint16 spell_id);
|
||||
int GetSpellViralSpreadRange(uint16 spell_id);
|
||||
bool IsInstrumentModifierAppliedToSpellEffect(uint16 spell_id, int effect_id);
|
||||
bool IsPulsingBardSong(uint16 spell_id);
|
||||
int GetSpellProcLimitTimer(uint16 spell_id, int proc_type);
|
||||
bool IsCastNotStandingSpell(uint16 spell_id);
|
||||
int GetSpellEffectDescriptionNumber(uint16 spell_id);
|
||||
DmgShieldType GetDamageShieldType(uint16 spell_id, int damage_shield_type = 0);
|
||||
bool IsRestAllowedSpell(uint16 spell_id);
|
||||
int GetSpellNimbusEffect(uint16 spell_id);
|
||||
int GetSpellFuriousBash(uint16 spell_id);
|
||||
bool IsShortDurationBuff(uint16 spell_id);
|
||||
bool IsSpellUsableThisZoneType(uint16 spell_id, uint8 zone_type);
|
||||
bool IsSpellUsableInThisZoneType(uint16 spell_id, uint8 zone_type);
|
||||
const char *GetSpellName(uint16 spell_id);
|
||||
int GetSpellStatValue(uint32 spell_id, const char* stat_identifier, uint8 slot = 0);
|
||||
bool CastRestrictedSpell(int spellid);
|
||||
int GetSpellStatValue(uint16 spell_id, const char* stat_identifier, uint8 slot = 0);
|
||||
bool IsCastRestrictedSpell(uint16 spell_id);
|
||||
|
||||
#endif
|
||||
|
||||
+2
-1
@@ -370,7 +370,8 @@ std::string Strings::NumberToWords(unsigned long long int n)
|
||||
|
||||
return res;
|
||||
}
|
||||
std::string Strings::Money(uint32 platinum, uint32 gold, uint32 silver, uint32 copper)
|
||||
|
||||
std::string Strings::Money(uint64 platinum, uint64 gold, uint64 silver, uint64 copper)
|
||||
{
|
||||
std::string money_string = "Unknown";
|
||||
if (copper && silver && gold && platinum) { // CSGP
|
||||
|
||||
+1
-1
@@ -114,7 +114,7 @@ public:
|
||||
static std::string Join(const std::vector<std::string> &ar, const std::string &delim);
|
||||
static std::string Join(const std::vector<uint32_t> &ar, const std::string &delim);
|
||||
static std::string MillisecondsToTime(int duration);
|
||||
static std::string Money(uint32 platinum, uint32 gold = 0, uint32 silver = 0, uint32 copper = 0);
|
||||
static std::string Money(uint64 platinum, uint64 gold = 0, uint64 silver = 0, uint64 copper = 0);
|
||||
static std::string NumberToWords(unsigned long long int n);
|
||||
static std::string Repeat(std::string s, int n);
|
||||
static std::string Replace(std::string subject, const std::string &search, const std::string &replace);
|
||||
|
||||
+2
-2
@@ -25,7 +25,7 @@
|
||||
|
||||
// Build variables
|
||||
// these get injected during the build pipeline
|
||||
#define CURRENT_VERSION "22.11.0-dev" // always append -dev to the current version for custom-builds
|
||||
#define CURRENT_VERSION "22.14.1-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__
|
||||
@@ -42,7 +42,7 @@
|
||||
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
|
||||
*/
|
||||
|
||||
#define CURRENT_BINARY_DATABASE_VERSION 9227
|
||||
#define CURRENT_BINARY_DATABASE_VERSION 9228
|
||||
|
||||
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9039
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -24,6 +24,8 @@
|
||||
#include "../common/repositories/zone_repository.h"
|
||||
#include "../common/repositories/base/base_content_flags_repository.h"
|
||||
|
||||
#include <glm/vec4.hpp>
|
||||
|
||||
class ZoneStore {
|
||||
public:
|
||||
ZoneStore();
|
||||
@@ -43,6 +45,62 @@ public:
|
||||
const char *GetZoneName(uint32 zone_id, bool error_unknown = false);
|
||||
const char *GetZoneLongName(uint32 zone_id, bool error_unknown = false);
|
||||
ZoneRepository::Zone *GetZoneWithFallback(uint32 zone_id, int version = 0);
|
||||
|
||||
glm::vec4 GetZoneSafeCoordinates(uint32 zone_id, int version = 0);
|
||||
float GetZoneGraveyardID(uint32 zone_id, int version = 0);
|
||||
uint8 GetZoneMinimumLevel(uint32 zone_id, int version = 0);
|
||||
uint8 GetZoneMaximumLevel(uint32 zone_id, int version = 0);
|
||||
uint8 GetZoneMinimumStatus(uint32 zone_id, int version = 0);
|
||||
int GetZoneTimeZone(uint32 zone_id, int version = 0);
|
||||
int GetZoneMaximumPlayers(uint32 zone_id, int version = 0);
|
||||
uint32 GetZoneRuleSet(uint32 zone_id, int version = 0);
|
||||
const std::string& GetZoneNote(uint32 zone_id, int version = 0);
|
||||
float GetZoneUnderworld(uint32 zone_id, int version = 0);
|
||||
float GetZoneMinimumClip(uint32 zone_id, int version = 0);
|
||||
float GetZoneMaximumClip(uint32 zone_id, int version = 0);
|
||||
float GetZoneFogMinimumClip(uint32 zone_id, uint8 slot = 0, int version = 0);
|
||||
float GetZoneFogMaximumClip(uint32 zone_id, uint8 slot = 0, int version = 0);
|
||||
uint8 GetZoneFogRed(uint32 zone_id, uint8 slot = 0, int version = 0);
|
||||
uint8 GetZoneFogGreen(uint32 zone_id, uint8 slot = 0, int version = 0);
|
||||
uint8 GetZoneFogBlue(uint32 zone_id, uint8 slot = 0, int version = 0);
|
||||
uint8 GetZoneSky(uint32 zone_id, int version = 0);
|
||||
uint8 GetZoneZType(uint32 zone_id, int version = 0);
|
||||
float GetZoneExperienceMultiplier(uint32 zone_id, int version = 0);
|
||||
float GetZoneWalkSpeed(uint32 zone_id, int version = 0);
|
||||
uint8 GetZoneTimeType(uint32 zone_id, int version = 0);
|
||||
float GetZoneFogDensity(uint32 zone_id, int version = 0);
|
||||
const std::string& GetZoneFlagNeeded(uint32 zone_id, int version = 0);
|
||||
int8 GetZoneCanBind(uint32 zone_id, int version = 0);
|
||||
int8 GetZoneCanCombat(uint32 zone_id, int version = 0);
|
||||
int8 GetZoneCanLevitate(uint32 zone_id, int version = 0);
|
||||
int8 GetZoneCastOutdoor(uint32 zone_id, int version = 0);
|
||||
uint8 GetZoneHotzone(uint32 zone_id, int version = 0);
|
||||
uint8 GetZoneInstanceType(uint32 zone_id, int version = 0);
|
||||
uint64 GetZoneShutdownDelay(uint32 zone_id, int version = 0);
|
||||
int8 GetZonePEQZone(uint32 zone_id, int version = 0);
|
||||
int8 GetZoneExpansion(uint32 zone_id, int version = 0);
|
||||
int8 GetZoneBypassExpansionCheck(uint32 zone_id, int version = 0);
|
||||
uint8 GetZoneSuspendBuffs(uint32 zone_id, int version = 0);
|
||||
int GetZoneRainChance(uint32 zone_id, uint8 slot = 0, int version = 0);
|
||||
int GetZoneRainDuration(uint32 zone_id, uint8 slot = 0, int version = 0);
|
||||
int GetZoneSnowChance(uint32 zone_id, uint8 slot = 0, int version = 0);
|
||||
int GetZoneSnowDuration(uint32 zone_id, uint8 slot = 0, int version = 0);
|
||||
float GetZoneGravity(uint32 zone_id, int version = 0);
|
||||
int GetZoneType(uint32 zone_id, int version = 0);
|
||||
int8 GetZoneSkyLock(uint32 zone_id, int version = 0);
|
||||
int GetZoneFastRegenHP(uint32 zone_id, int version = 0);
|
||||
int GetZoneFastRegenMana(uint32 zone_id, int version = 0);
|
||||
int GetZoneFastRegenEndurance(uint32 zone_id, int version = 0);
|
||||
int GetZoneNPCMaximumAggroDistance(uint32 zone_id, int version = 0);
|
||||
uint32 GetZoneMaximumMovementUpdateRange(uint32 zone_id, int version = 0);
|
||||
int8 GetZoneMinimumExpansion(uint32 zone_id, int version = 0);
|
||||
int8 GetZoneMaximumExpansion(uint32 zone_id, int version = 0);
|
||||
const std::string& GetZoneContentFlags(uint32 zone_id, int version = 0);
|
||||
const std::string& GetZoneContentFlagsDisabled(uint32 zone_id, int version = 0);
|
||||
int GetZoneUnderworldTeleportIndex(uint32 zone_id, int version = 0);
|
||||
int GetZoneLavaDamage(uint32 zone_id, int version = 0);
|
||||
int GetZoneMinimumLavaDamage(uint32 zone_id, int version = 0);
|
||||
|
||||
private:
|
||||
std::vector<ZoneRepository::Zone> m_zones;
|
||||
};
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "eqemu-server",
|
||||
"version": "22.11.0",
|
||||
"version": "22.14.1",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/EQEmu/Server.git"
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
#ifndef EQEMU_CONFIG_H
|
||||
#define EQEMU_CONFIG_H
|
||||
|
||||
// no-op
|
||||
|
||||
#endif //EQEMU_CONFIG_H
|
||||
@@ -93,6 +93,10 @@ public:
|
||||
TEST_ASSERT(Strings::SearchDelim(h, "air") == std::string::npos);
|
||||
TEST_ASSERT(Strings::SearchDelim(h, "bef") == std::string::npos);
|
||||
TEST_ASSERT(Strings::SearchDelim(h, "wwi") == std::string::npos);
|
||||
TEST_ASSERT(Strings::SearchDelim(h, "bothunder,") == std::string::npos);
|
||||
TEST_ASSERT(Strings::SearchDelim(h, "poair,") == std::string::npos);
|
||||
TEST_ASSERT(Strings::SearchDelim(h, "befallen,") == std::string::npos);
|
||||
TEST_ASSERT(Strings::SearchDelim(h, "wwi,") == std::string::npos);
|
||||
}
|
||||
|
||||
void SplitStringTest() {
|
||||
@@ -126,6 +130,11 @@ public:
|
||||
TEST_ASSERT_EQUALS(Strings::IsFloat(".234234"), true);
|
||||
TEST_ASSERT_EQUALS(Strings::IsFloat(".234234f"), false);
|
||||
TEST_ASSERT_EQUALS(Strings::IsFloat("Johnson"), false);
|
||||
TEST_ASSERT_EQUALS(Strings::IsFloat("12312312313f"), false); // character at end
|
||||
TEST_ASSERT_EQUALS(Strings::IsFloat("18446744073709551616"), true);
|
||||
TEST_ASSERT_EQUALS(Strings::IsFloat("-18"), true);
|
||||
TEST_ASSERT_EQUALS(Strings::IsFloat("-f18"), false);
|
||||
TEST_ASSERT_EQUALS(Strings::IsFloat("-18446744073709551616"), true);
|
||||
}
|
||||
|
||||
void TestIsNumber() {
|
||||
@@ -137,6 +146,9 @@ public:
|
||||
TEST_ASSERT_EQUALS(Strings::IsNumber("-18"), true);
|
||||
TEST_ASSERT_EQUALS(Strings::IsNumber("-f18"), false);
|
||||
TEST_ASSERT_EQUALS(Strings::IsNumber("-18446744073709551616"), true); // 64
|
||||
TEST_ASSERT_EQUALS(Strings::IsNumber("18446744073709551616f"), false); // 64
|
||||
TEST_ASSERT_EQUALS(Strings::IsNumber("18446744073709551616.0"), false); // 64
|
||||
TEST_ASSERT_EQUALS(Strings::IsNumber("18446744073709551616.0f"), false); // 64
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -9,11 +9,13 @@ git submodule init && git submodule update
|
||||
|
||||
perl utils/scripts/build/tag-version.pl
|
||||
|
||||
mkdir -p build && cd build && cmake -DEQEMU_BUILD_TESTS=ON -DEQEMU_BUILD_LOGIN=ON -DEQEMU_BUILD_LUA=ON -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="-Os" -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -G 'Unix Makefiles' .. && make -j$((`nproc`-4))
|
||||
mkdir -p build && cd build && cmake -DEQEMU_BUILD_TESTS=ON -DEQEMU_BUILD_STATIC=ON -DEQEMU_BUILD_LOGIN=ON -DEQEMU_BUILD_LUA=ON -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="-Os" -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -G 'Unix Makefiles' .. && make -j$((`nproc`-4))
|
||||
|
||||
curl https://raw.githubusercontent.com/Akkadius/eqemu-install-v2/master/eqemu_config.json --output eqemu_config.json
|
||||
./bin/tests
|
||||
|
||||
ldd ./bin/zone
|
||||
|
||||
# shellcheck disable=SC2164
|
||||
cd /drone/src/
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -481,6 +481,7 @@
|
||||
9225|2023_01_21_bots_raid_members.sql|SHOW COLUMNS FROM `raid_members` LIKE 'bot_id'|empty|
|
||||
9226|2023_03_17_corpse_fields.sql|SHOW COLUMNS FROM `character_corpse_items` LIKE 'custom_data'|empty|
|
||||
9227|2023_03_24_npc_scale_global_base_verify.sql|SHOW COLUMNS FROM `npc_scale_global_base` LIKE 'heroic_strikethrough'|not_empty|
|
||||
9228|2023_05_08_character_tribute_primary_key.sql|SHOW COLUMNS FROM `character_tribute` LIKE 'character_id'|empty|
|
||||
|
||||
# Upgrade conditions:
|
||||
# This won't be needed after this system is implemented, but it is used database that are not
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
ALTER TABLE `character_tribute`
|
||||
CHANGE COLUMN `id` `character_id` int(11) UNSIGNED NOT NULL DEFAULT 0,
|
||||
ADD COLUMN `id` int(11) NOT NULL AUTO_INCREMENT FIRST,
|
||||
ADD PRIMARY KEY (`id`);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,36 @@
|
||||
#include "../worlddb.h"
|
||||
#include "../../common/database_schema.h"
|
||||
|
||||
void WorldserverCLI::BotsDisable(int argc, char **argv, argh::parser &cmd, std::string &description)
|
||||
{
|
||||
description = "Disables bots and drops tables";
|
||||
|
||||
if (cmd[{"-h", "--help"}]) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::string input;
|
||||
std::cout << "Warning! This will drop all bot tables, are you sure? [y/n]";
|
||||
std::getline(std::cin, input);
|
||||
|
||||
if (Strings::ToLower(input) != "y") {
|
||||
LogInfo("Aborting");
|
||||
return;
|
||||
}
|
||||
|
||||
// drop bot tables
|
||||
std::string sql = "SET FOREIGN_KEY_CHECKS = 0;";
|
||||
for (auto &t: DatabaseSchema::GetBotTables()) {
|
||||
sql += fmt::format("DROP TABLE IF EXISTS {};", t);
|
||||
LogInfo("Dropping table [{}]", t);
|
||||
}
|
||||
|
||||
sql += "SET FOREIGN_KEY_CHECKS = 1;";
|
||||
|
||||
database.QueryDatabaseMulti(sql);
|
||||
|
||||
// disable bots
|
||||
LogInfo("Setting rule Bots:Enabled to false");
|
||||
RuleManager::Instance()->SetRule("Bots:Enabled", "false", &database, true, true);
|
||||
LogInfo("Bots disabled");
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
#include "../worlddb.h"
|
||||
#include "../../common/rulesys.h"
|
||||
|
||||
void WorldserverCLI::BotsEnable(int argc, char **argv, argh::parser &cmd, std::string &description)
|
||||
{
|
||||
description = "Bootstraps bot tables and enables bots";
|
||||
|
||||
if (cmd[{"-h", "--help"}]) {
|
||||
return;
|
||||
}
|
||||
|
||||
// bootstrap bot tables if they don't exist
|
||||
if (!database.DoesTableExist("bot_data")) {
|
||||
LogInfo("Bootstrapping bot tables");
|
||||
database.SourceSqlFromUrl(
|
||||
"https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/bot_tables_bootstrap.sql"
|
||||
);
|
||||
}
|
||||
else {
|
||||
LogInfo("Bot tables already exist, skipping bootstrap");
|
||||
}
|
||||
|
||||
LogInfo("Enabling bots");
|
||||
LogInfo("Setting rule Bots:Enabled to true");
|
||||
RuleManager::Instance()->SetRule("Bots:Enabled", "true", &database, true, true);
|
||||
}
|
||||
@@ -23,12 +23,12 @@ void WorldserverCLI::DatabaseDump(int argc, char **argv, argh::parser &cmd, std:
|
||||
"--compress"
|
||||
};
|
||||
|
||||
EQEmuCommand::ValidateCmdInput(arguments, options, cmd, argc, argv);
|
||||
|
||||
if (cmd[{"-h", "--help"}]) {
|
||||
return;
|
||||
}
|
||||
|
||||
EQEmuCommand::ValidateCmdInput(arguments, options, cmd, argc, argv);
|
||||
|
||||
auto s = new DatabaseDumpService();
|
||||
bool dump_all = cmd[{"-a", "--all"}];
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
#include "../worlddb.h"
|
||||
#include "../../common/database_schema.h"
|
||||
|
||||
void WorldserverCLI::MercsDisable(int argc, char **argv, argh::parser &cmd, std::string &description)
|
||||
{
|
||||
description = "Disables mercenaries";
|
||||
|
||||
if (cmd[{"-h", "--help"}]) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::string input;
|
||||
std::cout << "Warning! This will drop all merc tables, are you sure? [y/n]";
|
||||
std::getline(std::cin, input);
|
||||
|
||||
if (Strings::ToLower(input) != "y") {
|
||||
LogInfo("Aborting");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string sql = "SET FOREIGN_KEY_CHECKS = 0;";
|
||||
for (auto &t: DatabaseSchema::GetMercTables()) {
|
||||
sql += fmt::format("DROP TABLE IF EXISTS {};", t);
|
||||
LogInfo("Dropping table [{}]", t);
|
||||
}
|
||||
|
||||
sql += "SET FOREIGN_KEY_CHECKS = 1;";
|
||||
|
||||
database.QueryDatabaseMulti(sql);
|
||||
LogInfo("Setting rule Mercs:AllowMercs to false");
|
||||
RuleManager::Instance()->SetRule("Mercs:AllowMercs", "false", &database, true, true);
|
||||
LogInfo("Disabled mercs and dropped tables");
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#include "../worlddb.h"
|
||||
#include "../../common/database_schema.h"
|
||||
|
||||
void WorldserverCLI::MercsEnable(int argc, char **argv, argh::parser &cmd, std::string &description)
|
||||
{
|
||||
description = "Enables mercenaries";
|
||||
|
||||
if (cmd[{"-h", "--help"}]) {
|
||||
return;
|
||||
}
|
||||
|
||||
// bootstrap merc tables if they don't exist
|
||||
if (!database.DoesTableExist("merc_types")) {
|
||||
LogInfo("Bootstrapping merc tables");
|
||||
database.SourceSqlFromUrl(
|
||||
"https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/merc_tables_bootstrap.sql"
|
||||
);
|
||||
}
|
||||
else {
|
||||
LogInfo("Merc tables already exist, skipping bootstrap");
|
||||
}
|
||||
|
||||
LogInfo("Enabling mercs");
|
||||
LogInfo("Setting rule Mercs:AllowMercs to true");
|
||||
RuleManager::Instance()->SetRule("Mercs:AllowMercs", "true", &database, true, true);
|
||||
LogInfo("Mercs enabled");
|
||||
}
|
||||
+358
-7
@@ -361,7 +361,7 @@ void ConsoleTell(
|
||||
auto join_args = args;
|
||||
join_args.erase(join_args.begin(), join_args.begin() + 1);
|
||||
|
||||
zoneserver_list.SendChannelMessage(tmpname, to.c_str(), 7, 0, Strings::Join(join_args, " ").c_str());
|
||||
zoneserver_list.SendChannelMessage(tmpname, to.c_str(), ChatChannel_Tell, 0, Strings::Join(join_args, " ").c_str());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -382,7 +382,7 @@ void ConsoleBroadcast(
|
||||
char tmpname[64];
|
||||
tmpname[0] = '*';
|
||||
strcpy(&tmpname[1], connection->UserName().c_str());
|
||||
zoneserver_list.SendChannelMessage(tmpname, 0, 6, 0, Strings::Join(args, " ").c_str());
|
||||
zoneserver_list.SendChannelMessage(tmpname, 0, ChatChannel_Broadcast, 0, Strings::Join(args, " ").c_str());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -403,7 +403,7 @@ void ConsoleGMSay(
|
||||
char tmpname[64];
|
||||
tmpname[0] = '*';
|
||||
strcpy(&tmpname[1], connection->UserName().c_str());
|
||||
zoneserver_list.SendChannelMessage(tmpname, 0, 11, 0, Strings::Join(args, " ").c_str());
|
||||
zoneserver_list.SendChannelMessage(tmpname, 0, ChatChannel_GMSAY, 0, Strings::Join(args, " ").c_str());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -457,7 +457,7 @@ void ConsoleOOC(
|
||||
char tmpname[64];
|
||||
tmpname[0] = '*';
|
||||
strcpy(&tmpname[1], connection->UserName().c_str());
|
||||
zoneserver_list.SendChannelMessage(tmpname, 0, 5, 0, Strings::Join(args, " ").c_str());
|
||||
zoneserver_list.SendChannelMessage(tmpname, 0, ChatChannel_OOC, 0, Strings::Join(args, " ").c_str());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -478,7 +478,7 @@ void ConsoleAuction(
|
||||
char tmpname[64];
|
||||
tmpname[0] = '*';
|
||||
strcpy(&tmpname[1], connection->UserName().c_str());
|
||||
zoneserver_list.SendChannelMessage(tmpname, 0, 4, 0, Strings::Join(args, " ").c_str());
|
||||
zoneserver_list.SendChannelMessage(tmpname, 0, ChatChannel_Auction, 0, Strings::Join(args, " ").c_str());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -962,6 +962,352 @@ void ConsoleQuit(
|
||||
connection->Close();
|
||||
}
|
||||
|
||||
void ConsoleCrossZoneCastSpell(
|
||||
EQ::Net::ConsoleServerConnection *connection,
|
||||
const std::string &command,
|
||||
const std::vector<std::string> &args
|
||||
) {
|
||||
if (args.size() < 3) {
|
||||
connection->SendLine("czcast character [character_id] [spell_id]");
|
||||
connection->SendLine("czcast expedition [expedition_id] [spell_id]");
|
||||
connection->SendLine("czcast group [group_id] [spell_id]");
|
||||
connection->SendLine("czcast guild [guild_id] [spell_id]");
|
||||
connection->SendLine("czcast name [character_name] [spell_id]");
|
||||
connection->SendLine("czcast raid [raid_id] [spell_id]");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& type = Strings::ToLower(args[0]);
|
||||
|
||||
const auto is_character = type == "character";
|
||||
const auto is_expedition = type == "expedition";
|
||||
const auto is_group = type == "group";
|
||||
const auto is_guild = type == "guild";
|
||||
const auto is_name = type == "name";
|
||||
const auto is_raid = type == "raid";
|
||||
|
||||
if (
|
||||
!is_character &&
|
||||
!is_expedition &&
|
||||
!is_group &&
|
||||
!is_guild &&
|
||||
!is_name &
|
||||
!is_raid
|
||||
) {
|
||||
connection->SendLine("czcast character [character_id] [spell_id]");
|
||||
connection->SendLine("czcast expedition [expedition_id] [spell_id]");
|
||||
connection->SendLine("czcast group [group_id] [spell_id]");
|
||||
connection->SendLine("czcast guild [guild_id] [spell_id]");
|
||||
connection->SendLine("czcast name [character_name] [spell_id]");
|
||||
connection->SendLine("czcast raid [raid_id] [spell_id]");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string name;
|
||||
int update_identifier = 0;
|
||||
|
||||
if (!is_name) {
|
||||
if (Strings::IsNumber(args[1])) {
|
||||
update_identifier = Strings::ToInt(args[1]);
|
||||
}
|
||||
|
||||
if (!update_identifier) {
|
||||
connection->SendLine(fmt::format("Identifier is invalid for '{}'.", type));
|
||||
return;
|
||||
}
|
||||
} else if (is_name) {
|
||||
if (!Strings::IsNumber(args[1])) {
|
||||
name = Strings::UcFirst(Strings::ToLower(args[1]));
|
||||
}
|
||||
|
||||
if (name.empty()) {
|
||||
connection->SendLine("Empty name is invalid.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const auto spell_id = Strings::IsNumber(args[2]) ? Strings::ToUnsignedInt(args[2]) : 0;
|
||||
|
||||
if (!spell_id) {
|
||||
connection->SendLine("Spell ID is invalid.");
|
||||
return;
|
||||
}
|
||||
|
||||
uint8 update_type;
|
||||
|
||||
if (is_character) {
|
||||
update_type = CZUpdateType_Character;
|
||||
} else if (is_expedition) {
|
||||
update_type = CZUpdateType_Expedition;
|
||||
} else if (is_group) {
|
||||
update_type = CZUpdateType_Group;
|
||||
} else if (is_guild) {
|
||||
update_type = CZUpdateType_Guild;
|
||||
} else if (is_name) {
|
||||
update_type = CZUpdateType_ClientName;
|
||||
} else if (is_raid) {
|
||||
update_type = CZUpdateType_Raid;
|
||||
}
|
||||
|
||||
auto pack = new ServerPacket(ServerOP_CZSpell, sizeof(CZSpell_Struct));
|
||||
auto* CZS = (CZSpell_Struct*) pack->pBuffer;
|
||||
|
||||
CZS->update_type = update_type;
|
||||
CZS->update_subtype = CZSpellUpdateSubtype_Cast;
|
||||
CZS->update_identifier = update_identifier;
|
||||
CZS->spell_id = spell_id;
|
||||
|
||||
strn0cpy(CZS->client_name, name.c_str(), sizeof(CZS->client_name));
|
||||
|
||||
zoneserver_list.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
|
||||
connection->SendLine(
|
||||
fmt::format(
|
||||
"Casting spell ID {} across zones by {} with an identifier of {}.",
|
||||
spell_id,
|
||||
type,
|
||||
!is_name ? std::to_string(update_identifier) : name
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
void ConsoleWorldWideCastSpell(
|
||||
EQ::Net::ConsoleServerConnection *connection,
|
||||
const std::string &command,
|
||||
const std::vector<std::string> &args
|
||||
) {
|
||||
if (args.size() < 1) {
|
||||
connection->SendLine("wwcast [spell_id]");
|
||||
connection->SendLine("wwcast [spell_id] [min_status]");
|
||||
connection->SendLine("wwcast [spell_id] [min_status] [max_status]");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto spell_id = Strings::IsNumber(args[0]) ? Strings::ToUnsignedInt(args[0]) : 0;
|
||||
|
||||
if (!spell_id) {
|
||||
connection->SendLine("Spell ID 0 is invalid.");
|
||||
return;
|
||||
}
|
||||
|
||||
uint8 min_status = AccountStatus::Player;
|
||||
uint8 max_status = AccountStatus::Player;
|
||||
|
||||
if (args.size() >= 2 && Strings::IsNumber(args[1])) {
|
||||
min_status = static_cast<uint8>(Strings::ToUnsignedInt(args[1]));
|
||||
}
|
||||
|
||||
if (args.size() >= 3 && Strings::IsNumber(args[2])) {
|
||||
max_status = static_cast<uint8>(Strings::ToUnsignedInt(args[2]));
|
||||
}
|
||||
|
||||
auto pack = new ServerPacket(ServerOP_WWSpell, sizeof(WWSpell_Struct));
|
||||
auto* WWS = (WWSpell_Struct*) pack->pBuffer;
|
||||
|
||||
WWS->update_type = WWSpellUpdateType_Cast;
|
||||
WWS->spell_id = spell_id;
|
||||
WWS->min_status = min_status;
|
||||
WWS->max_status = max_status;
|
||||
|
||||
zoneserver_list.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
|
||||
connection->SendLine(
|
||||
fmt::format(
|
||||
"Casting spell ID {} world wide for players with a status between {} and {}.",
|
||||
spell_id,
|
||||
min_status,
|
||||
max_status
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
void ConsoleCrossZoneMove(
|
||||
EQ::Net::ConsoleServerConnection *connection,
|
||||
const std::string &command,
|
||||
const std::vector<std::string> &args
|
||||
) {
|
||||
if (args.size() < 3) {
|
||||
connection->SendLine("czmove character [character_id] [instance_id]");
|
||||
connection->SendLine("czmove character [character_id] [zone_short_name]");
|
||||
connection->SendLine("czmove expedition [expedition_id] [instance_id]");
|
||||
connection->SendLine("czmove expedition [expedition_id] [zone_short_name]");
|
||||
connection->SendLine("czmove group [group_id] [instance_id]");
|
||||
connection->SendLine("czmove group [group_id] [zone_short_name]");
|
||||
connection->SendLine("czmove guild [guild_id] [instance_id]");
|
||||
connection->SendLine("czmove guild [guild_id] [zone_short_name]");
|
||||
connection->SendLine("czmove name [character_name] [instance_id]");
|
||||
connection->SendLine("czmove name [character_name] [zone_short_name]");
|
||||
connection->SendLine("czmove raid [raid_id] [instance_id]");
|
||||
connection->SendLine("czmove raid [raid_id] [zone_short_name]");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& type = Strings::ToLower(args[0]);
|
||||
|
||||
const auto is_character = type == "character";
|
||||
const auto is_expedition = type == "expedition";
|
||||
const auto is_group = type == "group";
|
||||
const auto is_guild = type == "guild";
|
||||
const auto is_name = type == "name";
|
||||
const auto is_raid = type == "raid";
|
||||
|
||||
if (
|
||||
!is_character &&
|
||||
!is_expedition &&
|
||||
!is_group &&
|
||||
!is_guild &&
|
||||
!is_name &
|
||||
!is_raid
|
||||
) {
|
||||
connection->SendLine("czmove character [character_id] [instance_id]");
|
||||
connection->SendLine("czmove character [character_id] [zone_short_name]");
|
||||
connection->SendLine("czmove expedition [expedition_id] [instance_id]");
|
||||
connection->SendLine("czmove expedition [expedition_id] [zone_short_name]");
|
||||
connection->SendLine("czmove group [group_id] [instance_id]");
|
||||
connection->SendLine("czmove group [group_id] [zone_short_name]");
|
||||
connection->SendLine("czmove guild [guild_id] [instance_id]");
|
||||
connection->SendLine("czmove guild [guild_id] [zone_short_name]");
|
||||
connection->SendLine("czmove name [character_name] [instance_id]");
|
||||
connection->SendLine("czmove name [character_name] [zone_short_name]");
|
||||
connection->SendLine("czmove raid [raid_id] [instance_id]");
|
||||
connection->SendLine("czmove raid [raid_id] [zone_short_name]");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string name;
|
||||
int update_identifier = 0;
|
||||
|
||||
if (!is_name) {
|
||||
if (Strings::IsNumber(args[1])) {
|
||||
update_identifier = Strings::ToInt(args[1]);
|
||||
}
|
||||
|
||||
if (!update_identifier) {
|
||||
connection->SendLine(fmt::format("Identifier invalid for '{}'.", type));
|
||||
return;
|
||||
}
|
||||
} else if (is_name) {
|
||||
if (!Strings::IsNumber(args[1])) {
|
||||
name = Strings::UcFirst(Strings::ToLower(args[1]));
|
||||
}
|
||||
|
||||
if (name.empty()) {
|
||||
connection->SendLine("Empty name is invalid.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const auto& zone_short_name = !Strings::IsNumber(args[2]) ? args[2] : "";
|
||||
const uint16 instance_id = Strings::IsNumber(args[2]) ? static_cast<uint16>(Strings::ToUnsignedInt(args[2])) : 0;
|
||||
|
||||
const auto& z = !zone_short_name.empty() ? zone_store.GetZone(zone_short_name) : nullptr;
|
||||
|
||||
if (z && !z->id) {
|
||||
connection->SendLine(fmt::format("No zone with the short name '{}' exists.", zone_short_name));
|
||||
return;
|
||||
}
|
||||
|
||||
uint8 update_type;
|
||||
|
||||
if (is_character) {
|
||||
update_type = CZUpdateType_Character;
|
||||
} else if (is_expedition) {
|
||||
update_type = CZUpdateType_Expedition;
|
||||
} else if (is_group) {
|
||||
update_type = CZUpdateType_Group;
|
||||
} else if (is_guild) {
|
||||
update_type = CZUpdateType_Guild;
|
||||
} else if (is_name) {
|
||||
update_type = CZUpdateType_ClientName;
|
||||
} else if (is_raid) {
|
||||
update_type = CZUpdateType_Raid;
|
||||
}
|
||||
|
||||
auto pack = new ServerPacket(ServerOP_CZMove, sizeof(CZMove_Struct));
|
||||
auto* CZM = (CZMove_Struct*) pack->pBuffer;
|
||||
|
||||
CZM->update_type = update_type;
|
||||
CZM->update_subtype = !instance_id ? CZMoveUpdateSubtype_MoveZone : CZMoveUpdateSubtype_MoveZoneInstance;
|
||||
CZM->update_identifier = update_identifier;
|
||||
CZM->instance_id = instance_id;
|
||||
|
||||
strn0cpy(CZM->zone_short_name, zone_short_name.c_str(), sizeof(CZM->zone_short_name));
|
||||
strn0cpy(CZM->client_name, name.c_str(), sizeof(CZM->client_name));
|
||||
|
||||
zoneserver_list.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
|
||||
connection->SendLine(
|
||||
fmt::format(
|
||||
"Moving player(s) to {} by {} with an identifier of {}.",
|
||||
!instance_id ? fmt::format("{} ({})", z->long_name, z->short_name) : fmt::format("Instance ID {}", instance_id),
|
||||
type,
|
||||
!is_name ? std::to_string(update_identifier) : name
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
void ConsoleWorldWideMove(
|
||||
EQ::Net::ConsoleServerConnection *connection,
|
||||
const std::string &command,
|
||||
const std::vector<std::string> &args
|
||||
) {
|
||||
if (args.size() < 1) {
|
||||
connection->SendLine("wwmove [instance_id]");
|
||||
connection->SendLine("wwmove [instance_id] [min_status]");
|
||||
connection->SendLine("wwmove [instance_id] [min_status] [max_status]");
|
||||
connection->SendLine("wwmove [zone_short_name]");
|
||||
connection->SendLine("wwmove [zone_short_name] [min_status]");
|
||||
connection->SendLine("wwmove [zone_short_name] [min_status] [max_status]");
|
||||
return;
|
||||
}
|
||||
\
|
||||
const auto& zone_short_name = !Strings::IsNumber(args[2]) ? args[2] : "";
|
||||
const uint16 instance_id = Strings::IsNumber(args[2]) ? static_cast<uint16>(Strings::ToUnsignedInt(args[2])) : 0;
|
||||
|
||||
const auto& z = !zone_short_name.empty() ? zone_store.GetZone(zone_short_name) : nullptr;
|
||||
|
||||
if (z && !z->id) {
|
||||
connection->SendLine(fmt::format("No zone with the short name '{}' exists.", zone_short_name));
|
||||
return;
|
||||
}
|
||||
|
||||
uint8 min_status = AccountStatus::Player;
|
||||
uint8 max_status = AccountStatus::Player;
|
||||
|
||||
if (args.size() >= 2 && Strings::IsNumber(args[1])) {
|
||||
min_status = static_cast<uint8>(Strings::ToUnsignedInt(args[1]));
|
||||
}
|
||||
|
||||
if (args.size() >= 3 && Strings::IsNumber(args[2])) {
|
||||
max_status = static_cast<uint8>(Strings::ToUnsignedInt(args[2]));
|
||||
}
|
||||
|
||||
auto pack = new ServerPacket(ServerOP_WWMove, sizeof(WWMove_Struct));
|
||||
auto* WWM = (WWMove_Struct*) pack->pBuffer;
|
||||
|
||||
WWM->update_type = !instance_id ? WWMoveUpdateType_MoveZone : WWMoveUpdateType_MoveZoneInstance;
|
||||
WWM->instance_id = instance_id;
|
||||
WWM->min_status = min_status;
|
||||
WWM->max_status = max_status;
|
||||
|
||||
strn0cpy(WWM->zone_short_name, zone_short_name.c_str(), sizeof(WWM->zone_short_name));
|
||||
|
||||
zoneserver_list.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
|
||||
connection->SendLine(
|
||||
fmt::format(
|
||||
"Moving player(s) to {} for players with a status between {} and {}.",
|
||||
!instance_id ? fmt::format("{} ({})", z->long_name, z->short_name) : fmt::format("Instance ID {}", instance_id),
|
||||
min_status,
|
||||
max_status
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param console
|
||||
@@ -973,17 +1319,20 @@ void RegisterConsoleFunctions(std::unique_ptr<EQ::Net::ConsoleServer>& console)
|
||||
console->RegisterCall("api", 200, "api", std::bind(ConsoleApi, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("auction", 50, "auction [message]", std::bind(ConsoleAuction, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("broadcast", 50, "broadcast [message]", std::bind(ConsoleBroadcast, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("czcast", 50, "czcast [type] [identifier] [spell_id]", std::bind(ConsoleCrossZoneCastSpell, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("czmove", 50, "czmove [type] [identifier] [instance_id|zone_short_name] - instance_id and zone_short_name are interchangeable", std::bind(ConsoleCrossZoneMove, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("echo", 50, "echo [on/off]", std::bind(ConsoleNull, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("emote", 50, "emote [zonename or charname or world] [type] [message]", std::bind(ConsoleEmote, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("flag", 200, "flag [status] [accountname]", std::bind(ConsoleFlag, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("gmsay", 50, "gmsay [message]", std::bind(ConsoleGMSay, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("guildsay", 50, "guildsay [Character Name] [Guild ID] [Message]", std::bind(ConsoleGuildSay, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("iplookup", 50, "IPLookup [name]", std::bind(ConsoleIpLookup, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("iplookup", 50, "iplookup [name]", std::bind(ConsoleIpLookup, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("kick", 150, "kick [charname]", std::bind(ConsoleKick, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("lock", 150, "lock", std::bind(ConsoleLock, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("lsreconnect", 50, "LSReconnect", std::bind(ConsoleNull, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("md5", 50, "md5", std::bind(ConsoleMd5, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("ooc", 50, "ooc [message]", std::bind(ConsoleOOC, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("ping", 50, "ping", std::bind(ConsoleNull, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("reloadworld", 200, "reloadworld", std::bind(ConsoleReloadWorld, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("reloadzonequests", 200, "reloadzonequests [zone_short_name]", std::bind(ConsoleReloadZoneQuests, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("setpass", 200, "setpass [account_name] [new_password]", std::bind(ConsoleSetPass, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
@@ -995,10 +1344,12 @@ void RegisterConsoleFunctions(std::unique_ptr<EQ::Net::ConsoleServer>& console)
|
||||
console->RegisterCall("who", 50, "who", std::bind(ConsoleWho, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("whoami", 50, "whoami", std::bind(ConsoleWhoami, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("worldshutdown", 200, "worldshutdown", std::bind(ConsoleWorldShutdown, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("wwcast", 50, "wwcast [spell_id] [min_status] [max_status] - min_status and max_status are optional", std::bind(ConsoleWorldWideCastSpell, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("wwmove", 50, "wwmove [instance_id|zone_short_name] [min_status] [max_status] - min_status and max_status are optional, instance_id and zone_short_name are interchangeable", std::bind(ConsoleWorldWideMove, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("zonebootup", 150, "zonebootup [zone_server_id] [zone_short_name]", std::bind(ConsoleZoneBootup, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("zonelock", 150, "zonelock [list|lock|unlock] [zone_short_name]", std::bind(ConsoleZoneLock, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("zoneshutdown", 150, "zoneshutdown [zone_short_name or zone_server_id]", std::bind(ConsoleZoneShutdown, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("zonestatus", 50, "zonestatus", std::bind(ConsoleZoneStatus, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));console->RegisterCall("ping", 50, "ping", std::bind(ConsoleNull, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("zonestatus", 50, "zonestatus", std::bind(ConsoleZoneStatus, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("quit", 50, "quit", std::bind(ConsoleQuit, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
console->RegisterCall("exit", 50, "exit", std::bind(ConsoleQuit, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||
}
|
||||
|
||||
@@ -146,6 +146,7 @@ std::vector<Reload> reload_types = {
|
||||
Reload{.command = "merchants", .opcode = ServerOP_ReloadMerchants, .desc = "Merchants"},
|
||||
Reload{.command = "npc_emotes", .opcode = ServerOP_ReloadNPCEmotes, .desc = "NPC Emotes"},
|
||||
Reload{.command = "objects", .opcode = ServerOP_ReloadObjects, .desc = "Objects"},
|
||||
Reload{.command = "opcodes", .opcode = ServerOP_ReloadOpcodes, .desc = "Opcodes"},
|
||||
Reload{.command = "perl_export", .opcode = ServerOP_ReloadPerlExportSettings, .desc = "Perl Event Export Settings"},
|
||||
Reload{.command = "rules", .opcode = ServerOP_ReloadRules, .desc = "Rules"},
|
||||
Reload{.command = "static", .opcode = ServerOP_ReloadStaticZoneData, .desc = "Static Zone Data"},
|
||||
|
||||
@@ -20,6 +20,10 @@ void WorldserverCLI::CommandHandler(int argc, char **argv)
|
||||
/**
|
||||
* Register commands
|
||||
*/
|
||||
function_map["bots:enable"] = &WorldserverCLI::BotsEnable;
|
||||
function_map["bots:disable"] = &WorldserverCLI::BotsDisable;
|
||||
function_map["mercs:enable"] = &WorldserverCLI::MercsEnable;
|
||||
function_map["mercs:disable"] = &WorldserverCLI::MercsDisable;
|
||||
function_map["world:version"] = &WorldserverCLI::Version;
|
||||
function_map["character:copy-character"] = &WorldserverCLI::CopyCharacter;
|
||||
function_map["database:version"] = &WorldserverCLI::DatabaseVersion;
|
||||
@@ -37,6 +41,10 @@ void WorldserverCLI::CommandHandler(int argc, char **argv)
|
||||
EQEmuCommand::HandleMenu(function_map, cmd, argc, argv);
|
||||
}
|
||||
|
||||
#include "cli/bots_enable.cpp"
|
||||
#include "cli/bots_disable.cpp"
|
||||
#include "cli/mercs_enable.cpp"
|
||||
#include "cli/mercs_disable.cpp"
|
||||
#include "cli/database_concurrency.cpp"
|
||||
#include "cli/copy_character.cpp"
|
||||
#include "cli/database_dump.cpp"
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
class WorldserverCLI {
|
||||
public:
|
||||
static void CommandHandler(int argc, char **argv);
|
||||
static void BotsEnable(int argc, char **argv, argh::parser &cmd, std::string &description);
|
||||
static void BotsDisable(int argc, char **argv, argh::parser &cmd, std::string &description);
|
||||
static void MercsEnable(int argc, char **argv, argh::parser &cmd, std::string &description);
|
||||
static void MercsDisable(int argc, char **argv, argh::parser &cmd, std::string &description);
|
||||
static void Version(int argc, char **argv, argh::parser &cmd, std::string &description);
|
||||
static void CopyCharacter(int argc, char **argv, argh::parser &cmd, std::string &description);
|
||||
static void DatabaseVersion(int argc, char **argv, argh::parser &cmd, std::string &description);
|
||||
|
||||
@@ -45,6 +45,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "../common/content/world_content_service.h"
|
||||
#include "../common/repositories/player_event_logs_repository.h"
|
||||
#include "../common/events/player_event_logs.h"
|
||||
#include "../common/patches/patches.h"
|
||||
|
||||
extern ClientList client_list;
|
||||
extern GroupLFPList LFPGroupList;
|
||||
@@ -1296,6 +1297,10 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
QSLink.SendPacket(pack);
|
||||
break;
|
||||
}
|
||||
case ServerOP_ReloadOpcodes: {
|
||||
ReloadAllPatches();
|
||||
break;
|
||||
}
|
||||
case ServerOP_CZDialogueWindow:
|
||||
case ServerOP_CZLDoNUpdate:
|
||||
case ServerOP_CZMarquee:
|
||||
|
||||
@@ -228,7 +228,6 @@ SET(zone_headers
|
||||
lua_stat_bonuses.h
|
||||
map.h
|
||||
masterentity.h
|
||||
message.h
|
||||
merc.h
|
||||
mob.h
|
||||
mob_movement_manager.h
|
||||
|
||||
+2
-2
@@ -1320,7 +1320,7 @@ void Client::ActivateAlternateAdvancementAbility(int rank_id, int target_id) {
|
||||
timer_duration = 0;
|
||||
}
|
||||
|
||||
if (!IsCastWhileInvis(rank->spell))
|
||||
if (!IsCastWhileInvisibleSpell(rank->spell))
|
||||
CommonBreakInvisible();
|
||||
|
||||
if (spells[rank->spell].sneak && (!hidden || (hidden && (Timer::GetCurrentTime() - tmHidden) < 4000))) {
|
||||
@@ -1333,7 +1333,7 @@ void Client::ActivateAlternateAdvancementAbility(int rank_id, int target_id) {
|
||||
target_id = GetPetID();
|
||||
|
||||
// extra handling for cast_not_standing spells
|
||||
if (!IgnoreCastingRestriction(rank->spell)) {
|
||||
if (!IsCastNotStandingSpell(rank->spell)) {
|
||||
if (GetAppearance() == eaSitting) // we need to stand!
|
||||
SetAppearance(eaStanding, false);
|
||||
|
||||
|
||||
+3
-15
@@ -21,22 +21,10 @@
|
||||
#include "masterentity.h"
|
||||
#include "aa_ability.h"
|
||||
|
||||
AA::Rank *AA::Ability::GetMaxRank() {
|
||||
if(!first)
|
||||
return nullptr;
|
||||
|
||||
Rank *current = first;
|
||||
while(current->next) {
|
||||
current = current->next;
|
||||
}
|
||||
|
||||
return current;
|
||||
}
|
||||
|
||||
AA::Rank *AA::Ability::GetRankByPointsSpent(int current_level) {
|
||||
if(current_level == 0)
|
||||
return nullptr;
|
||||
|
||||
|
||||
if(!first)
|
||||
return nullptr;
|
||||
|
||||
@@ -65,6 +53,6 @@ int AA::Ability::GetMaxLevel(Mob *who) {
|
||||
max_level++;
|
||||
current = current->next;
|
||||
}
|
||||
|
||||
|
||||
return max_level;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ public:
|
||||
Ability() { }
|
||||
~Ability() { }
|
||||
|
||||
Rank *GetMaxRank();
|
||||
Rank *GetRankByPointsSpent(int current_level);
|
||||
int GetMaxLevel(Mob *who);
|
||||
|
||||
|
||||
+1
-1
@@ -1161,7 +1161,7 @@ bool Mob::CheckLosFN(glm::vec3 posWatcher, float sizeWatcher, glm::vec3 posTarge
|
||||
//offensive spell aggro
|
||||
int32 Mob::CheckAggroAmount(uint16 spell_id, Mob *target, bool isproc)
|
||||
{
|
||||
if (NoDetrimentalSpellAggro(spell_id))
|
||||
if (IsNoDetrimentalSpellAggroSpell(spell_id))
|
||||
return 0;
|
||||
|
||||
int32 AggroAmount = 0;
|
||||
|
||||
+15
-7
@@ -160,7 +160,7 @@ int Mob::compute_tohit(EQ::skills::SkillType skillinuse)
|
||||
if (IsNPC())
|
||||
tohit += CastToNPC()->GetAccuracyRating();
|
||||
if (IsClient()) {
|
||||
double reduction = CastToClient()->m_pp.intoxication / 2.0;
|
||||
double reduction = CastToClient()->GetIntoxication() / 2.0;
|
||||
if (reduction > 20.0) {
|
||||
reduction = std::min((110 - reduction) / 100.0, 1.0);
|
||||
tohit = reduction * static_cast<double>(tohit);
|
||||
@@ -256,7 +256,7 @@ int Mob::compute_defense()
|
||||
defense += CastToNPC()->GetAvoidanceRating();
|
||||
|
||||
if (IsClient()) {
|
||||
double reduction = CastToClient()->m_pp.intoxication / 2.0;
|
||||
double reduction = CastToClient()->GetIntoxication() / 2.0;
|
||||
if (reduction > 20.0) {
|
||||
reduction = std::min((110 - reduction) / 100.0, 1.0);
|
||||
defense = reduction * static_cast<double>(defense);
|
||||
@@ -2958,7 +2958,7 @@ void Mob::AddToHateList(Mob* other, int64 hate /*= 0*/, int64 damage /*= 0*/, bo
|
||||
if (GetSpecialAbility(IMMUNE_AGGRO_CLIENT) && other->IsClient())
|
||||
return;
|
||||
|
||||
if (IsValidSpell(spell_id) && NoDetrimentalSpellAggro(spell_id))
|
||||
if (IsValidSpell(spell_id) && IsNoDetrimentalSpellAggroSpell(spell_id))
|
||||
return;
|
||||
|
||||
if (other == myowner)
|
||||
@@ -4447,11 +4447,19 @@ void Mob::HealDamage(uint64 amount, Mob* caster, uint16 spell_id)
|
||||
}
|
||||
}
|
||||
else { // normal heals
|
||||
FilteredMessageString(caster, Chat::NonMelee, FilterSpellDamage,
|
||||
YOU_HEALED, caster->GetCleanName(), itoa(acthealed));
|
||||
// Message to caster
|
||||
if (caster->IsClient()) {
|
||||
caster->FilteredMessageString(caster, Chat::NonMelee,
|
||||
FilterSpellDamage, YOU_HEAL, GetCleanName(),
|
||||
itoa(acthealed));
|
||||
}
|
||||
|
||||
caster->FilteredMessageString(caster, Chat::NonMelee, FilterSpellDamage,
|
||||
YOU_HEAL, GetCleanName(), itoa(acthealed));
|
||||
// Message to target
|
||||
if (IsClient() && caster != this) {
|
||||
FilteredMessageString(caster, Chat::NonMelee,
|
||||
FilterSpellDamage, YOU_HEALED, caster->GetCleanName(),
|
||||
itoa(acthealed));
|
||||
}
|
||||
}
|
||||
} else if (
|
||||
CastToClient()->GetFilter(FilterHealOverTime) != FilterShowSelfOnly ||
|
||||
|
||||
+9
-20
@@ -146,18 +146,7 @@ void Mob::CalcItemBonuses(StatBonuses* b) {
|
||||
int16 i;
|
||||
|
||||
for (i = EQ::invslot::BONUS_BEGIN; i <= EQ::invslot::BONUS_SKILL_END; i++) {
|
||||
const EQ::ItemInstance* inst = nullptr;
|
||||
if (IsOfClientBotMerc()) {
|
||||
inst = GetInv().GetItem(i);
|
||||
} else {
|
||||
const auto* item = CastToNPC()->GetItem(i);
|
||||
if (!item) {
|
||||
continue;
|
||||
}
|
||||
|
||||
inst = database.CreateItem(item->item_id);
|
||||
}
|
||||
|
||||
const EQ::ItemInstance* inst = GetInv().GetItem(i);
|
||||
if (!inst) {
|
||||
continue;
|
||||
}
|
||||
@@ -5959,26 +5948,26 @@ void Mob::CalcHeroicBonuses(StatBonuses* newbon)
|
||||
|
||||
void Mob::SetHeroicWisBonuses(StatBonuses* n)
|
||||
{
|
||||
n->heroic_max_mana += IsWISCasterClass(GetClass()) ? GetHeroicWIS() * RuleR(Character, HeroicWisdomMultiplier) * 10 : 0;
|
||||
n->heroic_mana_regen += IsWISCasterClass(GetClass()) ? GetHeroicWIS() * RuleR(Character, HeroicWisdomMultiplier) / 25 : 0;
|
||||
n->heroic_max_mana += IsHeroicWISCasterClass(GetClass()) ? GetHeroicWIS() * RuleR(Character, HeroicWisdomMultiplier) * 10 : 0;
|
||||
n->heroic_mana_regen += IsHeroicWISCasterClass(GetClass()) ? GetHeroicWIS() * RuleR(Character, HeroicWisdomMultiplier) / 25 : 0;
|
||||
n->HealAmt += GetHeroicWIS() * RuleR(Character, HeroicWisdomIncreaseHealAmtMultiplier);
|
||||
|
||||
if (RuleB(Character, HeroicStatsUseDataBucketsToScale)) {
|
||||
n->heroic_max_mana += IsWISCasterClass(GetClass()) ? GetHeroicWIS() * CheckHeroicBonusesDataBuckets(HeroicBonusBucket::WisMaxMana) * 10 : 0;
|
||||
n->heroic_mana_regen += IsWISCasterClass(GetClass()) ? GetHeroicWIS() * CheckHeroicBonusesDataBuckets(HeroicBonusBucket::WisManaRegen) / 25 : 0;
|
||||
n->heroic_max_mana += IsHeroicWISCasterClass(GetClass()) ? GetHeroicWIS() * CheckHeroicBonusesDataBuckets(HeroicBonusBucket::WisMaxMana) * 10 : 0;
|
||||
n->heroic_mana_regen += IsHeroicWISCasterClass(GetClass()) ? GetHeroicWIS() * CheckHeroicBonusesDataBuckets(HeroicBonusBucket::WisManaRegen) / 25 : 0;
|
||||
n->HealAmt += GetHeroicWIS() * CheckHeroicBonusesDataBuckets(HeroicBonusBucket::WisHealAmt);
|
||||
}
|
||||
}
|
||||
|
||||
void Mob::SetHeroicIntBonuses(StatBonuses* n)
|
||||
{
|
||||
n->heroic_max_mana += IsINTCasterClass(GetClass()) ? GetHeroicINT() * RuleR(Character, HeroicIntelligenceMultiplier) * 10 : 0;
|
||||
n->heroic_mana_regen += IsINTCasterClass(GetClass()) ? GetHeroicINT() * RuleR(Character, HeroicIntelligenceMultiplier) / 25 : 0;
|
||||
n->heroic_max_mana += IsHeroicINTCasterClass(GetClass()) ? GetHeroicINT() * RuleR(Character, HeroicIntelligenceMultiplier) * 10 : 0;
|
||||
n->heroic_mana_regen += IsHeroicINTCasterClass(GetClass()) ? GetHeroicINT() * RuleR(Character, HeroicIntelligenceMultiplier) / 25 : 0;
|
||||
n->SpellDmg += GetHeroicINT() * RuleR(Character, HeroicIntelligenceIncreaseSpellDmgMultiplier);
|
||||
|
||||
if (RuleB(Character, HeroicStatsUseDataBucketsToScale)) {
|
||||
n->heroic_max_mana += IsINTCasterClass(GetClass()) ? GetHeroicINT() * CheckHeroicBonusesDataBuckets(HeroicBonusBucket::IntMaxMana) * 10 : 0;
|
||||
n->heroic_mana_regen += IsINTCasterClass(GetClass()) ? GetHeroicINT() * CheckHeroicBonusesDataBuckets(HeroicBonusBucket::IntManaRegen) / 25 : 0;
|
||||
n->heroic_max_mana += IsHeroicINTCasterClass(GetClass()) ? GetHeroicINT() * CheckHeroicBonusesDataBuckets(HeroicBonusBucket::IntMaxMana) * 10 : 0;
|
||||
n->heroic_mana_regen += IsHeroicINTCasterClass(GetClass()) ? GetHeroicINT() * CheckHeroicBonusesDataBuckets(HeroicBonusBucket::IntManaRegen) / 25 : 0;
|
||||
n->SpellDmg += GetHeroicINT() * CheckHeroicBonusesDataBuckets(HeroicBonusBucket::IntSpellDmg);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -259,7 +259,7 @@ Bot::Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double to
|
||||
|
||||
const SPDat_Spell_Struct& spell = spells[buffs[j1].spellid];
|
||||
|
||||
if (int NimbusEffect = GetNimbusEffect(buffs[j1].spellid); NimbusEffect && !IsNimbusEffectActive(NimbusEffect)) {
|
||||
if (int NimbusEffect = GetSpellNimbusEffect(buffs[j1].spellid); NimbusEffect && !IsNimbusEffectActive(NimbusEffect)) {
|
||||
SendSpellEffect(NimbusEffect, 500, 0, 1, 3000, true);
|
||||
}
|
||||
|
||||
@@ -4890,7 +4890,7 @@ void Bot::DoSpecialAttackDamage(Mob *who, EQ::skills::SkillType skill, int32 max
|
||||
if (botweapon->ItemType == EQ::item::ItemTypeShield)
|
||||
hate += botweapon->AC;
|
||||
|
||||
hate = (hate * (100 + GetFuriousBash(botweapon->Focus.Effect)) / 100);
|
||||
hate = (hate * (100 + GetSpellFuriousBash(botweapon->Focus.Effect)) / 100);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5536,7 +5536,7 @@ int32 Bot::GetActSpellDuration(uint16 spell_id, int32 duration) {
|
||||
increase += 20;
|
||||
}
|
||||
|
||||
if (IsMezSpell(spell_id))
|
||||
if (IsMesmerizeSpell(spell_id))
|
||||
tic_inc += GetAA(aaMesmerizationMastery);
|
||||
|
||||
return (((duration * increase) / 100) + tic_inc);
|
||||
@@ -6326,7 +6326,7 @@ void Bot::CalcRestState() {
|
||||
for (unsigned int j = 0; j < buff_count; j++) {
|
||||
if (IsValidSpell(buffs[j].spellid)) {
|
||||
if (IsDetrimentalSpell(buffs[j].spellid) && (buffs[j].ticsremaining > 0))
|
||||
if (!DetrimentalSpellAllowsRest(buffs[j].spellid))
|
||||
if (!IsRestAllowedSpell(buffs[j].spellid))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
+19
-19
@@ -110,7 +110,7 @@ bool Bot::BotCastSong(Mob* tar, uint8 botLevel) {
|
||||
continue;
|
||||
if (!CheckSpellRecastTimers(this, iter.SpellIndex))
|
||||
continue;
|
||||
if (!IsSpellUsableThisZoneType(iter.SpellId, zone->GetZoneType()))
|
||||
if (!IsSpellUsableInThisZoneType(iter.SpellId, zone->GetZoneType()))
|
||||
continue;
|
||||
switch (spells[iter.SpellId].target_type) {
|
||||
case ST_AEBard:
|
||||
@@ -144,7 +144,7 @@ bool Bot::BotCastCombatSong(Mob* tar, uint8 botLevel) {
|
||||
continue;
|
||||
if (!CheckSpellRecastTimers(this, iter.SpellIndex))
|
||||
continue;
|
||||
if (!IsSpellUsableThisZoneType(iter.SpellId, zone->GetZoneType()))
|
||||
if (!IsSpellUsableInThisZoneType(iter.SpellId, zone->GetZoneType()))
|
||||
continue;
|
||||
switch (spells[iter.SpellId].target_type) {
|
||||
case ST_AEBard:
|
||||
@@ -176,7 +176,7 @@ bool Bot::BotCastHateReduction(Mob* tar, uint8 botLevel, const BotSpell& botSpel
|
||||
continue;
|
||||
if (!CheckSpellRecastTimers(this, iter.SpellIndex))
|
||||
continue;
|
||||
if (!IsSpellUsableThisZoneType(iter.SpellId, zone->GetZoneType()))
|
||||
if (!IsSpellUsableInThisZoneType(iter.SpellId, zone->GetZoneType()))
|
||||
continue;
|
||||
if (spells[iter.SpellId].target_type != ST_Target)
|
||||
continue;
|
||||
@@ -262,7 +262,7 @@ bool Bot::BotCastDebuff(Mob* tar, uint8 botLevel, BotSpell& botSpell, bool check
|
||||
bool casted_spell = false;
|
||||
if ((tar->GetHPRatio() <= 99.0f) && (tar->GetHPRatio() > 20.0f))
|
||||
{
|
||||
if (!checked_los && !CheckLosFN(tar)) {
|
||||
if (!checked_los && (!CheckLosFN(tar) || !CheckWaterLoS(tar))) {
|
||||
return casted_spell;
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ bool Bot::BotCastSlow(Mob* tar, uint8 botLevel, uint8 botClass, BotSpell& botSpe
|
||||
bool casted_spell = false;
|
||||
if (tar->GetHPRatio() <= 99.0f) {
|
||||
|
||||
if (!checked_los && !CheckLosFN(tar)) {
|
||||
if (!checked_los && (!CheckLosFN(tar) || !CheckWaterLoS(tar))) {
|
||||
return casted_spell;
|
||||
}
|
||||
|
||||
@@ -316,7 +316,7 @@ bool Bot::BotCastSlow(Mob* tar, uint8 botLevel, uint8 botClass, BotSpell& botSpe
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!IsSpellUsableThisZoneType(iter.SpellId, zone->GetZoneType())) {
|
||||
if (!IsSpellUsableInThisZoneType(iter.SpellId, zone->GetZoneType())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -387,7 +387,7 @@ bool Bot::BotCastDOT(Mob* tar, uint8 botLevel, const BotSpell& botSpell, const b
|
||||
bool casted_spell = false;
|
||||
|
||||
if ((tar->GetHPRatio() <= 98.0f) && (tar->DontDotMeBefore() < Timer::GetCurrentTime()) && (tar->GetHPRatio() > 15.0f)) {
|
||||
if (!checked_los && !CheckLosFN(tar)) {
|
||||
if (!checked_los && (!CheckLosFN(tar) || !CheckWaterLoS(tar))) {
|
||||
return casted_spell;
|
||||
}
|
||||
|
||||
@@ -470,7 +470,7 @@ bool Bot::BotCastDOT(Mob* tar, uint8 botLevel, const BotSpell& botSpell, const b
|
||||
bool Bot::BotCastSnare(Mob* tar, uint8 botLevel, BotSpell& botSpell, const bool& checked_los, uint32 iSpellTypes) {
|
||||
bool casted_spell = false;
|
||||
if (tar->DontSnareMeBefore() < Timer::GetCurrentTime()) {
|
||||
if (!checked_los && !CheckLosFN(tar)) {
|
||||
if (!checked_los && (!CheckLosFN(tar) || !CheckWaterLoS(tar))) {
|
||||
return casted_spell;
|
||||
}
|
||||
|
||||
@@ -501,7 +501,7 @@ bool Bot::BotCastSnare(Mob* tar, uint8 botLevel, BotSpell& botSpell, const bool&
|
||||
bool Bot::BotCastLifetap(Mob* tar, uint8 botLevel, BotSpell& botSpell, const bool& checked_los, uint32 iSpellTypes) {
|
||||
bool casted_spell = false;
|
||||
if (GetHPRatio() < 90.0f) {
|
||||
if (!checked_los && !CheckLosFN(tar)) {
|
||||
if (!checked_los && (!CheckLosFN(tar) || !CheckWaterLoS(tar))) {
|
||||
return casted_spell;
|
||||
}
|
||||
|
||||
@@ -582,7 +582,7 @@ bool Bot::BotCastCombatBuff(Mob* tar, uint8 botLevel, uint8 botClass) {
|
||||
if (
|
||||
((IsEffectInSpell(s.SpellId, SE_Levitate) && !zone->CanLevitate()) ||
|
||||
(IsEffectInSpell(s.SpellId, SE_MovementSpeed) && !zone->CanCastOutdoor())) &&
|
||||
(botClass != BARD || !IsSpellUsableThisZoneType(s.SpellId, zone->GetZoneType()))
|
||||
(botClass != BARD || !IsSpellUsableInThisZoneType(s.SpellId, zone->GetZoneType()))
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
@@ -714,7 +714,7 @@ bool Bot::BotCastDispel(Mob* tar, BotSpell& botSpell, uint32 iSpellTypes, const
|
||||
|
||||
bool casted_spell = false;
|
||||
if (tar->GetHPRatio() > 95.0f) {
|
||||
if (!checked_los && !CheckLosFN(tar)) {
|
||||
if (!checked_los && (!CheckLosFN(tar) || !CheckWaterLoS(tar))) {
|
||||
return casted_spell;
|
||||
}
|
||||
|
||||
@@ -737,7 +737,7 @@ bool Bot::BotCastNuke(Mob* tar, uint8 botLevel, uint8 botClass, BotSpell& botSpe
|
||||
bool casted_spell = false;
|
||||
if ((tar->GetHPRatio() <= 95.0f) || ((botClass == BARD) || (botClass == SHAMAN) || (botClass == ENCHANTER) || (botClass == PALADIN) || (botClass == SHADOWKNIGHT) || (botClass == WARRIOR)))
|
||||
{
|
||||
if (!checked_los && !CheckLosFN(tar)) {
|
||||
if (!checked_los && (!CheckLosFN(tar) || !CheckWaterLoS(tar))) {
|
||||
return casted_spell;
|
||||
}
|
||||
|
||||
@@ -892,7 +892,7 @@ bool Bot::BotCastBuff(Mob* tar, uint8 botLevel, uint8 botClass) {
|
||||
(IsEffectInSpell(s.SpellId, SE_Levitate) && !zone->CanLevitate()) ||
|
||||
(IsEffectInSpell(s.SpellId, SE_MovementSpeed) && !zone->CanCastOutdoor())
|
||||
) &&
|
||||
(botClass != BARD || !IsSpellUsableThisZoneType(s.SpellId, zone->GetZoneType()))
|
||||
(botClass != BARD || !IsSpellUsableInThisZoneType(s.SpellId, zone->GetZoneType()))
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
@@ -965,7 +965,7 @@ bool Bot::BotCastBuff(Mob* tar, uint8 botLevel, uint8 botClass) {
|
||||
bool Bot::BotCastRoot(Mob* tar, uint8 botLevel, uint32 iSpellTypes, BotSpell& botSpell, const bool& checked_los) {
|
||||
bool casted_spell = false;
|
||||
if (!tar->IsRooted() && tar->DontRootMeBefore() < Timer::GetCurrentTime()) {
|
||||
if (!checked_los && !CheckLosFN(tar)) {
|
||||
if (!checked_los && (!CheckLosFN(tar) || !CheckWaterLoS(tar))) {
|
||||
return casted_spell;
|
||||
}
|
||||
|
||||
@@ -1189,7 +1189,7 @@ bool Bot::BotCastHeal(Mob* tar, uint8 botLevel, uint8 botClass, BotSpell& botSpe
|
||||
|
||||
bool Bot::BotCastMez(Mob* tar, uint8 botLevel, bool checked_los, BotSpell& botSpell, Raid* raid) {
|
||||
bool casted_spell = false;
|
||||
if (!checked_los && !CheckLosFN(tar)) {
|
||||
if (!checked_los && (!CheckLosFN(tar) || !CheckWaterLoS(tar))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1902,7 +1902,7 @@ std::list<BotSpell> Bot::GetBotSpellsForSpellEffect(Bot* botCaster, int spellEff
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IsEffectInSpell(botSpellList[i].spellid, spellEffect) || GetTriggerSpellID(botSpellList[i].spellid, spellEffect)) {
|
||||
if (IsEffectInSpell(botSpellList[i].spellid, spellEffect) || GetSpellTriggerSpellID(botSpellList[i].spellid, spellEffect)) {
|
||||
BotSpell botSpell;
|
||||
botSpell.SpellId = botSpellList[i].spellid;
|
||||
botSpell.SpellIndex = i;
|
||||
@@ -1940,7 +1940,7 @@ std::list<BotSpell> Bot::GetBotSpellsForSpellEffectAndTargetType(Bot* botCaster,
|
||||
if (
|
||||
(
|
||||
IsEffectInSpell(botSpellList[i].spellid, spellEffect) ||
|
||||
GetTriggerSpellID(botSpellList[i].spellid, spellEffect)
|
||||
GetSpellTriggerSpellID(botSpellList[i].spellid, spellEffect)
|
||||
) &&
|
||||
spells[botSpellList[i].spellid].target_type == targetType
|
||||
) {
|
||||
@@ -2313,7 +2313,7 @@ BotSpell Bot::GetBestBotSpellForMez(Bot* botCaster) {
|
||||
for (std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); ++botSpellListItr) {
|
||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||
if (
|
||||
IsMezSpell(botSpellListItr->SpellId) &&
|
||||
IsMesmerizeSpell(botSpellListItr->SpellId) &&
|
||||
CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)
|
||||
) {
|
||||
result.SpellId = botSpellListItr->SpellId;
|
||||
@@ -2388,7 +2388,7 @@ BotSpell Bot::GetBestBotSpellForDiseaseBasedSlow(Bot* botCaster) {
|
||||
Mob* Bot::GetFirstIncomingMobToMez(Bot* botCaster, BotSpell botSpell) {
|
||||
Mob* result = 0;
|
||||
|
||||
if (botCaster && IsMezSpell(botSpell.SpellId)) {
|
||||
if (botCaster && IsMesmerizeSpell(botSpell.SpellId)) {
|
||||
|
||||
std::list<NPC*> npc_list;
|
||||
entity_list.GetNPCList(npc_list);
|
||||
|
||||
+78
-16
@@ -656,10 +656,10 @@ bool Client::Save(uint8 iCommitNow) {
|
||||
/* Save Character Currency */
|
||||
database.SaveCharacterCurrency(CharacterID(), &m_pp);
|
||||
|
||||
/* Save Current Bind Points */
|
||||
for (int i = 0; i < 5; i++)
|
||||
if (m_pp.binds[i].zone_id)
|
||||
database.SaveCharacterBindPoint(CharacterID(), m_pp.binds[i], i);
|
||||
// save character binds
|
||||
// this may not need to be called in Save() but it's here for now
|
||||
// to maintain the current behavior
|
||||
database.SaveCharacterBinds(this);
|
||||
|
||||
/* Save Character Buffs */
|
||||
database.SaveBuffs(this);
|
||||
@@ -713,7 +713,7 @@ bool Client::Save(uint8 iCommitNow) {
|
||||
|
||||
p_timers.Store(&database);
|
||||
|
||||
database.SaveCharacterTribute(CharacterID(), &m_pp);
|
||||
database.SaveCharacterTribute(this);
|
||||
SaveTaskState(); /* Save Character Task */
|
||||
|
||||
LogFood("Client::Save - hunger_level: [{}] thirst_level: [{}]", m_pp.hunger_level, m_pp.thirst_level);
|
||||
@@ -908,8 +908,8 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
|
||||
}
|
||||
|
||||
// Garble the message based on drunkness
|
||||
if (m_pp.intoxication > 0 && !(RuleB(Chat, ServerWideOOC) && chan_num == ChatChannel_OOC) && !GetGM()) {
|
||||
GarbleMessage(message, (int)(m_pp.intoxication / 3));
|
||||
if (GetIntoxication() > 0 && !(RuleB(Chat, ServerWideOOC) && chan_num == ChatChannel_OOC) && !GetGM()) {
|
||||
GarbleMessage(message, (int)(GetIntoxication() / 3));
|
||||
language = 0; // No need for language when drunk
|
||||
lang_skill = 100;
|
||||
}
|
||||
@@ -1062,7 +1062,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
|
||||
if(!global_channel_timer.Check())
|
||||
{
|
||||
if(strlen(targetname) == 0)
|
||||
ChannelMessageReceived(7, language, lang_skill, message, "discard"); //Fast typer or spammer??
|
||||
ChannelMessageReceived(ChatChannel_Tell, language, lang_skill, message, "discard"); //Fast typer or spammer??
|
||||
else
|
||||
return;
|
||||
}
|
||||
@@ -2783,18 +2783,64 @@ void Client::GMKill() {
|
||||
safe_delete(outapp);
|
||||
}
|
||||
|
||||
void Client::MemorizeSpell(uint32 slot,uint32 spellid,uint32 scribing, uint32 reduction){
|
||||
if (slot < 0 || slot >= EQ::spells::DynamicLookup(ClientVersion(), GetGM())->SpellbookSize)
|
||||
void Client::MemorizeSpell(uint32 slot, uint32 spell_id, uint32 scribing, uint32 reduction){
|
||||
if (
|
||||
!EQ::ValueWithin(
|
||||
slot,
|
||||
0,
|
||||
(EQ::spells::DynamicLookup(ClientVersion(), GetGM())->SpellbookSize - 1)
|
||||
)
|
||||
) {
|
||||
return;
|
||||
if ((spellid < 3 || spellid > EQ::spells::DynamicLookup(ClientVersion(), GetGM())->SpellIdMax) && spellid != 0xFFFFFFFF)
|
||||
}
|
||||
|
||||
if (
|
||||
!EQ::ValueWithin(
|
||||
spell_id,
|
||||
3,
|
||||
EQ::spells::DynamicLookup(ClientVersion(), GetGM())->SpellIdMax
|
||||
) &&
|
||||
spell_id != UINT32_MAX
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto outapp = new EQApplicationPacket(OP_MemorizeSpell, sizeof(MemorizeSpell_Struct));
|
||||
MemorizeSpell_Struct* mss=(MemorizeSpell_Struct*)outapp->pBuffer;
|
||||
mss->scribing=scribing;
|
||||
mss->slot=slot;
|
||||
mss->spell_id=spellid;
|
||||
|
||||
auto* mss = (MemorizeSpell_Struct*) outapp->pBuffer;
|
||||
|
||||
mss->scribing = scribing;
|
||||
mss->slot = slot;
|
||||
mss->spell_id = spell_id;
|
||||
mss->reduction = reduction;
|
||||
|
||||
outapp->priority = 5;
|
||||
|
||||
if (
|
||||
parse->PlayerHasQuestSub(EVENT_SCRIBE_SPELL) ||
|
||||
parse->PlayerHasQuestSub(EVENT_MEMORIZE_SPELL) ||
|
||||
parse->PlayerHasQuestSub(EVENT_UNMEMORIZE_SPELL)
|
||||
) {
|
||||
const auto export_string = fmt::format("{} {}", slot, spell_id);
|
||||
|
||||
if (
|
||||
scribing == ScribeSpellActions::Memorize &&
|
||||
parse->PlayerHasQuestSub(EVENT_MEMORIZE_SPELL)
|
||||
) {
|
||||
parse->EventPlayer(EVENT_MEMORIZE_SPELL, this, export_string, 0);
|
||||
} else if (
|
||||
scribing == ScribeSpellActions::Unmemorize &&
|
||||
parse->PlayerHasQuestSub(EVENT_UNMEMORIZE_SPELL)
|
||||
) {
|
||||
parse->EventPlayer(EVENT_UNMEMORIZE_SPELL, this, export_string, 0);
|
||||
} else if (
|
||||
scribing == ScribeSpellActions::Scribe &&
|
||||
parse->PlayerHasQuestSub(EVENT_SCRIBE_SPELL)
|
||||
) {
|
||||
parse->EventPlayer(EVENT_SCRIBE_SPELL, this, export_string, 0);
|
||||
}
|
||||
}
|
||||
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
}
|
||||
@@ -8340,6 +8386,11 @@ void Client::SetThirst(int32 in_thirst)
|
||||
safe_delete(outapp);
|
||||
}
|
||||
|
||||
void Client::SetIntoxication(int32 in_intoxication)
|
||||
{
|
||||
m_pp.intoxication = EQ::Clamp(in_intoxication, 0, 200);
|
||||
}
|
||||
|
||||
void Client::SetConsumption(int32 in_hunger, int32 in_thirst)
|
||||
{
|
||||
EQApplicationPacket *outapp = nullptr;
|
||||
@@ -9425,6 +9476,7 @@ void Client::ShowDevToolsMenu()
|
||||
menu_reload_five += Saylink::Silent("#reload merchants", "Merchants");
|
||||
menu_reload_five += " | " + Saylink::Silent("#reload npc_emotes", "NPC Emotes");
|
||||
menu_reload_five += " | " + Saylink::Silent("#reload objects", "Objects");
|
||||
menu_reload_five += " | " + Saylink::Silent("#reload opcodes", "Opcodes");
|
||||
|
||||
menu_reload_six += Saylink::Silent("#reload perl_export", "Perl Event Export Settings");
|
||||
menu_reload_six += " | " + Saylink::Silent("#reload quest", "Quests");
|
||||
@@ -11233,7 +11285,7 @@ void Client::ReconnectUCS()
|
||||
{
|
||||
EQApplicationPacket *outapp = nullptr;
|
||||
std::string buffer;
|
||||
std::string mail_key = database.GetMailKey(CharacterID(), true);
|
||||
std::string mail_key = m_mail_key;
|
||||
EQ::versions::UCSVersion connection_type = EQ::versions::ucsUnknown;
|
||||
|
||||
// chat server packet
|
||||
@@ -11432,6 +11484,16 @@ void Client::SendReloadCommandMessages() {
|
||||
).c_str()
|
||||
);
|
||||
|
||||
auto opcodes_link = Saylink::Silent("#reload opcodes");
|
||||
|
||||
Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Usage: {} - Reloads Opcodes globally",
|
||||
opcodes_link
|
||||
).c_str()
|
||||
);
|
||||
|
||||
auto perl_export_link = Saylink::Silent("#reload perl_export");
|
||||
|
||||
Message(
|
||||
|
||||
+16
-3
@@ -67,6 +67,7 @@ namespace EQ
|
||||
#include "task_client_state.h"
|
||||
#include "cheat_manager.h"
|
||||
#include "../common/events/player_events.h"
|
||||
#include "../common/data_verification.h"
|
||||
|
||||
#ifdef _WINDOWS
|
||||
// since windows defines these within windef.h (which windows.h include)
|
||||
@@ -306,7 +307,6 @@ public:
|
||||
void ReturnTraderReq(const EQApplicationPacket* app,int16 traderitemcharges, uint32 itemid = 0);
|
||||
void TradeRequestFailed(const EQApplicationPacket* app);
|
||||
void BuyTraderItem(TraderBuy_Struct* tbs,Client* trader,const EQApplicationPacket* app);
|
||||
void TraderUpdate(uint16 slot_id,uint32 trader_id);
|
||||
void FinishTrade(Mob* with, bool finalizer = false, void* event_entry = nullptr, std::list<void*>* event_details = nullptr);
|
||||
void SendZonePoints();
|
||||
|
||||
@@ -932,7 +932,7 @@ public:
|
||||
inline uint32 GetAAPercent() const { return m_epp.perAA; }
|
||||
void SetAATitle(std::string title);
|
||||
void SetTitleSuffix(std::string suffix);
|
||||
void MemorizeSpell(uint32 slot, uint32 spellid, uint32 scribing, uint32 reduction = 0);
|
||||
void MemorizeSpell(uint32 slot, uint32 spell_id, uint32 scribing, uint32 reduction = 0);
|
||||
|
||||
// Item methods
|
||||
void UseAugmentContainer(int container_slot);
|
||||
@@ -966,6 +966,8 @@ public:
|
||||
void DropItem(int16 slot_id, bool recurse = true);
|
||||
void DropItemQS(EQ::ItemInstance* inst, bool pickup);
|
||||
|
||||
bool IsAugmentRestricted(uint8 item_type, uint32 augment_restriction);
|
||||
|
||||
int GetItemLinkHash(const EQ::ItemInstance* inst); // move to ItemData..or make use of the pre-calculated database field
|
||||
|
||||
void SendItemLink(const EQ::ItemInstance* inst, bool sendtoall=false);
|
||||
@@ -993,6 +995,7 @@ public:
|
||||
void SetThirst(int32 in_thirst);
|
||||
void SetConsumption(int32 in_hunger, int32 in_thirst);
|
||||
bool IsStarved() const { if (GetGM() || !RuleB(Character, EnableFoodRequirement) || !RuleB(Character, EnableHungerPenalties)) return false; return m_pp.hunger_level == 0 || m_pp.thirst_level == 0; }
|
||||
int32 GetIntoxication() const { return m_pp.intoxication; }
|
||||
|
||||
bool CheckTradeLoreConflict(Client* other);
|
||||
bool CheckTradeNonDroppable();
|
||||
@@ -1500,6 +1503,8 @@ public:
|
||||
bool GroupFollow(Client* inviter);
|
||||
inline bool GetRunMode() const { return runmode; }
|
||||
|
||||
virtual bool CheckWaterAutoFireLoS(Mob* m);
|
||||
|
||||
void SendReloadCommandMessages();
|
||||
|
||||
void SendItemRecastTimer(int32 recast_type, uint32 recast_delay = 0, bool in_ignore_casting_requirement = false);
|
||||
@@ -1582,6 +1587,7 @@ public:
|
||||
void SetEnvironmentDamageModifier(int32 val) { environment_damage_modifier = val; }
|
||||
inline bool GetInvulnerableEnvironmentDamage() const { return invulnerable_environment_damage; }
|
||||
void SetInvulnerableEnvironmentDamage(bool val) { invulnerable_environment_damage = val; }
|
||||
void SetIntoxication(int32 in_intoxication);
|
||||
|
||||
void ShowNumHits(); // work around function for numhits not showing on buffs
|
||||
|
||||
@@ -1637,6 +1643,7 @@ public:
|
||||
PlayerEvent::PlayerEvent GetPlayerEvent();
|
||||
void RecordKilledNPCEvent(NPC *n);
|
||||
|
||||
uint32 GetEXPForLevel(uint16 check_level);
|
||||
protected:
|
||||
friend class Mob;
|
||||
void CalcEdibleBonuses(StatBonuses* newbon);
|
||||
@@ -1812,7 +1819,6 @@ private:
|
||||
bool temp_pvp;
|
||||
|
||||
void NPCSpawn(const Seperator* sep);
|
||||
uint32 GetEXPForLevel(uint16 level);
|
||||
|
||||
void SendLogoutPackets();
|
||||
void SendZoneInPackets();
|
||||
@@ -2033,6 +2039,13 @@ private:
|
||||
bool CanTradeFVNoDropItem();
|
||||
void SendMobPositions();
|
||||
void PlayerTradeEventLog(Trade *t, Trade *t2);
|
||||
|
||||
// full and partial mail key cache
|
||||
std::string m_mail_key_full;
|
||||
std::string m_mail_key;
|
||||
public:
|
||||
const std::string &GetMailKeyFull() const;
|
||||
const std::string &GetMailKey() const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -797,10 +797,10 @@ uint32 Client::CalcCurrentWeight()
|
||||
|
||||
int32 Client::CalcAlcoholPhysicalEffect()
|
||||
{
|
||||
if (m_pp.intoxication <= 55) {
|
||||
if (GetIntoxication() <= 55) {
|
||||
return 0;
|
||||
}
|
||||
return (m_pp.intoxication - 40) / 16;
|
||||
return (GetIntoxication() - 40) / 16;
|
||||
}
|
||||
|
||||
int32 Client::CalcSTR()
|
||||
@@ -878,8 +878,8 @@ int32 Client::CalcINT()
|
||||
int32 val = m_pp.INT + itembonuses.INT + spellbonuses.INT;
|
||||
int32 mod = aabonuses.INT;
|
||||
INT = val + mod;
|
||||
if (m_pp.intoxication) {
|
||||
int32 AlcINT = INT - (int32)((float)m_pp.intoxication / 200.0f * (float)INT) - 1;
|
||||
if (GetIntoxication()) {
|
||||
int32 AlcINT = INT - (int32)((float)GetIntoxication() / 200.0f * (float)INT) - 1;
|
||||
if ((AlcINT < (int)(0.2 * INT))) {
|
||||
INT = (int)(0.2f * (float)INT);
|
||||
}
|
||||
@@ -902,8 +902,8 @@ int32 Client::CalcWIS()
|
||||
int32 val = m_pp.WIS + itembonuses.WIS + spellbonuses.WIS;
|
||||
int32 mod = aabonuses.WIS;
|
||||
WIS = val + mod;
|
||||
if (m_pp.intoxication) {
|
||||
int32 AlcWIS = WIS - (int32)((float)m_pp.intoxication / 200.0f * (float)WIS) - 1;
|
||||
if (GetIntoxication()) {
|
||||
int32 AlcWIS = WIS - (int32)((float)GetIntoxication() / 200.0f * (float)WIS) - 1;
|
||||
if ((AlcWIS < (int)(0.2 * WIS))) {
|
||||
WIS = (int)(0.2f * (float)WIS);
|
||||
}
|
||||
|
||||
+185
-188
@@ -656,7 +656,7 @@ void Client::CompleteConnect()
|
||||
|
||||
const SPDat_Spell_Struct &spell = spells[buffs[j1].spellid];
|
||||
|
||||
int NimbusEffect = GetNimbusEffect(buffs[j1].spellid);
|
||||
int NimbusEffect = GetSpellNimbusEffect(buffs[j1].spellid);
|
||||
if (NimbusEffect) {
|
||||
if (!IsNimbusEffectActive(NimbusEffect))
|
||||
SendSpellEffect(NimbusEffect, 500, 0, 1, 3000, true);
|
||||
@@ -721,17 +721,17 @@ void Client::CompleteConnect()
|
||||
case SE_AddMeleeProc:
|
||||
case SE_WeaponProc:
|
||||
{
|
||||
AddProcToWeapon(GetProcID(buffs[j1].spellid, x1), false, 100 + spells[buffs[j1].spellid].limit_value[x1], buffs[j1].spellid, buffs[j1].casterlevel, GetProcLimitTimer(buffs[j1].spellid, ProcType::MELEE_PROC));
|
||||
AddProcToWeapon(GetProcID(buffs[j1].spellid, x1), false, 100 + spells[buffs[j1].spellid].limit_value[x1], buffs[j1].spellid, buffs[j1].casterlevel, GetSpellProcLimitTimer(buffs[j1].spellid, ProcType::MELEE_PROC));
|
||||
break;
|
||||
}
|
||||
case SE_DefensiveProc:
|
||||
{
|
||||
AddDefensiveProc(GetProcID(buffs[j1].spellid, x1), 100 + spells[buffs[j1].spellid].limit_value[x1], buffs[j1].spellid, GetProcLimitTimer(buffs[j1].spellid, ProcType::DEFENSIVE_PROC));
|
||||
AddDefensiveProc(GetProcID(buffs[j1].spellid, x1), 100 + spells[buffs[j1].spellid].limit_value[x1], buffs[j1].spellid, GetSpellProcLimitTimer(buffs[j1].spellid, ProcType::DEFENSIVE_PROC));
|
||||
break;
|
||||
}
|
||||
case SE_RangedProc:
|
||||
{
|
||||
AddRangedProc(GetProcID(buffs[j1].spellid, x1), 100 + spells[buffs[j1].spellid].limit_value[x1], buffs[j1].spellid, GetProcLimitTimer(buffs[j1].spellid, ProcType::RANGED_PROC));
|
||||
AddRangedProc(GetProcID(buffs[j1].spellid, x1), 100 + spells[buffs[j1].spellid].limit_value[x1], buffs[j1].spellid, GetSpellProcLimitTimer(buffs[j1].spellid, ProcType::RANGED_PROC));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1265,7 +1265,13 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
|
||||
database.LoadCharacterDisciplines(cid, &m_pp); /* Load Character Disciplines */
|
||||
database.LoadCharacterLanguages(cid, &m_pp); /* Load Character Languages */
|
||||
database.LoadCharacterLeadershipAA(cid, &m_pp); /* Load Character Leadership AA's */
|
||||
database.LoadCharacterTribute(cid, &m_pp); /* Load CharacterTribute */
|
||||
database.LoadCharacterTribute(this); /* Load CharacterTribute */
|
||||
|
||||
// this pattern is strange
|
||||
// this is remnants of the old way of doing things
|
||||
auto mail_keys = database.GetMailKey(CharacterID());
|
||||
m_mail_key_full = mail_keys.mail_key_full;
|
||||
m_mail_key = mail_keys.mail_key;
|
||||
|
||||
/* Load AdventureStats */
|
||||
AdventureStats_Struct as;
|
||||
@@ -1309,7 +1315,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
|
||||
|
||||
/* If we can maintain intoxication across zones, check for it */
|
||||
if (!RuleB(Character, MaintainIntoxicationAcrossZones))
|
||||
m_pp.intoxication = 0;
|
||||
SetIntoxication(0);
|
||||
|
||||
strcpy(name, m_pp.name);
|
||||
strcpy(lastname, m_pp.last_name);
|
||||
@@ -1508,30 +1514,31 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
|
||||
}
|
||||
|
||||
if (group) {
|
||||
// If the group leader is not set, pull the group leader infomrmation from the database.
|
||||
if (!group->GetLeader()) {
|
||||
char ln[64];
|
||||
char MainTankName[64];
|
||||
char AssistName[64];
|
||||
char PullerName[64];
|
||||
char NPCMarkerName[64];
|
||||
char mentoree_name[64];
|
||||
int mentor_percent;
|
||||
GroupLeadershipAA_Struct GLAA;
|
||||
memset(ln, 0, 64);
|
||||
database.GetGroupLeadershipInfo(group->GetID(), ln, MainTankName, AssistName, PullerName, NPCMarkerName, mentoree_name, &mentor_percent, &GLAA);
|
||||
Client *c = entity_list.GetClientByName(ln);
|
||||
if (c)
|
||||
group->SetLeader(c);
|
||||
|
||||
group->SetMainTank(MainTankName);
|
||||
group->SetMainAssist(AssistName);
|
||||
group->SetPuller(PullerName);
|
||||
group->SetNPCMarker(NPCMarkerName);
|
||||
group->SetGroupAAs(&GLAA);
|
||||
group->SetGroupMentor(mentor_percent, mentoree_name);
|
||||
}
|
||||
char ln[64];
|
||||
char MainTankName[64];
|
||||
char AssistName[64];
|
||||
char PullerName[64];
|
||||
char NPCMarkerName[64];
|
||||
char mentoree_name[64];
|
||||
int mentor_percent;
|
||||
GroupLeadershipAA_Struct GLAA;
|
||||
memset(ln, 0, 64);
|
||||
database.GetGroupLeadershipInfo(group->GetID(), ln, MainTankName, AssistName, PullerName, NPCMarkerName, mentoree_name, &mentor_percent, &GLAA);
|
||||
group->LearnMembers();
|
||||
|
||||
if (!group->GetLeader()) {
|
||||
Client *c = entity_list.GetClientByName(ln);
|
||||
if (c) {
|
||||
group->SetLeader(c);
|
||||
}
|
||||
}
|
||||
|
||||
group->SetMainTank(MainTankName);
|
||||
group->SetMainAssist(AssistName);
|
||||
group->SetPuller(PullerName);
|
||||
group->SetNPCMarker(NPCMarkerName);
|
||||
group->SetGroupAAs(&GLAA);
|
||||
group->SetGroupMentor(mentor_percent, mentoree_name);
|
||||
JoinGroupXTargets(group);
|
||||
group->UpdatePlayer(this);
|
||||
LFG = false;
|
||||
@@ -5568,10 +5575,8 @@ void Client::Handle_OP_DeleteItem(const EQApplicationPacket *app)
|
||||
if (IntoxicationIncrease < 0)
|
||||
IntoxicationIncrease = 1;
|
||||
|
||||
m_pp.intoxication += IntoxicationIncrease;
|
||||
SetIntoxication(GetIntoxication()+IntoxicationIncrease);
|
||||
|
||||
if (m_pp.intoxication > 200)
|
||||
m_pp.intoxication = 200;
|
||||
}
|
||||
DeleteItemInInventory(alc->from_slot, 1);
|
||||
|
||||
@@ -6466,27 +6471,28 @@ void Client::Handle_OP_GMFind(const EQApplicationPacket *app)
|
||||
RecordPlayerEventLog(PlayerEvent::POSSIBLE_HACK, PlayerEvent::PossibleHackEvent{.message = "Used /find"});
|
||||
return;
|
||||
}
|
||||
if (app->size != sizeof(GMSummon_Struct)) {
|
||||
LogError("Wrong size: OP_GMFind, size=[{}], expected [{}]", app->size, sizeof(GMSummon_Struct));
|
||||
|
||||
if (app->size != sizeof(GMFind_Struct)) {
|
||||
LogError("Wrong size: OP_GMFind, size=[{}], expected [{}]", app->size, sizeof(GMFind_Struct));
|
||||
return;
|
||||
}
|
||||
|
||||
//Break down incoming
|
||||
GMSummon_Struct* request = (GMSummon_Struct*)app->pBuffer;
|
||||
auto* request = (GMFind_Struct*) app->pBuffer;
|
||||
//Create a new outgoing
|
||||
auto outapp = new EQApplicationPacket(OP_GMFind, sizeof(GMSummon_Struct));
|
||||
GMSummon_Struct* foundplayer = (GMSummon_Struct*)outapp->pBuffer;
|
||||
auto outapp = new EQApplicationPacket(OP_GMFind, sizeof(GMFind_Struct));
|
||||
auto* foundplayer = (GMFind_Struct*) outapp->pBuffer;
|
||||
//Copy the constants
|
||||
strcpy(foundplayer->charname, request->charname);
|
||||
strcpy(foundplayer->gmname, request->gmname);
|
||||
//Check if the NPC exits intrazone...
|
||||
Mob* gt = entity_list.GetMob(request->charname);
|
||||
if (gt != 0) {
|
||||
auto* gt = entity_list.GetMob(request->charname);
|
||||
if (gt) {
|
||||
foundplayer->success = 1;
|
||||
foundplayer->x = (int32)gt->GetX();
|
||||
foundplayer->y = (int32)gt->GetY();
|
||||
|
||||
foundplayer->z = (int32)gt->GetZ();
|
||||
foundplayer->zoneID = zone->GetZoneID();
|
||||
foundplayer->x = gt->GetX();
|
||||
foundplayer->y = gt->GetY();
|
||||
foundplayer->z = gt->GetZ();
|
||||
foundplayer->zoneID = zone->GetZoneID();
|
||||
}
|
||||
//Send the packet...
|
||||
FastQueuePacket(&outapp);
|
||||
@@ -9227,7 +9233,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
|
||||
return;
|
||||
}
|
||||
if (i == 0) {
|
||||
if (!IsCastWhileInvis(item->Click.Effect)) {
|
||||
if (!IsCastWhileInvisibleSpell(item->Click.Effect)) {
|
||||
CommonBreakInvisible(); // client can't do this for us :(
|
||||
}
|
||||
if (GetClass() == BARD){
|
||||
@@ -9299,7 +9305,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
if (!IsCastWhileInvis(augitem->Click.Effect)) {
|
||||
if (!IsCastWhileInvisibleSpell(augitem->Click.Effect)) {
|
||||
CommonBreakInvisible(); // client can't do this for us :(
|
||||
}
|
||||
if (GetClass() == BARD) {
|
||||
@@ -11464,7 +11470,7 @@ void Client::Handle_OP_PopupResponse(const EQApplicationPacket *app)
|
||||
if (EntityVariableExists(DIAWIND_RESPONSE_ONE_KEY)) {
|
||||
response = GetEntityVariable(DIAWIND_RESPONSE_ONE_KEY);
|
||||
if (!response.empty()) {
|
||||
ChannelMessageReceived(8, 0, 100, response.c_str(), nullptr, true);
|
||||
ChannelMessageReceived(ChatChannel_Say, 0, 100, response.c_str(), nullptr, true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -11473,7 +11479,7 @@ void Client::Handle_OP_PopupResponse(const EQApplicationPacket *app)
|
||||
if (EntityVariableExists(DIAWIND_RESPONSE_TWO_KEY)) {
|
||||
response = GetEntityVariable(DIAWIND_RESPONSE_TWO_KEY);
|
||||
if (!response.empty()) {
|
||||
ChannelMessageReceived(8, 0, 100, response.c_str(), nullptr, true);
|
||||
ChannelMessageReceived(ChatChannel_Say, 0, 100, response.c_str(), nullptr, true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -11679,7 +11685,7 @@ void Client::Handle_OP_QueryUCSServerStatus(const EQApplicationPacket *app)
|
||||
EQApplicationPacket* outapp = nullptr;
|
||||
std::string buffer;
|
||||
|
||||
std::string MailKey = database.GetMailKey(CharacterID(), true);
|
||||
std::string MailKey = GetMailKey();
|
||||
EQ::versions::UCSVersion ConnectionType = EQ::versions::ucsUnknown;
|
||||
|
||||
// chat server packet
|
||||
@@ -14408,6 +14414,46 @@ void Client::Handle_OP_SwapSpell(const EQApplicationPacket *app)
|
||||
}
|
||||
|
||||
void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app)
|
||||
{
|
||||
if (app->size != sizeof(ClientTarget_Struct)) {
|
||||
LogError("OP size error: OP_TargetCommand expected:[{}] got:[{}]", sizeof(ClientTarget_Struct), app->size);
|
||||
return;
|
||||
}
|
||||
|
||||
// Locate and cache new target
|
||||
ClientTarget_Struct* ct = (ClientTarget_Struct*)app->pBuffer;
|
||||
|
||||
bool can_target=false;
|
||||
Mob *nt = entity_list.GetMob(ct->new_target);
|
||||
|
||||
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 ||
|
||||
nt->GetBodyType() == BT_NoTarget) {
|
||||
can_target = false;
|
||||
}
|
||||
else {
|
||||
can_target = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (can_target) {
|
||||
QueuePacket(app);
|
||||
}
|
||||
else {
|
||||
MessageString(Chat::Red, DONT_SEE_TARGET);
|
||||
auto outapp = new EQApplicationPacket(OP_TargetReject, sizeof(TargetReject_Struct));
|
||||
outapp->pBuffer[0] = 0x2f;
|
||||
outapp->pBuffer[1] = 0x01;
|
||||
outapp->pBuffer[4] = 0x0d;
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
}
|
||||
}
|
||||
|
||||
void Client::Handle_OP_TargetMouse(const EQApplicationPacket *app)
|
||||
{
|
||||
if (app->size != sizeof(ClientTarget_Struct)) {
|
||||
LogError("OP size error: OP_TargetMouse expected:[{}] got:[{}]", sizeof(ClientTarget_Struct), app->size);
|
||||
@@ -14504,157 +14550,108 @@ void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app)
|
||||
if (g && g->HasRole(this, RolePuller))
|
||||
g->SetGroupPullerTarget(GetTarget());
|
||||
|
||||
// For /target, send reject or success packet
|
||||
if (app->GetOpcode() == OP_TargetCommand) {
|
||||
if (GetTarget() && !GetTarget()->CastToMob()->IsInvisible(this) && (DistanceSquared(m_Position, GetTarget()->GetPosition()) <= TARGETING_RANGE*TARGETING_RANGE || GetGM())) {
|
||||
if (GetTarget()->GetBodyType() == BT_NoTarget2 || GetTarget()->GetBodyType() == BT_Special
|
||||
|| GetTarget()->GetBodyType() == BT_NoTarget)
|
||||
{
|
||||
//Targeting something we shouldn't with /target
|
||||
//but the client allows this without MQ so you don't flag it
|
||||
auto outapp = new EQApplicationPacket(OP_TargetReject, sizeof(TargetReject_Struct));
|
||||
outapp->pBuffer[0] = 0x2f;
|
||||
outapp->pBuffer[1] = 0x01;
|
||||
outapp->pBuffer[4] = 0x0d;
|
||||
if (GetTarget())
|
||||
{
|
||||
SetTarget(nullptr);
|
||||
}
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
return;
|
||||
}
|
||||
|
||||
QueuePacket(app);
|
||||
|
||||
GetTarget()->IsTargeted(1);
|
||||
SendHPUpdate();
|
||||
}
|
||||
else
|
||||
{
|
||||
auto outapp = new EQApplicationPacket(OP_TargetReject, sizeof(TargetReject_Struct));
|
||||
outapp->pBuffer[0] = 0x2f;
|
||||
outapp->pBuffer[1] = 0x01;
|
||||
outapp->pBuffer[4] = 0x0d;
|
||||
if (GetTarget())
|
||||
{
|
||||
SetTarget(nullptr);
|
||||
}
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (GetTarget())
|
||||
{
|
||||
if (GetTarget())
|
||||
if (GetGM())
|
||||
{
|
||||
if (GetGM())
|
||||
{
|
||||
GetTarget()->IsTargeted(1);
|
||||
return;
|
||||
}
|
||||
else if (RuleB(Character, AllowMQTarget))
|
||||
{
|
||||
GetTarget()->IsTargeted(1);
|
||||
return;
|
||||
}
|
||||
else if (cheat_manager.GetExemptStatus(Assist)) {
|
||||
GetTarget()->IsTargeted(1);
|
||||
cheat_manager.SetExemptStatus(Assist, false);
|
||||
return;
|
||||
}
|
||||
else if (GetTarget()->IsClient())
|
||||
{
|
||||
//make sure this client is in our raid/group
|
||||
GetTarget()->IsTargeted(1);
|
||||
return;
|
||||
}
|
||||
else if (GetTarget()->GetBodyType() == BT_NoTarget2 || GetTarget()->GetBodyType() == BT_Special
|
||||
|| GetTarget()->GetBodyType() == BT_NoTarget)
|
||||
{
|
||||
auto message = fmt::format(
|
||||
"[{}] attempting to target something untargetable [{}] bodytype [{}]",
|
||||
GetName(),
|
||||
GetTarget()->GetName(),
|
||||
(int) GetTarget()->GetBodyType()
|
||||
);
|
||||
RecordPlayerEventLog(PlayerEvent::POSSIBLE_HACK, PlayerEvent::PossibleHackEvent{.message = message});
|
||||
GetTarget()->IsTargeted(1);
|
||||
return;
|
||||
}
|
||||
else if (RuleB(Character, AllowMQTarget))
|
||||
{
|
||||
GetTarget()->IsTargeted(1);
|
||||
return;
|
||||
}
|
||||
else if (cheat_manager.GetExemptStatus(Assist)) {
|
||||
GetTarget()->IsTargeted(1);
|
||||
cheat_manager.SetExemptStatus(Assist, false);
|
||||
return;
|
||||
}
|
||||
else if (GetTarget()->IsClient())
|
||||
{
|
||||
//make sure this client is in our raid/group
|
||||
GetTarget()->IsTargeted(1);
|
||||
return;
|
||||
}
|
||||
else if (GetTarget()->GetBodyType() == BT_NoTarget2 || GetTarget()->GetBodyType() == BT_Special
|
||||
|| GetTarget()->GetBodyType() == BT_NoTarget)
|
||||
{
|
||||
auto message = fmt::format(
|
||||
"[{}] attempting to target something untargetable [{}] bodytype [{}]",
|
||||
GetName(),
|
||||
GetTarget()->GetName(),
|
||||
(int) GetTarget()->GetBodyType()
|
||||
);
|
||||
RecordPlayerEventLog(PlayerEvent::POSSIBLE_HACK, PlayerEvent::PossibleHackEvent{.message = message});
|
||||
|
||||
SetTarget((Mob*)nullptr);
|
||||
return;
|
||||
}
|
||||
else if (cheat_manager.GetExemptStatus(Port)) {
|
||||
GetTarget()->IsTargeted(1);
|
||||
return;
|
||||
}
|
||||
else if (cheat_manager.GetExemptStatus(Sense)) {
|
||||
GetTarget()->IsTargeted(1);
|
||||
cheat_manager.SetExemptStatus(Sense, false);
|
||||
return;
|
||||
}
|
||||
else if (IsXTarget(GetTarget()))
|
||||
SetTarget((Mob*)nullptr);
|
||||
return;
|
||||
}
|
||||
else if (cheat_manager.GetExemptStatus(Port)) {
|
||||
GetTarget()->IsTargeted(1);
|
||||
return;
|
||||
}
|
||||
else if (cheat_manager.GetExemptStatus(Sense)) {
|
||||
GetTarget()->IsTargeted(1);
|
||||
cheat_manager.SetExemptStatus(Sense, false);
|
||||
return;
|
||||
}
|
||||
else if (IsXTarget(GetTarget()))
|
||||
{
|
||||
GetTarget()->IsTargeted(1);
|
||||
return;
|
||||
}
|
||||
else if (GetTarget()->IsPetOwnerClient())
|
||||
{
|
||||
GetTarget()->IsTargeted(1);
|
||||
return;
|
||||
}
|
||||
else if (GetBindSightTarget())
|
||||
{
|
||||
if (DistanceSquared(GetBindSightTarget()->GetPosition(), GetTarget()->GetPosition()) > (zone->newzone_data.maxclip*zone->newzone_data.maxclip))
|
||||
{
|
||||
GetTarget()->IsTargeted(1);
|
||||
return;
|
||||
}
|
||||
else if (GetTarget()->IsPetOwnerClient())
|
||||
{
|
||||
GetTarget()->IsTargeted(1);
|
||||
return;
|
||||
}
|
||||
else if (GetBindSightTarget())
|
||||
{
|
||||
if (DistanceSquared(GetBindSightTarget()->GetPosition(), GetTarget()->GetPosition()) > (zone->newzone_data.maxclip*zone->newzone_data.maxclip))
|
||||
if (DistanceSquared(m_Position, GetTarget()->GetPosition()) > (zone->newzone_data.maxclip*zone->newzone_data.maxclip))
|
||||
{
|
||||
if (DistanceSquared(m_Position, GetTarget()->GetPosition()) > (zone->newzone_data.maxclip*zone->newzone_data.maxclip))
|
||||
{
|
||||
auto message = fmt::format(
|
||||
"[{}] attempting to target something beyond the clip plane of {:.2f} "
|
||||
"units, from ({:.2f}, {:.2f}, {:.2f}) to {} ({:.2f}, {:.2f}, "
|
||||
"{:.2f})",
|
||||
GetName(),
|
||||
(zone->newzone_data.maxclip * zone->newzone_data.maxclip), GetX(),
|
||||
GetY(), GetZ(), GetTarget()->GetName(), GetTarget()->GetX(),
|
||||
GetTarget()->GetY(), GetTarget()->GetZ());
|
||||
auto message = fmt::format(
|
||||
"[{}] attempting to target something beyond the clip plane of {:.2f} "
|
||||
"units, from ({:.2f}, {:.2f}, {:.2f}) to {} ({:.2f}, {:.2f}, "
|
||||
"{:.2f})",
|
||||
GetName(),
|
||||
(zone->newzone_data.maxclip * zone->newzone_data.maxclip), GetX(),
|
||||
GetY(), GetZ(), GetTarget()->GetName(), GetTarget()->GetX(),
|
||||
GetTarget()->GetY(), GetTarget()->GetZ());
|
||||
|
||||
RecordPlayerEventLog(PlayerEvent::POSSIBLE_HACK, PlayerEvent::PossibleHackEvent{.message = message});
|
||||
SetTarget(nullptr);
|
||||
return;
|
||||
}
|
||||
RecordPlayerEventLog(PlayerEvent::POSSIBLE_HACK, PlayerEvent::PossibleHackEvent{.message = message});
|
||||
SetTarget(nullptr);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (DistanceSquared(m_Position, GetTarget()->GetPosition()) > (zone->newzone_data.maxclip*zone->newzone_data.maxclip))
|
||||
{
|
||||
auto message = fmt::format(
|
||||
"{} attempting to target something beyond the clip plane of {:.2f} "
|
||||
"units, from ({:.2f}, {:.2f}, {:.2f}) to {} ({:.2f}, {:.2f}, {:.2f})",
|
||||
GetName(),
|
||||
(zone->newzone_data.maxclip * zone->newzone_data.maxclip),
|
||||
GetX(),
|
||||
GetY(),
|
||||
GetZ(),
|
||||
GetTarget()->GetName(),
|
||||
GetTarget()->GetX(),
|
||||
GetTarget()->GetY(),
|
||||
GetTarget()->GetZ()
|
||||
);
|
||||
|
||||
RecordPlayerEventLog(PlayerEvent::POSSIBLE_HACK, PlayerEvent::PossibleHackEvent{.message = message});
|
||||
SetTarget(nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
GetTarget()->IsTargeted(1);
|
||||
}
|
||||
else if (DistanceSquared(m_Position, GetTarget()->GetPosition()) > (zone->newzone_data.maxclip*zone->newzone_data.maxclip))
|
||||
{
|
||||
auto message = fmt::format(
|
||||
"{} attempting to target something beyond the clip plane of {:.2f} "
|
||||
"units, from ({:.2f}, {:.2f}, {:.2f}) to {} ({:.2f}, {:.2f}, {:.2f})",
|
||||
GetName(),
|
||||
(zone->newzone_data.maxclip * zone->newzone_data.maxclip),
|
||||
GetX(),
|
||||
GetY(),
|
||||
GetZ(),
|
||||
GetTarget()->GetName(),
|
||||
GetTarget()->GetX(),
|
||||
GetTarget()->GetY(),
|
||||
GetTarget()->GetZ()
|
||||
);
|
||||
|
||||
RecordPlayerEventLog(PlayerEvent::POSSIBLE_HACK, PlayerEvent::PossibleHackEvent{.message = message});
|
||||
SetTarget(nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
GetTarget()->IsTargeted(1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void Client::Handle_OP_TargetMouse(const EQApplicationPacket *app)
|
||||
{
|
||||
Handle_OP_TargetCommand(app);
|
||||
}
|
||||
|
||||
void Client::Handle_OP_TaskHistoryRequest(const EQApplicationPacket *app)
|
||||
{
|
||||
|
||||
|
||||
+22
-6
@@ -51,6 +51,7 @@
|
||||
#include "zone.h"
|
||||
#include "zonedb.h"
|
||||
#include "../common/events/player_event_logs.h"
|
||||
#include "water_map.h"
|
||||
|
||||
extern QueryServ* QServ;
|
||||
extern Zone* zone;
|
||||
@@ -336,7 +337,7 @@ bool Client::Process() {
|
||||
if (ranged_timer.Check(false)) {
|
||||
if (GetTarget() && (GetTarget()->IsNPC() || GetTarget()->IsClient()) && IsAttackAllowed(GetTarget())) {
|
||||
if (GetTarget()->InFrontMob(this, GetTarget()->GetX(), GetTarget()->GetY())) {
|
||||
if (CheckLosFN(GetTarget())) {
|
||||
if (CheckLosFN(GetTarget()) && CheckWaterAutoFireLoS(GetTarget())) {
|
||||
//client has built in los check, but auto fire does not.. done last.
|
||||
RangedAttack(GetTarget());
|
||||
if (CheckDoubleRangedAttack())
|
||||
@@ -356,7 +357,7 @@ bool Client::Process() {
|
||||
if (ranged_timer.Check(false)) {
|
||||
if (GetTarget() && (GetTarget()->IsNPC() || GetTarget()->IsClient()) && IsAttackAllowed(GetTarget())) {
|
||||
if (GetTarget()->InFrontMob(this, GetTarget()->GetX(), GetTarget()->GetY())) {
|
||||
if (CheckLosFN(GetTarget())) {
|
||||
if (CheckLosFN(GetTarget()) && CheckWaterAutoFireLoS(GetTarget())) {
|
||||
//client has built in los check, but auto fire does not.. done last.
|
||||
ThrowingAttack(GetTarget());
|
||||
}
|
||||
@@ -518,9 +519,9 @@ bool Client::Process() {
|
||||
Save(0);
|
||||
}
|
||||
|
||||
if (m_pp.intoxication > 0)
|
||||
if (GetIntoxication() > 0)
|
||||
{
|
||||
--m_pp.intoxication;
|
||||
SetIntoxication(GetIntoxication()-1);
|
||||
CalcBonuses();
|
||||
}
|
||||
|
||||
@@ -1035,7 +1036,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I
|
||||
BuffFadeNonPersistDeath();
|
||||
}
|
||||
|
||||
int SpellEffectDescNum = GetSpellEffectDescNum(SpellID);
|
||||
int SpellEffectDescNum = GetSpellEffectDescriptionNumber(SpellID);
|
||||
// Rez spells with Rez effects have this DescNum (first is Titanium, second is 6.2 Client)
|
||||
if(RuleB(Character, UseResurrectionSickness) && SpellEffectDescNum == 82 || SpellEffectDescNum == 39067) {
|
||||
SetHP(GetMaxHP() / 5);
|
||||
@@ -1968,7 +1969,7 @@ void Client::CalcRestState()
|
||||
for (unsigned int j = 0; j < buff_count; j++) {
|
||||
if(IsValidSpell(buffs[j].spellid)) {
|
||||
if(IsDetrimentalSpell(buffs[j].spellid) && (buffs[j].ticsremaining > 0))
|
||||
if(!DetrimentalSpellAllowsRest(buffs[j].spellid))
|
||||
if(!IsRestAllowedSpell(buffs[j].spellid))
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -2401,3 +2402,18 @@ void Client::SendGuildLFGuildStatus()
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
|
||||
bool Client::CheckWaterAutoFireLoS(Mob* m)
|
||||
{
|
||||
if (
|
||||
!RuleB(Combat, WaterMatchRequiredForAutoFireLoS) ||
|
||||
!zone->watermap
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return (
|
||||
zone->watermap->InLiquid(GetPosition()) &&
|
||||
zone->watermap->InLiquid(m->GetPosition())
|
||||
);
|
||||
}
|
||||
|
||||
@@ -71,13 +71,3 @@ float CombatRecord::GetHealedReceivedPerSecond() const
|
||||
double time_in_combat = TimeInCombat();
|
||||
return time_in_combat > 0 ? (m_heal_received / time_in_combat) : m_heal_received;
|
||||
}
|
||||
|
||||
int64 CombatRecord::GetDamageReceived() const
|
||||
{
|
||||
return m_damage_received;
|
||||
}
|
||||
|
||||
int64 CombatRecord::GetHealReceived() const
|
||||
{
|
||||
return m_heal_received;
|
||||
}
|
||||
|
||||
@@ -12,8 +12,6 @@ public:
|
||||
bool InCombat() const;
|
||||
void ProcessHPEvent(int64 hp, int64 current_hp);
|
||||
double TimeInCombat() const;
|
||||
int64 GetDamageReceived() const;
|
||||
int64 GetHealReceived() const;
|
||||
float GetDamageReceivedPerSecond() const;
|
||||
float GetHealedReceivedPerSecond() const;
|
||||
private:
|
||||
|
||||
+5
-2
@@ -131,6 +131,7 @@ int command_init(void)
|
||||
command_add("emptyinventory", "Clears your or your target's entire inventory (Equipment, General, Bank, and Shared Bank)", AccountStatus::GMImpossible, command_emptyinventory) ||
|
||||
command_add("enablerecipe", "[Recipe ID] - Enables a Recipe", AccountStatus::QuestTroupe, command_enablerecipe) ||
|
||||
command_add("endurance", "Restores your or your target's endurance.", AccountStatus::Guide, command_endurance) ||
|
||||
command_add("entityvariable", "[clear|delete|set|view] - Modify entity variables for yourself or your target", AccountStatus::GMAdmin, command_entityvariable) ||
|
||||
command_add("exptoggle", "[Toggle] - Toggle your or your target's experience gain.", AccountStatus::QuestTroupe, command_exptoggle) ||
|
||||
command_add("faction", "[Find (criteria | all ) | Review (criteria | all) | Reset (id)] - Resets Player's Faction", AccountStatus::QuestTroupe, command_faction) ||
|
||||
command_add("factionassociation", "[factionid] [amount] - triggers a faction hits via association", AccountStatus::GMLeadAdmin, command_faction_association) ||
|
||||
@@ -140,6 +141,7 @@ int command_init(void)
|
||||
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) ||
|
||||
@@ -230,7 +232,7 @@ int command_init(void)
|
||||
command_add("nukeitem", "[Item ID] - Removes the specified Item ID from you or your player target's inventory", AccountStatus::GMLeadAdmin, command_nukeitem) ||
|
||||
command_add("object", "List|Add|Edit|Move|Rotate|Copy|Save|Undo|Delete - Manipulate static and tradeskill objects within the zone", AccountStatus::GMAdmin, command_object) ||
|
||||
command_add("oocmute", "[0|1] - Enable or Disable Server OOC", AccountStatus::GMMgmt, command_oocmute) ||
|
||||
command_add("opcode", "Reloads all server patches", AccountStatus::GMImpossible, command_opcode) ||
|
||||
command_add("opcode", "Reloads all opcodes from server patch files", AccountStatus::GMMgmt, command_reload) ||
|
||||
command_add("path", "view and edit pathing", AccountStatus::GMMgmt, command_path) ||
|
||||
command_add("peekinv", "[equip/gen/cursor/poss/limbo/curlim/trib/bank/shbank/allbank/trade/world/all] - Print out contents of your player target's inventory", AccountStatus::GMAdmin, command_peekinv) ||
|
||||
command_add("peqzone", "[Zone ID|Zone Short Name] - Teleports you to the specified zone if you meet the requirements.", AccountStatus::Player, command_peqzone) ||
|
||||
@@ -976,12 +978,14 @@ void command_bot(Client *c, const Seperator *sep)
|
||||
#include "gm_commands/emptyinventory.cpp"
|
||||
#include "gm_commands/enablerecipe.cpp"
|
||||
#include "gm_commands/endurance.cpp"
|
||||
#include "gm_commands/entityvariable.cpp"
|
||||
#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"
|
||||
@@ -1069,7 +1073,6 @@ void command_bot(Client *c, const Seperator *sep)
|
||||
#include "gm_commands/nukeitem.cpp"
|
||||
#include "gm_commands/object.cpp"
|
||||
#include "gm_commands/oocmute.cpp"
|
||||
#include "gm_commands/opcode.cpp"
|
||||
#include "gm_commands/path.cpp"
|
||||
#include "gm_commands/peekinv.cpp"
|
||||
#include "gm_commands/peqzone.cpp"
|
||||
|
||||
+2
-1
@@ -82,6 +82,7 @@ void command_emoteview(Client *c, const Seperator *sep);
|
||||
void command_emptyinventory(Client *c, const Seperator *sep);
|
||||
void command_enablerecipe(Client *c, const Seperator *sep);
|
||||
void command_endurance(Client *c, const Seperator *sep);
|
||||
void command_entityvariable(Client *c, const Seperator *sep);
|
||||
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);
|
||||
@@ -90,6 +91,7 @@ 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);
|
||||
@@ -180,7 +182,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);
|
||||
void command_opcode(Client *c, const Seperator *sep);
|
||||
|
||||
#ifdef PACKET_PROFILER
|
||||
void command_packetprofile(Client *c, const Seperator *sep);
|
||||
|
||||
@@ -14,13 +14,10 @@
|
||||
#define _CLIENTCORPSE(x) (x && x->IsCorpse() && x->CastToCorpse()->IsPlayerCorpse() && !x->CastToCorpse()->IsBecomeNPCCorpse())
|
||||
#define _NPCCORPSE(x) (x && x->IsCorpse() && (x->CastToCorpse()->IsNPCCorpse() || x->CastToCorpse()->IsBecomeNPCCorpse()))
|
||||
#define _CLIENTPET(x) (x && x->CastToMob()->GetOwner() && x->CastToMob()->GetOwner()->IsClient())
|
||||
#define _NPCPET(x) (x && x->IsNPC() && x->CastToMob()->GetOwner() && x->CastToMob()->GetOwner()->IsNPC())
|
||||
#define _BECOMENPCPET(x) (x && x->CastToMob()->GetOwner() && x->CastToMob()->GetOwner()->IsClient() && x->CastToMob()->GetOwner()->CastToClient()->IsBecomeNPC())
|
||||
|
||||
//LOS Parameters:
|
||||
#define HEAD_POSITION 0.9f //ratio of GetSize() where NPCs see from
|
||||
#define SEE_POSITION 0.5f //ratio of GetSize() where NPCs try to see for LOS
|
||||
#define CHECK_LOS_STEP 1.0f
|
||||
|
||||
#define ARCHETYPE_HYBRID 1
|
||||
#define ARCHETYPE_CASTER 2
|
||||
@@ -44,7 +41,6 @@
|
||||
|
||||
//Spell specialization parameters, not sure of a better place for them
|
||||
#define SPECIALIZE_FIZZLE 11 //% fizzle chance reduce at 200 specialized
|
||||
#define SPECIALIZE_MANA_REDUCE 12 //% mana cost reduction at 200 specialized
|
||||
|
||||
//these are large right now because the x,y,z coords of the zone
|
||||
//lines do not make a lot of sense
|
||||
@@ -232,7 +228,6 @@ enum GravityBehavior {
|
||||
LevitateWhileRunning
|
||||
};
|
||||
|
||||
struct TradeEntity;
|
||||
class Trade;
|
||||
enum TradeState {
|
||||
TradeNone,
|
||||
@@ -846,7 +841,6 @@ public:
|
||||
virtual ~Trade();
|
||||
|
||||
void Reset();
|
||||
void SetTradeCash(uint32 in_pp, uint32 in_gp, uint32 in_sp, uint32 in_cp);
|
||||
|
||||
// Initiate a trade with another mob
|
||||
// Also puts other mob into trader mode with this mob
|
||||
|
||||
+3
-3
@@ -623,13 +623,13 @@ void Doors::ForceOpen(Mob *sender, bool alt_mode)
|
||||
if (!alt_mode) { // original function
|
||||
if (!m_is_open) {
|
||||
if (!m_disable_timer) {
|
||||
LogDoorsDetail("door_id [{}] starting timer", md->doorid);
|
||||
LogDoorsDetail("door_id [{}] starting timer", m_door_id);
|
||||
m_close_timer.Start();
|
||||
}
|
||||
m_is_open = true;
|
||||
}
|
||||
else {
|
||||
LogDoorsDetail("door_id [{}] disable timer", md->doorid);
|
||||
LogDoorsDetail("door_id [{}] disable timer", m_door_id);
|
||||
m_close_timer.Disable();
|
||||
if (!m_disable_timer) {
|
||||
m_is_open = false;
|
||||
@@ -638,7 +638,7 @@ void Doors::ForceOpen(Mob *sender, bool alt_mode)
|
||||
}
|
||||
else { // alternative function
|
||||
if (!m_disable_timer) {
|
||||
LogDoorsDetail("door_id [{}] alt starting timer", md->doorid);
|
||||
LogDoorsDetail("door_id [{}] alt starting timer", m_door_id);
|
||||
m_close_timer.Start();
|
||||
}
|
||||
m_is_open = true;
|
||||
|
||||
+3
-3
@@ -810,9 +810,9 @@ void Client::SendDisciplineUpdate() {
|
||||
|
||||
bool Client::UseDiscipline(uint32 spell_id, uint32 target) {
|
||||
// Dont let client waste a reuse timer if they can't use the disc
|
||||
if ((IsStunned() && !IgnoreCastingRestriction(spell_id))||
|
||||
if ((IsStunned() && !IsCastNotStandingSpell(spell_id))||
|
||||
IsFeared() ||
|
||||
(IsMezzed() && !IgnoreCastingRestriction(spell_id)) ||
|
||||
(IsMezzed() && !IsCastNotStandingSpell(spell_id)) ||
|
||||
IsAmnesiad() ||
|
||||
IsPet())
|
||||
{
|
||||
@@ -837,7 +837,7 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (DivineAura() && !IgnoreCastingRestriction(spell_id)) {
|
||||
if (DivineAura() && !IsCastNotStandingSpell(spell_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -179,6 +179,10 @@ const char *QuestEventSubroutines[_LargestEventID] = {
|
||||
"EVENT_ITEM_CLICK_CAST_CLIENT",
|
||||
"EVENT_DESTROY_ITEM_CLIENT",
|
||||
"EVENT_DROP_ITEM_CLIENT",
|
||||
"EVENT_MEMORIZE_SPELL",
|
||||
"EVENT_UNMEMORIZE_SPELL",
|
||||
"EVENT_SCRIBE_SPELL",
|
||||
"EVENT_UNSCRIBE_SPELL",
|
||||
// Add new events before these or Lua crashes
|
||||
"EVENT_SPELL_EFFECT_BOT",
|
||||
"EVENT_SPELL_EFFECT_BUFF_TIC_BOT"
|
||||
@@ -2160,6 +2164,19 @@ void PerlembParser::ExportEventVariables(
|
||||
break;
|
||||
}
|
||||
|
||||
case EVENT_MEMORIZE_SPELL:
|
||||
case EVENT_UNMEMORIZE_SPELL:
|
||||
case EVENT_SCRIBE_SPELL:
|
||||
case EVENT_UNSCRIBE_SPELL: {
|
||||
Seperator sep(data);
|
||||
ExportVar(package_name.c_str(), "slot_id", sep.arg[0]);
|
||||
ExportVar(package_name.c_str(), "spell_id", sep.arg[1]);
|
||||
if (IsValidSpell(Strings::ToUnsignedInt(sep.arg[1]))) {
|
||||
ExportVar(package_name.c_str(), "spell", "Spell", (void*)&spells[Strings::ToUnsignedInt(sep.arg[1])]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
|
||||
+1482
-17
File diff suppressed because it is too large
Load Diff
-228
@@ -1756,21 +1756,6 @@ void EntityList::QueueClients(
|
||||
}
|
||||
}
|
||||
|
||||
void EntityList::QueueManaged(Mob *sender, const EQApplicationPacket *app,
|
||||
bool ignore_sender, bool ackreq)
|
||||
{
|
||||
auto it = client_list.begin();
|
||||
while (it != client_list.end()) {
|
||||
Client *ent = it->second;
|
||||
|
||||
if ((!ignore_sender || ent != sender))
|
||||
ent->QueuePacket(app, ackreq, Client::CLIENT_CONNECTED);
|
||||
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void EntityList::QueueClientsStatus(Mob *sender, const EQApplicationPacket *app,
|
||||
bool ignore_sender, uint8 minstatus, uint8 maxstatus)
|
||||
{
|
||||
@@ -2180,21 +2165,6 @@ Group *EntityList::GetGroupByClient(Client *client)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Raid *EntityList::GetRaidByLeaderName(const char *leader)
|
||||
{
|
||||
std::list<Raid *>::iterator iterator;
|
||||
|
||||
iterator = raid_list.begin();
|
||||
|
||||
while (iterator != raid_list.end()) {
|
||||
if ((*iterator)->GetLeader() && strcmp((*iterator)->GetLeader()->GetName(), leader) == 0) {
|
||||
return *iterator;
|
||||
}
|
||||
++iterator;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Raid *EntityList::GetRaidByID(uint32 id)
|
||||
{
|
||||
std::list<Raid *>::iterator iterator;
|
||||
@@ -2274,26 +2244,6 @@ Raid* EntityList::GetRaidByBot(const Bot* bot)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Raid *EntityList::GetRaidByMob(Mob *mob)
|
||||
{
|
||||
std::list<Raid *>::iterator iterator;
|
||||
|
||||
iterator = raid_list.begin();
|
||||
|
||||
while (iterator != raid_list.end()) {
|
||||
for(int x = 0; x < MAX_RAID_MEMBERS; x++) {
|
||||
// TODO: Implement support for Mob objects in Raid class
|
||||
/*if((*iterator)->members[x].member){
|
||||
if((*iterator)->members[x].member == mob)
|
||||
return *iterator;
|
||||
}*/
|
||||
}
|
||||
++iterator;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Client *EntityList::GetClientByAccID(uint32 accid)
|
||||
{
|
||||
auto it = client_list.begin();
|
||||
@@ -2833,31 +2783,6 @@ bool EntityList::RemoveMob(uint16 delete_id)
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param delete_mob
|
||||
* @return
|
||||
*/
|
||||
bool EntityList::RemoveMob(Mob *delete_mob)
|
||||
{
|
||||
if (delete_mob == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
auto it = mob_list.begin();
|
||||
while (it != mob_list.end()) {
|
||||
if (it->second == delete_mob) {
|
||||
safe_delete(it->second);
|
||||
if (!corpse_list.count(it->first)) {
|
||||
free_ids.push(it->first);
|
||||
}
|
||||
mob_list.erase(it);
|
||||
return true;
|
||||
}
|
||||
++it;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param delete_id
|
||||
* @return
|
||||
@@ -3109,18 +3034,6 @@ bool EntityList::RemoveGroup(uint32 delete_id)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EntityList::RemoveRaid(uint32 delete_id)
|
||||
{
|
||||
auto it = std::find_if(raid_list.begin(), raid_list.end(),
|
||||
[delete_id](const Raid *a) { return a->GetID() == delete_id; });
|
||||
if (it == raid_list.end())
|
||||
return false;
|
||||
auto raid = *it;
|
||||
raid_list.erase(it);
|
||||
safe_delete(raid);
|
||||
return true;
|
||||
}
|
||||
|
||||
void EntityList::Clear()
|
||||
{
|
||||
RemoveAllClients();
|
||||
@@ -3205,21 +3118,6 @@ void EntityList::Process()
|
||||
CheckSpawnQueue();
|
||||
}
|
||||
|
||||
void EntityList::CountNPC(uint32 *NPCCount, uint32 *NPCLootCount, uint32 *gmspawntype_count)
|
||||
{
|
||||
*NPCCount = 0;
|
||||
*NPCLootCount = 0;
|
||||
|
||||
auto it = npc_list.begin();
|
||||
while (it != npc_list.end()) {
|
||||
(*NPCCount)++;
|
||||
(*NPCLootCount) += it->second->CountLoot();
|
||||
if (it->second->GetNPCTypeID() == 0)
|
||||
(*gmspawntype_count)++;
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
void EntityList::Depop(bool StartSpawnTimer)
|
||||
{
|
||||
for (auto it = npc_list.begin(); it != npc_list.end(); ++it) {
|
||||
@@ -3554,15 +3452,6 @@ void EntityList::ClearClientPetitionQueue()
|
||||
return;
|
||||
}
|
||||
|
||||
void EntityList::WriteEntityIDs()
|
||||
{
|
||||
auto it = mob_list.begin();
|
||||
while (it != mob_list.end()) {
|
||||
std::cout << "ID: " << it->first << " Name: " << it->second->GetName() << std::endl;
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
BulkZoneSpawnPacket::BulkZoneSpawnPacket(Client *iSendTo, uint32 iMaxSpawnsPerPacket)
|
||||
{
|
||||
data = nullptr;
|
||||
@@ -3631,24 +3520,6 @@ void EntityList::HalveAggro(Mob *who)
|
||||
}
|
||||
}
|
||||
|
||||
void EntityList::Evade(Mob *who)
|
||||
{
|
||||
uint32 flatval = who->GetLevel() * 13;
|
||||
int amt = 0;
|
||||
auto it = npc_list.begin();
|
||||
while (it != npc_list.end()) {
|
||||
if (it->second->CastToNPC()->CheckAggro(who)) {
|
||||
amt = it->second->CastToNPC()->GetHateAmount(who);
|
||||
amt -= flatval;
|
||||
if (amt > 0)
|
||||
it->second->CastToNPC()->SetHateAmountOnEnt(who, amt);
|
||||
else
|
||||
it->second->CastToNPC()->SetHateAmountOnEnt(who, 0);
|
||||
}
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
//removes "targ" from all hate lists, including feigned, in the zone
|
||||
void EntityList::ClearAggro(Mob* targ)
|
||||
{
|
||||
@@ -4388,35 +4259,6 @@ bool EntityList::LimitCheckGroup(uint32 spawngroup_id, int count)
|
||||
return true;
|
||||
}
|
||||
|
||||
//check limits on an npc type in a given spawn group, and
|
||||
//checks limits on the entire zone in one pass.
|
||||
//returns true if neither limit has been reached
|
||||
bool EntityList::LimitCheckBoth(uint32 npc_type, uint32 spawngroup_id, int group_count, int type_count)
|
||||
{
|
||||
if (group_count < 1 && type_count < 1)
|
||||
return true;
|
||||
|
||||
std::map<uint16, SpawnLimitRecord>::iterator cur,end;
|
||||
cur = npc_limit_list.begin();
|
||||
end = npc_limit_list.end();
|
||||
|
||||
for (; cur != end; ++cur) {
|
||||
if (cur->second.npc_type == npc_type) {
|
||||
type_count--;
|
||||
if (type_count == 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (cur->second.spawngroup_id == spawngroup_id) {
|
||||
group_count--;
|
||||
if (group_count == 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EntityList::LimitCheckName(const char *npc_name)
|
||||
{
|
||||
auto it = npc_list.begin();
|
||||
@@ -4463,25 +4305,6 @@ void EntityList::DestroyTempPets(Mob *owner)
|
||||
}
|
||||
}
|
||||
|
||||
int16 EntityList::CountTempPets(Mob *owner)
|
||||
{
|
||||
int16 count = 0;
|
||||
auto it = npc_list.begin();
|
||||
while (it != npc_list.end()) {
|
||||
NPC* n = it->second;
|
||||
if (n->GetSwarmInfo()) {
|
||||
if (n->GetSwarmInfo()->owner_id == owner->GetID()) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
++it;
|
||||
}
|
||||
|
||||
owner->SetTempPetCount(count);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
void EntityList::AddTempPetsToHateList(Mob *owner, Mob* other, bool bFrenzy)
|
||||
{
|
||||
if (!other || !owner)
|
||||
@@ -4534,32 +4357,6 @@ void EntityList::AddTempPetsToHateListOnOwnerDamage(Mob *owner, Mob* attacker, i
|
||||
}
|
||||
}
|
||||
|
||||
bool Entity::CheckCoordLosNoZLeaps(float cur_x, float cur_y, float cur_z,
|
||||
float trg_x, float trg_y, float trg_z, float perwalk)
|
||||
{
|
||||
if (zone->zonemap == nullptr)
|
||||
return true;
|
||||
|
||||
glm::vec3 myloc;
|
||||
glm::vec3 oloc;
|
||||
glm::vec3 hit;
|
||||
|
||||
myloc.x = cur_x;
|
||||
myloc.y = cur_y;
|
||||
myloc.z = cur_z+5;
|
||||
|
||||
oloc.x = trg_x;
|
||||
oloc.y = trg_y;
|
||||
oloc.z = trg_z+5;
|
||||
|
||||
if (myloc.x == oloc.x && myloc.y == oloc.y && myloc.z == oloc.z)
|
||||
return true;
|
||||
|
||||
if (!zone->zonemap->LineIntersectsZoneNoZLeaps(myloc,oloc,perwalk,&hit))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void EntityList::QuestJournalledSayClose(
|
||||
Mob *sender, float dist, const char *mobname, const char *message,
|
||||
Journal::Options &opts
|
||||
@@ -5201,17 +4998,6 @@ uint32 EntityList::CheckNPCsClose(Mob *center)
|
||||
return count;
|
||||
}
|
||||
|
||||
void EntityList::GateAllClients()
|
||||
{
|
||||
auto it = client_list.begin();
|
||||
while (it != client_list.end()) {
|
||||
Client *c = it->second;
|
||||
if (c)
|
||||
c->GoToBind();
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
void EntityList::SignalAllClients(int signal_id)
|
||||
{
|
||||
for (const auto& c : client_list) {
|
||||
@@ -5221,20 +5007,6 @@ void EntityList::SignalAllClients(int signal_id)
|
||||
}
|
||||
}
|
||||
|
||||
uint16 EntityList::GetClientCount(){
|
||||
uint16 ClientCount = 0;
|
||||
std::list<Client*> client_list;
|
||||
entity_list.GetClientList(client_list);
|
||||
auto iter = client_list.begin();
|
||||
while (iter != client_list.end()) {
|
||||
Client *entry = (*iter);
|
||||
entry->GetCleanName();
|
||||
ClientCount++;
|
||||
iter++;
|
||||
}
|
||||
return ClientCount;
|
||||
}
|
||||
|
||||
void EntityList::GetMobList(std::list<Mob *> &m_list)
|
||||
{
|
||||
m_list.clear();
|
||||
|
||||
@@ -50,7 +50,6 @@ class Raid;
|
||||
class Spawn2;
|
||||
class Trap;
|
||||
|
||||
struct DynamicZoneSafeReturn;
|
||||
struct GuildBankItemUpdate_Struct;
|
||||
struct NewSpawn_Struct;
|
||||
struct QGlobal;
|
||||
@@ -115,7 +114,6 @@ public:
|
||||
inline const time_t& GetSpawnTimeStamp() const { return spawn_timestamp; }
|
||||
|
||||
virtual const char* GetName() { return ""; }
|
||||
bool CheckCoordLosNoZLeaps(float cur_x, float cur_y, float cur_z, float trg_x, float trg_y, float trg_z, float perwalk=1);
|
||||
|
||||
Bot* CastToBot();
|
||||
const Bot* CastToBot() const;
|
||||
@@ -129,7 +127,6 @@ protected:
|
||||
initial_id = set_id;
|
||||
}
|
||||
}
|
||||
uint32 pDBAsyncWorkID;
|
||||
private:
|
||||
uint16 id;
|
||||
uint16 initial_id;
|
||||
@@ -186,7 +183,6 @@ public:
|
||||
Client *GetClientByCharID(uint32 iCharID);
|
||||
Client *GetClientByWID(uint32 iWID);
|
||||
Client *GetClientByLSID(uint32 iLSID);
|
||||
Client *GetClient(uint32 ip, uint16 port);
|
||||
|
||||
Bot* GetRandomBot(const glm::vec3& location = glm::vec3(0.f), float distance = 0, Bot* exclude_bot = nullptr);
|
||||
Client* GetRandomClient(const glm::vec3& location = glm::vec3(0.f), float distance = 0, Client* exclude_client = nullptr);
|
||||
@@ -194,15 +190,12 @@ public:
|
||||
Mob* GetRandomMob(const glm::vec3& location = glm::vec3(0.f), float distance = 0, Mob* exclude_mob = nullptr);
|
||||
Group* GetGroupByMob(Mob* mob);
|
||||
Group* GetGroupByMobName(const char* name);
|
||||
Group* GetGroupByBot(Bot* bot);
|
||||
bool IsInSameGroupOrRaidGroup(Client *client1, Client *client2);
|
||||
Group *GetGroupByClient(Client* client);
|
||||
Group *GetGroupByID(uint32 id);
|
||||
Group *GetGroupByLeaderName(const char* leader);
|
||||
Raid *GetRaidByMob(Mob* mob);
|
||||
Raid *GetRaidByClient(Client* client);
|
||||
Raid *GetRaidByID(uint32 id);
|
||||
Raid *GetRaidByLeaderName(const char *leader);
|
||||
Raid* GetRaidByBotName(const char* name);
|
||||
Raid* GetRaidByBot(const Bot* bot);
|
||||
|
||||
@@ -268,7 +261,6 @@ public:
|
||||
void ClearAreas();
|
||||
void ReloadMerchants();
|
||||
void ProcessProximitySay(const char *message, Client *c, uint8 language = 0);
|
||||
void SendAATimer(uint32 charid,UseAA_Struct* uaa);
|
||||
Doors *FindDoor(uint8 door_id);
|
||||
Object *FindObject(uint32 object_id);
|
||||
Object* FindNearbyObject(float x, float y, float z, float radius);
|
||||
@@ -291,13 +283,11 @@ public:
|
||||
void AddProximity(NPC *proximity_for);
|
||||
void Clear();
|
||||
bool RemoveMob(uint16 delete_id);
|
||||
bool RemoveMob(Mob* delete_mob);
|
||||
bool RemoveClient(uint16 delete_id);
|
||||
bool RemoveClient(Client* delete_client);
|
||||
bool RemoveNPC(uint16 delete_id);
|
||||
bool RemoveMerc(uint16 delete_id);
|
||||
bool RemoveGroup(uint32 delete_id);
|
||||
bool RemoveRaid(uint32 delete_id);
|
||||
bool RemoveCorpse(uint16 delete_id);
|
||||
bool RemoveDoor(uint16 delete_id);
|
||||
bool RemoveTrap(uint16 delete_id);
|
||||
@@ -321,7 +311,6 @@ public:
|
||||
void RemoveAllRaids();
|
||||
void RemoveAllEncounters();
|
||||
void DestroyTempPets(Mob *owner);
|
||||
int16 CountTempPets(Mob *owner);
|
||||
void AddTempPetsToHateList(Mob *owner, Mob* other, bool bFrenzy = false);
|
||||
void AddTempPetsToHateListOnOwnerDamage(Mob *owner, Mob* attacker, int32 spell_id);
|
||||
Entity *GetEntityMob(uint16 id);
|
||||
@@ -428,7 +417,6 @@ public:
|
||||
|
||||
void QueueClientsByXTarget(Mob* sender, const EQApplicationPacket* app, bool iSendToSender = true, EQ::versions::ClientVersionBitmask client_version_bits = EQ::versions::ClientVersionBitmask::maskAllClients);
|
||||
void QueueToGroupsForNPCHealthAA(Mob* sender, const EQApplicationPacket* app);
|
||||
void QueueManaged(Mob* sender, const EQApplicationPacket* app, bool ignore_sender=false, bool ackreq = true);
|
||||
|
||||
void AEAttack(
|
||||
Mob *attacker,
|
||||
@@ -455,13 +443,11 @@ public:
|
||||
Trap* FindNearbyTrap(Mob* searcher, float max_dist, float &curdist, bool detected = false);
|
||||
|
||||
void AddHealAggro(Mob* target, Mob* caster, uint16 hate);
|
||||
Mob* FindDefenseNPC(uint32 npcid);
|
||||
void OpenDoorsNear(Mob* opener);
|
||||
void UpdateWho(bool iSendFullUpdate = false);
|
||||
char* MakeNameUnique(char* name);
|
||||
static char* RemoveNumbers(char* name);
|
||||
void SignalMobsByNPCID(uint32 npc_type, int signal_id);
|
||||
void CountNPC(uint32* NPCCount, uint32* NPCLootCount, uint32* gmspawntype_count);
|
||||
void RemoveEntity(uint16 id);
|
||||
void SendPetitionToAdmins(Petition* pet);
|
||||
void SendPetitionToAdmins();
|
||||
@@ -472,10 +458,8 @@ public:
|
||||
uint32 DeleteNPCCorpses();
|
||||
uint32 DeletePlayerCorpses();
|
||||
void CorpseFix(Client* c);
|
||||
void WriteEntityIDs();
|
||||
void HalveAggro(Mob* who);
|
||||
void DoubleAggro(Mob* who);
|
||||
void Evade(Mob *who);
|
||||
void UpdateHoTT(Mob* target);
|
||||
|
||||
void Process();
|
||||
@@ -496,7 +480,6 @@ public:
|
||||
void LimitRemoveNPC(NPC *npc);
|
||||
bool LimitCheckType(uint32 npc_type, int count);
|
||||
bool LimitCheckGroup(uint32 spawngroup_id, int count);
|
||||
bool LimitCheckBoth(uint32 npc_type, uint32 spawngroup_id, int group_count, int type_count);
|
||||
bool LimitCheckName(const char* npc_name);
|
||||
|
||||
int GetHatedCount(Mob *attacker, Mob *exclude, bool inc_gray_con);
|
||||
@@ -521,7 +504,6 @@ public:
|
||||
void ZoneWho(Client *c, Who_All_Struct* Who);
|
||||
void UnMarkNPC(uint16 ID);
|
||||
|
||||
void GateAllClients();
|
||||
void SignalAllClients(int signal_id);
|
||||
void UpdateQGlobal(uint32 qid, QGlobal newGlobal);
|
||||
void DeleteQGlobal(std::string name, uint32 npcID, uint32 charID, uint32 zoneID);
|
||||
@@ -531,7 +513,6 @@ public:
|
||||
|
||||
void GateAllClientsToSafeReturn();
|
||||
|
||||
uint16 GetClientCount();
|
||||
void GetMobList(std::list<Mob*> &m_list);
|
||||
void GetNPCList(std::list<NPC*> &n_list);
|
||||
void GetMercList(std::list<Merc*> &n_list);
|
||||
|
||||
@@ -124,6 +124,10 @@ typedef enum {
|
||||
EVENT_ITEM_CLICK_CAST_CLIENT,
|
||||
EVENT_DESTROY_ITEM_CLIENT,
|
||||
EVENT_DROP_ITEM_CLIENT,
|
||||
EVENT_MEMORIZE_SPELL,
|
||||
EVENT_UNMEMORIZE_SPELL,
|
||||
EVENT_SCRIBE_SPELL,
|
||||
EVENT_UNSCRIBE_SPELL,
|
||||
// Add new events before these or Lua crashes
|
||||
EVENT_SPELL_EFFECT_BOT,
|
||||
EVENT_SPELL_EFFECT_BUFF_TIC_BOT,
|
||||
|
||||
@@ -62,7 +62,7 @@ void command_appearanceeffects(Client *c, const Seperator *sep)
|
||||
"Appearance Effect ID {} in slot ID {} has been set for {}.",
|
||||
effect_id,
|
||||
slot_id,
|
||||
c->GetTargetDescription(t, TargetDescriptionType::LCSelf)
|
||||
c->GetTargetDescription(t)
|
||||
).c_str()
|
||||
);
|
||||
} else if (is_remove) {
|
||||
@@ -90,7 +90,7 @@ void command_appearanceeffects(Client *c, const Seperator *sep)
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Appearance Effects have been removed for {}.",
|
||||
c->GetTargetDescription(t, TargetDescriptionType::LCSelf)
|
||||
c->GetTargetDescription(t)
|
||||
).c_str()
|
||||
);
|
||||
} else if (is_view) {
|
||||
|
||||
@@ -21,7 +21,7 @@ void command_castspell(Client *c, const Seperator *sep)
|
||||
else {
|
||||
uint16 spell_id = Strings::ToUnsignedInt(sep->arg[1]);
|
||||
|
||||
if (CastRestrictedSpell(spell_id) && c->Admin() < commandCastSpecials) {
|
||||
if (IsCastRestrictedSpell(spell_id) && c->Admin() < commandCastSpecials) {
|
||||
c->Message(Chat::Red, "Unable to cast spell.");
|
||||
}
|
||||
else if (spell_id >= SPDAT_RECORDS) {
|
||||
|
||||
@@ -0,0 +1,190 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_entityvariable(Client *c, const Seperator *sep)
|
||||
{
|
||||
const auto arguments = sep->argnum;
|
||||
|
||||
if (!arguments) {
|
||||
c->Message(Chat::White, "Usage: #entityvariable clear - Clear all entity variables on yourself or your target");
|
||||
c->Message(Chat::White, "Usage: #entityvariable delete [Variable Name] - Delete an entity variable from yourself or your target");
|
||||
c->Message(Chat::White, "Usage: #entityvariable set [Variable Name] [Variable Value] - Set an entity variable for yourself or your target");
|
||||
c->Message(Chat::White, "Usage: #entityvariable view [Variable Name] - View an entity variable on yourself or your target");
|
||||
c->Message(Chat::White, "Note: You can have spaces in variable names and values by wrapping in double quotes like this");
|
||||
c->Message(Chat::White, "Example: #entityvariable set \"Test Variable\" \"Test Value\"");
|
||||
c->Message(Chat::White, "Note: Variable Value is optional and can be set to empty by not providing a value");
|
||||
return;
|
||||
}
|
||||
|
||||
const bool is_clear = !strcasecmp(sep->arg[1], "clear");
|
||||
const bool is_delete = !strcasecmp(sep->arg[1], "delete");
|
||||
const bool is_set = !strcasecmp(sep->arg[1], "set");
|
||||
const bool is_view = !strcasecmp(sep->arg[1], "view");
|
||||
|
||||
if (
|
||||
!is_clear &&
|
||||
!is_delete &&
|
||||
!is_set &&
|
||||
!is_view
|
||||
) {
|
||||
c->Message(Chat::White, "Usage: #entityvariable clear - Clear all entity variables on yourself or your target");
|
||||
c->Message(Chat::White, "Usage: #entityvariable delete [Variable Name] - Delete an entity variable from yourself or your target");
|
||||
c->Message(Chat::White, "Usage: #entityvariable set [Variable Name] [Variable Value] - Set an entity variable for yourself or your target");
|
||||
c->Message(Chat::White, "Usage: #entityvariable view [Variable Name] - View an entity variable on yourself or your target");
|
||||
c->Message(Chat::White, "Note: You can have spaces in variable names and values by wrapping in double quotes like this");
|
||||
c->Message(Chat::White, "Example: #entityvariable set \"Test Variable\" \"Test Value\"");
|
||||
c->Message(Chat::White, "Note: Variable Value is optional and can be set to empty by not providing a value");
|
||||
return;
|
||||
}
|
||||
|
||||
Mob* t = c;
|
||||
if (c->GetTarget()) {
|
||||
t = c->GetTarget();
|
||||
}
|
||||
|
||||
if (is_clear) {
|
||||
const auto cleared = t->ClearEntityVariables();
|
||||
|
||||
if (!cleared) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} {} not have any entity variables to clear.",
|
||||
c->GetTargetDescription(t, TargetDescriptionType::UCYou),
|
||||
c == t ? "do" : "does"
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Cleared all entity variables for {}.",
|
||||
c->GetTargetDescription(t)
|
||||
).c_str()
|
||||
);
|
||||
} else if (is_delete) {
|
||||
const std::string variable_name = sep->argplus[2];
|
||||
|
||||
if (!t->EntityVariableExists(variable_name)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} {} not have an entity variable named '{}'.",
|
||||
c->GetTargetDescription(t, TargetDescriptionType::UCYou),
|
||||
c == t ? "do" : "does",
|
||||
variable_name
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
t->DeleteEntityVariable(variable_name);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Deleted an entity variable named '{}' from {}.",
|
||||
variable_name,
|
||||
c->GetTargetDescription(t)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
} else if (is_set) {
|
||||
const std::string variable_name = sep->arg[2];
|
||||
const std::string variable_value = sep->arg[3];
|
||||
|
||||
t->SetEntityVariable(variable_name, variable_value);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Set an entity variable named '{}' to a value of '{}' for {}.",
|
||||
variable_name,
|
||||
variable_value,
|
||||
c->GetTargetDescription(t)
|
||||
).c_str()
|
||||
);
|
||||
} else if (is_view) {
|
||||
const auto &l = t->GetEntityVariables();
|
||||
|
||||
uint32 variable_count = 0;
|
||||
uint32 variable_number = 1;
|
||||
const std::string search_criteria = arguments ? sep->argplus[2] : "";
|
||||
|
||||
for (const auto &e: l) {
|
||||
if (
|
||||
search_criteria.empty() ||
|
||||
Strings::Contains(Strings::ToLower(e), Strings::ToLower(search_criteria))
|
||||
) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Variable {} | Name: {} Value: {} | {}",
|
||||
variable_number,
|
||||
e,
|
||||
t->GetEntityVariable(e),
|
||||
Saylink::Silent(
|
||||
fmt::format(
|
||||
"#entityvariable delete {}",
|
||||
e
|
||||
),
|
||||
"Delete"
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
variable_count++;
|
||||
variable_number++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!variable_count) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} {} no entity variables{}.",
|
||||
c->GetTargetDescription(t, TargetDescriptionType::UCYou),
|
||||
c == t ? "have" : "has",
|
||||
(
|
||||
!search_criteria.empty() ?
|
||||
fmt::format(
|
||||
" matching '{}'",
|
||||
search_criteria
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} {} {} entity variable{}{}, would you like to {} all of {} entity variables?",
|
||||
c->GetTargetDescription(t, TargetDescriptionType::UCYou),
|
||||
c == t ? "have" : "has",
|
||||
variable_count,
|
||||
variable_count != 1 ? "s" : "",
|
||||
(
|
||||
!search_criteria.empty() ?
|
||||
fmt::format(
|
||||
" matching '{}'",
|
||||
search_criteria
|
||||
) :
|
||||
""
|
||||
),
|
||||
Saylink::Silent(
|
||||
"#entityvariable clear",
|
||||
"clear"
|
||||
),
|
||||
c == t ? "your" : "their"
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ void command_exptoggle(Client *c, const Seperator *sep)
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Experience gain for {} is now {}abled.",
|
||||
c->GetTargetDescription(t, TargetDescriptionType::LCSelf),
|
||||
c->GetTargetDescription(t),
|
||||
is_exp_enabled ? "en" : "dis"
|
||||
).c_str()
|
||||
);
|
||||
|
||||
Executable
+134
@@ -0,0 +1,134 @@
|
||||
#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()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -420,24 +420,18 @@ void command_npcedit(Client *c, const Seperator *sep)
|
||||
} else if (!strcasecmp(sep->arg[1], "special_attacks")) {
|
||||
std::string special_attacks = sep->argplus[2];
|
||||
n.npcspecialattks = special_attacks;
|
||||
c->Message(
|
||||
Chat::Yellow,
|
||||
fmt::format(
|
||||
"{} is now using the following Special Attacks '{}'.",
|
||||
npc_id_string,
|
||||
special_attacks
|
||||
).c_str()
|
||||
d = fmt::format(
|
||||
"{} is now using the following Special Attacks '{}'.",
|
||||
npc_id_string,
|
||||
special_attacks
|
||||
);
|
||||
} else if (!strcasecmp(sep->arg[1], "special_abilities")) {
|
||||
std::string special_abilities = sep->argplus[2];
|
||||
n.special_abilities = special_abilities;
|
||||
c->Message(
|
||||
Chat::Yellow,
|
||||
fmt::format(
|
||||
"{} is now using the following Special Abilities '{}'.",
|
||||
npc_id_string,
|
||||
special_abilities
|
||||
).c_str()
|
||||
d = fmt::format(
|
||||
"{} is now using the following Special Abilities '{}'.",
|
||||
npc_id_string,
|
||||
special_abilities
|
||||
);
|
||||
} else if (!strcasecmp(sep->arg[1], "aggroradius")) {
|
||||
if (sep->IsNumber(2)) {
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
#include "../client.h"
|
||||
#include "../../common/patches/patches.h"
|
||||
|
||||
void command_opcode(Client *c, const Seperator *sep)
|
||||
{
|
||||
ReloadAllPatches();
|
||||
c->Message(Chat::White, "Opcodes for all patches have been reloaded");
|
||||
}
|
||||
|
||||
@@ -11,8 +11,15 @@ void command_questerrors(Client *c, const Seperator *sep)
|
||||
|
||||
int error_index = 0;
|
||||
for (auto quest_error : quest_errors) {
|
||||
if (error_index >= 30) {
|
||||
c->Message(Chat::White, "Maximum of 30 errors shown.");
|
||||
if (error_index >= RuleI(World, MaximumQuestErrors)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Maximum of {} error{} shown.",
|
||||
RuleI(World, MaximumQuestErrors),
|
||||
RuleI(World, MaximumQuestErrors) != 1 ? "s" : ""
|
||||
).c_str()
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+57
-81
@@ -1,16 +1,18 @@
|
||||
#include "../client.h"
|
||||
#include "../../common/patches/patches.h"
|
||||
|
||||
void command_reload(Client *c, const Seperator *sep)
|
||||
{
|
||||
std::string command = sep->arg[0] ? sep->arg[0] : "";
|
||||
int arguments = sep->argnum;
|
||||
const auto arguments = sep->argnum;
|
||||
if (!arguments && Strings::Contains(command, "#reload")) {
|
||||
c->SendReloadCommandMessages();
|
||||
return;
|
||||
}
|
||||
|
||||
bool is_rq_alias = sep->arg[0] && Strings::Contains(command, "#rq");
|
||||
bool is_logs_reload_alias = sep->arg[0] && Strings::Contains(command, "#rl");
|
||||
bool is_opcodes_reload_alias = sep->arg[0] && Strings::Contains(command, "#opcode");
|
||||
bool is_rq_alias = sep->arg[0] && Strings::Contains(command, "#rq");
|
||||
bool is_aa = !strcasecmp(sep->arg[1], "aa");
|
||||
bool is_alternate_currencies = !strcasecmp(sep->arg[1], "alternate_currencies");
|
||||
bool is_blocked_spells = !strcasecmp(sep->arg[1], "blocked_spells");
|
||||
@@ -24,6 +26,7 @@ void command_reload(Client *c, const Seperator *sep)
|
||||
bool is_merchants = !strcasecmp(sep->arg[1], "merchants");
|
||||
bool is_npc_emotes = !strcasecmp(sep->arg[1], "npc_emotes");
|
||||
bool is_objects = !strcasecmp(sep->arg[1], "objects");
|
||||
bool is_opcodes = !strcasecmp(sep->arg[1], "opcodes") || is_opcodes_reload_alias;
|
||||
bool is_perl_export = !strcasecmp(sep->arg[1], "perl_export");
|
||||
bool is_quest = !strcasecmp(sep->arg[1], "quest") || (is_rq_alias);
|
||||
bool is_rules = !strcasecmp(sep->arg[1], "rules");
|
||||
@@ -51,6 +54,7 @@ void command_reload(Client *c, const Seperator *sep)
|
||||
!is_merchants &&
|
||||
!is_npc_emotes &&
|
||||
!is_objects &&
|
||||
!is_opcodes &&
|
||||
!is_perl_export &&
|
||||
!is_quest &&
|
||||
!is_rules &&
|
||||
@@ -63,7 +67,7 @@ void command_reload(Client *c, const Seperator *sep)
|
||||
!is_world &&
|
||||
!is_zone &&
|
||||
!is_zone_points
|
||||
) {
|
||||
) {
|
||||
c->SendReloadCommandMessages();
|
||||
return;
|
||||
}
|
||||
@@ -73,36 +77,28 @@ void command_reload(Client *c, const Seperator *sep)
|
||||
if (is_aa) {
|
||||
c->Message(Chat::White, "Attempting to reload Alternate Advancement Data globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadAAData, 0);
|
||||
}
|
||||
else if (is_alternate_currencies) {
|
||||
} else if (is_alternate_currencies) {
|
||||
c->Message(Chat::White, "Attempting to reload Alternate Currencies globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadAlternateCurrencies, 0);
|
||||
}
|
||||
else if (is_blocked_spells) {
|
||||
} else if (is_blocked_spells) {
|
||||
c->Message(Chat::White, "Attempting to reload Blocked Spells globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadBlockedSpells, 0);
|
||||
}
|
||||
else if (is_commands) {
|
||||
} else if (is_commands) {
|
||||
c->Message(Chat::White, "Attempting to reload Commands globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadCommands, 0);
|
||||
}
|
||||
else if (is_content_flags) {
|
||||
} else if (is_content_flags) {
|
||||
c->Message(Chat::White, "Attempting to reload Content Flags globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadContentFlags, 0);
|
||||
}
|
||||
else if (is_doors) {
|
||||
} else if (is_doors) {
|
||||
c->Message(Chat::White, "Attempting to reload Doors globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadDoors, 0);
|
||||
}
|
||||
else if (is_dztemplates) {
|
||||
} else if (is_dztemplates) {
|
||||
c->Message(Chat::White, "Attempting to reload Dynamic Zone Templates globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadDzTemplates, 0);
|
||||
}
|
||||
else if (is_ground_spawns) {
|
||||
} else if (is_ground_spawns) {
|
||||
c->Message(Chat::White, "Attempting to reload Ground Spawns globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadGroundSpawns, 0);
|
||||
}
|
||||
else if (is_level_mods) {
|
||||
} else if (is_level_mods) {
|
||||
if (!RuleB(Zone, LevelBasedEXPMods)) {
|
||||
c->Message(Chat::White, "Level Based Experience Modifiers are disabled.");
|
||||
return;
|
||||
@@ -110,75 +106,60 @@ void command_reload(Client *c, const Seperator *sep)
|
||||
|
||||
c->Message(Chat::White, "Attempting to reload Level Based Experience Modifiers globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadLevelEXPMods, 0);
|
||||
}
|
||||
else if (is_logs) {
|
||||
} else if (is_logs) {
|
||||
c->Message(Chat::White, "Attempting to reload Log Settings globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadLogs, 0);
|
||||
}
|
||||
else if (is_merchants) {
|
||||
} else if (is_merchants) {
|
||||
c->Message(Chat::White, "Attempting to reload Merchants globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadMerchants, 0);
|
||||
}
|
||||
else if (is_npc_emotes) {
|
||||
} else if (is_npc_emotes) {
|
||||
c->Message(Chat::White, "Attempting to reload NPC Emotes globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadNPCEmotes, 0);
|
||||
}
|
||||
else if (is_objects) {
|
||||
} else if (is_objects) {
|
||||
c->Message(Chat::White, "Attempting to reload Objects globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadObjects, 0);
|
||||
}
|
||||
else if (is_perl_export) {
|
||||
} else if (is_opcodes) {
|
||||
c->Message(Chat::White, "Attempting to reload Opcodes globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadOpcodes, 0);
|
||||
} else if (is_perl_export) {
|
||||
c->Message(Chat::White, "Attempting to reload Perl Event Export Settings globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadPerlExportSettings, 0);
|
||||
}
|
||||
else if (is_quest) {
|
||||
bool stop_timers = false;
|
||||
|
||||
if (sep->IsNumber(2)) {
|
||||
stop_timers = Strings::ToInt(sep->arg[2]) != 0 ? true : false;
|
||||
}
|
||||
|
||||
std::string stop_timers_message = stop_timers ? " and timers stopped" : "";
|
||||
} else if (is_quest) {
|
||||
const auto stop_timers = sep->IsNumber(2) ? Strings::ToBool(sep->arg[2]) : false;
|
||||
|
||||
c->Message(
|
||||
Chat::Yellow,
|
||||
fmt::format(
|
||||
"Quests reloaded{} for {}.",
|
||||
stop_timers_message,
|
||||
stop_timers ? " and timers stopped" : "",
|
||||
zone->GetZoneDescription()
|
||||
).c_str()
|
||||
);
|
||||
|
||||
entity_list.ClearAreas();
|
||||
parse->ReloadQuests(stop_timers);
|
||||
}
|
||||
else if (is_rules) {
|
||||
} else if (is_rules) {
|
||||
c->Message(Chat::White, "Attempting to reload Rules globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadRules, 0);
|
||||
}
|
||||
else if (is_static) {
|
||||
} else if (is_static) {
|
||||
c->Message(Chat::White, "Attempting to reload Static Zone Data globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadStaticZoneData, 0);
|
||||
}
|
||||
else if (is_tasks) {
|
||||
} else if (is_tasks) {
|
||||
uint32 task_id = 0;
|
||||
if (!sep->IsNumber(2)) {
|
||||
c->Message(Chat::White, "Attempting to reload Tasks globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadTasks, sizeof(ReloadTasks_Struct));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
task_id = Strings::ToUnsignedInt(sep->arg[2]);
|
||||
}
|
||||
|
||||
auto rts = (ReloadTasks_Struct *) pack->pBuffer;
|
||||
rts->reload_type = RELOADTASKS;
|
||||
rts->task_id = task_id;
|
||||
}
|
||||
else if (is_titles) {
|
||||
} else if (is_titles) {
|
||||
c->Message(Chat::White, "Attempting to reload Titles globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadTitles, 0);
|
||||
}
|
||||
else if (is_traps) {
|
||||
} else if (is_traps) {
|
||||
if (arguments < 2 || !sep->IsNumber(2)) {
|
||||
entity_list.UpdateAllTraps(true, true);
|
||||
c->Message(
|
||||
@@ -191,7 +172,7 @@ void command_reload(Client *c, const Seperator *sep)
|
||||
return;
|
||||
}
|
||||
|
||||
bool global = Strings::ToInt(sep->arg[2]) ? true : false;
|
||||
const auto global = Strings::ToBool(sep->arg[2]);
|
||||
|
||||
if (!global) {
|
||||
entity_list.UpdateAllTraps(true, true);
|
||||
@@ -207,16 +188,13 @@ void command_reload(Client *c, const Seperator *sep)
|
||||
|
||||
c->Message(Chat::White, "Attempting to reload Traps globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadTraps, 0);
|
||||
}
|
||||
else if (is_variables) {
|
||||
} else if (is_variables) {
|
||||
c->Message(Chat::White, "Attempting to reload Variables globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadVariables, 0);
|
||||
}
|
||||
else if (is_veteran_rewards) {
|
||||
} else if (is_veteran_rewards) {
|
||||
c->Message(Chat::White, "Attempting to reload Veteran Rewards globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadVeteranRewards, 0);
|
||||
}
|
||||
else if (is_world) {
|
||||
} else if (is_world) {
|
||||
uint8 global_repop = ReloadWorld::NoRepop;
|
||||
|
||||
if (sep->IsNumber(2)) {
|
||||
@@ -233,12 +211,12 @@ void command_reload(Client *c, const Seperator *sep)
|
||||
"Attempting to reload Quests {}worldwide.",
|
||||
(
|
||||
global_repop ?
|
||||
(
|
||||
global_repop == ReloadWorld::Repop ?
|
||||
"and repop NPCs " :
|
||||
"and forcefully repop NPCs "
|
||||
) :
|
||||
""
|
||||
(
|
||||
global_repop == ReloadWorld::Repop ?
|
||||
"and repop NPCs " :
|
||||
"and forcefully repop NPCs "
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
@@ -246,8 +224,7 @@ void command_reload(Client *c, const Seperator *sep)
|
||||
pack = new ServerPacket(ServerOP_ReloadWorld, sizeof(ReloadWorld_Struct));
|
||||
auto RW = (ReloadWorld_Struct *) pack->pBuffer;
|
||||
RW->global_repop = global_repop;
|
||||
}
|
||||
else if (is_zone) {
|
||||
} else if (is_zone) {
|
||||
zone_store.LoadZones(content_db);
|
||||
|
||||
if (arguments < 2) {
|
||||
@@ -257,8 +234,8 @@ void command_reload(Client *c, const Seperator *sep)
|
||||
"Zone Header Load {} | Zone: {}",
|
||||
(
|
||||
zone->LoadZoneCFG(zone->GetShortName(), zone->GetInstanceVersion()) ?
|
||||
"Succeeded" :
|
||||
"Failed"
|
||||
"Succeeded" :
|
||||
"Failed"
|
||||
),
|
||||
zone->GetZoneDescription()
|
||||
).c_str()
|
||||
@@ -268,8 +245,8 @@ void command_reload(Client *c, const Seperator *sep)
|
||||
|
||||
auto zone_id = (
|
||||
sep->IsNumber(2) ?
|
||||
Strings::ToUnsignedInt(sep->arg[2]) :
|
||||
ZoneID(sep->arg[2])
|
||||
Strings::ToUnsignedInt(sep->arg[2]) :
|
||||
ZoneID(sep->arg[2])
|
||||
);
|
||||
if (!zone_id) {
|
||||
c->Message(
|
||||
@@ -286,8 +263,8 @@ void command_reload(Client *c, const Seperator *sep)
|
||||
auto zone_long_name = ZoneLongName(zone_id);
|
||||
auto version = (
|
||||
sep->IsNumber(3) ?
|
||||
Strings::ToUnsignedInt(sep->arg[3]) :
|
||||
0
|
||||
Strings::ToUnsignedInt(sep->arg[3]) :
|
||||
0
|
||||
);
|
||||
|
||||
auto outapp = new EQApplicationPacket(OP_NewZone, sizeof(NewZone_Struct));
|
||||
@@ -301,23 +278,22 @@ void command_reload(Client *c, const Seperator *sep)
|
||||
"Zone Header Load {} | Zone: {} ({}){}",
|
||||
(
|
||||
zone->LoadZoneCFG(zone_short_name, version) ?
|
||||
"Succeeded" :
|
||||
"Failed"
|
||||
"Succeeded" :
|
||||
"Failed"
|
||||
),
|
||||
zone_long_name,
|
||||
zone_short_name,
|
||||
(
|
||||
version ?
|
||||
fmt::format(
|
||||
" Version: {}",
|
||||
version
|
||||
) :
|
||||
""
|
||||
fmt::format(
|
||||
" Version: {}",
|
||||
version
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
else if (is_zone_points) {
|
||||
} else if (is_zone_points) {
|
||||
c->Message(Chat::White, "Attempting to reloading Zone Points globally.");
|
||||
pack = new ServerPacket(ServerOP_ReloadZonePoints, 0);
|
||||
}
|
||||
|
||||
@@ -2,9 +2,24 @@
|
||||
|
||||
void command_setanim(Client *c, const Seperator *sep)
|
||||
{
|
||||
int arguments = sep->argnum;
|
||||
const auto arguments = sep->argnum;
|
||||
if (!arguments || !sep->IsNumber(1)) {
|
||||
c->Message(Chat::White, "Usage: #setanim [Animation ID (IDs are 0 to 4)]");
|
||||
c->Message(Chat::White, "Usage: #setanim [Animation ID]");
|
||||
|
||||
uint32 animation_number = 1;
|
||||
for (const auto& a : EQ::constants::GetSpawnAnimationMap()) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Animation {} | ID: {} Name: {}",
|
||||
animation_number,
|
||||
a.first,
|
||||
a.second
|
||||
).c_str()
|
||||
);
|
||||
|
||||
animation_number++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -13,29 +28,36 @@ void command_setanim(Client *c, const Seperator *sep)
|
||||
target = c->GetTarget();
|
||||
}
|
||||
|
||||
|
||||
int animation_id = Strings::ToInt(sep->arg[1]);
|
||||
const auto animation_id = static_cast<uint8>(Strings::ToUnsignedInt(sep->arg[1]));
|
||||
if (
|
||||
animation_id < 0 ||
|
||||
animation_id > eaLooting
|
||||
!EQ::ValueWithin(
|
||||
animation_id,
|
||||
static_cast<uint8>(eaStanding),
|
||||
static_cast<uint8>(eaLooting)
|
||||
)
|
||||
) {
|
||||
c->Message(Chat::White, "Usage: #setanim [Animation ID (IDs are 0 to 4)]");
|
||||
c->Message(Chat::White, "Usage: #setanim [Animation ID]");
|
||||
|
||||
uint32 animation_number = 1;
|
||||
for (const auto& a : EQ::constants::GetSpawnAnimationMap()) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Animation {} | ID: {} Name: {}",
|
||||
animation_number,
|
||||
a.first,
|
||||
a.second
|
||||
).c_str()
|
||||
);
|
||||
|
||||
animation_number++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
target->SetAppearance(static_cast<EmuAppearance>(animation_id), false);
|
||||
std::string animation_name;
|
||||
if (animation_id == eaStanding) {
|
||||
animation_name = "Standing";
|
||||
} else if (animation_id == eaSitting) {
|
||||
animation_name = "Sitting";
|
||||
} else if (animation_id == eaCrouching) {
|
||||
animation_name = "Crouching";
|
||||
} else if (animation_id == eaDead) {
|
||||
animation_name = "Dead";
|
||||
} else if (animation_id == eaLooting) {
|
||||
animation_name = "Looting";
|
||||
}
|
||||
|
||||
const auto animation_name = EQ::constants::GetSpawnAnimationName(animation_id);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
|
||||
@@ -2,54 +2,45 @@
|
||||
|
||||
void command_setskill(Client *c, const Seperator *sep)
|
||||
{
|
||||
Client *target = c;
|
||||
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||
target = c->GetTarget()->CastToClient();
|
||||
}
|
||||
const auto arguments = sep->argnum;
|
||||
|
||||
auto skill_id = sep->IsNumber(1) ? Strings::ToInt(sep->arg[1]) : -1;
|
||||
auto skill_value = sep->IsNumber(2) ? Strings::ToInt(sep->arg[2]) : -1;
|
||||
if (
|
||||
skill_id < 0 ||
|
||||
skill_id > EQ::skills::HIGHEST_SKILL ||
|
||||
skill_value < 0 ||
|
||||
skill_value > HIGHEST_CAN_SET_SKILL
|
||||
) {
|
||||
if (arguments < 2 || !sep->IsNumber(1) || !sep->IsNumber(2)) {
|
||||
c->Message(Chat::White, "Usage: #setskill [Skill ID] [Skill Value]");
|
||||
c->Message(Chat::White, fmt::format("Skill ID = 0 to {}", EQ::skills::HIGHEST_SKILL).c_str());
|
||||
c->Message(Chat::White, fmt::format("Skill Value = 0 to {}", HIGHEST_CAN_SET_SKILL).c_str());
|
||||
return;
|
||||
}
|
||||
else {
|
||||
LogInfo(
|
||||
"Set skill request from [{}], Target: [{}] Skill ID: [{}] Skill Value: [{}]",
|
||||
c->GetCleanName(),
|
||||
c->GetTargetDescription(target),
|
||||
skill_id,
|
||||
skill_value
|
||||
|
||||
auto t = c;
|
||||
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||
t = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
const auto skill_id = Strings::ToInt(sep->arg[1]);
|
||||
const auto skill_value = Strings::ToInt(sep->arg[2]);
|
||||
|
||||
if (!EQ::ValueWithin(skill_id, EQ::skills::Skill1HBlunt, EQ::skills::HIGHEST_SKILL)) {
|
||||
c->Message(Chat::White, "Usage: #setskill [Skill ID] [Skill Value]");
|
||||
c->Message(Chat::White, fmt::format("Skill ID: 0 to {}", EQ::skills::HIGHEST_SKILL).c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
const auto skill_type = static_cast<EQ::skills::SkillType>(skill_id);
|
||||
|
||||
t->SetSkill(
|
||||
skill_type,
|
||||
skill_value > t->MaxSkill(skill_type) ? t->MaxSkill(skill_type) : skill_value
|
||||
);
|
||||
|
||||
if (c != t) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Set {} ({}) to {} for {}.",
|
||||
EQ::skills::GetSkillName(skill_type),
|
||||
skill_id,
|
||||
skill_value > t->MaxSkill(skill_type) ? t->MaxSkill(skill_type) : skill_value,
|
||||
c->GetTargetDescription(t)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
if (
|
||||
skill_id >= EQ::skills::Skill1HBlunt &&
|
||||
skill_id <= EQ::skills::HIGHEST_SKILL
|
||||
) {
|
||||
target->SetSkill(
|
||||
(EQ::skills::SkillType) skill_id,
|
||||
skill_value
|
||||
);
|
||||
|
||||
if (c != target) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Set {} ({}) to {} for {}.",
|
||||
EQ::skills::GetSkillName((EQ::skills::SkillType) skill_id),
|
||||
skill_id,
|
||||
skill_value,
|
||||
c->GetTargetDescription(target)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,45 +2,42 @@
|
||||
|
||||
void command_setskillall(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto target = c;
|
||||
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||
target = c->GetTarget()->CastToClient();
|
||||
const auto arguments = sep->argnum;
|
||||
|
||||
if (!arguments || !sep->IsNumber(1)) {
|
||||
c->Message(Chat::White, "Usage: #setskillall [Skill Level] - Set all of your or your target's skills to the specified skill level");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!sep->IsNumber(1)) {
|
||||
c->Message(Chat::White, "Usage: #setskillall [Skill Level] - Set all of your or your target's skills to the specified skill level");
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Note: Skill Level ranges from 0 to {}",
|
||||
HIGHEST_CAN_SET_SKILL
|
||||
).c_str()
|
||||
);
|
||||
} else {
|
||||
if (c->Admin() >= commandSetSkillsOther || c->GetTarget() == c) {
|
||||
LogInfo(
|
||||
"Set ALL skill request from [{}], target:[{}]",
|
||||
c->GetCleanName(),
|
||||
c->GetTargetDescription(target)
|
||||
);
|
||||
auto t = c;
|
||||
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||
t = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
auto skill_level = static_cast<uint16>(Strings::ToUnsignedInt(sep->arg[1]));
|
||||
if (c->Admin() < commandSetSkillsOther && t != c) {
|
||||
c->Message(Chat::White, "Your status is not high enough to set another player's skills.");
|
||||
return;
|
||||
}
|
||||
|
||||
auto skill_level = static_cast<uint16>(Strings::ToUnsignedInt(sep->arg[1]));
|
||||
|
||||
for (const auto& s : EQ::skills::GetSkillTypeMap()) {
|
||||
if (c != t) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Setting all skills to {} for {}.",
|
||||
skill_level,
|
||||
c->GetTargetDescription(target)
|
||||
"Setting {} ({}) to {} for {}.",
|
||||
s.second,
|
||||
s.first,
|
||||
skill_level > t->MaxSkill(s.first) ? t->MaxSkill(s.first) : skill_level,
|
||||
c->GetTargetDescription(t)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
for (EQ::skills::SkillType skill_num = EQ::skills::Skill1HBlunt; skill_num <= EQ::skills::HIGHEST_SKILL; skill_num = (EQ::skills::SkillType) (skill_num + 1)) {
|
||||
target->SetSkill(skill_num, skill_level);
|
||||
}
|
||||
} else {
|
||||
c->Message(Chat::White, "Your status is not high enough to set another player's skills.");
|
||||
}
|
||||
|
||||
t->SetSkill(
|
||||
s.first,
|
||||
skill_level > t->MaxSkill(s.first) ? t->MaxSkill(s.first) : skill_level
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+28
-11
@@ -2,19 +2,36 @@
|
||||
|
||||
void command_spawn(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->arg[1][0] != 0) {
|
||||
Client *client = entity_list.GetClientByName(sep->arg[1]);
|
||||
if (client) {
|
||||
c->Message(Chat::White, "You cannot spawn a mob with the same name as a character!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
NPC *npc = NPC::SpawnNPC(sep->argplus[1], c->GetPosition(), c);
|
||||
if (!npc) {
|
||||
const auto arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
c->Message(Chat::White, "Usage: #spawn [Name]");
|
||||
c->Message(
|
||||
Chat::White,
|
||||
"Format: #spawn name race level material hp gender class priweapon secweapon merchantid bodytype - spawns a npc those parameters."
|
||||
"Optional Usage: #spawn [Name] [Race] [Level] [Texture] [Health] [Gender] [Class] [Primary Model] [Secondary Model] [Merchant ID] [Body Type]"
|
||||
);
|
||||
c->Message(
|
||||
Chat::White,
|
||||
"Name Format: NPCFirstname_NPCLastname - All numbers in a name are stripped and \"_\" characters become a space."
|
||||
);
|
||||
c->Message(
|
||||
Chat::White,
|
||||
"Note: Using \"-\" for gender will autoselect the gender for the race. Using \"-\" for HP will use the calculated maximum HP."
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const auto* m = entity_list.GetClientByName(sep->arg[1]);
|
||||
if (m) {
|
||||
c->Message(Chat::White, "You cannot spawn a mob with the same name as a character!");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto* n = NPC::SpawnNPC(sep->argplus[1], c->GetPosition(), c);
|
||||
if (!n) {
|
||||
c->Message(Chat::White, "Usage: #spawn [Name]");
|
||||
c->Message(
|
||||
Chat::White,
|
||||
"Optional Usage: #spawn [Name] [Race] [Level] [Texture] [Health] [Gender] [Class] [Primary Model] [Secondary Model] [Merchant ID] [Body Type]"
|
||||
);
|
||||
c->Message(
|
||||
Chat::White,
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
|
||||
void command_unscribespell(Client *c, const Seperator *sep)
|
||||
{
|
||||
int arguments = sep->argnum;
|
||||
const auto arguments = sep->argnum;
|
||||
if (!arguments || !sep->IsNumber(1)) {
|
||||
c->Message(Chat::White, "Usage: #unscribespell [Spell ID] - Unscribe a spell from your or your target's spell book by Spell ID");
|
||||
return;
|
||||
}
|
||||
|
||||
auto target = c;
|
||||
auto t = c;
|
||||
if (c->GetTarget() && c->GetTarget()->IsClient() && c->GetGM()) {
|
||||
target = c->GetTarget()->CastToClient();
|
||||
t = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
uint16 spell_id = EQ::Clamp(Strings::ToInt(sep->arg[1]), 0, 65535);
|
||||
const uint16 spell_id = EQ::Clamp(Strings::ToInt(sep->arg[1]), 0, 65535);
|
||||
|
||||
if (!IsValidSpell(spell_id)) {
|
||||
c->Message(
|
||||
@@ -29,16 +29,16 @@ void command_unscribespell(Client *c, const Seperator *sep)
|
||||
|
||||
auto spell_name = GetSpellName(spell_id);
|
||||
|
||||
if (target->HasSpellScribed(spell_id)) {
|
||||
target->UnscribeSpellBySpellID(spell_id);
|
||||
if (t->HasSpellScribed(spell_id)) {
|
||||
t->UnscribeSpellBySpellID(spell_id);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Unscribing {} ({}) for {}.",
|
||||
"Unscribing {} ({}) from {}.",
|
||||
spell_name,
|
||||
spell_id,
|
||||
c->GetTargetDescription(target)
|
||||
c->GetTargetDescription(t, TargetDescriptionType::LCSelf)
|
||||
).c_str()
|
||||
);
|
||||
} else {
|
||||
@@ -46,8 +46,8 @@ void command_unscribespell(Client *c, const Seperator *sep)
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} {} not have {} ({}) scribed.",
|
||||
c->GetTargetDescription(target),
|
||||
c == target ? "do" : "does",
|
||||
c->GetTargetDescription(t, TargetDescriptionType::UCYou),
|
||||
c == t ? "do" : "does",
|
||||
spell_name,
|
||||
spell_id
|
||||
).c_str()
|
||||
|
||||
@@ -34,7 +34,7 @@ void command_xtargets(Client *c, const Seperator *sep)
|
||||
fmt::format(
|
||||
"Max number of XTargets set to {} for {}.",
|
||||
new_max,
|
||||
c->GetTargetDescription(t, TargetDescriptionType::LCSelf)
|
||||
c->GetTargetDescription(t)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
|
||||
void command_zheader(Client *c, const Seperator *sep)
|
||||
{
|
||||
int arguments = sep->argnum;
|
||||
const auto arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
c->Message(Chat::White, "Usage: #zheader [Zone ID|Zone Short Name] [Version]");
|
||||
return;
|
||||
}
|
||||
|
||||
auto zone_id = (
|
||||
sep->IsNumber(2) ?
|
||||
Strings::ToUnsignedInt(sep->arg[2]) :
|
||||
ZoneID(sep->arg[2])
|
||||
const auto zone_id = (
|
||||
sep->IsNumber(1) ?
|
||||
Strings::ToUnsignedInt(sep->arg[1]) :
|
||||
ZoneID(sep->arg[1])
|
||||
);
|
||||
if (!zone_id) {
|
||||
c->Message(
|
||||
@@ -26,9 +26,9 @@ void command_zheader(Client *c, const Seperator *sep)
|
||||
|
||||
auto zone_short_name = ZoneName(zone_id);
|
||||
auto zone_long_name = ZoneLongName(zone_id);
|
||||
auto version = (
|
||||
sep->IsNumber(3) ?
|
||||
Strings::ToUnsignedInt(sep->arg[3]) :
|
||||
const auto version = (
|
||||
sep->IsNumber(2) ?
|
||||
Strings::ToUnsignedInt(sep->arg[2]) :
|
||||
0
|
||||
);
|
||||
|
||||
|
||||
@@ -1156,6 +1156,13 @@ bool Group::LearnMembers() {
|
||||
);
|
||||
}
|
||||
|
||||
for(int i = 0; i < MAX_GROUP_MEMBERS; ++i)
|
||||
{
|
||||
members[i] = nullptr;
|
||||
memset(membername[i],0,64);
|
||||
MemberRoles[i] = 0;
|
||||
}
|
||||
|
||||
int memberIndex = 0;
|
||||
for (const auto& member : rows) {
|
||||
if (memberIndex >= MAX_GROUP_MEMBERS) {
|
||||
|
||||
+37
-47
@@ -42,19 +42,6 @@ HateList::~HateList()
|
||||
{
|
||||
}
|
||||
|
||||
// added for frenzy support
|
||||
// checks if target still is in frenzy mode
|
||||
void HateList::IsEntityInFrenzyMode()
|
||||
{
|
||||
auto iterator = list.begin();
|
||||
while (iterator != list.end())
|
||||
{
|
||||
if ((*iterator)->entity_on_hatelist->GetHPRatio() >= 20)
|
||||
(*iterator)->is_entity_frenzy = false;
|
||||
++iterator;
|
||||
}
|
||||
}
|
||||
|
||||
void HateList::WipeHateList()
|
||||
{
|
||||
auto iterator = list.begin();
|
||||
@@ -155,28 +142,54 @@ Mob* HateList::GetDamageTopOnHateList(Mob* hater)
|
||||
return current;
|
||||
}
|
||||
|
||||
Mob* HateList::GetClosestEntOnHateList(Mob *hater, bool skip_mezzed) {
|
||||
Mob* HateList::GetClosestEntOnHateList(Mob *hater, bool skip_mezzed, EntityFilterType entity_type) {
|
||||
Mob* close_entity = nullptr;
|
||||
float close_distance = 99999.9f;
|
||||
float this_distance;
|
||||
|
||||
auto iterator = list.begin();
|
||||
while (iterator != list.end()) {
|
||||
if (skip_mezzed && (*iterator)->entity_on_hatelist->IsMezzed()) {
|
||||
++iterator;
|
||||
for (const auto& e : list) {
|
||||
if (!e->entity_on_hatelist) {
|
||||
continue;
|
||||
}
|
||||
|
||||
this_distance = DistanceSquaredNoZ((*iterator)->entity_on_hatelist->GetPosition(), hater->GetPosition());
|
||||
if ((*iterator)->entity_on_hatelist != nullptr && this_distance <= close_distance) {
|
||||
close_distance = this_distance;
|
||||
close_entity = (*iterator)->entity_on_hatelist;
|
||||
if (skip_mezzed && e->entity_on_hatelist->IsMezzed()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (entity_type) {
|
||||
case EntityFilterType::Bots:
|
||||
if (!e->entity_on_hatelist->IsBot()) {
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case EntityFilterType::Clients:
|
||||
if (!e->entity_on_hatelist->IsClient()) {
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case EntityFilterType::NPCs:
|
||||
if (!e->entity_on_hatelist->IsNPC()) {
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case EntityFilterType::All:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
this_distance = DistanceSquaredNoZ(e->entity_on_hatelist->GetPosition(), hater->GetPosition());
|
||||
if (this_distance <= close_distance) {
|
||||
close_distance = this_distance;
|
||||
close_entity = e->entity_on_hatelist;
|
||||
}
|
||||
++iterator;
|
||||
}
|
||||
|
||||
if ((!close_entity && hater->IsNPC()) || (close_entity && close_entity->DivineAura()))
|
||||
if (
|
||||
(!close_entity && hater->IsNPC()) ||
|
||||
(close_entity && close_entity->DivineAura())
|
||||
) {
|
||||
close_entity = hater->CastToNPC()->GetHateTop();
|
||||
}
|
||||
|
||||
return close_entity;
|
||||
}
|
||||
@@ -591,29 +604,6 @@ Mob *HateList::GetRandomEntOnHateList(bool skip_mezzed)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Mob *HateList::GetEscapingEntOnHateList() {
|
||||
// function is still in design stage
|
||||
|
||||
for (auto iter : list) {
|
||||
if (!iter->entity_on_hatelist)
|
||||
continue;
|
||||
|
||||
if (!iter->entity_on_hatelist->IsFeared())
|
||||
continue;
|
||||
|
||||
if (iter->entity_on_hatelist->IsRooted())
|
||||
continue;
|
||||
if (iter->entity_on_hatelist->IsMezzed())
|
||||
continue;
|
||||
if (iter->entity_on_hatelist->IsStunned())
|
||||
continue;
|
||||
|
||||
return iter->entity_on_hatelist;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Mob *HateList::GetEscapingEntOnHateList(Mob *center, float range, bool first) {
|
||||
// function is still in design stage
|
||||
|
||||
|
||||
+1
-3
@@ -41,12 +41,11 @@ public:
|
||||
HateList();
|
||||
~HateList();
|
||||
|
||||
Mob *GetClosestEntOnHateList(Mob *hater, bool skip_mezzed = false);
|
||||
Mob *GetClosestEntOnHateList(Mob *hater, bool skip_mezzed = false, EntityFilterType entity_type = EntityFilterType::All);
|
||||
Mob *GetDamageTopOnHateList(Mob *hater); // didn't add 'skip_mezzed' due to calls being in ::Death()
|
||||
Mob *GetEntWithMostHateOnList(Mob *center, Mob *skip = nullptr, bool skip_mezzed = false);
|
||||
Mob *GetRandomEntOnHateList(bool skip_mezzed = false);
|
||||
Mob *GetEntWithMostHateOnList(bool skip_mezzed = false);
|
||||
Mob *GetEscapingEntOnHateList(); // returns first eligble entity
|
||||
Mob *GetEscapingEntOnHateList(Mob *center, float range = 0.0f, bool first = false);
|
||||
|
||||
Bot* GetRandomBotOnHateList(bool skip_mezzed = false);
|
||||
@@ -85,7 +84,6 @@ public:
|
||||
bool add_to_hate_list_if_not_exist = true
|
||||
);
|
||||
void DoFactionHits(int64 npc_faction_level_id, int32 faction_id, int32 faction_value);
|
||||
void IsEntityInFrenzyMode();
|
||||
void PrintHateListToClient(Client *c);
|
||||
void SetHateAmountOnEnt(Mob *other, int64 in_hate, uint64 in_damage);
|
||||
void SetHateOwner(Mob *new_hate_owner) { hate_owner = new_hate_owner; }
|
||||
|
||||
+154
-166
@@ -415,173 +415,10 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
||||
}
|
||||
|
||||
// check for augment to item restriction
|
||||
if(enforce_restrictions) {
|
||||
bool is_restricted = false;
|
||||
uint8 item_type = item->ItemType;
|
||||
switch (augtest->AugRestrict) {
|
||||
case EQ::item::AugRestrictionAny:
|
||||
break;
|
||||
case EQ::item::AugRestrictionArmor:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemTypeArmor:
|
||||
break;
|
||||
default:
|
||||
is_restricted = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestrictionWeapons:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemType1HSlash:
|
||||
case EQ::item::ItemType1HBlunt:
|
||||
case EQ::item::ItemType1HPiercing:
|
||||
case EQ::item::ItemTypeMartial:
|
||||
case EQ::item::ItemType2HSlash:
|
||||
case EQ::item::ItemType2HBlunt:
|
||||
case EQ::item::ItemType2HPiercing:
|
||||
case EQ::item::ItemTypeBow:
|
||||
break;
|
||||
default:
|
||||
is_restricted = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestriction1HWeapons:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemType1HSlash:
|
||||
case EQ::item::ItemType1HBlunt:
|
||||
case EQ::item::ItemType1HPiercing:
|
||||
case EQ::item::ItemTypeMartial:
|
||||
break;
|
||||
default:
|
||||
is_restricted = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestriction2HWeapons:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemType2HSlash:
|
||||
case EQ::item::ItemType2HBlunt:
|
||||
case EQ::item::ItemType2HPiercing:
|
||||
case EQ::item::ItemTypeBow:
|
||||
break;
|
||||
default:
|
||||
is_restricted = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestriction1HSlash:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemType1HSlash:
|
||||
break;
|
||||
default:
|
||||
is_restricted = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestriction1HBlunt:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemType1HBlunt:
|
||||
break;
|
||||
default:
|
||||
is_restricted = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestrictionPiercing:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemType1HPiercing:
|
||||
break;
|
||||
default:
|
||||
is_restricted = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestrictionHandToHand:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemTypeMartial:
|
||||
break;
|
||||
default:
|
||||
is_restricted = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestriction2HSlash:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemType2HSlash:
|
||||
break;
|
||||
default:
|
||||
is_restricted = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestriction2HBlunt:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemType2HBlunt:
|
||||
break;
|
||||
default:
|
||||
is_restricted = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestriction2HPierce:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemType2HPiercing:
|
||||
break;
|
||||
default:
|
||||
is_restricted = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestrictionBows:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemTypeBow:
|
||||
break;
|
||||
default:
|
||||
is_restricted = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestrictionShields:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemTypeShield:
|
||||
break;
|
||||
default:
|
||||
is_restricted = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestriction1HSlash1HBluntOrHandToHand:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemType1HSlash:
|
||||
case EQ::item::ItemType1HBlunt:
|
||||
case EQ::item::ItemTypeMartial:
|
||||
break;
|
||||
default:
|
||||
is_restricted = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestriction1HBluntOrHandToHand:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemType1HBlunt:
|
||||
case EQ::item::ItemTypeMartial:
|
||||
break;
|
||||
default:
|
||||
is_restricted = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
// These 3 are in-work
|
||||
case EQ::item::AugRestrictionUnknown1:
|
||||
case EQ::item::AugRestrictionUnknown2:
|
||||
case EQ::item::AugRestrictionUnknown3:
|
||||
default:
|
||||
is_restricted = true;
|
||||
break;
|
||||
}
|
||||
if (enforce_restrictions) {
|
||||
bool is_restricted = IsAugmentRestricted(item->ItemType, augtest->AugRestrict);
|
||||
|
||||
if(is_restricted) {
|
||||
if (is_restricted) {
|
||||
Message(
|
||||
Chat::Red,
|
||||
fmt::format(
|
||||
@@ -4766,3 +4603,154 @@ int32 Bot::GetAugmentIDAt(int16 slot_id, uint8 augslot) {
|
||||
// None found
|
||||
return INVALID_ID;
|
||||
}
|
||||
|
||||
bool Client::IsAugmentRestricted(uint8 item_type, uint32 augment_restriction)
|
||||
{
|
||||
switch (augment_restriction) {
|
||||
case EQ::item::AugRestrictionAny:
|
||||
break;
|
||||
case EQ::item::AugRestrictionArmor:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemTypeArmor:
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestrictionWeapons:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemType1HSlash:
|
||||
case EQ::item::ItemType1HBlunt:
|
||||
case EQ::item::ItemType1HPiercing:
|
||||
case EQ::item::ItemTypeMartial:
|
||||
case EQ::item::ItemType2HSlash:
|
||||
case EQ::item::ItemType2HBlunt:
|
||||
case EQ::item::ItemType2HPiercing:
|
||||
case EQ::item::ItemTypeBow:
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestriction1HWeapons:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemType1HSlash:
|
||||
case EQ::item::ItemType1HBlunt:
|
||||
case EQ::item::ItemType1HPiercing:
|
||||
case EQ::item::ItemTypeMartial:
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestriction2HWeapons:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemType2HSlash:
|
||||
case EQ::item::ItemType2HBlunt:
|
||||
case EQ::item::ItemType2HPiercing:
|
||||
case EQ::item::ItemTypeBow:
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestriction1HSlash:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemType1HSlash:
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestriction1HBlunt:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemType1HBlunt:
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestrictionPiercing:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemType1HPiercing:
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestrictionHandToHand:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemTypeMartial:
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestriction2HSlash:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemType2HSlash:
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestriction2HBlunt:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemType2HBlunt:
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestriction2HPierce:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemType2HPiercing:
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestrictionBows:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemTypeBow:
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestrictionShields:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemTypeShield:
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestriction1HSlash1HBluntOrHandToHand:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemType1HSlash:
|
||||
case EQ::item::ItemType1HBlunt:
|
||||
case EQ::item::ItemTypeMartial:
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestriction1HBluntOrHandToHand:
|
||||
switch (item_type) {
|
||||
case EQ::item::ItemType1HBlunt:
|
||||
case EQ::item::ItemTypeMartial:
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case EQ::item::AugRestrictionUnknown1:
|
||||
case EQ::item::AugRestrictionUnknown2:
|
||||
case EQ::item::AugRestrictionUnknown3:
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
+7
-1
@@ -395,9 +395,15 @@ void NPC::AddLootDrop(
|
||||
foundslot = i;
|
||||
}
|
||||
else {
|
||||
// Unequip old item
|
||||
auto* olditem = GetItem(i);
|
||||
|
||||
olditem->equip_slot = EQ::invslot::SLOT_INVALID;
|
||||
|
||||
equipment[i] = item2->ID;
|
||||
|
||||
foundslot = i;
|
||||
found = true;
|
||||
found = true;
|
||||
}
|
||||
} // end if ac
|
||||
}
|
||||
|
||||
@@ -2504,6 +2504,10 @@ int Lua_Client::GetSpellDamage() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetSpellDmg();
|
||||
}
|
||||
int Lua_Client::GetIntoxication() {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetIntoxication();
|
||||
}
|
||||
|
||||
void Lua_Client::TaskSelector(luabind::adl::object table) {
|
||||
TaskSelector(table, false);
|
||||
@@ -3050,6 +3054,12 @@ bool Lua_Client::ReloadDataBuckets() {
|
||||
return DataBucket::GetDataBuckets(self);
|
||||
}
|
||||
|
||||
uint32 Lua_Client::GetEXPForLevel(uint16 check_level)
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetEXPForLevel(check_level);
|
||||
}
|
||||
|
||||
luabind::scope lua_register_client() {
|
||||
return luabind::class_<Lua_Client, Lua_Mob>("Client")
|
||||
.def(luabind::constructor<>())
|
||||
@@ -3213,6 +3223,7 @@ luabind::scope lua_register_client() {
|
||||
.def("GetDisciplineTimer", (uint32(Lua_Client::*)(uint32))&Lua_Client::GetDisciplineTimer)
|
||||
.def("GetDuelTarget", (int(Lua_Client::*)(void))&Lua_Client::GetDuelTarget)
|
||||
.def("GetEXP", (uint32(Lua_Client::*)(void))&Lua_Client::GetEXP)
|
||||
.def("GetEXPForLevel", (uint32(Lua_Client::*)(uint16))&Lua_Client::GetEXPForLevel)
|
||||
.def("GetEXPModifier", (double(Lua_Client::*)(uint32))&Lua_Client::GetEXPModifier)
|
||||
.def("GetEXPModifier", (double(Lua_Client::*)(uint32,int16))&Lua_Client::GetEXPModifier)
|
||||
.def("GetEbonCrystals", (uint32(Lua_Client::*)(void))&Lua_Client::GetEbonCrystals)
|
||||
@@ -3237,6 +3248,7 @@ luabind::scope lua_register_client() {
|
||||
.def("GetIPExemption", (int(Lua_Client::*)(void))&Lua_Client::GetIPExemption)
|
||||
.def("GetIPString", (std::string(Lua_Client::*)(void))&Lua_Client::GetIPString)
|
||||
.def("GetInstrumentMod", (int(Lua_Client::*)(int))&Lua_Client::GetInstrumentMod)
|
||||
.def("GetIntoxication", (int(Lua_Client::*)(void))&Lua_Client::GetIntoxication)
|
||||
.def("GetInventory", (Lua_Inventory(Lua_Client::*)(void))&Lua_Client::GetInventory)
|
||||
.def("GetInvulnerableEnvironmentDamage", (bool(Lua_Client::*)(void))&Lua_Client::GetInvulnerableEnvironmentDamage)
|
||||
.def("GetItemIDAt", (int(Lua_Client::*)(int))&Lua_Client::GetItemIDAt)
|
||||
|
||||
@@ -395,6 +395,7 @@ public:
|
||||
void QueuePacket(Lua_Packet app, bool ack_req, int client_connection_status, int filter);
|
||||
int GetHunger();
|
||||
int GetThirst();
|
||||
int GetIntoxication();
|
||||
void SetHunger(int in_hunger);
|
||||
void SetThirst(int in_thirst);
|
||||
void SetConsumption(int in_hunger, int in_thirst);
|
||||
@@ -467,6 +468,7 @@ public:
|
||||
void UseAugmentContainer(int container_slot);
|
||||
bool IsAutoAttackEnabled();
|
||||
bool IsAutoFireEnabled();
|
||||
uint32 GetEXPForLevel(uint16 check_level);
|
||||
|
||||
void ApplySpell(int spell_id);
|
||||
void ApplySpell(int spell_id, int duration);
|
||||
|
||||
+1482
-1
File diff suppressed because it is too large
Load Diff
+43
-1
@@ -2376,6 +2376,41 @@ Lua_Mob Lua_Mob::GetHateClosest() {
|
||||
return Lua_Mob(self->GetHateClosest());
|
||||
}
|
||||
|
||||
Lua_Mob Lua_Mob::GetHateClosest(bool skip_mezzed) {
|
||||
Lua_Safe_Call_Class(Lua_Mob);
|
||||
return Lua_Mob(self->GetHateClosest(skip_mezzed));
|
||||
}
|
||||
|
||||
Lua_Bot Lua_Mob::GetHateClosestBot() {
|
||||
Lua_Safe_Call_Class(Lua_Bot);
|
||||
return Lua_Bot(self->GetHateClosestBot());
|
||||
}
|
||||
|
||||
Lua_Bot Lua_Mob::GetHateClosestBot(bool skip_mezzed) {
|
||||
Lua_Safe_Call_Class(Lua_Bot);
|
||||
return Lua_Bot(self->GetHateClosestBot());
|
||||
}
|
||||
|
||||
Lua_Client Lua_Mob::GetHateClosestClient() {
|
||||
Lua_Safe_Call_Class(Lua_Client);
|
||||
return Lua_Client(self->GetHateClosestClient());
|
||||
}
|
||||
|
||||
Lua_Client Lua_Mob::GetHateClosestClient(bool skip_mezzed) {
|
||||
Lua_Safe_Call_Class(Lua_Client);
|
||||
return Lua_Client(self->GetHateClosestClient(skip_mezzed));
|
||||
}
|
||||
|
||||
Lua_NPC Lua_Mob::GetHateClosestNPC() {
|
||||
Lua_Safe_Call_Class(Lua_NPC);
|
||||
return Lua_NPC(self->GetHateClosestNPC());
|
||||
}
|
||||
|
||||
Lua_NPC Lua_Mob::GetHateClosestNPC(bool skip_mezzed) {
|
||||
Lua_Safe_Call_Class(Lua_NPC);
|
||||
return Lua_NPC(self->GetHateClosestNPC(skip_mezzed));
|
||||
}
|
||||
|
||||
Lua_HateList Lua_Mob::GetHateListByDistance() {
|
||||
Lua_Safe_Call_Class(Lua_HateList);
|
||||
Lua_HateList ret;
|
||||
@@ -3253,7 +3288,14 @@ luabind::scope lua_register_mob() {
|
||||
.def("GetHaste", (int(Lua_Mob::*)(void))&Lua_Mob::GetHaste)
|
||||
.def("GetHateAmount", (int64(Lua_Mob::*)(Lua_Mob))&Lua_Mob::GetHateAmount)
|
||||
.def("GetHateAmount", (int64(Lua_Mob::*)(Lua_Mob,bool))&Lua_Mob::GetHateAmount)
|
||||
.def("GetHateClosest", &Lua_Mob::GetHateClosest)
|
||||
.def("GetHateClosest", (Lua_Mob(Lua_Mob::*)(void))&Lua_Mob::GetHateClosest)
|
||||
.def("GetHateClosest", (Lua_Mob(Lua_Mob::*)(bool))&Lua_Mob::GetHateClosest)
|
||||
.def("GetHateClosestBot", (Lua_Bot(Lua_Mob::*)(void))&Lua_Mob::GetHateClosestBot)
|
||||
.def("GetHateClosestBot", (Lua_Bot(Lua_Mob::*)(bool))&Lua_Mob::GetHateClosestBot)
|
||||
.def("GetHateClosestClient", (Lua_Client(Lua_Mob::*)(void))&Lua_Mob::GetHateClosestClient)
|
||||
.def("GetHateClosestClient", (Lua_Client(Lua_Mob::*)(bool))&Lua_Mob::GetHateClosestClient)
|
||||
.def("GetHateClosestNPC", (Lua_NPC(Lua_Mob::*)(void))&Lua_Mob::GetHateClosestNPC)
|
||||
.def("GetHateClosestNPC", (Lua_NPC(Lua_Mob::*)(bool))&Lua_Mob::GetHateClosestNPC)
|
||||
.def("GetHateDamageTop", (Lua_Mob(Lua_Mob::*)(Lua_Mob))&Lua_Mob::GetHateDamageTop)
|
||||
.def("GetHateList", &Lua_Mob::GetHateList)
|
||||
.def("GetHateListBots", (Lua_HateList(Lua_Mob::*)(void))&Lua_Mob::GetHateListBots)
|
||||
|
||||
@@ -227,6 +227,13 @@ public:
|
||||
Lua_Client GetHateRandomClient();
|
||||
Lua_NPC GetHateRandomNPC();
|
||||
Lua_Mob GetHateClosest();
|
||||
Lua_Mob GetHateClosest(bool skip_mezzed);
|
||||
Lua_Bot GetHateClosestBot();
|
||||
Lua_Bot GetHateClosestBot(bool skip_mezzed);
|
||||
Lua_Client GetHateClosestClient();
|
||||
Lua_Client GetHateClosestClient(bool skip_mezzed);
|
||||
Lua_NPC GetHateClosestNPC();
|
||||
Lua_NPC GetHateClosestNPC(bool skip_mezzed);
|
||||
void AddToHateList(Lua_Mob other);
|
||||
void AddToHateList(Lua_Mob other, int64 hate);
|
||||
void AddToHateList(Lua_Mob other, int64 hate, int64 damage);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user