mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-25 11:02:29 +00:00
Compare commits
132 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9fd07b4dd4 | |||
| 31a20a1e4c | |||
| f40b44a454 | |||
| d1aef18974 | |||
| 86f1cedf91 | |||
| 3a7d18f32a | |||
| 834062fbf9 | |||
| 4b6ab34fd9 | |||
| 7cc5b143fc | |||
| ace81215a1 | |||
| ffb9323a98 | |||
| 30148c3c56 | |||
| 585ef81fde | |||
| 54abeba1ce | |||
| e582a8d17a | |||
| 4b7126a2cd | |||
| 1e0ec048af | |||
| ddd3e43d4e | |||
| 053c35c59b | |||
| e3c01d4143 | |||
| 93749bc509 | |||
| 060f8aadfe | |||
| 8089d52df6 | |||
| 483a34242b | |||
| d4558b4664 | |||
| d707fb13b8 | |||
| f15ba46c24 | |||
| 79c7d9d8f2 | |||
| c2c8de01b8 | |||
| 58883c2ed4 | |||
| f9ea18b642 | |||
| 082641b1ad | |||
| 87ea81cc36 | |||
| 2fe923457b | |||
| 7d0b281b7f | |||
| 7a44521b03 | |||
| 9fa377303e | |||
| 9251e6efd2 | |||
| 983b8f7237 | |||
| ede21d9b10 | |||
| 02a3f971dd | |||
| 2013063928 | |||
| 508a731181 | |||
| b5b266d265 | |||
| c375716c22 | |||
| 2f40e5da98 | |||
| 96d146f73c | |||
| e06c128ced | |||
| f51396aa70 | |||
| f776b1c73b | |||
| f7107fda83 | |||
| 69b96b718e | |||
| dfa7e2bffb | |||
| 22f586f110 | |||
| 0cd4c0ac65 | |||
| e12e1c0d9b | |||
| 59ad6012b1 | |||
| 71e309022a | |||
| 6aba38f664 | |||
| 6ac4154acd | |||
| 6ab2871fd1 | |||
| 18005ac7a9 | |||
| 37ff8c830d | |||
| d0956194af | |||
| ac4117d815 | |||
| 1d0b11acde | |||
| ade56231fc | |||
| b8eff702df | |||
| cc4924ebfc | |||
| e4d8915c9d | |||
| 623b7b3eee | |||
| c08993b60b | |||
| 07f3ab955f | |||
| 46bdbfc454 | |||
| dc87b8e78b | |||
| 0d094754db | |||
| c0c34cf07a | |||
| 4c6de9b991 | |||
| 2d456ba8c9 | |||
| 3969ac346d | |||
| 2418c3dd74 | |||
| 7218128d03 | |||
| 62b78fb9a8 | |||
| 7e0c4eb93f | |||
| 9b229779db | |||
| b59a41829b | |||
| 160b56b4b7 | |||
| b6388595f3 | |||
| 5060de9b58 | |||
| 41ab512349 | |||
| 0c899b2caa | |||
| 51baccc10f | |||
| 955b2afb18 | |||
| 69f621f361 | |||
| c435a77813 | |||
| 5c4ed0becf | |||
| 0600b6834a | |||
| cf30056cf6 | |||
| 0367bc3465 | |||
| 2f4fb46007 | |||
| 26f1d450fc | |||
| a7c1fad213 | |||
| 6d60f619c0 | |||
| 60ac0f7888 | |||
| d2683022e1 | |||
| 887b71eebb | |||
| 2533de1d62 | |||
| d2679f065a | |||
| 0ea82b5d88 | |||
| 1b8736188d | |||
| df43d33def | |||
| 80b4248315 | |||
| 3d3eee9772 | |||
| 3498f7a56f | |||
| 39d06a4012 | |||
| 7d18b90788 | |||
| 58ad1641e6 | |||
| 18c73526aa | |||
| 4c826dfbcc | |||
| 6708cd3d75 | |||
| 9bd5f36129 | |||
| 247d478990 | |||
| c35e010461 | |||
| 0765d273ea | |||
| 4662f29f11 | |||
| 9e64132261 | |||
| 6b64a8183d | |||
| c3e007597e | |||
| 6399710c1d | |||
| e3dfb2f19d | |||
| 4fec8a2b75 | |||
| 707cb452d8 |
@@ -53,6 +53,34 @@ IF(MSVC OR MINGW)
|
||||
ENDIF(MSVC OR MINGW)
|
||||
|
||||
IF(MSVC)
|
||||
IF(CMAKE_CL_64)
|
||||
SET(ZLIB_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/zlib_x64")
|
||||
SET(MYSQL_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/mysql_x64")
|
||||
SET(LUA_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/luaj_x64")
|
||||
SET(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/openssl_x64")
|
||||
SET(SODIUM_INCLUDE_HINTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libsodium/include")
|
||||
IF(MSVC_VERSION GREATER 1800)
|
||||
SET(SODIUM_LIBRARY_HINTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libsodium/x64/Release/v140/dynamic")
|
||||
ELSEIF(MSVC_VERSION EQUAL 1800)
|
||||
SET(SODIUM_LIBRARY_HINTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libsodium/x64/Release/v120/dynamic")
|
||||
ELSE()
|
||||
SET(SODIUM_LIBRARY_HINTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libsodium/x64/Release/v110/dynamic")
|
||||
ENDIF()
|
||||
ELSE(CMAKE_CL_64)
|
||||
SET(ZLIB_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/zlib_x86")
|
||||
SET(MYSQL_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/mysql_x86")
|
||||
SET(LUA_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/luaj_x86")
|
||||
SET(SODIUM_INCLUDE_HINTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libsodium/include")
|
||||
SET(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/openssl_x86")
|
||||
IF(MSVC_VERSION GREATER 1800)
|
||||
SET(SODIUM_LIBRARY_HINTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libsodium/Win32/Release/v140/dynamic")
|
||||
ELSEIF(MSVC_VERSION EQUAL 1800)
|
||||
SET(SODIUM_LIBRARY_HINTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libsodium/Win32/Release/v120/dynamic")
|
||||
ELSE()
|
||||
SET(SODIUM_LIBRARY_HINTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libsodium/Win32/Release/v110/dynamic")
|
||||
ENDIF()
|
||||
ENDIF(CMAKE_CL_64)
|
||||
|
||||
#disable CRT warnings on windows cause they're annoying as shit and we use C functions everywhere
|
||||
OPTION(EQEMU_DISABLE_CRT_SECURE_WARNINGS "Disable Secure CRT Warnings" ON)
|
||||
IF(EQEMU_DISABLE_CRT_SECURE_WARNINGS)
|
||||
@@ -233,6 +261,9 @@ IF(EQEMU_BUILD_PERL)
|
||||
ENDIF(EQEMU_BUILD_PERL)
|
||||
IF(EQEMU_BUILD_LUA)
|
||||
ADD_DEFINITIONS(-DLUA_EQEMU)
|
||||
IF(MSVC)
|
||||
ADD_DEFINITIONS(/bigobj)
|
||||
ENDIF()
|
||||
ENDIF(EQEMU_BUILD_LUA)
|
||||
|
||||
OPTION(EQEMU_USE_MAP_MMFS "Create and use Zone Map MMF files." OFF)
|
||||
@@ -297,6 +328,7 @@ IF(EQEMU_BUILD_LUA)
|
||||
FIND_PACKAGE(Boost REQUIRED)
|
||||
INCLUDE_DIRECTORIES(SYSTEM "${LUA_INCLUDE_DIR}" "${Boost_INCLUDE_DIRS}")
|
||||
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/libs/luabind")
|
||||
INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/libs/sol")
|
||||
|
||||
OPTION(EQEMU_SANITIZE_LUA_LIBS "Sanitize Lua Libraries (Remove OS and IO standard libraries from being able to run)." ON)
|
||||
IF(EQEMU_SANITIZE_LUA_LIBS)
|
||||
|
||||
@@ -1,165 +1,674 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
0. Additional Definitions.
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
0. Definitions.
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
4. Combined Works.
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
1. Source Code.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
d) Do one of the following:
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
5. Combined Libraries.
|
||||
2. Basic Permissions.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
|
||||
+2
-20
@@ -7,27 +7,9 @@ configuration: RelWithDebInfo
|
||||
clone_folder: c:\projects\eqemu
|
||||
init:
|
||||
- ps: git config --global core.autocrlf input
|
||||
cache: c:\tools\vcpkg\installed\
|
||||
before_build:
|
||||
- ps: >-
|
||||
$wc = New-Object System.Net.WebClient
|
||||
|
||||
$wc.DownloadFile("https://github.com/EQEmu/eqemu.github.com/blob/master/downloads/appveyor/vcpkg-export.7z?raw=true", "c:\projects\eqemu\vcpkg-export.7z")
|
||||
|
||||
$wc.DownloadFile("http://strawberryperl.com/download/5.26.2.1/strawberry-perl-5.26.2.1-64bit-portable.zip", "c:\projects\eqemu\strawberry-perl-5.26.2.1-64bit-portable.zip")
|
||||
|
||||
cd c:\projects\eqemu
|
||||
|
||||
7z x c:/projects/eqemu/vcpkg-export.7z -oc:/projects/eqemu/vcpkg -y
|
||||
|
||||
7z x c:/projects/eqemu/strawberry-perl-5.26.2.1-64bit-portable.zip -oc:/projects/eqemu/strawberry-perl-portable -y
|
||||
|
||||
(Get-Content C:/projects/eqemu/strawberry-perl-portable/perl/lib/CORE/config.h).replace('#define PERL_STATIC_INLINE static __inline__', '#define PERL_STATIC_INLINE static __inline') | Set-Content C:/projects/eqemu/strawberry-perl-portable/perl/lib/CORE/config.h
|
||||
|
||||
mkdir build
|
||||
|
||||
cd build
|
||||
|
||||
cmake -G "Visual Studio 15 2017 Win64" -DEQEMU_BUILD_TESTS=ON -DEQEMU_BUILD_LOGIN=ON -EQEMU_ENABLE_BOTS=ON -DPERL_EXECUTABLE="C:/projects/eqemu/strawberry-perl-portable/perl/bin/perl.exe" -DPERL_INCLUDE_PATH="C:/projects/eqemu/strawberry-perl-portable/perl/lib/CORE" -DPERL_LIBRARY="C:/projects/eqemu/strawberry-perl-portable/perl/lib/CORE/libperl526.a" -DCMAKE_TOOLCHAIN_FILE="C:/projects/eqemu/vcpkg/vcpkg-export-20180627-133249/scripts/buildsystems/vcpkg.cmake" ..
|
||||
- ps: "$wc = New-Object System.Net.WebClient\n$wc.DownloadFile(\"http://strawberryperl.com/download/5.26.2.1/strawberry-perl-5.26.2.1-64bit-portable.zip\", \"c:\\projects\\eqemu\\strawberry-perl-5.26.2.1-64bit-portable.zip\")\ncd c:\\projects\\eqemu\n7z x c:/projects/eqemu/strawberry-perl-5.26.2.1-64bit-portable.zip -oc:/projects/eqemu/strawberry-perl-portable -y\n(Get-Content C:/projects/eqemu/strawberry-perl-portable/perl/lib/CORE/config.h).replace('#define PERL_STATIC_INLINE static __inline__', '#define PERL_STATIC_INLINE static __inline') | Set-Content C:/projects/eqemu/strawberry-perl-portable/perl/lib/CORE/config.h\nvcpkg install boost-geometry:x64-windows boost-dynamic-bitset:x64-windows luajit:x64-windows libsodium:x64-windows libmysql:x64-windows openssl:x64-windows zlib:x64-windows \nmkdir build\ncd build\ncmake -G \"Visual Studio 15 2017 Win64\" -DEQEMU_BUILD_TESTS=ON -DEQEMU_BUILD_LOGIN=ON -EQEMU_ENABLE_BOTS=ON -DPERL_EXECUTABLE=\"C:/projects/eqemu/strawberry-perl-portable/perl/bin/perl.exe\" -DPERL_INCLUDE_PATH=\"C:/projects/eqemu/strawberry-perl-portable/perl/lib/CORE\" -DPERL_LIBRARY=\"C:/projects/eqemu/strawberry-perl-portable/perl/lib/CORE/libperl526.a\" -DCMAKE_TOOLCHAIN_FILE=\"c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake\" .."
|
||||
build:
|
||||
project: C:\projects\eqemu\build\EQEmu.sln
|
||||
parallel: true
|
||||
|
||||
+2
-20
@@ -7,27 +7,9 @@ configuration: RelWithDebInfo
|
||||
clone_folder: c:\projects\eqemu
|
||||
init:
|
||||
- ps: git config --global core.autocrlf input
|
||||
cache: c:\tools\vcpkg\installed\
|
||||
before_build:
|
||||
- ps: >-
|
||||
$wc = New-Object System.Net.WebClient
|
||||
|
||||
$wc.DownloadFile("https://github.com/EQEmu/eqemu.github.com/blob/master/downloads/appveyor/vcpkg-export.7z?raw=true", "c:\projects\eqemu\vcpkg-export.7z")
|
||||
|
||||
$wc.DownloadFile("http://strawberryperl.com/download/5.26.2.1/strawberry-perl-5.26.2.1-64bit-portable.zip", "c:\projects\eqemu\strawberry-perl-5.26.2.1-64bit-portable.zip")
|
||||
|
||||
cd c:\projects\eqemu
|
||||
|
||||
7z x c:/projects/eqemu/vcpkg-export.7z -oc:/projects/eqemu/vcpkg -y
|
||||
|
||||
7z x c:/projects/eqemu/strawberry-perl-5.26.2.1-64bit-portable.zip -oc:/projects/eqemu/strawberry-perl-portable -y
|
||||
|
||||
(Get-Content C:/projects/eqemu/strawberry-perl-portable/perl/lib/CORE/config.h).replace('#define PERL_STATIC_INLINE static __inline__', '#define PERL_STATIC_INLINE static __inline') | Set-Content C:/projects/eqemu/strawberry-perl-portable/perl/lib/CORE/config.h
|
||||
|
||||
mkdir build
|
||||
|
||||
cd build
|
||||
|
||||
cmake -G "Visual Studio 15 2017 Win64" -DEQEMU_BUILD_TESTS=ON -DEQEMU_BUILD_LOGIN=ON -EQEMU_ENABLE_BOTS=OFF -DPERL_EXECUTABLE="C:/projects/eqemu/strawberry-perl-portable/perl/bin/perl.exe" -DPERL_INCLUDE_PATH="C:/projects/eqemu/strawberry-perl-portable/perl/lib/CORE" -DPERL_LIBRARY="C:/projects/eqemu/strawberry-perl-portable/perl/lib/CORE/libperl526.a" -DCMAKE_TOOLCHAIN_FILE="C:/projects/eqemu/vcpkg/vcpkg-export-20180627-133249/scripts/buildsystems/vcpkg.cmake" ..
|
||||
- ps: "$wc = New-Object System.Net.WebClient\n$wc.DownloadFile(\"http://strawberryperl.com/download/5.26.2.1/strawberry-perl-5.26.2.1-64bit-portable.zip\", \"c:\\projects\\eqemu\\strawberry-perl-5.26.2.1-64bit-portable.zip\")\ncd c:\\projects\\eqemu\n7z x c:/projects/eqemu/strawberry-perl-5.26.2.1-64bit-portable.zip -oc:/projects/eqemu/strawberry-perl-portable -y\n(Get-Content C:/projects/eqemu/strawberry-perl-portable/perl/lib/CORE/config.h).replace('#define PERL_STATIC_INLINE static __inline__', '#define PERL_STATIC_INLINE static __inline') | Set-Content C:/projects/eqemu/strawberry-perl-portable/perl/lib/CORE/config.h\nvcpkg install boost-geometry:x64-windows boost-dynamic-bitset:x64-windows luajit:x64-windows libsodium:x64-windows libmysql:x64-windows openssl:x64-windows zlib:x64-windows \nmkdir build\ncd build\ncmake -G \"Visual Studio 15 2017 Win64\" -DEQEMU_BUILD_TESTS=ON -DEQEMU_BUILD_LOGIN=ON -EQEMU_ENABLE_BOTS=OFF -DPERL_EXECUTABLE=\"C:/projects/eqemu/strawberry-perl-portable/perl/bin/perl.exe\" -DPERL_INCLUDE_PATH=\"C:/projects/eqemu/strawberry-perl-portable/perl/lib/CORE\" -DPERL_LIBRARY=\"C:/projects/eqemu/strawberry-perl-portable/perl/lib/CORE/libperl526.a\" -DCMAKE_TOOLCHAIN_FILE=\"c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake\" .."
|
||||
build:
|
||||
project: C:\projects\eqemu\build\EQEmu.sln
|
||||
parallel: true
|
||||
|
||||
@@ -1,5 +1,39 @@
|
||||
EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
||||
-------------------------------------------------------
|
||||
== 07/10/2018 ==
|
||||
Akkadius: Adjusted DataBuckets to use other acceptable time formats
|
||||
Example: quest::set_data('key', 'value', '1d');
|
||||
- Acceptable inputs:
|
||||
- 15s = 15 seconds
|
||||
- s15 = 15 seconds
|
||||
- 60m = 60 minutes
|
||||
- 7d = 7 days
|
||||
- 1y = 1 year
|
||||
- 600 = 600 seconds
|
||||
|
||||
== 07/09/2018 ==
|
||||
mackal: Rework of Task System, Shared Tasks still unsupported
|
||||
- The tables now have better named columns, which hopefully won't need to be explained
|
||||
- Text1 is now target_name, Text2 is now item_list, Text3 is now description_override
|
||||
- Tasks can now reward faction hits, this is just normal NPC Faction ID entries because I was lazy
|
||||
- The "Task" type tasks are now supported, a player can only be doing one of these at a time
|
||||
- Activity IDs for use spell on and use skill on have been identified but not implemented
|
||||
- Identified "duration code" for unlimited duration tasks (None = 0, Short = 1, Medium = 2, Long = 3)
|
||||
- Activities can now have multiple zones separated by ';'
|
||||
- tasks.startzone removed since it actually just uses first activity
|
||||
- skill_list and spell_list are both IDs that can be separated by ';' (still unimplemented though)
|
||||
|
||||
== 07/07/2018 ==
|
||||
Akkadius: Implemented a much better replacement for qglobals called 'DataBuckets'
|
||||
- A much more detailed example can be found at: https://github.com/EQEmu/Server/wiki/Data-Buckets
|
||||
|
||||
== 07/05/2018 ==
|
||||
Uleat: Reintegration of inventory-based EQDictionary references
|
||||
- Standardized 'CONSTANT_DECLARATION' and 'enumerationValue' tokens for most of the affected references
|
||||
- Added 'BEGIN' and 'END' constants to many inventory-based ranges to help eliminate '< SIZE'-type comparisons
|
||||
- Eliminated multiple, duplicated reference points of the same value context (bye, bye namespace legacy!)
|
||||
- Most server values are now linked to the implementation client directly through a 'using ##' directive
|
||||
|
||||
== 05/28/2018 ==
|
||||
Akkadius: Fixed an issue where size 0 NPC's hop in and out of the ground at idle
|
||||
Akkadius: NPC's now open doors within proximity given the door doesn't have locked requirements
|
||||
|
||||
@@ -14,7 +14,6 @@ SET(common_sources
|
||||
dbcore.cpp
|
||||
deity.cpp
|
||||
emu_constants.cpp
|
||||
emu_legacy.cpp
|
||||
emu_limits.cpp
|
||||
emu_opcodes.cpp
|
||||
emu_versions.cpp
|
||||
@@ -61,6 +60,7 @@ SET(common_sources
|
||||
rdtsc.cpp
|
||||
rulesys.cpp
|
||||
say_link.cpp
|
||||
serialize_buffer.cpp
|
||||
serverinfo.cpp
|
||||
shareddb.cpp
|
||||
skills.cpp
|
||||
@@ -124,7 +124,6 @@ SET(common_headers
|
||||
dbcore.h
|
||||
deity.h
|
||||
emu_constants.h
|
||||
emu_legacy.h
|
||||
emu_limits.h
|
||||
emu_opcodes.h
|
||||
emu_oplist.h
|
||||
@@ -192,6 +191,7 @@ SET(common_headers
|
||||
ruletypes.h
|
||||
say_link.h
|
||||
seperator.h
|
||||
serialize_buffer.h
|
||||
serverinfo.h
|
||||
servertalk.h
|
||||
shareddb.h
|
||||
|
||||
@@ -39,6 +39,18 @@ BasePacket::BasePacket(const unsigned char *buf, uint32 len)
|
||||
}
|
||||
}
|
||||
|
||||
BasePacket::BasePacket(SerializeBuffer &buf)
|
||||
{
|
||||
pBuffer = buf.m_buffer;
|
||||
buf.m_buffer = nullptr;
|
||||
size = buf.m_pos;
|
||||
buf.m_pos = 0;
|
||||
buf.m_capacity = 0;
|
||||
_wpos = 0;
|
||||
_rpos = 0;
|
||||
timestamp.tv_sec = 0;
|
||||
}
|
||||
|
||||
BasePacket::~BasePacket()
|
||||
{
|
||||
if (pBuffer)
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#define BASEPACKET_H_
|
||||
|
||||
#include "types.h"
|
||||
#include "serialize_buffer.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -63,6 +64,8 @@ public:
|
||||
void WriteFloat(float value) { *(float *)(pBuffer + _wpos) = value; _wpos += sizeof(float); }
|
||||
void WriteDouble(double value) { *(double *)(pBuffer + _wpos) = value; _wpos += sizeof(double); }
|
||||
void WriteString(const char * str) { uint32 len = static_cast<uint32>(strlen(str)) + 1; memcpy(pBuffer + _wpos, str, len); _wpos += len; }
|
||||
// this is used in task system a lot, it is NOT null-termed
|
||||
void WriteLengthString(uint32 len, const char *str) { *(uint32 *)(pBuffer + _wpos) = len; _wpos += sizeof(uint32); memcpy(pBuffer + _wpos, str, len); _wpos += len; }
|
||||
void WriteData(const void *ptr, size_t n) { memcpy(pBuffer + _wpos, ptr, n); _wpos += n; }
|
||||
|
||||
uint8 ReadUInt8() { uint8 value = *(uint8 *)(pBuffer + _rpos); _rpos += sizeof(uint8); return value; }
|
||||
@@ -83,6 +86,7 @@ protected:
|
||||
virtual ~BasePacket();
|
||||
BasePacket() { pBuffer=nullptr; size=0; _wpos = 0; _rpos = 0; }
|
||||
BasePacket(const unsigned char *buf, const uint32 len);
|
||||
BasePacket(SerializeBuffer &buf);
|
||||
};
|
||||
|
||||
extern void DumpPacketHex(const BasePacket* app);
|
||||
|
||||
+16
-7
@@ -708,7 +708,7 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, EQEmu
|
||||
|
||||
/* Insert starting inventory... */
|
||||
std::string invquery;
|
||||
for (int16 i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::BANK_BAGS_END;) {
|
||||
for (int16 i = EQEmu::invslot::EQUIPMENT_BEGIN; i <= EQEmu::invbag::BANK_BAGS_END;) {
|
||||
const EQEmu::ItemInstance* newinv = inv->GetItem(i);
|
||||
if (newinv) {
|
||||
invquery = StringFormat("INSERT INTO `inventory` (charid, slotid, itemid, charges, color) VALUES (%u, %i, %u, %i, %u)",
|
||||
@@ -717,16 +717,16 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, EQEmu
|
||||
auto results = QueryDatabase(invquery);
|
||||
}
|
||||
|
||||
if (i == EQEmu::inventory::slotCursor) {
|
||||
i = EQEmu::legacy::GENERAL_BAGS_BEGIN;
|
||||
if (i == EQEmu::invslot::slotCursor) {
|
||||
i = EQEmu::invbag::GENERAL_BAGS_BEGIN;
|
||||
continue;
|
||||
}
|
||||
else if (i == EQEmu::legacy::CURSOR_BAG_END) {
|
||||
i = EQEmu::legacy::BANK_BEGIN;
|
||||
else if (i == EQEmu::invbag::CURSOR_BAG_END) {
|
||||
i = EQEmu::invslot::BANK_BEGIN;
|
||||
continue;
|
||||
}
|
||||
else if (i == EQEmu::legacy::BANK_END) {
|
||||
i = EQEmu::legacy::BANK_BAGS_BEGIN;
|
||||
else if (i == EQEmu::invslot::BANK_END) {
|
||||
i = EQEmu::invbag::BANK_BAGS_BEGIN;
|
||||
continue;
|
||||
}
|
||||
i++;
|
||||
@@ -1752,6 +1752,15 @@ void Database::ClearRaidDetails(uint32 rid) {
|
||||
std::cout << "Unable to clear raid details: " << results.ErrorMessage() << std::endl;
|
||||
}
|
||||
|
||||
void Database::PurgeAllDeletedDataBuckets() {
|
||||
std::string query = StringFormat(
|
||||
"DELETE FROM `data_buckets` WHERE (`expires` < %lld AND `expires` > 0)",
|
||||
(long long) std::time(nullptr)
|
||||
);
|
||||
|
||||
QueryDatabase(query);
|
||||
}
|
||||
|
||||
// returns 0 on error or no raid for that character, or
|
||||
// the raid id that the character is a member of.
|
||||
uint32 Database::GetRaidID(const char* name)
|
||||
|
||||
@@ -221,6 +221,8 @@ public:
|
||||
void GetRaidLeadershipInfo(uint32 rid, char* maintank = nullptr, char* assist = nullptr, char* puller = nullptr, char *marknpc = nullptr, RaidLeadershipAA_Struct* RLAA = nullptr);
|
||||
void SetRaidGroupLeaderInfo(uint32 gid, uint32 rid);
|
||||
|
||||
void PurgeAllDeletedDataBuckets();
|
||||
|
||||
/* Database Conversions 'database_conversions.cpp' */
|
||||
|
||||
bool CheckDatabaseConversions();
|
||||
|
||||
@@ -41,6 +41,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
// all const/macro reference values should really be converted to a magic number for this
|
||||
// process to ensure that the struct sizes and offsets match up to the corresponding blob
|
||||
|
||||
/* Conversion Structs */
|
||||
|
||||
namespace Convert {
|
||||
@@ -330,7 +333,7 @@ namespace Convert {
|
||||
/*7212*/ uint32 tribute_points;
|
||||
/*7216*/ uint32 unknown7252;
|
||||
/*7220*/ uint32 tribute_active; //1=active
|
||||
/*7224*/ Convert::Tribute_Struct tributes[EQEmu::legacy::TRIBUTE_SIZE];
|
||||
/*7224*/ Convert::Tribute_Struct tributes[5];
|
||||
/*7264*/ Convert::Disciplines_Struct disciplines;
|
||||
/*7664*/ uint32 recastTimers[MAX_RECAST_TYPES]; // Timers (GMT of last use)
|
||||
/*7744*/ char unknown7780[160];
|
||||
@@ -1405,7 +1408,7 @@ bool Database::CheckDatabaseConvertPPDeblob(){
|
||||
if (rquery != ""){ results = QueryDatabase(rquery); }
|
||||
/* Run Tribute Convert */
|
||||
first_entry = 0; rquery = "";
|
||||
for (i = 0; i < EQEmu::legacy::TRIBUTE_SIZE; i++){
|
||||
for (i = 0; i < 5; i++){
|
||||
if (pp->tributes[i].tribute > 0 && pp->tributes[i].tribute != 4294967295){
|
||||
if (first_entry != 1){
|
||||
rquery = StringFormat("REPLACE INTO `character_tribute` (id, tier, tribute) VALUES (%u, %u, %u)", character_id, pp->tributes[i].tier, pp->tributes[i].tribute);
|
||||
|
||||
@@ -20,6 +20,41 @@
|
||||
#include "emu_constants.h"
|
||||
|
||||
|
||||
int16 EQEmu::invtype::GetInvTypeSize(int16 inv_type) {
|
||||
static const int16 local_array[] = {
|
||||
POSSESSIONS_SIZE,
|
||||
BANK_SIZE,
|
||||
SHARED_BANK_SIZE,
|
||||
TRADE_SIZE,
|
||||
WORLD_SIZE,
|
||||
LIMBO_SIZE,
|
||||
TRIBUTE_SIZE,
|
||||
TROPHY_TRIBUTE_SIZE,
|
||||
GUILD_TRIBUTE_SIZE,
|
||||
MERCHANT_SIZE,
|
||||
DELETED_SIZE,
|
||||
CORPSE_SIZE,
|
||||
BAZAAR_SIZE,
|
||||
INSPECT_SIZE,
|
||||
REAL_ESTATE_SIZE,
|
||||
VIEW_MOD_PC_SIZE,
|
||||
VIEW_MOD_BANK_SIZE,
|
||||
VIEW_MOD_SHARED_BANK_SIZE,
|
||||
VIEW_MOD_LIMBO_SIZE,
|
||||
ALT_STORAGE_SIZE,
|
||||
ARCHIVED_SIZE,
|
||||
MAIL_SIZE,
|
||||
GUILD_TROPHY_TRIBUTE_SIZE,
|
||||
KRONO_SIZE,
|
||||
OTHER_SIZE,
|
||||
};
|
||||
|
||||
if (inv_type < TYPE_BEGIN || inv_type > TYPE_END)
|
||||
return INULL;
|
||||
|
||||
return local_array[inv_type];
|
||||
}
|
||||
|
||||
const char* EQEmu::bug::CategoryIDToCategoryName(CategoryID category_id) {
|
||||
switch (category_id) {
|
||||
case catVideo:
|
||||
|
||||
+171
-87
@@ -21,104 +21,173 @@
|
||||
#define COMMON_EMU_CONSTANTS_H
|
||||
|
||||
#include "eq_limits.h"
|
||||
#include "emu_legacy.h"
|
||||
#include "emu_versions.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
||||
// local definitions are the result of using hybrid-client or server-only values and methods
|
||||
namespace EQEmu
|
||||
{
|
||||
using RoF2::IINVALID;
|
||||
using RoF2::INULL;
|
||||
|
||||
namespace inventory {
|
||||
//using namespace RoF2::invtype;
|
||||
//using namespace RoF2::invslot;
|
||||
//using namespace RoF2::invbag;
|
||||
//using namespace RoF2::invaug;
|
||||
|
||||
enum : int16 { typeInvalid = -1, slotInvalid = -1, containerInvalid = -1, socketInvalid = -1 }; // temporary
|
||||
enum : int16 { typeBegin = 0, slotBegin = 0, containerBegin = 0, socketBegin = 0 }; // temporary
|
||||
|
||||
enum PossessionsSlots : int16 { // temporary
|
||||
slotCharm = 0,
|
||||
slotEar1,
|
||||
slotHead,
|
||||
slotFace,
|
||||
slotEar2,
|
||||
slotNeck, // 5
|
||||
slotShoulders,
|
||||
slotArms,
|
||||
slotBack,
|
||||
slotWrist1,
|
||||
slotWrist2, // 10
|
||||
slotRange,
|
||||
slotHands,
|
||||
slotPrimary,
|
||||
slotSecondary,
|
||||
slotFinger1, // 15
|
||||
slotFinger2,
|
||||
slotChest,
|
||||
slotLegs,
|
||||
slotFeet,
|
||||
slotWaist, // 20
|
||||
slotPowerSource = 9999,
|
||||
slotAmmo = 21,
|
||||
slotGeneral1,
|
||||
slotGeneral2,
|
||||
slotGeneral3,
|
||||
slotGeneral4, // 25
|
||||
slotGeneral5,
|
||||
slotGeneral6,
|
||||
slotGeneral7,
|
||||
slotGeneral8,
|
||||
slotCursor, // 30
|
||||
slotCount
|
||||
};
|
||||
|
||||
enum InventoryTypes : int16 { // temporary
|
||||
typePossessions = 0,
|
||||
typeBank,
|
||||
typeSharedBank,
|
||||
typeTrade,
|
||||
typeWorld,
|
||||
typeLimbo, // 5
|
||||
typeTribute,
|
||||
typeTrophyTribute,
|
||||
typeGuildTribute,
|
||||
typeMerchant,
|
||||
typeDeleted, // 10
|
||||
typeCorpse,
|
||||
typeBazaar,
|
||||
typeInspect,
|
||||
typeRealEstate,
|
||||
typeViewMODPC, // 15
|
||||
typeViewMODBank,
|
||||
typeViewMODSharedBank,
|
||||
typeViewMODLimbo,
|
||||
typeAltStorage,
|
||||
typeArchived, // 20
|
||||
typeMail,
|
||||
typeGuildTrophyTribute,
|
||||
typeKrono,
|
||||
typeOther,
|
||||
typeCount
|
||||
};
|
||||
|
||||
static int16 SlotCount(int16 type_index) { return 0; } // temporary
|
||||
|
||||
const int16 ContainerCount = 10; // temporary
|
||||
const int16 SocketCount = 6; // temporary
|
||||
|
||||
|
||||
} /*inventory*/
|
||||
|
||||
namespace constants {
|
||||
const EQEmu::versions::ClientVersion CharacterCreationClient = EQEmu::versions::ClientVersion::RoF2;
|
||||
const size_t CharacterCreationMax = RoF2::constants::CharacterCreationLimit;
|
||||
namespace invtype {
|
||||
using namespace RoF2::invtype::enum_;
|
||||
|
||||
const size_t SayLinkOpenerSize = 1;
|
||||
const size_t SayLinkBodySize = RoF2::constants::SayLinkBodySize;
|
||||
const size_t SayLinkTextSize = 256; // this may be varied until it breaks something (tested:374) - the others are constant
|
||||
const size_t SayLinkCloserSize = 1;
|
||||
const size_t SayLinkMaximumSize = (SayLinkOpenerSize + SayLinkBodySize + SayLinkTextSize + SayLinkCloserSize);
|
||||
using RoF2::invtype::POSSESSIONS_SIZE;
|
||||
using RoF2::invtype::BANK_SIZE;
|
||||
using RoF2::invtype::SHARED_BANK_SIZE;
|
||||
using RoF2::invtype::TRADE_SIZE;
|
||||
using RoF2::invtype::WORLD_SIZE;
|
||||
using RoF2::invtype::LIMBO_SIZE;
|
||||
using RoF2::invtype::TRIBUTE_SIZE;
|
||||
using RoF2::invtype::TROPHY_TRIBUTE_SIZE;
|
||||
using RoF2::invtype::GUILD_TRIBUTE_SIZE;
|
||||
using RoF2::invtype::MERCHANT_SIZE;
|
||||
using RoF2::invtype::DELETED_SIZE;
|
||||
using RoF2::invtype::CORPSE_SIZE;
|
||||
using RoF2::invtype::BAZAAR_SIZE;
|
||||
using RoF2::invtype::INSPECT_SIZE;
|
||||
using RoF2::invtype::REAL_ESTATE_SIZE;
|
||||
using RoF2::invtype::VIEW_MOD_PC_SIZE;
|
||||
using RoF2::invtype::VIEW_MOD_BANK_SIZE;
|
||||
using RoF2::invtype::VIEW_MOD_SHARED_BANK_SIZE;
|
||||
using RoF2::invtype::VIEW_MOD_LIMBO_SIZE;
|
||||
using RoF2::invtype::ALT_STORAGE_SIZE;
|
||||
using RoF2::invtype::ARCHIVED_SIZE;
|
||||
using RoF2::invtype::MAIL_SIZE;
|
||||
using RoF2::invtype::GUILD_TROPHY_TRIBUTE_SIZE;
|
||||
using RoF2::invtype::KRONO_SIZE;
|
||||
using RoF2::invtype::OTHER_SIZE;
|
||||
|
||||
using Titanium::invtype::TRADE_NPC_SIZE;
|
||||
|
||||
using RoF2::invtype::TYPE_INVALID;
|
||||
using RoF2::invtype::TYPE_BEGIN;
|
||||
using RoF2::invtype::TYPE_END;
|
||||
using RoF2::invtype::TYPE_COUNT;
|
||||
|
||||
int16 GetInvTypeSize(int16 inv_type);
|
||||
using RoF2::invtype::GetInvTypeName;
|
||||
|
||||
} // namespace invtype
|
||||
|
||||
namespace invslot {
|
||||
using namespace Titanium::invslot::enum_;
|
||||
|
||||
const int16 SLOT_POWER_SOURCE = 9999;
|
||||
|
||||
using RoF2::invslot::SLOT_INVALID;
|
||||
using RoF2::invslot::SLOT_BEGIN;
|
||||
|
||||
using Titanium::invslot::POSSESSIONS_BEGIN;
|
||||
using Titanium::invslot::POSSESSIONS_END;
|
||||
using SoF::invslot::POSSESSIONS_COUNT;
|
||||
|
||||
using Titanium::invslot::EQUIPMENT_BEGIN;
|
||||
using Titanium::invslot::EQUIPMENT_END;
|
||||
using Titanium::invslot::EQUIPMENT_COUNT;
|
||||
|
||||
using Titanium::invslot::GENERAL_BEGIN;
|
||||
using Titanium::invslot::GENERAL_END;
|
||||
using Titanium::invslot::GENERAL_COUNT;
|
||||
|
||||
using Titanium::invslot::BONUS_BEGIN;
|
||||
using Titanium::invslot::BONUS_STAT_END;
|
||||
using Titanium::invslot::BONUS_SKILL_END;
|
||||
|
||||
using Titanium::invslot::BANK_BEGIN;
|
||||
using SoF::invslot::BANK_END;
|
||||
|
||||
using Titanium::invslot::SHARED_BANK_BEGIN;
|
||||
using Titanium::invslot::SHARED_BANK_END;
|
||||
|
||||
using Titanium::invslot::TRADE_BEGIN;
|
||||
using Titanium::invslot::TRADE_END;
|
||||
|
||||
using Titanium::invslot::TRADE_NPC_END;
|
||||
|
||||
using Titanium::invslot::WORLD_BEGIN;
|
||||
using Titanium::invslot::WORLD_END;
|
||||
|
||||
using Titanium::invslot::TRIBUTE_BEGIN;
|
||||
using Titanium::invslot::TRIBUTE_END;
|
||||
|
||||
using Titanium::invslot::GUILD_TRIBUTE_BEGIN;
|
||||
using Titanium::invslot::GUILD_TRIBUTE_END;
|
||||
|
||||
const int16 CORPSE_BEGIN = invslot::slotGeneral1;
|
||||
const int16 CORPSE_END = CORPSE_BEGIN + invslot::slotCursor;
|
||||
|
||||
using RoF2::invslot::POSSESSIONS_BITMASK;
|
||||
using RoF2::invslot::CORPSE_BITMASK;
|
||||
|
||||
using RoF2::invslot::GetInvPossessionsSlotName;
|
||||
using RoF2::invslot::GetInvSlotName;
|
||||
|
||||
} // namespace invslot
|
||||
|
||||
namespace invbag {
|
||||
using Titanium::invbag::SLOT_INVALID;
|
||||
using Titanium::invbag::SLOT_BEGIN;
|
||||
using Titanium::invbag::SLOT_END;
|
||||
using Titanium::invbag::SLOT_COUNT;
|
||||
|
||||
using Titanium::invbag::GENERAL_BAGS_BEGIN;
|
||||
const int16 GENERAL_BAGS_COUNT = invslot::GENERAL_COUNT * SLOT_COUNT;
|
||||
const int16 GENERAL_BAGS_END = (GENERAL_BAGS_BEGIN + GENERAL_BAGS_COUNT) - 1;
|
||||
|
||||
const int16 GENERAL_BAGS_8_COUNT = 8 * SLOT_COUNT;
|
||||
const int16 GENERAL_BAGS_8_END = (GENERAL_BAGS_BEGIN + GENERAL_BAGS_8_COUNT) - 1;
|
||||
|
||||
const int16 CURSOR_BAG_BEGIN = 331;
|
||||
const int16 CURSOR_BAG_COUNT = SLOT_COUNT;
|
||||
const int16 CURSOR_BAG_END = (CURSOR_BAG_BEGIN + CURSOR_BAG_COUNT) - 1;
|
||||
|
||||
using Titanium::invbag::BANK_BAGS_BEGIN;
|
||||
const int16 BANK_BAGS_COUNT = (invtype::BANK_SIZE * SLOT_COUNT);
|
||||
const int16 BANK_BAGS_END = (BANK_BAGS_BEGIN + BANK_BAGS_COUNT) - 1;
|
||||
|
||||
const int16 BANK_BAGS_16_COUNT = 16 * SLOT_COUNT;
|
||||
const int16 BANK_BAGS_16_END = (BANK_BAGS_BEGIN + BANK_BAGS_16_COUNT) - 1;
|
||||
|
||||
using Titanium::invbag::SHARED_BANK_BAGS_BEGIN;
|
||||
const int16 SHARED_BANK_BAGS_COUNT = invtype::SHARED_BANK_SIZE * SLOT_COUNT;
|
||||
const int16 SHARED_BANK_BAGS_END = (SHARED_BANK_BAGS_BEGIN + SHARED_BANK_BAGS_COUNT) - 1;
|
||||
|
||||
using Titanium::invbag::TRADE_BAGS_BEGIN;
|
||||
const int16 TRADE_BAGS_COUNT = invtype::TRADE_SIZE * SLOT_COUNT;
|
||||
const int16 TRADE_BAGS_END = (TRADE_BAGS_BEGIN + TRADE_BAGS_COUNT) - 1;
|
||||
|
||||
using Titanium::invbag::GetInvBagIndexName;
|
||||
|
||||
} // namespace invbag
|
||||
|
||||
namespace invaug {
|
||||
using RoF2::invaug::SOCKET_INVALID;
|
||||
using RoF2::invaug::SOCKET_BEGIN;
|
||||
using RoF2::invaug::SOCKET_END;
|
||||
using RoF2::invaug::SOCKET_COUNT;
|
||||
|
||||
using RoF2::invaug::GetInvAugIndexName;
|
||||
|
||||
} // namespace invaug
|
||||
|
||||
namespace constants {
|
||||
const EQEmu::versions::ClientVersion CHARACTER_CREATION_CLIENT = EQEmu::versions::ClientVersion::Titanium;
|
||||
|
||||
using RoF2::constants::CHARACTER_CREATION_LIMIT;
|
||||
|
||||
const size_t SAY_LINK_OPENER_SIZE = 1;
|
||||
using RoF2::constants::SAY_LINK_BODY_SIZE;
|
||||
const size_t SAY_LINK_TEXT_SIZE = 256; // this may be varied until it breaks something (tested:374) - the others are constant
|
||||
const size_t SAY_LINK_CLOSER_SIZE = 1;
|
||||
const size_t SAY_LINK_MAXIMUM_SIZE = (SAY_LINK_OPENER_SIZE + SAY_LINK_BODY_SIZE + SAY_LINK_TEXT_SIZE + SAY_LINK_CLOSER_SIZE);
|
||||
|
||||
const int LongBuffs = RoF2::constants::LongBuffs;
|
||||
const int ShortBuffs = RoF2::constants::ShortBuffs;
|
||||
@@ -130,6 +199,21 @@ namespace EQEmu
|
||||
|
||||
} /*constants*/
|
||||
|
||||
namespace profile {
|
||||
using RoF2::profile::BANDOLIERS_SIZE;
|
||||
using RoF2::profile::BANDOLIER_ITEM_COUNT;
|
||||
|
||||
using RoF2::profile::POTION_BELT_SIZE;
|
||||
|
||||
using RoF2::profile::SKILL_ARRAY_SIZE;
|
||||
|
||||
} // namespace profile
|
||||
|
||||
namespace behavior {
|
||||
using RoF2::behavior::CoinHasWeight;
|
||||
|
||||
} // namespace behavior
|
||||
|
||||
namespace bug {
|
||||
enum CategoryID : uint32 {
|
||||
catOther = 0,
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
|
||||
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
are required to give you total support for your newly bought product;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "emu_legacy.h"
|
||||
@@ -1,182 +0,0 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
|
||||
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
are required to give you total support for your newly bought product;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef COMMON_EMU_LEGACY_H
|
||||
#define COMMON_EMU_LEGACY_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
namespace EQEmu
|
||||
{
|
||||
// this is for perl and other legacy systems
|
||||
namespace legacy {
|
||||
enum InventorySlot {
|
||||
SLOT_CHARM = 0,
|
||||
SLOT_EAR01 = 1,
|
||||
SLOT_HEAD = 2,
|
||||
SLOT_FACE = 3,
|
||||
SLOT_EAR02 = 4,
|
||||
SLOT_NECK = 5,
|
||||
SLOT_SHOULDER = 6,
|
||||
SLOT_ARMS = 7,
|
||||
SLOT_BACK = 8,
|
||||
SLOT_BRACER01 = 9,
|
||||
SLOT_BRACER02 = 10,
|
||||
SLOT_RANGE = 11,
|
||||
SLOT_HANDS = 12,
|
||||
SLOT_PRIMARY = 13,
|
||||
SLOT_SECONDARY = 14,
|
||||
SLOT_RING01 = 15,
|
||||
SLOT_RING02 = 16,
|
||||
SLOT_CHEST = 17,
|
||||
SLOT_LEGS = 18,
|
||||
SLOT_FEET = 19,
|
||||
SLOT_WAIST = 20,
|
||||
SLOT_POWER_SOURCE = 9999,
|
||||
SLOT_AMMO = 21,
|
||||
SLOT_GENERAL_1 = 22,
|
||||
SLOT_GENERAL_2 = 23,
|
||||
SLOT_GENERAL_3 = 24,
|
||||
SLOT_GENERAL_4 = 25,
|
||||
SLOT_GENERAL_5 = 26,
|
||||
SLOT_GENERAL_6 = 27,
|
||||
SLOT_GENERAL_7 = 28,
|
||||
SLOT_GENERAL_8 = 29,
|
||||
SLOT_CURSOR = 30,
|
||||
SLOT_CURSOR_END = (int16)0xFFFE, // I hope no one is using this...
|
||||
SLOT_TRADESKILL = 1000,
|
||||
SLOT_AUGMENT = 1001,
|
||||
SLOT_INVALID = (int16)0xFFFF,
|
||||
SLOT_POSSESSIONS_BEGIN = 0,
|
||||
SLOT_POSSESSIONS_END = 30,
|
||||
SLOT_EQUIPMENT_BEGIN = 0,
|
||||
SLOT_EQUIPMENT_END = 21,
|
||||
SLOT_PERSONAL_BEGIN = 22,
|
||||
SLOT_PERSONAL_END = 29,
|
||||
SLOT_PERSONAL_BAGS_BEGIN = 251,
|
||||
SLOT_PERSONAL_BAGS_END = 330,
|
||||
SLOT_CURSOR_BAG_BEGIN = 331,
|
||||
SLOT_CURSOR_BAG_END = 340,
|
||||
SLOT_TRIBUTE_BEGIN = 400,
|
||||
SLOT_TRIBUTE_END = 404,
|
||||
SLOT_GUILD_TRIBUTE_BEGIN = 450,
|
||||
SLOT_GUILD_TRIBUTE_END = 451,
|
||||
SLOT_BANK_BEGIN = 2000,
|
||||
SLOT_BANK_END = 2023,
|
||||
SLOT_BANK_BAGS_BEGIN = 2031,
|
||||
SLOT_BANK_BAGS_END = 2270,
|
||||
SLOT_SHARED_BANK_BEGIN = 2500,
|
||||
SLOT_SHARED_BANK_END = 2501,
|
||||
SLOT_SHARED_BANK_BAGS_BEGIN = 2531,
|
||||
SLOT_SHARED_BANK_BAGS_END = 2550,
|
||||
SLOT_TRADE_BEGIN = 3000,
|
||||
SLOT_TRADE_END = 3007,
|
||||
SLOT_TRADE_BAGS_BEGIN = 3031,
|
||||
SLOT_TRADE_BAGS_END = 3110,
|
||||
SLOT_WORLD_BEGIN = 4000,
|
||||
SLOT_WORLD_END = 4009
|
||||
};
|
||||
|
||||
// these are currently hard-coded for existing inventory system..do not use in place of special client version handlers until ready
|
||||
static const uint16 TYPE_POSSESSIONS_SIZE = 31;
|
||||
static const uint16 TYPE_BANK_SIZE = 24;
|
||||
static const uint16 TYPE_SHARED_BANK_SIZE = 2;
|
||||
static const uint16 TYPE_TRADE_SIZE = 8;
|
||||
static const uint16 TYPE_WORLD_SIZE = 10;
|
||||
static const uint16 TYPE_LIMBO_SIZE = 36;
|
||||
static const uint16 TYPE_TRIBUTE_SIZE = 5; // (need client values)
|
||||
static const uint16 TYPE_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 TYPE_GUILD_TRIBUTE_SIZE = 0;
|
||||
static const uint16 TYPE_MERCHANT_SIZE = 0;
|
||||
static const uint16 TYPE_DELETED_SIZE = 0;
|
||||
static const uint16 TYPE_CORPSE_SIZE = 31; // no bitmask use..limits to size of client corpse window (see EQLimits::InventoryMapSize(MapCorpse, <EQClientVersion))
|
||||
static const uint16 TYPE_BAZAAR_SIZE = 80;
|
||||
static const uint16 TYPE_INSPECT_SIZE = 22;
|
||||
static const uint16 TYPE_REAL_ESTATE_SIZE = 0;
|
||||
static const uint16 TYPE_VIEW_MOD_PC_SIZE = 0;
|
||||
static const uint16 TYPE_VIEW_MOD_BANK_SIZE = 0;
|
||||
static const uint16 TYPE_VIEW_MOD_SHARED_BANK_SIZE = 0;
|
||||
static const uint16 TYPE_VIEW_MOD_LIMBO_SIZE = 0;
|
||||
static const uint16 TYPE_ALT_STORAGE_SIZE = 0;
|
||||
static const uint16 TYPE_ARCHIVED_SIZE = 0;
|
||||
static const uint16 TYPE_MAIL_SIZE = 0;
|
||||
static const uint16 TYPE_GUILD_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 TYPE_KRONO_SIZE = 0;
|
||||
static const uint16 TYPE_OTHER_SIZE = 0;
|
||||
|
||||
// most of these definitions will go away with the structure-based system..this maintains compatibility for now
|
||||
// (these are mainly to assign specific values to constants used in conversions and to identify per-client ranges/offsets)
|
||||
static const int16 EQUIPMENT_BEGIN = 0;
|
||||
static const int16 EQUIPMENT_END = 21;
|
||||
static const uint16 EQUIPMENT_SIZE = 22; // does not account for 'Power Source' - used mainly for npc equipment arrays
|
||||
|
||||
static const int16 GENERAL_BEGIN = 22;
|
||||
static const int16 GENERAL_END = 29;
|
||||
static const uint16 GENERAL_SIZE = 8;
|
||||
static const int16 GENERAL_BAGS_BEGIN = 251;
|
||||
static const int16 GENERAL_BAGS_END_OFFSET = 79;
|
||||
static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET;
|
||||
|
||||
static const int16 CURSOR_BAG_BEGIN = 331;
|
||||
static const int16 CURSOR_BAG_END_OFFSET = 9;
|
||||
static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET;
|
||||
|
||||
static const int16 BANK_BEGIN = 2000;
|
||||
static const int16 BANK_END = 2023;
|
||||
static const int16 BANK_BAGS_BEGIN = 2031;
|
||||
static const int16 BANK_BAGS_END_OFFSET = 239;
|
||||
static const int16 BANK_BAGS_END = BANK_BAGS_BEGIN + BANK_BAGS_END_OFFSET;
|
||||
|
||||
static const int16 SHARED_BANK_BEGIN = 2500;
|
||||
static const int16 SHARED_BANK_END = 2501;
|
||||
static const int16 SHARED_BANK_BAGS_BEGIN = 2531;
|
||||
static const int16 SHARED_BANK_BAGS_END_OFFSET = 19;
|
||||
static const int16 SHARED_BANK_BAGS_END = SHARED_BANK_BAGS_BEGIN + SHARED_BANK_BAGS_END_OFFSET;
|
||||
|
||||
static const int16 TRADE_BEGIN = 3000;
|
||||
static const int16 TRADE_END = 3007;
|
||||
static const int16 TRADE_NPC_END = 3003;
|
||||
static const int16 TRADE_BAGS_BEGIN = 3031;
|
||||
static const int16 TRADE_BAGS_END_OFFSET = 79;
|
||||
static const int16 TRADE_BAGS_END = TRADE_BAGS_BEGIN + TRADE_BAGS_END_OFFSET;
|
||||
|
||||
static const int16 WORLD_BEGIN = 4000;
|
||||
static const int16 WORLD_END = 4009;
|
||||
static const int16 WORLD_SIZE = TYPE_WORLD_SIZE;
|
||||
|
||||
static const int16 TRIBUTE_BEGIN = 400;
|
||||
static const int16 TRIBUTE_END = 404;
|
||||
static const int16 TRIBUTE_SIZE = TYPE_TRIBUTE_SIZE;
|
||||
|
||||
static const int16 CORPSE_BEGIN = 22;
|
||||
|
||||
// BANDOLIERS_SIZE sets maximum limit..active limit will need to be handled by the appropriate AA or spell (or item?)
|
||||
static const size_t BANDOLIERS_SIZE = 20; // number of bandolier instances
|
||||
static const size_t BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
||||
|
||||
// POTION_BELT_SIZE sets maximum limit..active limit will need to be handled by the appropriate AA or spell (or item?)
|
||||
static const size_t POTION_BELT_ITEM_COUNT = 5;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif /* COMMON_EMU_LEGACY_H */
|
||||
+45
-24
@@ -28,74 +28,95 @@
|
||||
namespace EntityLimits
|
||||
{
|
||||
namespace NPC {
|
||||
enum : int { Invalid = -1, Null, Safety };
|
||||
const int16 IINVALID = -1;
|
||||
const int16 INULL = 0;
|
||||
|
||||
enum : bool { False = false, True = true };
|
||||
namespace invtype {
|
||||
const int16 TRADE_SIZE = 4;
|
||||
|
||||
const size_t InvTypeTradeSize = 4;
|
||||
} // namespace invtype
|
||||
|
||||
} /*NPC*/
|
||||
|
||||
namespace NPCMerchant {
|
||||
enum : int { Invalid = -1, Null, Safety };
|
||||
const int16 IINVALID = -1;
|
||||
const int16 INULL = 0;
|
||||
|
||||
enum : bool { False = false, True = true };
|
||||
namespace invtype {
|
||||
const int16 TRADE_SIZE = 4;
|
||||
|
||||
const size_t InvTypeTradeSize = 4;
|
||||
} // namespace invtype
|
||||
|
||||
} /*NPCMerchant*/
|
||||
|
||||
namespace Merc {
|
||||
enum : int { Invalid = -1, Null, Safety };
|
||||
const int16 IINVALID = -1;
|
||||
const int16 INULL = 0;
|
||||
|
||||
enum : bool { False = false, True = true };
|
||||
namespace invtype {
|
||||
const int16 TRADE_SIZE = 4;
|
||||
|
||||
const size_t InvTypeTradeSize = 4;
|
||||
} // namespace invtype
|
||||
|
||||
} /*Merc*/
|
||||
|
||||
namespace Bot {
|
||||
enum : int { Invalid = -1, Null, Safety };
|
||||
const int16 IINVALID = -1;
|
||||
const int16 INULL = 0;
|
||||
|
||||
enum : bool { False = false, True = true };
|
||||
namespace invtype {
|
||||
const int16 TRADE_SIZE = 8;
|
||||
|
||||
const size_t InvTypeTradeSize = 8;
|
||||
} // namespace invtype
|
||||
|
||||
namespace invslot {
|
||||
const uint64 POSSESSIONS_BITMASK = 0x00000000007FFFFF; // based on 34-slot count (RoF+)
|
||||
|
||||
} // namespace invslot
|
||||
|
||||
} /*Bot*/
|
||||
|
||||
namespace ClientPet {
|
||||
enum : int { Invalid = -1, Null, Safety };
|
||||
const int16 IINVALID = -1;
|
||||
const int16 INULL = 0;
|
||||
|
||||
enum : bool { False = false, True = true };
|
||||
namespace invtype {
|
||||
const int16 TRADE_SIZE = 4;
|
||||
|
||||
const size_t InvTypeTradeSize = 4;
|
||||
} // namespace invtype
|
||||
|
||||
} /*Pet*/
|
||||
|
||||
namespace NPCPet {
|
||||
enum : int { Invalid = -1, Null, Safety };
|
||||
const int16 IINVALID = -1;
|
||||
const int16 INULL = 0;
|
||||
|
||||
enum : bool { False = false, True = true };
|
||||
namespace invtype {
|
||||
const int16 TRADE_SIZE = 4;
|
||||
|
||||
const size_t InvTypeTradeSize = 4;
|
||||
} // namespace invtype
|
||||
|
||||
} /*Pet*/
|
||||
|
||||
namespace MercPet {
|
||||
enum : int { Invalid = -1, Null, Safety };
|
||||
const int16 IINVALID = -1;
|
||||
const int16 INULL = 0;
|
||||
|
||||
enum : bool { False = false, True = true };
|
||||
namespace invtype {
|
||||
const int16 TRADE_SIZE = 4;
|
||||
|
||||
const size_t InvTypeTradeSize = 4;
|
||||
} // namespace invtype
|
||||
|
||||
} /*Pet*/
|
||||
|
||||
namespace BotPet {
|
||||
enum : int { Invalid = -1, Null, Safety };
|
||||
const int16 IINVALID = -1;
|
||||
const int16 INULL = 0;
|
||||
|
||||
enum : bool { False = false, True = true };
|
||||
namespace invtype {
|
||||
const int16 TRADE_SIZE = 4;
|
||||
|
||||
const size_t InvTypeTradeSize = 4;
|
||||
} // namespace invtype
|
||||
|
||||
} /*Pet*/
|
||||
|
||||
|
||||
@@ -523,4 +523,18 @@ static const uint8 SkillDamageTypes[EQEmu::skills::HIGHEST_SKILL + 1] = // chang
|
||||
|
||||
static const uint32 MAX_SPELL_DB_ID_VAL = 65535;
|
||||
|
||||
namespace EQEmu
|
||||
{
|
||||
namespace legacy {
|
||||
enum InventorySlot {
|
||||
SLOT_CURSOR_END = (int16)0xFFFE, // I hope no one is using this...
|
||||
SLOT_TRADESKILL = 1000,
|
||||
SLOT_AUGMENT = 1001,
|
||||
//SLOT_INVALID = (int16)0xFFFF,
|
||||
};
|
||||
|
||||
} // namespace legacy
|
||||
|
||||
}
|
||||
|
||||
#endif /*COMMON_EQ_CONSTANTS_H*/
|
||||
|
||||
+742
-716
File diff suppressed because it is too large
Load Diff
+14
-11
@@ -20,7 +20,6 @@
|
||||
#ifndef COMMON_EQ_LIMITS_H
|
||||
#define COMMON_EQ_LIMITS_H
|
||||
|
||||
#include "emu_legacy.h"
|
||||
#include "types.h"
|
||||
#include "eq_constants.h"
|
||||
#include "emu_versions.h"
|
||||
@@ -37,7 +36,7 @@ namespace EQEmu
|
||||
namespace constants {
|
||||
class LookupEntry {
|
||||
public:
|
||||
size_t CharacterCreationLimit;
|
||||
int16 CharacterCreationLimit;
|
||||
int LongBuffs;
|
||||
int ShortBuffs;
|
||||
int DiscBuffs;
|
||||
@@ -54,11 +53,17 @@ namespace EQEmu
|
||||
namespace inventory {
|
||||
class LookupEntry {
|
||||
public:
|
||||
size_t InventoryTypeSize[25]; // should reflect EQEmu::inventory::typeCount referenced in emu_constants.h
|
||||
// note: 'PossessionsBitmask' needs to be attuned to the client version with the highest number
|
||||
// of possessions slots and 'InventoryTypeSize[typePossessions]' should reflect the same count
|
||||
// with translators adjusting for valid slot indices. Server-side validations will be performed
|
||||
// against 'PossessionsBitmask' (note: the same applies to Corpse type size and bitmask)
|
||||
|
||||
int16 InventoryTypeSize[25]; // should reflect EQEmu::invtype::TYPE_COUNT referenced in emu_constants.h
|
||||
|
||||
uint64 PossessionsBitmask;
|
||||
size_t ItemBagSize;
|
||||
size_t ItemAugSize;
|
||||
uint64 CorpseBitmask;
|
||||
int16 BagSlotCount;
|
||||
int16 AugSocketCount;
|
||||
|
||||
bool AllowEmptyBagInBag;
|
||||
bool AllowClickCastFromBag;
|
||||
@@ -84,17 +89,15 @@ namespace EQEmu
|
||||
|
||||
namespace ClientUnknown
|
||||
{
|
||||
enum : int { Invalid = -1, Null, Safety };
|
||||
|
||||
enum : bool { False = false, True = true };
|
||||
const int16 IINVALID = -1;
|
||||
const int16 INULL = 0;
|
||||
|
||||
} /*ClientUnknown*/
|
||||
|
||||
namespace Client62
|
||||
{
|
||||
enum : int { Invalid = -1, Null, Safety };
|
||||
|
||||
enum : bool { False = false, True = true };
|
||||
const int16 IINVALID = -1;
|
||||
const int16 INULL = 0;
|
||||
|
||||
} /*Client62*/
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ protected:
|
||||
EmuOpcode emu_opcode;
|
||||
|
||||
EQPacket(EmuOpcode opcode, const unsigned char *buf, const uint32 len);
|
||||
EQPacket(EmuOpcode opcode, SerializeBuffer &buf) : BasePacket(buf), emu_opcode(opcode) { };
|
||||
// EQPacket(const EQPacket &p) { }
|
||||
EQPacket() { emu_opcode=OP_Unknown; pBuffer=nullptr; size=0; }
|
||||
|
||||
@@ -104,6 +105,8 @@ public:
|
||||
{ app_opcode_size = GetExecutablePlatform() == ExePlatformUCS ? 1 : 2; }
|
||||
EQApplicationPacket(const EmuOpcode op, const unsigned char *buf, const uint32 len) : EQPacket(op, buf, len), opcode_bypass(0)
|
||||
{ app_opcode_size = GetExecutablePlatform() == ExePlatformUCS ? 1 : 2; }
|
||||
EQApplicationPacket(const EmuOpcode op, SerializeBuffer &buf) : EQPacket(op, buf), opcode_bypass(0)
|
||||
{ app_opcode_size = GetExecutablePlatform() == ExePlatformUCS ? 1 : 2; }
|
||||
bool combine(const EQApplicationPacket *rhs);
|
||||
uint32 serialize (uint16 opcode, unsigned char *dest) const;
|
||||
uint32 Size() const { return size+app_opcode_size; }
|
||||
|
||||
+31
-22
@@ -731,7 +731,7 @@ struct BandolierItem_Struct
|
||||
struct Bandolier_Struct
|
||||
{
|
||||
char Name[32];
|
||||
BandolierItem_Struct Items[EQEmu::legacy::BANDOLIER_ITEM_COUNT];
|
||||
BandolierItem_Struct Items[EQEmu::profile::BANDOLIER_ITEM_COUNT];
|
||||
};
|
||||
|
||||
//len = 72
|
||||
@@ -745,7 +745,7 @@ struct PotionBeltItem_Struct
|
||||
//len = 288
|
||||
struct PotionBelt_Struct
|
||||
{
|
||||
PotionBeltItem_Struct Items[EQEmu::legacy::POTION_BELT_ITEM_COUNT];
|
||||
PotionBeltItem_Struct Items[EQEmu::profile::POTION_BELT_SIZE];
|
||||
};
|
||||
|
||||
struct MovePotionToBelt_Struct
|
||||
@@ -1049,7 +1049,7 @@ struct PlayerProfile_Struct
|
||||
/*7212*/ uint32 tribute_points;
|
||||
/*7216*/ uint32 unknown7252;
|
||||
/*7220*/ uint32 tribute_active; //1=active
|
||||
/*7224*/ Tribute_Struct tributes[EQEmu::legacy::TRIBUTE_SIZE];
|
||||
/*7224*/ Tribute_Struct tributes[EQEmu::invtype::TRIBUTE_SIZE];
|
||||
/*7264*/ Disciplines_Struct disciplines;
|
||||
/*7664*/ uint32 recastTimers[MAX_RECAST_TYPES]; // Timers (GMT of last use)
|
||||
/*7744*/ char unknown7780[160];
|
||||
@@ -1076,7 +1076,7 @@ struct PlayerProfile_Struct
|
||||
/*12800*/ uint32 expAA;
|
||||
/*12804*/ uint32 aapoints; //avaliable, unspent
|
||||
/*12808*/ uint8 unknown12844[36];
|
||||
/*12844*/ Bandolier_Struct bandoliers[EQEmu::legacy::BANDOLIERS_SIZE];
|
||||
/*12844*/ Bandolier_Struct bandoliers[EQEmu::profile::BANDOLIERS_SIZE];
|
||||
/*14124*/ uint8 unknown14160[4506];
|
||||
/*18630*/ SuspendedMinion_Struct SuspendedMinion; // No longer in use
|
||||
/*19240*/ uint32 timeentitledonaccount;
|
||||
@@ -1783,6 +1783,15 @@ struct CombatAbility_Struct {
|
||||
uint32 m_skill;
|
||||
};
|
||||
|
||||
// Disarm Struct incoming from Client [Size: 16]
|
||||
struct Disarm_Struct
|
||||
{
|
||||
uint32 source;
|
||||
uint32 target;
|
||||
uint32 skill;
|
||||
uint32 unknown;
|
||||
};
|
||||
|
||||
//Instill Doubt
|
||||
struct Instill_Doubt_Struct {
|
||||
uint8 i_id;
|
||||
@@ -3449,8 +3458,8 @@ struct SelectTributeReply_Struct {
|
||||
|
||||
struct TributeInfo_Struct {
|
||||
uint32 active; //0 == inactive, 1 == active
|
||||
uint32 tributes[EQEmu::legacy::TRIBUTE_SIZE]; //-1 == NONE
|
||||
uint32 tiers[EQEmu::legacy::TRIBUTE_SIZE]; //all 00's
|
||||
uint32 tributes[EQEmu::invtype::TRIBUTE_SIZE]; //-1 == NONE
|
||||
uint32 tiers[EQEmu::invtype::TRIBUTE_SIZE]; //all 00's
|
||||
uint32 tribute_master_id;
|
||||
};
|
||||
|
||||
@@ -3782,7 +3791,7 @@ struct AcceptNewTask_Struct {
|
||||
//was all 0's from client, server replied with same op, all 0's
|
||||
struct CancelTask_Struct {
|
||||
uint32 SequenceNumber;
|
||||
uint32 unknown4; // Only seen 0x00000002
|
||||
uint32 type; // Only seen 0x00000002
|
||||
};
|
||||
|
||||
#if 0
|
||||
@@ -3836,28 +3845,28 @@ struct AvailableTaskTrailer_Struct {
|
||||
struct TaskDescriptionHeader_Struct {
|
||||
uint32 SequenceNumber; // The order the tasks appear in the journal. 0 for first task, 1 for second, etc.
|
||||
uint32 TaskID;
|
||||
uint32 unknown2;
|
||||
uint32 unknown3;
|
||||
uint8 unknown4;
|
||||
uint8 open_window;
|
||||
uint32 task_type;
|
||||
uint32 reward_type; // if this != 4 says Ebon Crystals else Radiant Crystals
|
||||
};
|
||||
|
||||
struct TaskDescriptionData1_Struct {
|
||||
uint32 Duration;
|
||||
uint32 unknown2;
|
||||
uint32 dur_code; // if Duration == 0
|
||||
uint32 StartTime;
|
||||
};
|
||||
|
||||
struct TaskDescriptionData2_Struct {
|
||||
uint32 RewardCount; // ??
|
||||
uint32 unknown1;
|
||||
uint32 unknown2;
|
||||
uint16 unknown3;
|
||||
//uint8 unknown4;
|
||||
uint8 has_rewards;
|
||||
uint32 coin_reward;
|
||||
uint32 xp_reward;
|
||||
uint32 faction_reward;
|
||||
};
|
||||
|
||||
struct TaskDescriptionTrailer_Struct {
|
||||
//uint16 unknown1; // 0x0012
|
||||
uint32 Points;
|
||||
uint8 has_reward_selection; // uses newer reward selection window, not in all clients
|
||||
};
|
||||
|
||||
struct TaskActivityHeader_Struct {
|
||||
@@ -3897,11 +3906,11 @@ struct TaskActivityShort_Struct {
|
||||
|
||||
struct TaskActivityComplete_Struct {
|
||||
uint32 TaskIndex;
|
||||
uint32 unknown2; // 0x00000002
|
||||
uint32 unknown3;
|
||||
uint32 TaskType; // task, shared task, quest
|
||||
uint32 TaskID; // must match
|
||||
uint32 ActivityID;
|
||||
uint32 unknown4; // 0x00000001
|
||||
uint32 unknown5; // 0x00000001
|
||||
uint32 task_completed; // Broadcasts "Task '%1' Completed" it not 0 and "Task '%1' Failed." if 0
|
||||
uint32 stage_complete; // Broadcasts "Task Stage Completed"
|
||||
};
|
||||
|
||||
#if 0
|
||||
@@ -5302,7 +5311,7 @@ struct MercenaryMerchantResponse_Struct {
|
||||
struct ServerLootItem_Struct {
|
||||
uint32 item_id; // uint32 item_id;
|
||||
int16 equip_slot; // int16 equip_slot;
|
||||
uint16 charges; // uint8 charges;
|
||||
uint16 charges; // uint8 charges;
|
||||
uint16 lootslot; // uint16 lootslot;
|
||||
uint32 aug_1; // uint32 aug_1;
|
||||
uint32 aug_2; // uint32 aug_2;
|
||||
@@ -5330,7 +5339,7 @@ struct ClientMarqueeMessage_Struct {
|
||||
uint32 fade_out_time; //The fade out time, in ms
|
||||
uint32 duration; //in ms
|
||||
char msg[1]; //message plus null terminator
|
||||
|
||||
|
||||
};
|
||||
|
||||
typedef std::list<ServerLootItem_Struct*> ItemList;
|
||||
|
||||
@@ -90,6 +90,7 @@ enum LogCategory {
|
||||
FixZ,
|
||||
Food,
|
||||
Traps,
|
||||
NPCRoamBox,
|
||||
MaxCategoryID /* Don't Remove this*/
|
||||
};
|
||||
|
||||
@@ -144,7 +145,8 @@ static const char* LogCategoryName[LogCategory::MaxCategoryID] = {
|
||||
"HP Update",
|
||||
"FixZ",
|
||||
"Food",
|
||||
"Traps"
|
||||
"Traps",
|
||||
"NPC Roam Box"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+150
-135
@@ -119,6 +119,21 @@ EQEmu::InventoryProfile::~InventoryProfile()
|
||||
m_trade.clear();
|
||||
}
|
||||
|
||||
bool EQEmu::InventoryProfile::SetInventoryVersion(versions::MobVersion inventory_version) {
|
||||
if (!m_mob_version_set) {
|
||||
m_mob_version = versions::ValidateMobVersion(inventory_version);
|
||||
m_lookup = inventory::Lookup(m_mob_version);
|
||||
m_mob_version_set = true;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
m_lookup = inventory::Lookup(versions::MobVersion::Unknown);
|
||||
Log(Logs::General, Logs::Error, "InventoryVersion set request after initial set (old: %u, new: %u)",
|
||||
static_cast<uint32>(m_mob_version), static_cast<uint32>(inventory_version));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void EQEmu::InventoryProfile::CleanDirty() {
|
||||
auto iter = dirty_inst.begin();
|
||||
while (iter != dirty_inst.end()) {
|
||||
@@ -140,63 +155,63 @@ EQEmu::ItemInstance* EQEmu::InventoryProfile::GetItem(int16 slot_id) const
|
||||
ItemInstance* result = nullptr;
|
||||
|
||||
// Cursor
|
||||
if (slot_id == inventory::slotCursor) {
|
||||
if (slot_id == invslot::slotCursor) {
|
||||
// Cursor slot
|
||||
result = m_cursor.peek_front();
|
||||
}
|
||||
|
||||
// Non bag slots
|
||||
else if (slot_id >= legacy::TRADE_BEGIN && slot_id <= legacy::TRADE_END) {
|
||||
else if (slot_id >= invslot::TRADE_BEGIN && slot_id <= invslot::TRADE_END) {
|
||||
result = _GetItem(m_trade, slot_id);
|
||||
}
|
||||
else if (slot_id >= legacy::SHARED_BANK_BEGIN && slot_id <= legacy::SHARED_BANK_END) {
|
||||
else if (slot_id >= invslot::SHARED_BANK_BEGIN && slot_id <= invslot::SHARED_BANK_END) {
|
||||
// Shared Bank slots
|
||||
result = _GetItem(m_shbank, slot_id);
|
||||
}
|
||||
else if (slot_id >= legacy::BANK_BEGIN && slot_id <= legacy::BANK_END) {
|
||||
else if (slot_id >= invslot::BANK_BEGIN && slot_id <= invslot::BANK_END) {
|
||||
// Bank slots
|
||||
result = _GetItem(m_bank, slot_id);
|
||||
}
|
||||
else if ((slot_id >= legacy::GENERAL_BEGIN && slot_id <= legacy::GENERAL_END)) {
|
||||
else if ((slot_id >= invslot::GENERAL_BEGIN && slot_id <= invslot::GENERAL_END)) {
|
||||
// Personal inventory slots
|
||||
result = _GetItem(m_inv, slot_id);
|
||||
}
|
||||
else if ((slot_id >= legacy::EQUIPMENT_BEGIN && slot_id <= legacy::EQUIPMENT_END) ||
|
||||
(slot_id >= legacy::TRIBUTE_BEGIN && slot_id <= legacy::TRIBUTE_END) || (slot_id == inventory::slotPowerSource)) {
|
||||
else if ((slot_id >= invslot::EQUIPMENT_BEGIN && slot_id <= invslot::EQUIPMENT_END) ||
|
||||
(slot_id >= invslot::TRIBUTE_BEGIN && slot_id <= invslot::TRIBUTE_END) || (slot_id == invslot::SLOT_POWER_SOURCE)) {
|
||||
// Equippable slots (on body)
|
||||
result = _GetItem(m_worn, slot_id);
|
||||
}
|
||||
|
||||
// Inner bag slots
|
||||
else if (slot_id >= legacy::TRADE_BAGS_BEGIN && slot_id <= legacy::TRADE_BAGS_END) {
|
||||
else if (slot_id >= invbag::TRADE_BAGS_BEGIN && slot_id <= invbag::TRADE_BAGS_END) {
|
||||
// Trade bag slots
|
||||
ItemInstance* inst = _GetItem(m_trade, InventoryProfile::CalcSlotId(slot_id));
|
||||
if (inst && inst->IsClassBag()) {
|
||||
result = inst->GetItem(InventoryProfile::CalcBagIdx(slot_id));
|
||||
}
|
||||
}
|
||||
else if (slot_id >= legacy::SHARED_BANK_BAGS_BEGIN && slot_id <= legacy::SHARED_BANK_BAGS_END) {
|
||||
else if (slot_id >= invbag::SHARED_BANK_BAGS_BEGIN && slot_id <= invbag::SHARED_BANK_BAGS_END) {
|
||||
// Shared Bank bag slots
|
||||
ItemInstance* inst = _GetItem(m_shbank, InventoryProfile::CalcSlotId(slot_id));
|
||||
if (inst && inst->IsClassBag()) {
|
||||
result = inst->GetItem(InventoryProfile::CalcBagIdx(slot_id));
|
||||
}
|
||||
}
|
||||
else if (slot_id >= legacy::BANK_BAGS_BEGIN && slot_id <= legacy::BANK_BAGS_END) {
|
||||
else if (slot_id >= invbag::BANK_BAGS_BEGIN && slot_id <= invbag::BANK_BAGS_END) {
|
||||
// Bank bag slots
|
||||
ItemInstance* inst = _GetItem(m_bank, InventoryProfile::CalcSlotId(slot_id));
|
||||
if (inst && inst->IsClassBag()) {
|
||||
result = inst->GetItem(InventoryProfile::CalcBagIdx(slot_id));
|
||||
}
|
||||
}
|
||||
else if (slot_id >= legacy::CURSOR_BAG_BEGIN && slot_id <= legacy::CURSOR_BAG_END) {
|
||||
else if (slot_id >= invbag::CURSOR_BAG_BEGIN && slot_id <= invbag::CURSOR_BAG_END) {
|
||||
// Cursor bag slots
|
||||
ItemInstance* inst = m_cursor.peek_front();
|
||||
if (inst && inst->IsClassBag()) {
|
||||
result = inst->GetItem(InventoryProfile::CalcBagIdx(slot_id));
|
||||
}
|
||||
}
|
||||
else if (slot_id >= legacy::GENERAL_BAGS_BEGIN && slot_id <= legacy::GENERAL_BAGS_END) {
|
||||
else if (slot_id >= invbag::GENERAL_BAGS_BEGIN && slot_id <= invbag::GENERAL_BAGS_END) {
|
||||
// Personal inventory bag slots
|
||||
ItemInstance* inst = _GetItem(m_inv, InventoryProfile::CalcSlotId(slot_id));
|
||||
if (inst && inst->IsClassBag()) {
|
||||
@@ -232,7 +247,7 @@ int16 EQEmu::InventoryProfile::PutItem(int16 slot_id, const ItemInstance& inst)
|
||||
int16 EQEmu::InventoryProfile::PushCursor(const ItemInstance& inst)
|
||||
{
|
||||
m_cursor.push(inst.Clone());
|
||||
return inventory::slotCursor;
|
||||
return invslot::slotCursor;
|
||||
}
|
||||
|
||||
EQEmu::ItemInstance* EQEmu::InventoryProfile::GetCursorItem()
|
||||
@@ -254,7 +269,7 @@ bool EQEmu::InventoryProfile::SwapItem(int16 slot_a, int16 slot_b, SwapItemFailS
|
||||
fail_state = swapNotAllowed;
|
||||
return false;
|
||||
}
|
||||
if ((slot_b >= legacy::EQUIPMENT_BEGIN && slot_b <= legacy::EQUIPMENT_END) || slot_b == inventory::slotPowerSource) {
|
||||
if ((slot_b >= invslot::EQUIPMENT_BEGIN && slot_b <= invslot::EQUIPMENT_END) || slot_b == invslot::SLOT_POWER_SOURCE) {
|
||||
auto item_a = inst_a->GetItem();
|
||||
if (!item_a) {
|
||||
fail_state = swapNullData;
|
||||
@@ -280,7 +295,7 @@ bool EQEmu::InventoryProfile::SwapItem(int16 slot_a, int16 slot_b, SwapItemFailS
|
||||
fail_state = swapNotAllowed;
|
||||
return false;
|
||||
}
|
||||
if ((slot_a >= legacy::EQUIPMENT_BEGIN && slot_a <= legacy::EQUIPMENT_END) || slot_a == inventory::slotPowerSource) {
|
||||
if ((slot_a >= invslot::EQUIPMENT_BEGIN && slot_a <= invslot::EQUIPMENT_END) || slot_a == invslot::SLOT_POWER_SOURCE) {
|
||||
auto item_b = inst_b->GetItem();
|
||||
if (!item_b) {
|
||||
fail_state = swapNullData;
|
||||
@@ -361,30 +376,30 @@ EQEmu::ItemInstance* EQEmu::InventoryProfile::PopItem(int16 slot_id)
|
||||
{
|
||||
ItemInstance* p = nullptr;
|
||||
|
||||
if (slot_id == inventory::slotCursor) {
|
||||
if (slot_id == invslot::slotCursor) {
|
||||
p = m_cursor.pop();
|
||||
}
|
||||
else if ((slot_id >= legacy::EQUIPMENT_BEGIN && slot_id <= legacy::EQUIPMENT_END) || (slot_id == inventory::slotPowerSource)) {
|
||||
else if ((slot_id >= invslot::EQUIPMENT_BEGIN && slot_id <= invslot::EQUIPMENT_END) || (slot_id == invslot::SLOT_POWER_SOURCE)) {
|
||||
p = m_worn[slot_id];
|
||||
m_worn.erase(slot_id);
|
||||
}
|
||||
else if ((slot_id >= legacy::GENERAL_BEGIN && slot_id <= legacy::GENERAL_END)) {
|
||||
else if ((slot_id >= invslot::GENERAL_BEGIN && slot_id <= invslot::GENERAL_END)) {
|
||||
p = m_inv[slot_id];
|
||||
m_inv.erase(slot_id);
|
||||
}
|
||||
else if (slot_id >= legacy::TRIBUTE_BEGIN && slot_id <= legacy::TRIBUTE_END) {
|
||||
else if (slot_id >= invslot::TRIBUTE_BEGIN && slot_id <= invslot::TRIBUTE_END) {
|
||||
p = m_worn[slot_id];
|
||||
m_worn.erase(slot_id);
|
||||
}
|
||||
else if (slot_id >= legacy::BANK_BEGIN && slot_id <= legacy::BANK_END) {
|
||||
else if (slot_id >= invslot::BANK_BEGIN && slot_id <= invslot::BANK_END) {
|
||||
p = m_bank[slot_id];
|
||||
m_bank.erase(slot_id);
|
||||
}
|
||||
else if (slot_id >= legacy::SHARED_BANK_BEGIN && slot_id <= legacy::SHARED_BANK_END) {
|
||||
else if (slot_id >= invslot::SHARED_BANK_BEGIN && slot_id <= invslot::SHARED_BANK_END) {
|
||||
p = m_shbank[slot_id];
|
||||
m_shbank.erase(slot_id);
|
||||
}
|
||||
else if (slot_id >= legacy::TRADE_BEGIN && slot_id <= legacy::TRADE_END) {
|
||||
else if (slot_id >= invslot::TRADE_BEGIN && slot_id <= invslot::TRADE_END) {
|
||||
p = m_trade[slot_id];
|
||||
m_trade.erase(slot_id);
|
||||
}
|
||||
@@ -404,7 +419,7 @@ bool EQEmu::InventoryProfile::HasSpaceForItem(const ItemData *ItemToTry, int16 Q
|
||||
|
||||
if (ItemToTry->Stackable) {
|
||||
|
||||
for (int16 i = legacy::GENERAL_BEGIN; i <= legacy::GENERAL_END; i++) {
|
||||
for (int16 i = invslot::GENERAL_BEGIN; i <= invslot::GENERAL_END; i++) {
|
||||
|
||||
ItemInstance* InvItem = GetItem(i);
|
||||
|
||||
@@ -420,9 +435,9 @@ bool EQEmu::InventoryProfile::HasSpaceForItem(const ItemData *ItemToTry, int16 Q
|
||||
}
|
||||
if (InvItem && InvItem->IsClassBag()) {
|
||||
|
||||
int16 BaseSlotID = InventoryProfile::CalcSlotId(i, inventory::containerBegin);
|
||||
int16 BaseSlotID = InventoryProfile::CalcSlotId(i, invbag::SLOT_BEGIN);
|
||||
uint8 BagSize = InvItem->GetItem()->BagSlots;
|
||||
for (uint8 BagSlot = inventory::containerBegin; BagSlot < BagSize; BagSlot++) {
|
||||
for (uint8 BagSlot = invbag::SLOT_BEGIN; BagSlot < BagSize; BagSlot++) {
|
||||
|
||||
InvItem = GetItem(BaseSlotID + BagSlot);
|
||||
|
||||
@@ -441,7 +456,7 @@ bool EQEmu::InventoryProfile::HasSpaceForItem(const ItemData *ItemToTry, int16 Q
|
||||
}
|
||||
}
|
||||
|
||||
for (int16 i = legacy::GENERAL_BEGIN; i <= legacy::GENERAL_END; i++) {
|
||||
for (int16 i = invslot::GENERAL_BEGIN; i <= invslot::GENERAL_END; i++) {
|
||||
|
||||
ItemInstance* InvItem = GetItem(i);
|
||||
|
||||
@@ -464,11 +479,11 @@ bool EQEmu::InventoryProfile::HasSpaceForItem(const ItemData *ItemToTry, int16 Q
|
||||
}
|
||||
else if (InvItem->IsClassBag() && CanItemFitInContainer(ItemToTry, InvItem->GetItem())) {
|
||||
|
||||
int16 BaseSlotID = InventoryProfile::CalcSlotId(i, inventory::containerBegin);
|
||||
int16 BaseSlotID = InventoryProfile::CalcSlotId(i, invbag::SLOT_BEGIN);
|
||||
|
||||
uint8 BagSize = InvItem->GetItem()->BagSlots;
|
||||
|
||||
for (uint8 BagSlot = inventory::containerBegin; BagSlot<BagSize; BagSlot++) {
|
||||
for (uint8 BagSlot = invbag::SLOT_BEGIN; BagSlot<BagSize; BagSlot++) {
|
||||
|
||||
InvItem = GetItem(BaseSlotID + BagSlot);
|
||||
|
||||
@@ -647,14 +662,14 @@ int16 EQEmu::InventoryProfile::HasItemByLoreGroup(uint32 loregroup, uint8 where)
|
||||
int16 EQEmu::InventoryProfile::FindFreeSlot(bool for_bag, bool try_cursor, uint8 min_size, bool is_arrow)
|
||||
{
|
||||
// Check basic inventory
|
||||
for (int16 i = legacy::GENERAL_BEGIN; i <= legacy::GENERAL_END; i++) {
|
||||
for (int16 i = invslot::GENERAL_BEGIN; i <= invslot::GENERAL_END; i++) {
|
||||
if (!GetItem(i))
|
||||
// Found available slot in personal inventory
|
||||
return i;
|
||||
}
|
||||
|
||||
if (!for_bag) {
|
||||
for (int16 i = legacy::GENERAL_BEGIN; i <= legacy::GENERAL_END; i++) {
|
||||
for (int16 i = invslot::GENERAL_BEGIN; i <= invslot::GENERAL_END; i++) {
|
||||
const ItemInstance* inst = GetItem(i);
|
||||
if (inst && inst->IsClassBag() && inst->GetItem()->BagSize >= min_size)
|
||||
{
|
||||
@@ -663,11 +678,11 @@ int16 EQEmu::InventoryProfile::FindFreeSlot(bool for_bag, bool try_cursor, uint8
|
||||
continue;
|
||||
}
|
||||
|
||||
int16 base_slot_id = InventoryProfile::CalcSlotId(i, inventory::containerBegin);
|
||||
int16 base_slot_id = InventoryProfile::CalcSlotId(i, invbag::SLOT_BEGIN);
|
||||
|
||||
uint8 slots = inst->GetItem()->BagSlots;
|
||||
uint8 j;
|
||||
for (j = inventory::containerBegin; j<slots; j++) {
|
||||
for (j = invbag::SLOT_BEGIN; j<slots; j++) {
|
||||
if (!GetItem(base_slot_id + j)) {
|
||||
// Found available slot within bag
|
||||
return (base_slot_id + j);
|
||||
@@ -680,7 +695,7 @@ int16 EQEmu::InventoryProfile::FindFreeSlot(bool for_bag, bool try_cursor, uint8
|
||||
if (try_cursor) {
|
||||
// Always room on cursor (it's a queue)
|
||||
// (we may wish to cap this in the future)
|
||||
return inventory::slotCursor;
|
||||
return invslot::slotCursor;
|
||||
}
|
||||
|
||||
// No available slots
|
||||
@@ -694,9 +709,9 @@ int16 EQEmu::InventoryProfile::FindFreeSlotForTradeItem(const ItemInstance* inst
|
||||
//
|
||||
// I'll probably implement a bitmask in the new inventory system to avoid having to adjust stack bias
|
||||
|
||||
if ((general_start < legacy::GENERAL_BEGIN) || (general_start > legacy::GENERAL_END))
|
||||
if ((general_start < invslot::GENERAL_BEGIN) || (general_start > invslot::GENERAL_END))
|
||||
return INVALID_INDEX;
|
||||
if (bag_start >= inventory::ContainerCount)
|
||||
if (bag_start > invbag::SLOT_END)
|
||||
return INVALID_INDEX;
|
||||
|
||||
if (!inst || !inst->GetID())
|
||||
@@ -704,17 +719,17 @@ int16 EQEmu::InventoryProfile::FindFreeSlotForTradeItem(const ItemInstance* inst
|
||||
|
||||
// step 1: find room for bags (caller should really ask for slots for bags first to avoid sending them to cursor..and bag item loss)
|
||||
if (inst->IsClassBag()) {
|
||||
for (int16 free_slot = general_start; free_slot <= legacy::GENERAL_END; ++free_slot) {
|
||||
for (int16 free_slot = general_start; free_slot <= invslot::GENERAL_END; ++free_slot) {
|
||||
if (!m_inv[free_slot])
|
||||
return free_slot;
|
||||
}
|
||||
|
||||
return inventory::slotCursor; // return cursor since bags do not stack and will not fit inside other bags..yet...)
|
||||
return invslot::slotCursor; // return cursor since bags do not stack and will not fit inside other bags..yet...)
|
||||
}
|
||||
|
||||
// step 2: find partial room for stackables
|
||||
if (inst->IsStackable()) {
|
||||
for (int16 free_slot = general_start; free_slot <= legacy::GENERAL_END; ++free_slot) {
|
||||
for (int16 free_slot = general_start; free_slot <= invslot::GENERAL_END; ++free_slot) {
|
||||
const ItemInstance* main_inst = m_inv[free_slot];
|
||||
|
||||
if (!main_inst)
|
||||
@@ -724,15 +739,15 @@ int16 EQEmu::InventoryProfile::FindFreeSlotForTradeItem(const ItemInstance* inst
|
||||
return free_slot;
|
||||
}
|
||||
|
||||
for (int16 free_slot = general_start; free_slot <= legacy::GENERAL_END; ++free_slot) {
|
||||
for (int16 free_slot = general_start; free_slot <= invslot::GENERAL_END; ++free_slot) {
|
||||
const ItemInstance* main_inst = m_inv[free_slot];
|
||||
|
||||
if (!main_inst)
|
||||
continue;
|
||||
|
||||
if (main_inst->IsClassBag()) { // if item-specific containers already have bad items, we won't fix it here...
|
||||
uint8 _bag_start = (free_slot > general_start) ? inventory::containerBegin : bag_start;
|
||||
for (uint8 free_bag_slot = _bag_start; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < inventory::ContainerCount); ++free_bag_slot) {
|
||||
uint8 _bag_start = (free_slot > general_start) ? invbag::SLOT_BEGIN : bag_start;
|
||||
for (uint8 free_bag_slot = _bag_start; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot <= invbag::SLOT_END); ++free_bag_slot) {
|
||||
const ItemInstance* sub_inst = main_inst->GetItem(free_bag_slot);
|
||||
|
||||
if (!sub_inst)
|
||||
@@ -747,14 +762,14 @@ int16 EQEmu::InventoryProfile::FindFreeSlotForTradeItem(const ItemInstance* inst
|
||||
|
||||
// step 3a: find room for container-specific items (ItemClassArrow)
|
||||
if (inst->GetItem()->ItemType == item::ItemTypeArrow) {
|
||||
for (int16 free_slot = general_start; free_slot <= legacy::GENERAL_END; ++free_slot) {
|
||||
for (int16 free_slot = general_start; free_slot <= invslot::GENERAL_END; ++free_slot) {
|
||||
const ItemInstance* main_inst = m_inv[free_slot];
|
||||
|
||||
if (!main_inst || (main_inst->GetItem()->BagType != item::BagTypeQuiver) || !main_inst->IsClassBag())
|
||||
continue;
|
||||
|
||||
uint8 _bag_start = (free_slot > general_start) ? inventory::containerBegin : bag_start;
|
||||
for (uint8 free_bag_slot = _bag_start; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < inventory::ContainerCount); ++free_bag_slot) {
|
||||
uint8 _bag_start = (free_slot > general_start) ? invbag::SLOT_BEGIN : bag_start;
|
||||
for (uint8 free_bag_slot = _bag_start; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot <= invbag::SLOT_END); ++free_bag_slot) {
|
||||
if (!main_inst->GetItem(free_bag_slot))
|
||||
return InventoryProfile::CalcSlotId(free_slot, free_bag_slot);
|
||||
}
|
||||
@@ -763,14 +778,14 @@ int16 EQEmu::InventoryProfile::FindFreeSlotForTradeItem(const ItemInstance* inst
|
||||
|
||||
// step 3b: find room for container-specific items (ItemClassSmallThrowing)
|
||||
if (inst->GetItem()->ItemType == item::ItemTypeSmallThrowing) {
|
||||
for (int16 free_slot = general_start; free_slot <= legacy::GENERAL_END; ++free_slot) {
|
||||
for (int16 free_slot = general_start; free_slot <= invslot::GENERAL_END; ++free_slot) {
|
||||
const ItemInstance* main_inst = m_inv[free_slot];
|
||||
|
||||
if (!main_inst || (main_inst->GetItem()->BagType != item::BagTypeBandolier) || !main_inst->IsClassBag())
|
||||
continue;
|
||||
|
||||
uint8 _bag_start = (free_slot > general_start) ? inventory::containerBegin : bag_start;
|
||||
for (uint8 free_bag_slot = _bag_start; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < inventory::ContainerCount); ++free_bag_slot) {
|
||||
uint8 _bag_start = (free_slot > general_start) ? invbag::SLOT_BEGIN : bag_start;
|
||||
for (uint8 free_bag_slot = _bag_start; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot <= invbag::SLOT_END); ++free_bag_slot) {
|
||||
if (!main_inst->GetItem(free_bag_slot))
|
||||
return InventoryProfile::CalcSlotId(free_slot, free_bag_slot);
|
||||
}
|
||||
@@ -778,22 +793,22 @@ int16 EQEmu::InventoryProfile::FindFreeSlotForTradeItem(const ItemInstance* inst
|
||||
}
|
||||
|
||||
// step 4: just find an empty slot
|
||||
for (int16 free_slot = general_start; free_slot <= legacy::GENERAL_END; ++free_slot) {
|
||||
for (int16 free_slot = general_start; free_slot <= invslot::GENERAL_END; ++free_slot) {
|
||||
const ItemInstance* main_inst = m_inv[free_slot];
|
||||
|
||||
if (!main_inst)
|
||||
return free_slot;
|
||||
}
|
||||
|
||||
for (int16 free_slot = general_start; free_slot <= legacy::GENERAL_END; ++free_slot) {
|
||||
for (int16 free_slot = general_start; free_slot <= invslot::GENERAL_END; ++free_slot) {
|
||||
const ItemInstance* main_inst = m_inv[free_slot];
|
||||
|
||||
if (main_inst && main_inst->IsClassBag()) {
|
||||
if ((main_inst->GetItem()->BagSize < inst->GetItem()->Size) || (main_inst->GetItem()->BagType == item::BagTypeBandolier) || (main_inst->GetItem()->BagType == item::BagTypeQuiver))
|
||||
continue;
|
||||
|
||||
uint8 _bag_start = (free_slot > general_start) ? inventory::containerBegin : bag_start;
|
||||
for (uint8 free_bag_slot = _bag_start; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < inventory::ContainerCount); ++free_bag_slot) {
|
||||
uint8 _bag_start = (free_slot > general_start) ? invbag::SLOT_BEGIN : bag_start;
|
||||
for (uint8 free_bag_slot = _bag_start; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot <= invbag::SLOT_END); ++free_bag_slot) {
|
||||
if (!main_inst->GetItem(free_bag_slot))
|
||||
return InventoryProfile::CalcSlotId(free_slot, free_bag_slot);
|
||||
}
|
||||
@@ -801,7 +816,7 @@ int16 EQEmu::InventoryProfile::FindFreeSlotForTradeItem(const ItemInstance* inst
|
||||
}
|
||||
|
||||
//return INVALID_INDEX; // everything else pushes to the cursor
|
||||
return inventory::slotCursor;
|
||||
return invslot::slotCursor;
|
||||
}
|
||||
|
||||
// Opposite of below: Get parent bag slot_id from a slot inside of bag
|
||||
@@ -813,20 +828,20 @@ int16 EQEmu::InventoryProfile::CalcSlotId(int16 slot_id) {
|
||||
// parent_slot_id = EmuConstants::BANK_BEGIN + (slot_id - EmuConstants::BANK_BEGIN) / EmuConstants::ITEM_CONTAINER_SIZE;
|
||||
//else if (slot_id >= 3100 && slot_id <= 3179) should be {3031..3110}..where did this range come from!!? (verified db save range)
|
||||
|
||||
if (slot_id >= legacy::GENERAL_BAGS_BEGIN && slot_id <= legacy::GENERAL_BAGS_END) {
|
||||
parent_slot_id = legacy::GENERAL_BEGIN + (slot_id - legacy::GENERAL_BAGS_BEGIN) / inventory::ContainerCount;
|
||||
if (slot_id >= invbag::GENERAL_BAGS_BEGIN && slot_id <= invbag::GENERAL_BAGS_END) {
|
||||
parent_slot_id = invslot::GENERAL_BEGIN + (slot_id - invbag::GENERAL_BAGS_BEGIN) / invbag::SLOT_COUNT;
|
||||
}
|
||||
else if (slot_id >= legacy::CURSOR_BAG_BEGIN && slot_id <= legacy::CURSOR_BAG_END) {
|
||||
parent_slot_id = inventory::slotCursor;
|
||||
else if (slot_id >= invbag::CURSOR_BAG_BEGIN && slot_id <= invbag::CURSOR_BAG_END) {
|
||||
parent_slot_id = invslot::slotCursor;
|
||||
}
|
||||
else if (slot_id >= legacy::BANK_BAGS_BEGIN && slot_id <= legacy::BANK_BAGS_END) {
|
||||
parent_slot_id = legacy::BANK_BEGIN + (slot_id - legacy::BANK_BAGS_BEGIN) / inventory::ContainerCount;
|
||||
else if (slot_id >= invbag::BANK_BAGS_BEGIN && slot_id <= invbag::BANK_BAGS_END) {
|
||||
parent_slot_id = invslot::BANK_BEGIN + (slot_id - invbag::BANK_BAGS_BEGIN) / invbag::SLOT_COUNT;
|
||||
}
|
||||
else if (slot_id >= legacy::SHARED_BANK_BAGS_BEGIN && slot_id <= legacy::SHARED_BANK_BAGS_END) {
|
||||
parent_slot_id = legacy::SHARED_BANK_BEGIN + (slot_id - legacy::SHARED_BANK_BAGS_BEGIN) / inventory::ContainerCount;
|
||||
else if (slot_id >= invbag::SHARED_BANK_BAGS_BEGIN && slot_id <= invbag::SHARED_BANK_BAGS_END) {
|
||||
parent_slot_id = invslot::SHARED_BANK_BEGIN + (slot_id - invbag::SHARED_BANK_BAGS_BEGIN) / invbag::SLOT_COUNT;
|
||||
}
|
||||
else if (slot_id >= legacy::TRADE_BAGS_BEGIN && slot_id <= legacy::TRADE_BAGS_END) {
|
||||
parent_slot_id = legacy::TRADE_BEGIN + (slot_id - legacy::TRADE_BAGS_BEGIN) / inventory::ContainerCount;
|
||||
else if (slot_id >= invbag::TRADE_BAGS_BEGIN && slot_id <= invbag::TRADE_BAGS_END) {
|
||||
parent_slot_id = invslot::TRADE_BEGIN + (slot_id - invbag::TRADE_BAGS_BEGIN) / invbag::SLOT_COUNT;
|
||||
}
|
||||
|
||||
return parent_slot_id;
|
||||
@@ -839,20 +854,20 @@ int16 EQEmu::InventoryProfile::CalcSlotId(int16 bagslot_id, uint8 bagidx) {
|
||||
|
||||
int16 slot_id = INVALID_INDEX;
|
||||
|
||||
if (bagslot_id == inventory::slotCursor || bagslot_id == 8000) {
|
||||
slot_id = legacy::CURSOR_BAG_BEGIN + bagidx;
|
||||
if (bagslot_id == invslot::slotCursor || bagslot_id == 8000) {
|
||||
slot_id = invbag::CURSOR_BAG_BEGIN + bagidx;
|
||||
}
|
||||
else if (bagslot_id >= legacy::GENERAL_BEGIN && bagslot_id <= legacy::GENERAL_END) {
|
||||
slot_id = legacy::GENERAL_BAGS_BEGIN + (bagslot_id - legacy::GENERAL_BEGIN) * inventory::ContainerCount + bagidx;
|
||||
else if (bagslot_id >= invslot::GENERAL_BEGIN && bagslot_id <= invslot::GENERAL_END) {
|
||||
slot_id = invbag::GENERAL_BAGS_BEGIN + (bagslot_id - invslot::GENERAL_BEGIN) * invbag::SLOT_COUNT + bagidx;
|
||||
}
|
||||
else if (bagslot_id >= legacy::BANK_BEGIN && bagslot_id <= legacy::BANK_END) {
|
||||
slot_id = legacy::BANK_BAGS_BEGIN + (bagslot_id - legacy::BANK_BEGIN) * inventory::ContainerCount + bagidx;
|
||||
else if (bagslot_id >= invslot::BANK_BEGIN && bagslot_id <= invslot::BANK_END) {
|
||||
slot_id = invbag::BANK_BAGS_BEGIN + (bagslot_id - invslot::BANK_BEGIN) * invbag::SLOT_COUNT + bagidx;
|
||||
}
|
||||
else if (bagslot_id >= legacy::SHARED_BANK_BEGIN && bagslot_id <= legacy::SHARED_BANK_END) {
|
||||
slot_id = legacy::SHARED_BANK_BAGS_BEGIN + (bagslot_id - legacy::SHARED_BANK_BEGIN) * inventory::ContainerCount + bagidx;
|
||||
else if (bagslot_id >= invslot::SHARED_BANK_BEGIN && bagslot_id <= invslot::SHARED_BANK_END) {
|
||||
slot_id = invbag::SHARED_BANK_BAGS_BEGIN + (bagslot_id - invslot::SHARED_BANK_BEGIN) * invbag::SLOT_COUNT + bagidx;
|
||||
}
|
||||
else if (bagslot_id >= legacy::TRADE_BEGIN && bagslot_id <= legacy::TRADE_END) {
|
||||
slot_id = legacy::TRADE_BAGS_BEGIN + (bagslot_id - legacy::TRADE_BEGIN) * inventory::ContainerCount + bagidx;
|
||||
else if (bagslot_id >= invslot::TRADE_BEGIN && bagslot_id <= invslot::TRADE_END) {
|
||||
slot_id = invbag::TRADE_BAGS_BEGIN + (bagslot_id - invslot::TRADE_BEGIN) * invbag::SLOT_COUNT + bagidx;
|
||||
}
|
||||
|
||||
return slot_id;
|
||||
@@ -865,23 +880,23 @@ uint8 EQEmu::InventoryProfile::CalcBagIdx(int16 slot_id) {
|
||||
//else if (slot_id >= EmuConstants::BANK_BEGIN && slot_id <= EmuConstants::BANK_END)
|
||||
// index = (slot_id - EmuConstants::BANK_BEGIN) % EmuConstants::ITEM_CONTAINER_SIZE;
|
||||
|
||||
if (slot_id >= legacy::GENERAL_BAGS_BEGIN && slot_id <= legacy::GENERAL_BAGS_END) {
|
||||
index = (slot_id - legacy::GENERAL_BAGS_BEGIN) % inventory::ContainerCount;
|
||||
if (slot_id >= invbag::GENERAL_BAGS_BEGIN && slot_id <= invbag::GENERAL_BAGS_END) {
|
||||
index = (slot_id - invbag::GENERAL_BAGS_BEGIN) % invbag::SLOT_COUNT;
|
||||
}
|
||||
else if (slot_id >= legacy::CURSOR_BAG_BEGIN && slot_id <= legacy::CURSOR_BAG_END) {
|
||||
index = (slot_id - legacy::CURSOR_BAG_BEGIN); // % inventory::ContainerCount; - not needed since range is 10 slots
|
||||
else if (slot_id >= invbag::CURSOR_BAG_BEGIN && slot_id <= invbag::CURSOR_BAG_END) {
|
||||
index = (slot_id - invbag::CURSOR_BAG_BEGIN); // % invbag::SLOT_COUNT; - not needed since range is 10 slots
|
||||
}
|
||||
else if (slot_id >= legacy::BANK_BAGS_BEGIN && slot_id <= legacy::BANK_BAGS_END) {
|
||||
index = (slot_id - legacy::BANK_BAGS_BEGIN) % inventory::ContainerCount;
|
||||
else if (slot_id >= invbag::BANK_BAGS_BEGIN && slot_id <= invbag::BANK_BAGS_END) {
|
||||
index = (slot_id - invbag::BANK_BAGS_BEGIN) % invbag::SLOT_COUNT;
|
||||
}
|
||||
else if (slot_id >= legacy::SHARED_BANK_BAGS_BEGIN && slot_id <= legacy::SHARED_BANK_BAGS_END) {
|
||||
index = (slot_id - legacy::SHARED_BANK_BAGS_BEGIN) % inventory::ContainerCount;
|
||||
else if (slot_id >= invbag::SHARED_BANK_BAGS_BEGIN && slot_id <= invbag::SHARED_BANK_BAGS_END) {
|
||||
index = (slot_id - invbag::SHARED_BANK_BAGS_BEGIN) % invbag::SLOT_COUNT;
|
||||
}
|
||||
else if (slot_id >= legacy::TRADE_BAGS_BEGIN && slot_id <= legacy::TRADE_BAGS_END) {
|
||||
index = (slot_id - legacy::TRADE_BAGS_BEGIN) % inventory::ContainerCount;
|
||||
else if (slot_id >= invbag::TRADE_BAGS_BEGIN && slot_id <= invbag::TRADE_BAGS_END) {
|
||||
index = (slot_id - invbag::TRADE_BAGS_BEGIN) % invbag::SLOT_COUNT;
|
||||
}
|
||||
else if (slot_id >= legacy::WORLD_BEGIN && slot_id <= legacy::WORLD_END) {
|
||||
index = (slot_id - legacy::WORLD_BEGIN); // % inventory::ContainerCount; - not needed since range is 10 slots
|
||||
else if (slot_id >= invslot::WORLD_BEGIN && slot_id <= invslot::WORLD_END) {
|
||||
index = (slot_id - invslot::WORLD_BEGIN); // % invbag::SLOT_COUNT; - not needed since range is 10 slots
|
||||
}
|
||||
|
||||
return index;
|
||||
@@ -892,23 +907,23 @@ int16 EQEmu::InventoryProfile::CalcSlotFromMaterial(uint8 material)
|
||||
switch (material)
|
||||
{
|
||||
case textures::armorHead:
|
||||
return inventory::slotHead;
|
||||
return invslot::slotHead;
|
||||
case textures::armorChest:
|
||||
return inventory::slotChest;
|
||||
return invslot::slotChest;
|
||||
case textures::armorArms:
|
||||
return inventory::slotArms;
|
||||
return invslot::slotArms;
|
||||
case textures::armorWrist:
|
||||
return inventory::slotWrist1; // there's 2 bracers, only one bracer material
|
||||
return invslot::slotWrist1; // there's 2 bracers, only one bracer material
|
||||
case textures::armorHands:
|
||||
return inventory::slotHands;
|
||||
return invslot::slotHands;
|
||||
case textures::armorLegs:
|
||||
return inventory::slotLegs;
|
||||
return invslot::slotLegs;
|
||||
case textures::armorFeet:
|
||||
return inventory::slotFeet;
|
||||
return invslot::slotFeet;
|
||||
case textures::weaponPrimary:
|
||||
return inventory::slotPrimary;
|
||||
return invslot::slotPrimary;
|
||||
case textures::weaponSecondary:
|
||||
return inventory::slotSecondary;
|
||||
return invslot::slotSecondary;
|
||||
default:
|
||||
return INVALID_INDEX;
|
||||
}
|
||||
@@ -918,24 +933,24 @@ uint8 EQEmu::InventoryProfile::CalcMaterialFromSlot(int16 equipslot)
|
||||
{
|
||||
switch (equipslot)
|
||||
{
|
||||
case inventory::slotHead:
|
||||
case invslot::slotHead:
|
||||
return textures::armorHead;
|
||||
case inventory::slotChest:
|
||||
case invslot::slotChest:
|
||||
return textures::armorChest;
|
||||
case inventory::slotArms:
|
||||
case invslot::slotArms:
|
||||
return textures::armorArms;
|
||||
case inventory::slotWrist1:
|
||||
case invslot::slotWrist1:
|
||||
//case SLOT_BRACER02: // non-live behavior
|
||||
return textures::armorWrist;
|
||||
case inventory::slotHands:
|
||||
case invslot::slotHands:
|
||||
return textures::armorHands;
|
||||
case inventory::slotLegs:
|
||||
case invslot::slotLegs:
|
||||
return textures::armorLegs;
|
||||
case inventory::slotFeet:
|
||||
case invslot::slotFeet:
|
||||
return textures::armorFeet;
|
||||
case inventory::slotPrimary:
|
||||
case invslot::slotPrimary:
|
||||
return textures::weaponPrimary;
|
||||
case inventory::slotSecondary:
|
||||
case invslot::slotSecondary:
|
||||
return textures::weaponSecondary;
|
||||
default:
|
||||
return textures::materialInvalid;
|
||||
@@ -962,11 +977,11 @@ bool EQEmu::InventoryProfile::CanItemFitInContainer(const ItemData *ItemToTry, c
|
||||
bool EQEmu::InventoryProfile::SupportsClickCasting(int16 slot_id)
|
||||
{
|
||||
// there are a few non-potion items that identify as ItemTypePotion..so, we still need to ubiquitously include the equipment range
|
||||
if ((uint16)slot_id <= legacy::GENERAL_END || slot_id == inventory::slotPowerSource)
|
||||
if ((uint16)slot_id <= invslot::GENERAL_END || slot_id == invslot::SLOT_POWER_SOURCE)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (slot_id >= legacy::GENERAL_BAGS_BEGIN && slot_id <= legacy::GENERAL_BAGS_END)
|
||||
else if (slot_id >= invbag::GENERAL_BAGS_BEGIN && slot_id <= invbag::GENERAL_BAGS_END)
|
||||
{
|
||||
if (inventory::Lookup(m_mob_version)->AllowClickCastFromBag)
|
||||
return true;
|
||||
@@ -977,7 +992,7 @@ bool EQEmu::InventoryProfile::SupportsClickCasting(int16 slot_id)
|
||||
|
||||
bool EQEmu::InventoryProfile::SupportsPotionBeltCasting(int16 slot_id)
|
||||
{
|
||||
if ((uint16)slot_id <= legacy::GENERAL_END || slot_id == inventory::slotPowerSource || (slot_id >= legacy::GENERAL_BAGS_BEGIN && slot_id <= legacy::GENERAL_BAGS_END))
|
||||
if ((uint16)slot_id <= invslot::GENERAL_END || slot_id == invslot::SLOT_POWER_SOURCE || (slot_id >= invbag::GENERAL_BAGS_BEGIN && slot_id <= invbag::GENERAL_BAGS_END))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -986,11 +1001,11 @@ bool EQEmu::InventoryProfile::SupportsPotionBeltCasting(int16 slot_id)
|
||||
// Test whether a given slot can support a container item
|
||||
bool EQEmu::InventoryProfile::SupportsContainers(int16 slot_id)
|
||||
{
|
||||
if ((slot_id == inventory::slotCursor) ||
|
||||
(slot_id >= legacy::GENERAL_BEGIN && slot_id <= legacy::GENERAL_END) ||
|
||||
(slot_id >= legacy::BANK_BEGIN && slot_id <= legacy::BANK_END) ||
|
||||
(slot_id >= legacy::SHARED_BANK_BEGIN && slot_id <= legacy::SHARED_BANK_END) ||
|
||||
(slot_id >= legacy::TRADE_BEGIN && slot_id <= legacy::TRADE_END)
|
||||
if ((slot_id == invslot::slotCursor) ||
|
||||
(slot_id >= invslot::GENERAL_BEGIN && slot_id <= invslot::GENERAL_END) ||
|
||||
(slot_id >= invslot::BANK_BEGIN && slot_id <= invslot::BANK_END) ||
|
||||
(slot_id >= invslot::SHARED_BANK_BEGIN && slot_id <= invslot::SHARED_BANK_END) ||
|
||||
(slot_id >= invslot::TRADE_BEGIN && slot_id <= invslot::TRADE_END)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
@@ -1028,7 +1043,7 @@ int EQEmu::InventoryProfile::GetSlotByItemInst(ItemInstance *inst) {
|
||||
}
|
||||
|
||||
if (m_cursor.peek_front() == inst) {
|
||||
return inventory::slotCursor;
|
||||
return invslot::slotCursor;
|
||||
}
|
||||
|
||||
return INVALID_INDEX;
|
||||
@@ -1039,8 +1054,8 @@ uint8 EQEmu::InventoryProfile::FindBrightestLightType()
|
||||
uint8 brightest_light_type = 0;
|
||||
|
||||
for (auto iter = m_worn.begin(); iter != m_worn.end(); ++iter) {
|
||||
if ((iter->first < legacy::EQUIPMENT_BEGIN || iter->first > legacy::EQUIPMENT_END) && iter->first != inventory::slotPowerSource) { continue; }
|
||||
if (iter->first == inventory::slotAmmo) { continue; }
|
||||
if ((iter->first < invslot::EQUIPMENT_BEGIN || iter->first > invslot::EQUIPMENT_END) && iter->first != invslot::SLOT_POWER_SOURCE) { continue; }
|
||||
if (iter->first == invslot::slotAmmo) { continue; }
|
||||
|
||||
auto inst = iter->second;
|
||||
if (inst == nullptr) { continue; }
|
||||
@@ -1053,7 +1068,7 @@ uint8 EQEmu::InventoryProfile::FindBrightestLightType()
|
||||
|
||||
uint8 general_light_type = 0;
|
||||
for (auto iter = m_inv.begin(); iter != m_inv.end(); ++iter) {
|
||||
if (iter->first < legacy::GENERAL_BEGIN || iter->first > legacy::GENERAL_END) { continue; }
|
||||
if (iter->first < invslot::GENERAL_BEGIN || iter->first > invslot::GENERAL_END) { continue; }
|
||||
|
||||
auto inst = iter->second;
|
||||
if (inst == nullptr) { continue; }
|
||||
@@ -1184,33 +1199,33 @@ int16 EQEmu::InventoryProfile::_PutItem(int16 slot_id, ItemInstance* inst)
|
||||
int16 result = INVALID_INDEX;
|
||||
int16 parentSlot = INVALID_INDEX;
|
||||
|
||||
if (slot_id == inventory::slotCursor) {
|
||||
if (slot_id == invslot::slotCursor) {
|
||||
// Replace current item on cursor, if exists
|
||||
m_cursor.pop(); // no memory delete, clients of this function know what they are doing
|
||||
m_cursor.push_front(inst);
|
||||
result = slot_id;
|
||||
}
|
||||
else if ((slot_id >= legacy::EQUIPMENT_BEGIN && slot_id <= legacy::EQUIPMENT_END) || (slot_id == inventory::slotPowerSource)) {
|
||||
else if ((slot_id >= invslot::EQUIPMENT_BEGIN && slot_id <= invslot::EQUIPMENT_END) || (slot_id == invslot::SLOT_POWER_SOURCE)) {
|
||||
m_worn[slot_id] = inst;
|
||||
result = slot_id;
|
||||
}
|
||||
else if ((slot_id >= legacy::GENERAL_BEGIN && slot_id <= legacy::GENERAL_END)) {
|
||||
else if ((slot_id >= invslot::GENERAL_BEGIN && slot_id <= invslot::GENERAL_END)) {
|
||||
m_inv[slot_id] = inst;
|
||||
result = slot_id;
|
||||
}
|
||||
else if (slot_id >= legacy::TRIBUTE_BEGIN && slot_id <= legacy::TRIBUTE_END) {
|
||||
else if (slot_id >= invslot::TRIBUTE_BEGIN && slot_id <= invslot::TRIBUTE_END) {
|
||||
m_worn[slot_id] = inst;
|
||||
result = slot_id;
|
||||
}
|
||||
else if (slot_id >= legacy::BANK_BEGIN && slot_id <= legacy::BANK_END) {
|
||||
else if (slot_id >= invslot::BANK_BEGIN && slot_id <= invslot::BANK_END) {
|
||||
m_bank[slot_id] = inst;
|
||||
result = slot_id;
|
||||
}
|
||||
else if (slot_id >= legacy::SHARED_BANK_BEGIN && slot_id <= legacy::SHARED_BANK_END) {
|
||||
else if (slot_id >= invslot::SHARED_BANK_BEGIN && slot_id <= invslot::SHARED_BANK_END) {
|
||||
m_shbank[slot_id] = inst;
|
||||
result = slot_id;
|
||||
}
|
||||
else if (slot_id >= legacy::TRADE_BEGIN && slot_id <= legacy::TRADE_END) {
|
||||
else if (slot_id >= invslot::TRADE_BEGIN && slot_id <= invslot::TRADE_END) {
|
||||
m_trade[slot_id] = inst;
|
||||
result = slot_id;
|
||||
}
|
||||
@@ -1248,7 +1263,7 @@ int16 EQEmu::InventoryProfile::_HasItem(std::map<int16, ItemInstance*>& bucket,
|
||||
return iter->first;
|
||||
}
|
||||
|
||||
for (int index = inventory::socketBegin; index < inventory::SocketCount; ++index) {
|
||||
for (int index = invaug::SOCKET_BEGIN; index <= invaug::SOCKET_END; ++index) {
|
||||
if (inst->GetAugmentItemID(index) == item_id && quantity <= 1)
|
||||
return legacy::SLOT_AUGMENT;
|
||||
}
|
||||
@@ -1265,7 +1280,7 @@ int16 EQEmu::InventoryProfile::_HasItem(std::map<int16, ItemInstance*>& bucket,
|
||||
return InventoryProfile::CalcSlotId(iter->first, bag_iter->first);
|
||||
}
|
||||
|
||||
for (int index = inventory::socketBegin; index < inventory::SocketCount; ++index) {
|
||||
for (int index = invaug::SOCKET_BEGIN; index <= invaug::SOCKET_END; ++index) {
|
||||
if (bag_inst->GetAugmentItemID(index) == item_id && quantity <= 1)
|
||||
return legacy::SLOT_AUGMENT;
|
||||
}
|
||||
@@ -1293,10 +1308,10 @@ int16 EQEmu::InventoryProfile::_HasItem(ItemInstQueue& iqueue, uint32 item_id, u
|
||||
if (inst->GetID() == item_id) {
|
||||
quantity_found += (inst->GetCharges() <= 0) ? 1 : inst->GetCharges();
|
||||
if (quantity_found >= quantity)
|
||||
return inventory::slotCursor;
|
||||
return invslot::slotCursor;
|
||||
}
|
||||
|
||||
for (int index = inventory::socketBegin; index < inventory::SocketCount; ++index) {
|
||||
for (int index = invaug::SOCKET_BEGIN; index <= invaug::SOCKET_END; ++index) {
|
||||
if (inst->GetAugmentItemID(index) == item_id && quantity <= 1)
|
||||
return legacy::SLOT_AUGMENT;
|
||||
}
|
||||
@@ -1310,10 +1325,10 @@ int16 EQEmu::InventoryProfile::_HasItem(ItemInstQueue& iqueue, uint32 item_id, u
|
||||
if (bag_inst->GetID() == item_id) {
|
||||
quantity_found += (bag_inst->GetCharges() <= 0) ? 1 : bag_inst->GetCharges();
|
||||
if (quantity_found >= quantity)
|
||||
return InventoryProfile::CalcSlotId(inventory::slotCursor, bag_iter->first);
|
||||
return InventoryProfile::CalcSlotId(invslot::slotCursor, bag_iter->first);
|
||||
}
|
||||
|
||||
for (int index = inventory::socketBegin; index < inventory::SocketCount; ++index) {
|
||||
for (int index = invaug::SOCKET_BEGIN; index <= invaug::SOCKET_END; ++index) {
|
||||
if (bag_inst->GetAugmentItemID(index) == item_id && quantity <= 1)
|
||||
return legacy::SLOT_AUGMENT;
|
||||
}
|
||||
@@ -1370,7 +1385,7 @@ int16 EQEmu::InventoryProfile::_HasItemByUse(ItemInstQueue& iqueue, uint8 use, u
|
||||
if (inst->IsClassCommon() && inst->GetItem()->ItemType == use) {
|
||||
quantity_found += (inst->GetCharges() <= 0) ? 1 : inst->GetCharges();
|
||||
if (quantity_found >= quantity)
|
||||
return inventory::slotCursor;
|
||||
return invslot::slotCursor;
|
||||
}
|
||||
|
||||
if (!inst->IsClassBag()) { continue; }
|
||||
@@ -1382,7 +1397,7 @@ int16 EQEmu::InventoryProfile::_HasItemByUse(ItemInstQueue& iqueue, uint8 use, u
|
||||
if (bag_inst->IsClassCommon() && bag_inst->GetItem()->ItemType == use) {
|
||||
quantity_found += (bag_inst->GetCharges() <= 0) ? 1 : bag_inst->GetCharges();
|
||||
if (quantity_found >= quantity)
|
||||
return InventoryProfile::CalcSlotId(inventory::slotCursor, bag_iter->first);
|
||||
return InventoryProfile::CalcSlotId(invslot::slotCursor, bag_iter->first);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1402,7 +1417,7 @@ int16 EQEmu::InventoryProfile::_HasItemByLoreGroup(std::map<int16, ItemInstance*
|
||||
if (inst->GetItem()->LoreGroup == loregroup)
|
||||
return iter->first;
|
||||
|
||||
for (int index = inventory::socketBegin; index < inventory::SocketCount; ++index) {
|
||||
for (int index = invaug::SOCKET_BEGIN; index <= invaug::SOCKET_END; ++index) {
|
||||
auto aug_inst = inst->GetAugment(index);
|
||||
if (aug_inst == nullptr) { continue; }
|
||||
|
||||
@@ -1419,7 +1434,7 @@ int16 EQEmu::InventoryProfile::_HasItemByLoreGroup(std::map<int16, ItemInstance*
|
||||
if (bag_inst->IsClassCommon() && bag_inst->GetItem()->LoreGroup == loregroup)
|
||||
return InventoryProfile::CalcSlotId(iter->first, bag_iter->first);
|
||||
|
||||
for (int index = inventory::socketBegin; index < inventory::SocketCount; ++index) {
|
||||
for (int index = invaug::SOCKET_BEGIN; index <= invaug::SOCKET_END; ++index) {
|
||||
auto aug_inst = bag_inst->GetAugment(index);
|
||||
if (aug_inst == nullptr) { continue; }
|
||||
|
||||
@@ -1440,9 +1455,9 @@ int16 EQEmu::InventoryProfile::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32
|
||||
if (inst == nullptr) { continue; }
|
||||
|
||||
if (inst->GetItem()->LoreGroup == loregroup)
|
||||
return inventory::slotCursor;
|
||||
return invslot::slotCursor;
|
||||
|
||||
for (int index = inventory::socketBegin; index < inventory::SocketCount; ++index) {
|
||||
for (int index = invaug::SOCKET_BEGIN; index <= invaug::SOCKET_END; ++index) {
|
||||
auto aug_inst = inst->GetAugment(index);
|
||||
if (aug_inst == nullptr) { continue; }
|
||||
|
||||
@@ -1457,9 +1472,9 @@ int16 EQEmu::InventoryProfile::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32
|
||||
if (bag_inst == nullptr) { continue; }
|
||||
|
||||
if (bag_inst->IsClassCommon() && bag_inst->GetItem()->LoreGroup == loregroup)
|
||||
return InventoryProfile::CalcSlotId(inventory::slotCursor, bag_iter->first);
|
||||
return InventoryProfile::CalcSlotId(invslot::slotCursor, bag_iter->first);
|
||||
|
||||
for (int index = inventory::socketBegin; index < inventory::SocketCount; ++index) {
|
||||
for (int index = invaug::SOCKET_BEGIN; index <= invaug::SOCKET_END; ++index) {
|
||||
auto aug_inst = bag_inst->GetAugment(index);
|
||||
if (aug_inst == nullptr) { continue; }
|
||||
|
||||
|
||||
@@ -92,22 +92,13 @@ namespace EQEmu
|
||||
}
|
||||
~InventoryProfile();
|
||||
|
||||
bool SetInventoryVersion(versions::MobVersion inventory_version) {
|
||||
if (!m_mob_version_set) {
|
||||
m_mob_version = versions::ValidateMobVersion(inventory_version);
|
||||
m_lookup = inventory::Lookup(m_mob_version);
|
||||
m_mob_version_set = true;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
m_lookup = inventory::Lookup(versions::MobVersion::Unknown);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
bool SetInventoryVersion(versions::MobVersion inventory_version);
|
||||
bool SetInventoryVersion(versions::ClientVersion client_version) { return SetInventoryVersion(versions::ConvertClientVersionToMobVersion(client_version)); }
|
||||
|
||||
versions::MobVersion InventoryVersion() { return m_mob_version; }
|
||||
|
||||
const inventory::LookupEntry* GetLookup() const { return m_lookup; }
|
||||
|
||||
static void CleanDirty();
|
||||
static void MarkDirty(ItemInstance *inst);
|
||||
|
||||
@@ -163,7 +154,7 @@ namespace EQEmu
|
||||
|
||||
// Locate an available inventory slot
|
||||
int16 FindFreeSlot(bool for_bag, bool try_cursor, uint8 min_size = 0, bool is_arrow = false);
|
||||
int16 FindFreeSlotForTradeItem(const ItemInstance* inst, int16 general_start = legacy::GENERAL_BEGIN, uint8 bag_start = inventory::containerBegin);
|
||||
int16 FindFreeSlotForTradeItem(const ItemInstance* inst, int16 general_start = invslot::GENERAL_BEGIN, uint8 bag_start = invbag::SLOT_BEGIN);
|
||||
|
||||
// Calculate slot_id for an item within a bag
|
||||
static int16 CalcSlotId(int16 slot_id); // Calc parent bag's slot_id
|
||||
|
||||
+78
-78
@@ -25,23 +25,23 @@
|
||||
int8 EQEmu::inventory::ConvertEquipmentIndexToTextureIndex(int16 slot_index)
|
||||
{
|
||||
switch (slot_index) {
|
||||
case slotHead:
|
||||
case invslot::slotHead:
|
||||
return textures::armorHead;
|
||||
case slotChest:
|
||||
case invslot::slotChest:
|
||||
return textures::armorChest;
|
||||
case slotArms:
|
||||
case invslot::slotArms:
|
||||
return textures::armorArms;
|
||||
case slotWrist1:
|
||||
case invslot::slotWrist1:
|
||||
return textures::armorWrist;
|
||||
case slotHands:
|
||||
case invslot::slotHands:
|
||||
return textures::armorHands;
|
||||
case slotLegs:
|
||||
case invslot::slotLegs:
|
||||
return textures::armorLegs;
|
||||
case slotFeet:
|
||||
case invslot::slotFeet:
|
||||
return textures::armorFeet;
|
||||
case slotPrimary:
|
||||
case invslot::slotPrimary:
|
||||
return textures::weaponPrimary;
|
||||
case slotSecondary:
|
||||
case invslot::slotSecondary:
|
||||
return textures::weaponSecondary;
|
||||
default:
|
||||
return textures::textureInvalid;
|
||||
@@ -50,7 +50,7 @@ int8 EQEmu::inventory::ConvertEquipmentIndexToTextureIndex(int16 slot_index)
|
||||
|
||||
int8 EQEmu::inventory::ConvertEquipmentSlotToTextureIndex(const InventorySlot& inventory_slot)
|
||||
{
|
||||
if ((!inventory_slot.Typeless() && !inventory_slot.IsTypeIndex(typePossessions)) || !inventory_slot.IsContainerIndex(containerInvalid) || !inventory_slot.IsSocketIndex(socketInvalid))
|
||||
if ((!inventory_slot.Typeless() && !inventory_slot.IsTypeIndex(invtype::typePossessions)) || !inventory_slot.IsContainerIndex(invbag::SLOT_INVALID) || !inventory_slot.IsSocketIndex(invaug::SOCKET_INVALID))
|
||||
return textures::textureInvalid;
|
||||
|
||||
return ConvertEquipmentIndexToTextureIndex(inventory_slot.SlotIndex());
|
||||
@@ -60,25 +60,25 @@ int16 EQEmu::inventory::ConvertTextureIndexToEquipmentIndex(int8 texture_index)
|
||||
{
|
||||
switch (texture_index) {
|
||||
case textures::armorHead:
|
||||
return slotHead;
|
||||
return invslot::slotHead;
|
||||
case textures::armorChest:
|
||||
return slotChest;
|
||||
return invslot::slotChest;
|
||||
case textures::armorArms:
|
||||
return slotArms;
|
||||
return invslot::slotArms;
|
||||
case textures::armorWrist:
|
||||
return slotWrist1;
|
||||
return invslot::slotWrist1;
|
||||
case textures::armorHands:
|
||||
return slotHands;
|
||||
return invslot::slotHands;
|
||||
case textures::armorLegs:
|
||||
return slotLegs;
|
||||
return invslot::slotLegs;
|
||||
case textures::armorFeet:
|
||||
return slotFeet;
|
||||
return invslot::slotFeet;
|
||||
case textures::weaponPrimary:
|
||||
return slotPrimary;
|
||||
return invslot::slotPrimary;
|
||||
case textures::weaponSecondary:
|
||||
return slotSecondary;
|
||||
return invslot::slotSecondary;
|
||||
default:
|
||||
return slotInvalid;
|
||||
return invslot::SLOT_INVALID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,14 +87,14 @@ bool EQEmu::InventorySlot::IsValidSlot() const
|
||||
if (_typeless)
|
||||
return false;
|
||||
|
||||
int16 slot_count = inventory::SlotCount(_type_index);
|
||||
if (!slot_count || _slot_index < inventory::slotBegin || _slot_index >= slot_count)
|
||||
int16 slot_count = invtype::GetInvTypeSize(_type_index);
|
||||
if (!slot_count || _slot_index < invslot::SLOT_BEGIN || _slot_index >= slot_count)
|
||||
return false;
|
||||
|
||||
if (_container_index < inventory::containerInvalid || _container_index >= inventory::ContainerCount)
|
||||
if (_container_index < invbag::SLOT_INVALID || _container_index >= invbag::SLOT_COUNT)
|
||||
return false;
|
||||
|
||||
if (_socket_index < inventory::socketInvalid || _socket_index >= inventory::SocketCount)
|
||||
if (_socket_index < invaug::SOCKET_INVALID || _socket_index >= invaug::SOCKET_COUNT)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -103,16 +103,16 @@ bool EQEmu::InventorySlot::IsValidSlot() const
|
||||
bool EQEmu::InventorySlot::IsDeleteSlot() const
|
||||
{
|
||||
if (_typeless)
|
||||
return (_slot_index == inventory::slotInvalid && _container_index == inventory::containerInvalid && _socket_index == inventory::socketInvalid);
|
||||
return (_slot_index == invslot::SLOT_INVALID && _container_index == invbag::SLOT_INVALID && _socket_index == invaug::SOCKET_INVALID);
|
||||
else
|
||||
return (_type_index == inventory::typeInvalid && _slot_index == inventory::slotInvalid && _container_index == inventory::containerInvalid && _socket_index == inventory::socketInvalid);
|
||||
return (_type_index == invtype::TYPE_INVALID && _slot_index == invslot::SLOT_INVALID && _container_index == invbag::SLOT_INVALID && _socket_index == invaug::SOCKET_INVALID);
|
||||
}
|
||||
|
||||
bool EQEmu::InventorySlot::IsEquipmentIndex(int16 slot_index)
|
||||
{
|
||||
/*if (slot_index < inventory::EquipmentBegin || slot_index > inventory::EquipmentEnd)
|
||||
return false;*/
|
||||
if ((slot_index < legacy::EQUIPMENT_BEGIN || slot_index > legacy::EQUIPMENT_END) && slot_index != legacy::SLOT_POWER_SOURCE)
|
||||
if ((slot_index < invslot::EQUIPMENT_BEGIN || slot_index > invslot::EQUIPMENT_END) && slot_index != invslot::SLOT_POWER_SOURCE)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -122,7 +122,7 @@ bool EQEmu::InventorySlot::IsGeneralIndex(int16 slot_index)
|
||||
{
|
||||
/*if (slot_index < inventory::GeneralBegin || slot_index > inventory::GeneralEnd)
|
||||
return false;*/
|
||||
if (slot_index < legacy::GENERAL_BEGIN || slot_index > legacy::GENERAL_END)
|
||||
if (slot_index < invslot::GENERAL_BEGIN || slot_index > invslot::GENERAL_END)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -132,7 +132,7 @@ bool EQEmu::InventorySlot::IsCursorIndex(int16 slot_index)
|
||||
{
|
||||
/*if (slot_index != inventory::slotCursor)
|
||||
return false;*/
|
||||
if (slot_index != legacy::SLOT_CURSOR)
|
||||
if (slot_index != invslot::slotCursor)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -142,7 +142,7 @@ bool EQEmu::InventorySlot::IsWeaponIndex(int16 slot_index)
|
||||
{
|
||||
/*if ((slot_index != inventory::slotRange) && (slot_index != inventory::slotPrimary) && (slot_index != inventory::slotSecondary))
|
||||
return false;*/
|
||||
if ((slot_index != legacy::SLOT_RANGE) && (slot_index != legacy::SLOT_PRIMARY) && (slot_index != legacy::SLOT_SECONDARY))
|
||||
if ((slot_index != invslot::slotRange) && (slot_index != invslot::slotPrimary) && (slot_index != invslot::slotSecondary))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -151,15 +151,15 @@ bool EQEmu::InventorySlot::IsWeaponIndex(int16 slot_index)
|
||||
bool EQEmu::InventorySlot::IsTextureIndex(int16 slot_index)
|
||||
{
|
||||
switch (slot_index) {
|
||||
case inventory::slotHead:
|
||||
case inventory::slotChest:
|
||||
case inventory::slotArms:
|
||||
case inventory::slotWrist1:
|
||||
case inventory::slotHands:
|
||||
case inventory::slotLegs:
|
||||
case inventory::slotFeet:
|
||||
case inventory::slotPrimary:
|
||||
case inventory::slotSecondary:
|
||||
case invslot::slotHead:
|
||||
case invslot::slotChest:
|
||||
case invslot::slotArms:
|
||||
case invslot::slotWrist1:
|
||||
case invslot::slotHands:
|
||||
case invslot::slotLegs:
|
||||
case invslot::slotFeet:
|
||||
case invslot::slotPrimary:
|
||||
case invslot::slotSecondary:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
@@ -169,13 +169,13 @@ bool EQEmu::InventorySlot::IsTextureIndex(int16 slot_index)
|
||||
bool EQEmu::InventorySlot::IsTintableIndex(int16 slot_index)
|
||||
{
|
||||
switch (slot_index) {
|
||||
case inventory::slotHead:
|
||||
case inventory::slotChest:
|
||||
case inventory::slotArms:
|
||||
case inventory::slotWrist1:
|
||||
case inventory::slotHands:
|
||||
case inventory::slotLegs:
|
||||
case inventory::slotFeet:
|
||||
case invslot::slotHead:
|
||||
case invslot::slotChest:
|
||||
case invslot::slotArms:
|
||||
case invslot::slotWrist1:
|
||||
case invslot::slotHands:
|
||||
case invslot::slotLegs:
|
||||
case invslot::slotFeet:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
@@ -184,10 +184,10 @@ bool EQEmu::InventorySlot::IsTintableIndex(int16 slot_index)
|
||||
|
||||
bool EQEmu::InventorySlot::IsEquipmentSlot() const
|
||||
{
|
||||
if (!_typeless && (_type_index != inventory::typePossessions))
|
||||
if (!_typeless && (_type_index != invtype::typePossessions))
|
||||
return false;
|
||||
|
||||
if ((_container_index != inventory::containerInvalid) || (_socket_index != inventory::socketInvalid))
|
||||
if ((_container_index != invbag::SLOT_INVALID) || (_socket_index != invaug::SOCKET_INVALID))
|
||||
return false;
|
||||
|
||||
return IsEquipmentIndex(_slot_index);
|
||||
@@ -195,10 +195,10 @@ bool EQEmu::InventorySlot::IsEquipmentSlot() const
|
||||
|
||||
bool EQEmu::InventorySlot::IsGeneralSlot() const
|
||||
{
|
||||
if (!_typeless && (_type_index != inventory::typePossessions))
|
||||
if (!_typeless && (_type_index != invtype::typePossessions))
|
||||
return false;
|
||||
|
||||
if ((_container_index != inventory::containerInvalid) || (_socket_index != inventory::socketInvalid))
|
||||
if ((_container_index != invbag::SLOT_INVALID) || (_socket_index != invaug::SOCKET_INVALID))
|
||||
return false;
|
||||
|
||||
return IsGeneralIndex(_socket_index);
|
||||
@@ -206,10 +206,10 @@ bool EQEmu::InventorySlot::IsGeneralSlot() const
|
||||
|
||||
bool EQEmu::InventorySlot::IsCursorSlot() const
|
||||
{
|
||||
if (!_typeless && (_type_index != inventory::typePossessions))
|
||||
if (!_typeless && (_type_index != invtype::typePossessions))
|
||||
return false;
|
||||
|
||||
if ((_container_index != inventory::containerInvalid) || (_socket_index != inventory::socketInvalid))
|
||||
if ((_container_index != invbag::SLOT_INVALID) || (_socket_index != invaug::SOCKET_INVALID))
|
||||
return false;
|
||||
|
||||
return IsCursorIndex(_slot_index);
|
||||
@@ -217,10 +217,10 @@ bool EQEmu::InventorySlot::IsCursorSlot() const
|
||||
|
||||
bool EQEmu::InventorySlot::IsWeaponSlot() const
|
||||
{
|
||||
if (!_typeless && (_type_index != inventory::typePossessions))
|
||||
if (!_typeless && (_type_index != invtype::typePossessions))
|
||||
return false;
|
||||
|
||||
if ((_container_index != inventory::containerInvalid) || (_socket_index != inventory::socketInvalid))
|
||||
if ((_container_index != invbag::SLOT_INVALID) || (_socket_index != invaug::SOCKET_INVALID))
|
||||
return false;
|
||||
|
||||
return IsWeaponIndex(_slot_index);
|
||||
@@ -228,10 +228,10 @@ bool EQEmu::InventorySlot::IsWeaponSlot() const
|
||||
|
||||
bool EQEmu::InventorySlot::IsTextureSlot() const
|
||||
{
|
||||
if (!_typeless && (_type_index != inventory::typePossessions))
|
||||
if (!_typeless && (_type_index != invtype::typePossessions))
|
||||
return false;
|
||||
|
||||
if ((_container_index != inventory::containerInvalid) || (_socket_index != inventory::socketInvalid))
|
||||
if ((_container_index != invbag::SLOT_INVALID) || (_socket_index != invaug::SOCKET_INVALID))
|
||||
return false;
|
||||
|
||||
return IsTextureIndex(_slot_index);
|
||||
@@ -239,10 +239,10 @@ bool EQEmu::InventorySlot::IsTextureSlot() const
|
||||
|
||||
bool EQEmu::InventorySlot::IsTintableSlot() const
|
||||
{
|
||||
if (!_typeless && (_type_index != inventory::typePossessions))
|
||||
if (!_typeless && (_type_index != invtype::typePossessions))
|
||||
return false;
|
||||
|
||||
if ((_container_index != inventory::containerInvalid) || (_socket_index != inventory::socketInvalid))
|
||||
if ((_container_index != invbag::SLOT_INVALID) || (_socket_index != invaug::SOCKET_INVALID))
|
||||
return false;
|
||||
|
||||
return IsTintableIndex(_slot_index);
|
||||
@@ -250,13 +250,13 @@ bool EQEmu::InventorySlot::IsTintableSlot() const
|
||||
|
||||
bool EQEmu::InventorySlot::IsSlot() const
|
||||
{
|
||||
if (!_typeless && (_type_index == inventory::typeInvalid))
|
||||
if (!_typeless && (_type_index == invtype::TYPE_INVALID))
|
||||
return false;
|
||||
if (_slot_index == inventory::slotInvalid)
|
||||
if (_slot_index == invslot::SLOT_INVALID)
|
||||
return false;
|
||||
if (_container_index != inventory::containerInvalid)
|
||||
if (_container_index != invbag::SLOT_INVALID)
|
||||
return false;
|
||||
if (_socket_index != inventory::socketInvalid)
|
||||
if (_socket_index != invaug::SOCKET_INVALID)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -264,13 +264,13 @@ bool EQEmu::InventorySlot::IsSlot() const
|
||||
|
||||
bool EQEmu::InventorySlot::IsSlotSocket() const
|
||||
{
|
||||
if (!_typeless && (_type_index == inventory::typeInvalid))
|
||||
if (!_typeless && (_type_index == invtype::TYPE_INVALID))
|
||||
return false;
|
||||
if (_slot_index == inventory::slotInvalid)
|
||||
if (_slot_index == invslot::SLOT_INVALID)
|
||||
return false;
|
||||
if (_container_index != inventory::containerInvalid)
|
||||
if (_container_index != invbag::SLOT_INVALID)
|
||||
return false;
|
||||
if (_socket_index == inventory::socketInvalid)
|
||||
if (_socket_index == invaug::SOCKET_INVALID)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -278,13 +278,13 @@ bool EQEmu::InventorySlot::IsSlotSocket() const
|
||||
|
||||
bool EQEmu::InventorySlot::IsContainer() const
|
||||
{
|
||||
if (!_typeless && (_type_index == inventory::typeInvalid))
|
||||
if (!_typeless && (_type_index == invtype::TYPE_INVALID))
|
||||
return false;
|
||||
if (_slot_index == inventory::slotInvalid)
|
||||
if (_slot_index == invslot::SLOT_INVALID)
|
||||
return false;
|
||||
if (_container_index == inventory::containerInvalid)
|
||||
if (_container_index == invbag::SLOT_INVALID)
|
||||
return false;
|
||||
if (_socket_index != inventory::socketInvalid)
|
||||
if (_socket_index != invaug::SOCKET_INVALID)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -292,13 +292,13 @@ bool EQEmu::InventorySlot::IsContainer() const
|
||||
|
||||
bool EQEmu::InventorySlot::IsContainerSocket() const
|
||||
{
|
||||
if (!_typeless && (_type_index == inventory::typeInvalid))
|
||||
if (!_typeless && (_type_index == invtype::TYPE_INVALID))
|
||||
return false;
|
||||
if (_slot_index == inventory::slotInvalid)
|
||||
if (_slot_index == invslot::SLOT_INVALID)
|
||||
return false;
|
||||
if (_container_index == inventory::containerInvalid)
|
||||
if (_container_index == invbag::SLOT_INVALID)
|
||||
return false;
|
||||
if (_socket_index == inventory::socketInvalid)
|
||||
if (_socket_index == invaug::SOCKET_INVALID)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -332,10 +332,10 @@ const std::string EQEmu::InventorySlot::ToName() const
|
||||
|
||||
void EQEmu::InventorySlot::SetInvalidSlot()
|
||||
{
|
||||
_type_index = inventory::typeInvalid;
|
||||
_slot_index = inventory::slotInvalid;
|
||||
_container_index = inventory::containerInvalid;
|
||||
_socket_index = inventory::socketInvalid;
|
||||
_type_index = invtype::TYPE_INVALID;
|
||||
_slot_index = invslot::SLOT_INVALID;
|
||||
_container_index = invbag::SLOT_INVALID;
|
||||
_socket_index = invaug::SOCKET_INVALID;
|
||||
}
|
||||
|
||||
//bool EQEmu::InventorySlot::IsBonusIndex(int16 slot_index)
|
||||
|
||||
+12
-12
@@ -35,10 +35,10 @@ namespace EQEmu
|
||||
|
||||
class InventorySlot {
|
||||
public:
|
||||
InventorySlot() : _type_index(inventory::typeInvalid), _slot_index(inventory::slotInvalid), _container_index(inventory::containerInvalid), _socket_index(inventory::socketInvalid), _typeless(false) { }
|
||||
InventorySlot(int16 type_index) : _type_index(type_index), _slot_index(inventory::slotInvalid), _container_index(inventory::containerInvalid), _socket_index(inventory::socketInvalid), _typeless(false) { }
|
||||
InventorySlot(int16 type_index, int16 parent_index) : _type_index(type_index), _slot_index(parent_index), _container_index(inventory::containerInvalid), _socket_index(inventory::socketInvalid), _typeless(false) { }
|
||||
InventorySlot(int16 type_index, int16 parent_index, int16 bag_index) : _type_index(type_index), _slot_index(parent_index), _container_index(bag_index), _socket_index(inventory::socketInvalid), _typeless(false) { }
|
||||
InventorySlot() : _type_index(invtype::TYPE_INVALID), _slot_index(invslot::SLOT_INVALID), _container_index(invbag::SLOT_INVALID), _socket_index(invaug::SOCKET_INVALID), _typeless(false) { }
|
||||
InventorySlot(int16 type_index) : _type_index(type_index), _slot_index(invslot::SLOT_INVALID), _container_index(invbag::SLOT_INVALID), _socket_index(invaug::SOCKET_INVALID), _typeless(false) { }
|
||||
InventorySlot(int16 type_index, int16 parent_index) : _type_index(type_index), _slot_index(parent_index), _container_index(invbag::SLOT_INVALID), _socket_index(invaug::SOCKET_INVALID), _typeless(false) { }
|
||||
InventorySlot(int16 type_index, int16 parent_index, int16 bag_index) : _type_index(type_index), _slot_index(parent_index), _container_index(bag_index), _socket_index(invaug::SOCKET_INVALID), _typeless(false) { }
|
||||
InventorySlot(int16 type_index, int16 parent_index, int16 bag_index, int16 aug_index) : _type_index(type_index), _slot_index(parent_index), _container_index(bag_index), _socket_index(aug_index), _typeless(false) { }
|
||||
InventorySlot(const InventorySlot& r) : _type_index(r._type_index), _slot_index(r._slot_index), _container_index(r._container_index), _socket_index(r._socket_index), _typeless(r._typeless) { }
|
||||
InventorySlot(int16 type_index, const InventorySlot& r) : _type_index(type_index), _slot_index(r._slot_index), _container_index(r._container_index), _socket_index(r._socket_index), _typeless(false) { }
|
||||
@@ -90,15 +90,15 @@ namespace EQEmu
|
||||
|
||||
void SetInvalidSlot();
|
||||
|
||||
void SetTypeInvalid() { _type_index = inventory::typeInvalid; }
|
||||
void SetSlotInvalid() { _slot_index = inventory::slotInvalid; }
|
||||
void SetContainerInvalid() { _container_index = inventory::containerInvalid; }
|
||||
void SetSocketInvalid() { _socket_index = inventory::socketInvalid; }
|
||||
void SetTypeInvalid() { _type_index = invtype::TYPE_INVALID; }
|
||||
void SetSlotInvalid() { _slot_index = invslot::SLOT_INVALID; }
|
||||
void SetContainerInvalid() { _container_index = invbag::SLOT_INVALID; }
|
||||
void SetSocketInvalid() { _socket_index = invaug::SOCKET_INVALID; }
|
||||
|
||||
void SetTypeBegin() { _type_index = inventory::typeBegin; }
|
||||
void SetSlotBegin() { _slot_index = inventory::slotBegin; }
|
||||
void SetContainerBegin() { _container_index = inventory::containerBegin; }
|
||||
void SetSocketBegin() { _socket_index = inventory::socketBegin; }
|
||||
void SetTypeBegin() { _type_index = invtype::TYPE_BEGIN; }
|
||||
void SetSlotBegin() { _slot_index = invslot::SLOT_BEGIN; }
|
||||
void SetContainerBegin() { _container_index = invbag::SLOT_BEGIN; }
|
||||
void SetSocketBegin() { _socket_index = invaug::SOCKET_BEGIN; }
|
||||
|
||||
void IncrementType() { ++_type_index; }
|
||||
void IncrementSlot() { ++_slot_index; }
|
||||
|
||||
+3
-3
@@ -464,9 +464,9 @@ namespace EQEmu
|
||||
int32 FactionAmt4; // Faction Amt 4
|
||||
char CharmFile[32]; // ?
|
||||
uint32 AugType;
|
||||
uint8 AugSlotType[inventory::SocketCount]; // RoF: Augment Slot 1-6 Type
|
||||
uint8 AugSlotVisible[inventory::SocketCount]; // RoF: Augment Slot 1-6 Visible
|
||||
uint8 AugSlotUnk2[inventory::SocketCount]; // RoF: Augment Slot 1-6 Unknown Most likely Powersource related
|
||||
uint8 AugSlotType[invaug::SOCKET_COUNT]; // RoF: Augment Slot 1-6 Type
|
||||
uint8 AugSlotVisible[invaug::SOCKET_COUNT]; // RoF: Augment Slot 1-6 Visible
|
||||
uint8 AugSlotUnk2[invaug::SOCKET_COUNT]; // RoF: Augment Slot 1-6 Unknown Most likely Powersource related
|
||||
uint32 LDoNTheme;
|
||||
uint32 LDoNPrice;
|
||||
uint32 LDoNSold;
|
||||
|
||||
+59
-59
@@ -273,8 +273,8 @@ bool EQEmu::ItemInstance::IsEquipable(int16 slot_id) const
|
||||
|
||||
// another "shouldn't do" fix..will be fixed in future updates (requires code and database work)
|
||||
int16 use_slot = INVALID_INDEX;
|
||||
if (slot_id == inventory::slotPowerSource) { use_slot = inventory::slotGeneral1; }
|
||||
if ((uint16)slot_id <= legacy::EQUIPMENT_END) { use_slot = slot_id; }
|
||||
if (slot_id == invslot::SLOT_POWER_SOURCE) { use_slot = invslot::slotGeneral1; }
|
||||
if ((uint16)slot_id <= invslot::EQUIPMENT_END) { use_slot = slot_id; }
|
||||
|
||||
if (use_slot != INVALID_INDEX) {
|
||||
if (m_item->Slots & (1 << use_slot))
|
||||
@@ -289,7 +289,7 @@ bool EQEmu::ItemInstance::IsAugmentable() const
|
||||
if (!m_item)
|
||||
return false;
|
||||
|
||||
for (int index = inventory::socketBegin; index < inventory::SocketCount; ++index) {
|
||||
for (int index = invaug::SOCKET_BEGIN; index <= invaug::SOCKET_END; ++index) {
|
||||
if (m_item->AugSlotType[index] != 0)
|
||||
return true;
|
||||
}
|
||||
@@ -303,8 +303,8 @@ bool EQEmu::ItemInstance::AvailableWearSlot(uint32 aug_wear_slots) const {
|
||||
if (!m_item || !m_item->IsClassCommon())
|
||||
return false;
|
||||
|
||||
int index = legacy::EQUIPMENT_BEGIN;
|
||||
for (; index <= inventory::slotGeneral1; ++index) { // MainGeneral1 should be legacy::EQUIPMENT_END
|
||||
int index = invslot::EQUIPMENT_BEGIN;
|
||||
for (; index <= invslot::slotGeneral1; ++index) { // MainGeneral1 should be legacy::EQUIPMENT_END
|
||||
if (m_item->Slots & (1 << index)) {
|
||||
if (aug_wear_slots & (1 << index))
|
||||
break;
|
||||
@@ -319,14 +319,14 @@ int8 EQEmu::ItemInstance::AvailableAugmentSlot(int32 augtype) const
|
||||
if (!m_item || !m_item->IsClassCommon())
|
||||
return INVALID_INDEX;
|
||||
|
||||
int index = inventory::socketBegin;
|
||||
for (; index < inventory::SocketCount; ++index) {
|
||||
int index = invaug::SOCKET_BEGIN;
|
||||
for (; index <= invaug::SOCKET_END; ++index) {
|
||||
if (GetItem(index)) { continue; }
|
||||
if (augtype == -1 || (m_item->AugSlotType[index] && ((1 << (m_item->AugSlotType[index] - 1)) & augtype)))
|
||||
break;
|
||||
}
|
||||
|
||||
return (index < inventory::SocketCount) ? index : INVALID_INDEX;
|
||||
return (index <= invaug::SOCKET_END) ? index : INVALID_INDEX;
|
||||
}
|
||||
|
||||
bool EQEmu::ItemInstance::IsAugmentSlotAvailable(int32 augtype, uint8 slot) const
|
||||
@@ -469,7 +469,7 @@ uint8 EQEmu::ItemInstance::FirstOpenSlot() const
|
||||
return INVALID_INDEX;
|
||||
|
||||
uint8 slots = m_item->BagSlots, i;
|
||||
for (i = inventory::containerBegin; i < slots; i++) {
|
||||
for (i = invbag::SLOT_BEGIN; i < slots; i++) {
|
||||
if (!GetItem(i))
|
||||
break;
|
||||
}
|
||||
@@ -486,7 +486,7 @@ uint8 EQEmu::ItemInstance::GetTotalItemCount() const
|
||||
|
||||
if (m_item && !m_item->IsClassBag()) { return item_count; }
|
||||
|
||||
for (int index = inventory::containerBegin; index < m_item->BagSlots; ++index) { if (GetItem(index)) { ++item_count; } }
|
||||
for (int index = invbag::SLOT_BEGIN; index < m_item->BagSlots; ++index) { if (GetItem(index)) { ++item_count; } }
|
||||
|
||||
return item_count;
|
||||
}
|
||||
@@ -496,7 +496,7 @@ bool EQEmu::ItemInstance::IsNoneEmptyContainer()
|
||||
if (!m_item || !m_item->IsClassBag())
|
||||
return false;
|
||||
|
||||
for (int index = inventory::containerBegin; index < m_item->BagSlots; ++index) {
|
||||
for (int index = invbag::SLOT_BEGIN; index < m_item->BagSlots; ++index) {
|
||||
if (GetItem(index))
|
||||
return true;
|
||||
}
|
||||
@@ -518,7 +518,7 @@ EQEmu::ItemInstance* EQEmu::ItemInstance::GetOrnamentationAug(int32 ornamentatio
|
||||
if (!m_item || !m_item->IsClassCommon()) { return nullptr; }
|
||||
if (ornamentationAugtype == 0) { return nullptr; }
|
||||
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; i++)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; i++)
|
||||
{
|
||||
if (GetAugment(i) && m_item->AugSlotType[i] == ornamentationAugtype)
|
||||
{
|
||||
@@ -686,7 +686,7 @@ bool EQEmu::ItemInstance::IsAugmented()
|
||||
if (!m_item || !m_item->IsClassCommon())
|
||||
return false;
|
||||
|
||||
for (int index = inventory::socketBegin; index < inventory::SocketCount; ++index) {
|
||||
for (int index = invaug::SOCKET_BEGIN; index <= invaug::SOCKET_END; ++index) {
|
||||
if (GetAugmentItemID(index))
|
||||
return true;
|
||||
}
|
||||
@@ -814,8 +814,8 @@ bool EQEmu::ItemInstance::IsSlotAllowed(int16 slot_id) const {
|
||||
if (!m_item) { return false; }
|
||||
else if (InventoryProfile::SupportsContainers(slot_id)) { return true; }
|
||||
else if (m_item->Slots & (1 << slot_id)) { return true; }
|
||||
else if (slot_id == inventory::slotPowerSource && (m_item->Slots & (1 << 22))) { return true; } // got lazy... <watch>
|
||||
else if (slot_id != inventory::slotPowerSource && slot_id > legacy::EQUIPMENT_END) { return true; }
|
||||
else if (slot_id == invslot::SLOT_POWER_SOURCE && (m_item->Slots & (1 << 22))) { return true; } // got lazy... <watch>
|
||||
else if (slot_id != invslot::SLOT_POWER_SOURCE && slot_id > invslot::EQUIPMENT_END) { return true; }
|
||||
else { return false; }
|
||||
}
|
||||
|
||||
@@ -993,7 +993,7 @@ int EQEmu::ItemInstance::GetItemArmorClass(bool augments) const
|
||||
if (item) {
|
||||
ac = item->AC;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
ac += GetAugment(i)->GetItemArmorClass();
|
||||
}
|
||||
@@ -1035,7 +1035,7 @@ int EQEmu::ItemInstance::GetItemElementalDamage(int &magic, int &fire, int &cold
|
||||
}
|
||||
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
GetAugment(i)->GetItemElementalDamage(magic, fire, cold, poison, disease, chromatic, prismatic, physical, corruption);
|
||||
}
|
||||
@@ -1052,7 +1052,7 @@ int EQEmu::ItemInstance::GetItemElementalFlag(bool augments) const
|
||||
return flag;
|
||||
|
||||
if (augments) {
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i) {
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i) {
|
||||
if (GetAugment(i))
|
||||
flag = GetAugment(i)->GetItemElementalFlag();
|
||||
if (flag)
|
||||
@@ -1073,7 +1073,7 @@ int EQEmu::ItemInstance::GetItemElementalDamage(bool augments) const
|
||||
return damage;
|
||||
|
||||
if (augments) {
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i) {
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i) {
|
||||
if (GetAugment(i))
|
||||
damage = GetAugment(i)->GetItemElementalDamage();
|
||||
if (damage)
|
||||
@@ -1092,7 +1092,7 @@ int EQEmu::ItemInstance::GetItemRecommendedLevel(bool augments) const
|
||||
level = item->RecLevel;
|
||||
|
||||
if (augments) {
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i) {
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i) {
|
||||
int temp = 0;
|
||||
if (GetAugment(i)) {
|
||||
temp = GetAugment(i)->GetItemRecommendedLevel();
|
||||
@@ -1114,7 +1114,7 @@ int EQEmu::ItemInstance::GetItemRequiredLevel(bool augments) const
|
||||
level = item->ReqLevel;
|
||||
|
||||
if (augments) {
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i) {
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i) {
|
||||
int temp = 0;
|
||||
if (GetAugment(i)) {
|
||||
temp = GetAugment(i)->GetItemRequiredLevel();
|
||||
@@ -1136,7 +1136,7 @@ int EQEmu::ItemInstance::GetItemWeaponDamage(bool augments) const
|
||||
damage = item->Damage;
|
||||
|
||||
if (augments) {
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
damage += GetAugment(i)->GetItemWeaponDamage();
|
||||
}
|
||||
@@ -1152,7 +1152,7 @@ int EQEmu::ItemInstance::GetItemBackstabDamage(bool augments) const
|
||||
damage = item->BackstabDmg;
|
||||
|
||||
if (augments) {
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
damage += GetAugment(i)->GetItemBackstabDamage();
|
||||
}
|
||||
@@ -1170,7 +1170,7 @@ int EQEmu::ItemInstance::GetItemBaneDamageBody(bool augments) const
|
||||
return body;
|
||||
|
||||
if (augments) {
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i)) {
|
||||
body = GetAugment(i)->GetItemBaneDamageBody();
|
||||
if (body)
|
||||
@@ -1191,7 +1191,7 @@ int EQEmu::ItemInstance::GetItemBaneDamageRace(bool augments) const
|
||||
return race;
|
||||
|
||||
if (augments) {
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i)) {
|
||||
race = GetAugment(i)->GetItemBaneDamageRace();
|
||||
if (race)
|
||||
@@ -1211,7 +1211,7 @@ int EQEmu::ItemInstance::GetItemBaneDamageBody(bodyType against, bool augments)
|
||||
damage += item->BaneDmgAmt;
|
||||
|
||||
if (augments) {
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
damage += GetAugment(i)->GetItemBaneDamageBody(against);
|
||||
}
|
||||
@@ -1228,7 +1228,7 @@ int EQEmu::ItemInstance::GetItemBaneDamageRace(uint16 against, bool augments) co
|
||||
damage += item->BaneDmgRaceAmt;
|
||||
|
||||
if (augments) {
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
damage += GetAugment(i)->GetItemBaneDamageRace(against);
|
||||
}
|
||||
@@ -1244,7 +1244,7 @@ int EQEmu::ItemInstance::GetItemMagical(bool augments) const
|
||||
return 1;
|
||||
|
||||
if (augments) {
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i) && GetAugment(i)->GetItemMagical())
|
||||
return 1;
|
||||
}
|
||||
@@ -1259,7 +1259,7 @@ int EQEmu::ItemInstance::GetItemHP(bool augments) const
|
||||
if (item) {
|
||||
hp = item->HP;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
hp += GetAugment(i)->GetItemHP();
|
||||
}
|
||||
@@ -1273,7 +1273,7 @@ int EQEmu::ItemInstance::GetItemMana(bool augments) const
|
||||
if (item) {
|
||||
mana = item->Mana;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
mana += GetAugment(i)->GetItemMana();
|
||||
}
|
||||
@@ -1287,7 +1287,7 @@ int EQEmu::ItemInstance::GetItemEndur(bool augments) const
|
||||
if (item) {
|
||||
endur = item->Endur;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
endur += GetAugment(i)->GetItemEndur();
|
||||
}
|
||||
@@ -1301,7 +1301,7 @@ int EQEmu::ItemInstance::GetItemAttack(bool augments) const
|
||||
if (item) {
|
||||
atk = item->Attack;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
atk += GetAugment(i)->GetItemAttack();
|
||||
}
|
||||
@@ -1315,7 +1315,7 @@ int EQEmu::ItemInstance::GetItemStr(bool augments) const
|
||||
if (item) {
|
||||
str = item->AStr;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
str += GetAugment(i)->GetItemStr();
|
||||
}
|
||||
@@ -1329,7 +1329,7 @@ int EQEmu::ItemInstance::GetItemSta(bool augments) const
|
||||
if (item) {
|
||||
sta = item->ASta;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
sta += GetAugment(i)->GetItemSta();
|
||||
}
|
||||
@@ -1343,7 +1343,7 @@ int EQEmu::ItemInstance::GetItemDex(bool augments) const
|
||||
if (item) {
|
||||
total = item->ADex;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
total += GetAugment(i)->GetItemDex();
|
||||
}
|
||||
@@ -1357,7 +1357,7 @@ int EQEmu::ItemInstance::GetItemAgi(bool augments) const
|
||||
if (item) {
|
||||
total = item->AAgi;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
total += GetAugment(i)->GetItemAgi();
|
||||
}
|
||||
@@ -1371,7 +1371,7 @@ int EQEmu::ItemInstance::GetItemInt(bool augments) const
|
||||
if (item) {
|
||||
total = item->AInt;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
total += GetAugment(i)->GetItemInt();
|
||||
}
|
||||
@@ -1385,7 +1385,7 @@ int EQEmu::ItemInstance::GetItemWis(bool augments) const
|
||||
if (item) {
|
||||
total = item->AWis;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
total += GetAugment(i)->GetItemWis();
|
||||
}
|
||||
@@ -1399,7 +1399,7 @@ int EQEmu::ItemInstance::GetItemCha(bool augments) const
|
||||
if (item) {
|
||||
total = item->ACha;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
total += GetAugment(i)->GetItemCha();
|
||||
}
|
||||
@@ -1413,7 +1413,7 @@ int EQEmu::ItemInstance::GetItemMR(bool augments) const
|
||||
if (item) {
|
||||
total = item->MR;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
total += GetAugment(i)->GetItemMR();
|
||||
}
|
||||
@@ -1427,7 +1427,7 @@ int EQEmu::ItemInstance::GetItemFR(bool augments) const
|
||||
if (item) {
|
||||
total = item->FR;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
total += GetAugment(i)->GetItemFR();
|
||||
}
|
||||
@@ -1441,7 +1441,7 @@ int EQEmu::ItemInstance::GetItemCR(bool augments) const
|
||||
if (item) {
|
||||
total = item->CR;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
total += GetAugment(i)->GetItemCR();
|
||||
}
|
||||
@@ -1455,7 +1455,7 @@ int EQEmu::ItemInstance::GetItemPR(bool augments) const
|
||||
if (item) {
|
||||
total = item->PR;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
total += GetAugment(i)->GetItemPR();
|
||||
}
|
||||
@@ -1469,7 +1469,7 @@ int EQEmu::ItemInstance::GetItemDR(bool augments) const
|
||||
if (item) {
|
||||
total = item->DR;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
total += GetAugment(i)->GetItemDR();
|
||||
}
|
||||
@@ -1483,7 +1483,7 @@ int EQEmu::ItemInstance::GetItemCorrup(bool augments) const
|
||||
if (item) {
|
||||
total = item->SVCorruption;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
total += GetAugment(i)->GetItemCorrup();
|
||||
}
|
||||
@@ -1497,7 +1497,7 @@ int EQEmu::ItemInstance::GetItemHeroicStr(bool augments) const
|
||||
if (item) {
|
||||
total = item->HeroicStr;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
total += GetAugment(i)->GetItemHeroicStr();
|
||||
}
|
||||
@@ -1511,7 +1511,7 @@ int EQEmu::ItemInstance::GetItemHeroicSta(bool augments) const
|
||||
if (item) {
|
||||
total = item->HeroicSta;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
total += GetAugment(i)->GetItemHeroicSta();
|
||||
}
|
||||
@@ -1525,7 +1525,7 @@ int EQEmu::ItemInstance::GetItemHeroicDex(bool augments) const
|
||||
if (item) {
|
||||
total = item->HeroicDex;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
total += GetAugment(i)->GetItemHeroicDex();
|
||||
}
|
||||
@@ -1539,7 +1539,7 @@ int EQEmu::ItemInstance::GetItemHeroicAgi(bool augments) const
|
||||
if (item) {
|
||||
total = item->HeroicAgi;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
total += GetAugment(i)->GetItemHeroicAgi();
|
||||
}
|
||||
@@ -1553,7 +1553,7 @@ int EQEmu::ItemInstance::GetItemHeroicInt(bool augments) const
|
||||
if (item) {
|
||||
total = item->HeroicInt;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
total += GetAugment(i)->GetItemHeroicInt();
|
||||
}
|
||||
@@ -1567,7 +1567,7 @@ int EQEmu::ItemInstance::GetItemHeroicWis(bool augments) const
|
||||
if (item) {
|
||||
total = item->HeroicWis;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
total += GetAugment(i)->GetItemHeroicWis();
|
||||
}
|
||||
@@ -1581,7 +1581,7 @@ int EQEmu::ItemInstance::GetItemHeroicCha(bool augments) const
|
||||
if (item) {
|
||||
total = item->HeroicCha;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
total += GetAugment(i)->GetItemHeroicCha();
|
||||
}
|
||||
@@ -1595,7 +1595,7 @@ int EQEmu::ItemInstance::GetItemHeroicMR(bool augments) const
|
||||
if (item) {
|
||||
total = item->HeroicMR;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
total += GetAugment(i)->GetItemHeroicMR();
|
||||
}
|
||||
@@ -1609,7 +1609,7 @@ int EQEmu::ItemInstance::GetItemHeroicFR(bool augments) const
|
||||
if (item) {
|
||||
total = item->HeroicFR;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
total += GetAugment(i)->GetItemHeroicFR();
|
||||
}
|
||||
@@ -1623,7 +1623,7 @@ int EQEmu::ItemInstance::GetItemHeroicCR(bool augments) const
|
||||
if (item) {
|
||||
total = item->HeroicCR;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
total += GetAugment(i)->GetItemHeroicCR();
|
||||
}
|
||||
@@ -1637,7 +1637,7 @@ int EQEmu::ItemInstance::GetItemHeroicPR(bool augments) const
|
||||
if (item) {
|
||||
total = item->HeroicPR;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
total += GetAugment(i)->GetItemHeroicPR();
|
||||
}
|
||||
@@ -1651,7 +1651,7 @@ int EQEmu::ItemInstance::GetItemHeroicDR(bool augments) const
|
||||
if (item) {
|
||||
total = item->HeroicDR;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
total += GetAugment(i)->GetItemHeroicDR();
|
||||
}
|
||||
@@ -1665,7 +1665,7 @@ int EQEmu::ItemInstance::GetItemHeroicCorrup(bool augments) const
|
||||
if (item) {
|
||||
total = item->HeroicSVCorrup;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i))
|
||||
total += GetAugment(i)->GetItemHeroicCorrup();
|
||||
}
|
||||
@@ -1679,7 +1679,7 @@ int EQEmu::ItemInstance::GetItemHaste(bool augments) const
|
||||
if (item) {
|
||||
total = item->Haste;
|
||||
if (augments)
|
||||
for (int i = inventory::socketBegin; i < inventory::SocketCount; ++i)
|
||||
for (int i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; ++i)
|
||||
if (GetAugment(i)) {
|
||||
int temp = GetAugment(i)->GetItemHaste();
|
||||
if (temp > total)
|
||||
|
||||
@@ -275,7 +275,7 @@ float EQHtoFloat(int d)
|
||||
}
|
||||
|
||||
// returns a swapped-bit value for use in client translator and inventory functions
|
||||
uint32 SwapBits21and22(uint32 mask)
|
||||
uint32 SwapBits21And22(uint32 mask)
|
||||
{
|
||||
static const uint32 BIT21 = 1 << 21;
|
||||
static const uint32 BIT22 = 1 << 22;
|
||||
|
||||
@@ -69,7 +69,7 @@ int FloatToEQSpeedRun(float d);
|
||||
// brings heading back into EQ angles range
|
||||
float FixHeading(float in);
|
||||
|
||||
uint32 SwapBits21and22(uint32 mask);
|
||||
uint32 SwapBits21And22(uint32 mask);
|
||||
uint32 Catch22(uint32 mask);
|
||||
|
||||
// macro to catch fp errors (provided by noudness)
|
||||
|
||||
+101
-212
@@ -1863,120 +1863,6 @@ namespace RoF
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
|
||||
/*
|
||||
ENCODE(OP_OpenNewTasksWindow)
|
||||
{
|
||||
AvailableTaskHeader_Struct* __emu_AvailableTaskHeader;
|
||||
AvailableTaskData1_Struct* __emu_AvailableTaskData1;
|
||||
AvailableTaskData2_Struct* __emu_AvailableTaskData2;
|
||||
AvailableTaskTrailer_Struct* __emu_AvailableTaskTrailer;
|
||||
|
||||
structs::AvailableTaskHeader_Struct* __eq_AvailableTaskHeader;
|
||||
structs::AvailableTaskData1_Struct* __eq_AvailableTaskData1;
|
||||
structs::AvailableTaskData2_Struct* __eq_AvailableTaskData2;
|
||||
structs::AvailableTaskTrailer_Struct* __eq_AvailableTaskTrailer;
|
||||
|
||||
EQApplicationPacket *in = *p;
|
||||
*p = nullptr;
|
||||
|
||||
unsigned char *__emu_buffer = in->pBuffer;
|
||||
|
||||
__emu_AvailableTaskHeader = (AvailableTaskHeader_Struct*)__emu_buffer;
|
||||
|
||||
// For each task, SoF has an extra uint32 and what appears to be space for a null terminated string.
|
||||
//
|
||||
in->size = in->size + (__emu_AvailableTaskHeader->TaskCount * 5);
|
||||
|
||||
in->pBuffer = new unsigned char[in->size];
|
||||
|
||||
unsigned char *__eq_buffer = in->pBuffer;
|
||||
|
||||
__eq_AvailableTaskHeader = (structs::AvailableTaskHeader_Struct*)__eq_buffer;
|
||||
|
||||
char *__eq_ptr, *__emu_Ptr;
|
||||
|
||||
// Copy Header
|
||||
//
|
||||
//
|
||||
|
||||
__eq_AvailableTaskHeader->TaskCount = __emu_AvailableTaskHeader->TaskCount;
|
||||
__eq_AvailableTaskHeader->unknown1 = __emu_AvailableTaskHeader->unknown1;
|
||||
__eq_AvailableTaskHeader->TaskGiver = __emu_AvailableTaskHeader->TaskGiver;
|
||||
|
||||
__emu_Ptr = (char *) __emu_AvailableTaskHeader + sizeof(AvailableTaskHeader_Struct);
|
||||
__eq_ptr = (char *) __eq_AvailableTaskHeader + sizeof(structs::AvailableTaskHeader_Struct);
|
||||
|
||||
for(uint32 i=0; i<__emu_AvailableTaskHeader->TaskCount; i++) {
|
||||
|
||||
__emu_AvailableTaskData1 = (AvailableTaskData1_Struct*)__emu_Ptr;
|
||||
__eq_AvailableTaskData1 = (structs::AvailableTaskData1_Struct*)__eq_ptr;
|
||||
|
||||
__eq_AvailableTaskData1->TaskID = __emu_AvailableTaskData1->TaskID;
|
||||
// This next unknown seems to affect the colour of the task title. 0x3f80000 is what I have seen
|
||||
// in RoF packets. Changing it to 0x3f000000 makes the title red.
|
||||
__eq_AvailableTaskData1->unknown1 = 0x3f800000;
|
||||
__eq_AvailableTaskData1->TimeLimit = __emu_AvailableTaskData1->TimeLimit;
|
||||
__eq_AvailableTaskData1->unknown2 = __emu_AvailableTaskData1->unknown2;
|
||||
|
||||
__emu_Ptr += sizeof(AvailableTaskData1_Struct);
|
||||
__eq_ptr += sizeof(structs::AvailableTaskData1_Struct);
|
||||
|
||||
strcpy(__eq_ptr, __emu_Ptr); // Title
|
||||
|
||||
__emu_Ptr += strlen(__emu_Ptr) + 1;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
|
||||
strcpy(__eq_ptr, __emu_Ptr); // Description
|
||||
|
||||
__emu_Ptr += strlen(__emu_Ptr) + 1;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
|
||||
__eq_ptr[0] = 0;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
|
||||
__emu_AvailableTaskData2 = (AvailableTaskData2_Struct*)__emu_Ptr;
|
||||
__eq_AvailableTaskData2 = (structs::AvailableTaskData2_Struct*)__eq_ptr;
|
||||
|
||||
__eq_AvailableTaskData2->unknown1 = __emu_AvailableTaskData2->unknown1;
|
||||
__eq_AvailableTaskData2->unknown2 = __emu_AvailableTaskData2->unknown2;
|
||||
__eq_AvailableTaskData2->unknown3 = __emu_AvailableTaskData2->unknown3;
|
||||
__eq_AvailableTaskData2->unknown4 = __emu_AvailableTaskData2->unknown4;
|
||||
|
||||
__emu_Ptr += sizeof(AvailableTaskData2_Struct);
|
||||
__eq_ptr += sizeof(structs::AvailableTaskData2_Struct);
|
||||
|
||||
strcpy(__eq_ptr, __emu_Ptr); // Unknown string
|
||||
|
||||
__emu_Ptr += strlen(__emu_Ptr) + 1;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
|
||||
strcpy(__eq_ptr, __emu_Ptr); // Unknown string
|
||||
|
||||
__emu_Ptr += strlen(__emu_Ptr) + 1;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
|
||||
__emu_AvailableTaskTrailer = (AvailableTaskTrailer_Struct*)__emu_Ptr;
|
||||
__eq_AvailableTaskTrailer = (structs::AvailableTaskTrailer_Struct*)__eq_ptr;
|
||||
|
||||
__eq_AvailableTaskTrailer->ItemCount = __emu_AvailableTaskTrailer->ItemCount;
|
||||
__eq_AvailableTaskTrailer->unknown1 = __emu_AvailableTaskTrailer->unknown1;
|
||||
__eq_AvailableTaskTrailer->unknown2 = __emu_AvailableTaskTrailer->unknown2;
|
||||
__eq_AvailableTaskTrailer->StartZone = __emu_AvailableTaskTrailer->StartZone;
|
||||
|
||||
__emu_Ptr += sizeof(AvailableTaskTrailer_Struct);
|
||||
__eq_ptr += sizeof(structs::AvailableTaskTrailer_Struct);
|
||||
|
||||
strcpy(__eq_ptr, __emu_Ptr); // Unknown string
|
||||
|
||||
__emu_Ptr += strlen(__emu_Ptr) + 1;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
}
|
||||
|
||||
delete[] __emu_buffer;
|
||||
dest->FastQueuePacket(&in, ack_req);
|
||||
}
|
||||
*/
|
||||
|
||||
ENCODE(OP_PetBuffWindow)
|
||||
{
|
||||
// The format of the RoF packet is identical to the OP_BuffCreate packet.
|
||||
@@ -2338,12 +2224,12 @@ namespace RoF
|
||||
outapp->WriteUInt8(0); // Unknown
|
||||
outapp->WriteUInt8(0); // Unknown
|
||||
|
||||
outapp->WriteUInt32(profile::BandoliersSize);
|
||||
outapp->WriteUInt32(profile::BANDOLIERS_SIZE);
|
||||
|
||||
// Copy bandoliers where server and client indexes converge
|
||||
for (uint32 r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < profile::BandoliersSize; ++r) {
|
||||
for (uint32 r = 0; r < EQEmu::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
|
||||
outapp->WriteString(emu->bandoliers[r].Name);
|
||||
for (uint32 j = 0; j < profile::BandolierItemCount; ++j) { // Will need adjusting if 'server != client' is ever true
|
||||
for (uint32 j = 0; j < profile::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
|
||||
outapp->WriteString(emu->bandoliers[r].Items[j].Name);
|
||||
outapp->WriteUInt32(emu->bandoliers[r].Items[j].ID);
|
||||
if (emu->bandoliers[r].Items[j].Icon) {
|
||||
@@ -2356,19 +2242,19 @@ namespace RoF
|
||||
}
|
||||
}
|
||||
// Nullify bandoliers where server and client indexes diverge, with a client bias
|
||||
for (uint32 r = EQEmu::legacy::BANDOLIERS_SIZE; r < profile::BandoliersSize; ++r) {
|
||||
for (uint32 r = EQEmu::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
|
||||
outapp->WriteString("");
|
||||
for (uint32 j = 0; j < profile::BandolierItemCount; ++j) { // Will need adjusting if 'server != client' is ever true
|
||||
for (uint32 j = 0; j < profile::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
|
||||
outapp->WriteString("");
|
||||
outapp->WriteUInt32(0);
|
||||
outapp->WriteSInt32(-1);
|
||||
}
|
||||
}
|
||||
|
||||
outapp->WriteUInt32(profile::PotionBeltSize);
|
||||
outapp->WriteUInt32(profile::POTION_BELT_SIZE);
|
||||
|
||||
// Copy potion belt where server and client indexes converge
|
||||
for (uint32 r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < profile::PotionBeltSize; ++r) {
|
||||
for (uint32 r = 0; r < EQEmu::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
|
||||
outapp->WriteString(emu->potionbelt.Items[r].Name);
|
||||
outapp->WriteUInt32(emu->potionbelt.Items[r].ID);
|
||||
if (emu->potionbelt.Items[r].Icon) {
|
||||
@@ -2380,7 +2266,7 @@ namespace RoF
|
||||
}
|
||||
}
|
||||
// Nullify potion belt where server and client indexes diverge, with a client bias
|
||||
for (uint32 r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < profile::PotionBeltSize; ++r) {
|
||||
for (uint32 r = EQEmu::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
|
||||
outapp->WriteString("");
|
||||
outapp->WriteUInt32(0);
|
||||
outapp->WriteSInt32(-1);
|
||||
@@ -2501,9 +2387,9 @@ namespace RoF
|
||||
outapp->WriteUInt8(0); // Unknown
|
||||
outapp->WriteUInt8(0); // Unknown
|
||||
|
||||
outapp->WriteUInt32(EQEmu::legacy::TRIBUTE_SIZE);
|
||||
outapp->WriteUInt32(EQEmu::invtype::TRIBUTE_SIZE);
|
||||
|
||||
for (uint32 r = 0; r < EQEmu::legacy::TRIBUTE_SIZE; r++)
|
||||
for (uint32 r = 0; r < EQEmu::invtype::TRIBUTE_SIZE; r++)
|
||||
{
|
||||
outapp->WriteUInt32(emu->tributes[r].tribute);
|
||||
outapp->WriteUInt32(emu->tributes[r].tier);
|
||||
@@ -2994,7 +2880,7 @@ namespace RoF
|
||||
|
||||
size_t names_length = 0;
|
||||
size_t character_count = 0;
|
||||
for (; character_count < emu->CharCount && character_count < constants::SayLinkBodySize; ++character_count) {
|
||||
for (; character_count < emu->CharCount && character_count < constants::CHARACTER_CREATION_LIMIT; ++character_count) {
|
||||
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
|
||||
names_length += strlen(emu_cse->Name);
|
||||
emu_ptr += sizeof(CharacterSelectEntry_Struct);
|
||||
@@ -3368,13 +3254,16 @@ namespace RoF
|
||||
InBuffer += description_size;
|
||||
InBuffer += sizeof(TaskDescriptionData2_Struct);
|
||||
|
||||
std::string old_message = InBuffer; // start 'Reward' as string
|
||||
uint32 reward_size = strlen(InBuffer) + 1;
|
||||
InBuffer += reward_size;
|
||||
|
||||
std::string old_message = InBuffer; // start item link string
|
||||
std::string new_message;
|
||||
ServerToRoFSayLink(new_message, old_message);
|
||||
|
||||
in->size = sizeof(TaskDescriptionHeader_Struct) + sizeof(TaskDescriptionData1_Struct)+
|
||||
sizeof(TaskDescriptionData2_Struct) + sizeof(TaskDescriptionTrailer_Struct)+
|
||||
title_size + description_size + new_message.length() + 1;
|
||||
title_size + description_size + reward_size + new_message.length() + 1;
|
||||
|
||||
in->pBuffer = new unsigned char[in->size];
|
||||
|
||||
@@ -4811,7 +4700,7 @@ namespace RoF
|
||||
|
||||
IN(item_id);
|
||||
int r;
|
||||
for (r = EQEmu::inventory::socketBegin; r < EQEmu::inventory::SocketCount; r++) {
|
||||
for (r = EQEmu::invaug::SOCKET_BEGIN; r <= EQEmu::invaug::SOCKET_END; r++) {
|
||||
IN(augments[r]);
|
||||
}
|
||||
IN(link_hash);
|
||||
@@ -5205,7 +5094,7 @@ namespace RoF
|
||||
|
||||
structs::InventorySlot_Struct slot_id = ServerToRoFSlot(slot_id_in);
|
||||
|
||||
hdr.slot_type = (inst->GetMerchantSlot() ? invtype::InvTypeMerchant : slot_id.Type);
|
||||
hdr.slot_type = (inst->GetMerchantSlot() ? invtype::typeMerchant : slot_id.Type);
|
||||
hdr.main_slot = (inst->GetMerchantSlot() ? inst->GetMerchantSlot() : slot_id.Slot);
|
||||
hdr.sub_slot = (inst->GetMerchantSlot() ? 0xffff : slot_id.SubIndex);
|
||||
hdr.aug_slot = (inst->GetMerchantSlot() ? 0xffff : slot_id.AugIndex);
|
||||
@@ -5299,7 +5188,7 @@ namespace RoF
|
||||
ibs.nodrop = item->NoDrop;
|
||||
ibs.attune = item->Attuneable;
|
||||
ibs.size = item->Size;
|
||||
ibs.slots = SwapBits21and22(item->Slots);
|
||||
ibs.slots = SwapBits21And22(item->Slots);
|
||||
ibs.price = item->Price;
|
||||
ibs.icon = item->Icon;
|
||||
ibs.unknown1 = 1;
|
||||
@@ -5393,7 +5282,7 @@ namespace RoF
|
||||
isbs.augdistiller = 65535;
|
||||
isbs.augrestrict = item->AugRestrict;
|
||||
|
||||
for (int index = 0; index < invaug::ItemAugSize; ++index) {
|
||||
for (int index = invaug::SOCKET_BEGIN; index <= invaug::SOCKET_END; ++index) {
|
||||
isbs.augslots[index].type = item->AugSlotType[index];
|
||||
isbs.augslots[index].visible = item->AugSlotVisible[index];
|
||||
isbs.augslots[index].unknown = item->AugSlotUnk2[index];
|
||||
@@ -5603,18 +5492,18 @@ namespace RoF
|
||||
|
||||
ob.write((const char*)&subitem_count, sizeof(uint32));
|
||||
|
||||
for (uint32 index = EQEmu::inventory::containerBegin; index < EQEmu::inventory::ContainerCount; ++index) {
|
||||
for (uint32 index = EQEmu::invbag::SLOT_BEGIN; index <= EQEmu::invbag::SLOT_END; ++index) {
|
||||
EQEmu::ItemInstance* sub = inst->GetItem(index);
|
||||
if (!sub)
|
||||
continue;
|
||||
|
||||
int SubSlotNumber = INVALID_INDEX;
|
||||
if (slot_id_in >= EQEmu::legacy::GENERAL_BEGIN && slot_id_in <= EQEmu::legacy::GENERAL_END)
|
||||
SubSlotNumber = (((slot_id_in + 3) * EQEmu::inventory::ContainerCount) + index + 1);
|
||||
else if (slot_id_in >= EQEmu::legacy::BANK_BEGIN && slot_id_in <= EQEmu::legacy::BANK_END)
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::legacy::BANK_BEGIN) * EQEmu::inventory::ContainerCount) + EQEmu::legacy::BANK_BAGS_BEGIN + index);
|
||||
else if (slot_id_in >= EQEmu::legacy::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::legacy::SHARED_BANK_END)
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::legacy::SHARED_BANK_BEGIN) * EQEmu::inventory::ContainerCount) + EQEmu::legacy::SHARED_BANK_BAGS_BEGIN + index);
|
||||
if (slot_id_in >= EQEmu::invslot::GENERAL_BEGIN && slot_id_in <= EQEmu::invslot::GENERAL_END)
|
||||
SubSlotNumber = (((slot_id_in + 3) * EQEmu::invbag::SLOT_COUNT) + index + 1);
|
||||
else if (slot_id_in >= EQEmu::invslot::BANK_BEGIN && slot_id_in <= EQEmu::invslot::BANK_END)
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::invslot::BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT) + EQEmu::invbag::BANK_BAGS_BEGIN + index);
|
||||
else if (slot_id_in >= EQEmu::invslot::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::invslot::SHARED_BANK_END)
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::invslot::SHARED_BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT) + EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + index);
|
||||
else
|
||||
SubSlotNumber = slot_id_in;
|
||||
|
||||
@@ -5640,17 +5529,17 @@ namespace RoF
|
||||
|
||||
uint32 TempSlot = 0;
|
||||
|
||||
if (serverSlot < 56 || serverSlot == EQEmu::inventory::slotPowerSource) { // Main Inventory and Cursor
|
||||
RoFSlot.Type = invtype::InvTypePossessions;
|
||||
if (serverSlot < 56 || serverSlot == EQEmu::invslot::SLOT_POWER_SOURCE) { // Main Inventory and Cursor
|
||||
RoFSlot.Type = invtype::typePossessions;
|
||||
RoFSlot.Slot = serverSlot;
|
||||
|
||||
if (serverSlot == EQEmu::inventory::slotPowerSource)
|
||||
RoFSlot.Slot = invslot::PossessionsPowerSource;
|
||||
if (serverSlot == EQEmu::invslot::SLOT_POWER_SOURCE)
|
||||
RoFSlot.Slot = invslot::slotPowerSource;
|
||||
|
||||
else if (serverSlot >= EQEmu::inventory::slotCursor) // Cursor and Extended Corpse Inventory
|
||||
else if (serverSlot >= EQEmu::invslot::slotCursor) // Cursor and Extended Corpse Inventory
|
||||
RoFSlot.Slot += 3;
|
||||
|
||||
else if (serverSlot >= EQEmu::inventory::slotAmmo) // (> 20)
|
||||
else if (serverSlot >= EQEmu::invslot::slotAmmo) // (> 20)
|
||||
RoFSlot.Slot += 1;
|
||||
}
|
||||
|
||||
@@ -5659,51 +5548,51 @@ namespace RoF
|
||||
RoFSlot.MainSlot = ServerSlot - 31;
|
||||
}*/
|
||||
|
||||
else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END) { // (> 250 && < 341)
|
||||
RoFSlot.Type = invtype::InvTypePossessions;
|
||||
else if (serverSlot >= EQEmu::invbag::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::invbag::CURSOR_BAG_END) { // (> 250 && < 341)
|
||||
RoFSlot.Type = invtype::typePossessions;
|
||||
TempSlot = serverSlot - 1;
|
||||
RoFSlot.Slot = int(TempSlot / EQEmu::inventory::ContainerCount) - 2;
|
||||
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::inventory::ContainerCount);
|
||||
RoFSlot.Slot = int(TempSlot / EQEmu::invbag::SLOT_COUNT) - 2;
|
||||
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::invbag::SLOT_COUNT);
|
||||
|
||||
if (RoFSlot.Slot >= invslot::PossessionsGeneral9) // (> 30)
|
||||
RoFSlot.Slot = invslot::PossessionsCursor;
|
||||
if (RoFSlot.Slot >= invslot::slotGeneral9) // (> 30)
|
||||
RoFSlot.Slot = invslot::slotCursor;
|
||||
}
|
||||
|
||||
else if (serverSlot >= EQEmu::legacy::TRIBUTE_BEGIN && serverSlot <= EQEmu::legacy::TRIBUTE_END) { // Tribute
|
||||
RoFSlot.Type = invtype::InvTypeTribute;
|
||||
RoFSlot.Slot = serverSlot - EQEmu::legacy::TRIBUTE_BEGIN;
|
||||
else if (serverSlot >= EQEmu::invslot::TRIBUTE_BEGIN && serverSlot <= EQEmu::invslot::TRIBUTE_END) { // Tribute
|
||||
RoFSlot.Type = invtype::typeTribute;
|
||||
RoFSlot.Slot = serverSlot - EQEmu::invslot::TRIBUTE_BEGIN;
|
||||
}
|
||||
|
||||
else if (serverSlot >= EQEmu::legacy::BANK_BEGIN && serverSlot <= EQEmu::legacy::BANK_BAGS_END) {
|
||||
RoFSlot.Type = invtype::InvTypeBank;
|
||||
TempSlot = serverSlot - EQEmu::legacy::BANK_BEGIN;
|
||||
else if (serverSlot >= EQEmu::invslot::BANK_BEGIN && serverSlot <= EQEmu::invbag::BANK_BAGS_END) {
|
||||
RoFSlot.Type = invtype::typeBank;
|
||||
TempSlot = serverSlot - EQEmu::invslot::BANK_BEGIN;
|
||||
RoFSlot.Slot = TempSlot;
|
||||
|
||||
if (TempSlot > 30) { // (> 30)
|
||||
RoFSlot.Slot = int(TempSlot / EQEmu::inventory::ContainerCount) - 3;
|
||||
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::inventory::ContainerCount);
|
||||
RoFSlot.Slot = int(TempSlot / EQEmu::invbag::SLOT_COUNT) - 3;
|
||||
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::invbag::SLOT_COUNT);
|
||||
}
|
||||
}
|
||||
|
||||
else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END) {
|
||||
RoFSlot.Type = invtype::InvTypeSharedBank;
|
||||
TempSlot = serverSlot - EQEmu::legacy::SHARED_BANK_BEGIN;
|
||||
else if (serverSlot >= EQEmu::invslot::SHARED_BANK_BEGIN && serverSlot <= EQEmu::invbag::SHARED_BANK_BAGS_END) {
|
||||
RoFSlot.Type = invtype::typeSharedBank;
|
||||
TempSlot = serverSlot - EQEmu::invslot::SHARED_BANK_BEGIN;
|
||||
RoFSlot.Slot = TempSlot;
|
||||
|
||||
if (TempSlot > 30) { // (> 30)
|
||||
RoFSlot.Slot = int(TempSlot / EQEmu::inventory::ContainerCount) - 3;
|
||||
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::inventory::ContainerCount);
|
||||
RoFSlot.Slot = int(TempSlot / EQEmu::invbag::SLOT_COUNT) - 3;
|
||||
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::invbag::SLOT_COUNT);
|
||||
}
|
||||
}
|
||||
|
||||
else if (serverSlot >= EQEmu::legacy::TRADE_BEGIN && serverSlot <= EQEmu::legacy::TRADE_BAGS_END) {
|
||||
RoFSlot.Type = invtype::InvTypeTrade;
|
||||
TempSlot = serverSlot - EQEmu::legacy::TRADE_BEGIN;
|
||||
else if (serverSlot >= EQEmu::invslot::TRADE_BEGIN && serverSlot <= EQEmu::invbag::TRADE_BAGS_END) {
|
||||
RoFSlot.Type = invtype::typeTrade;
|
||||
TempSlot = serverSlot - EQEmu::invslot::TRADE_BEGIN;
|
||||
RoFSlot.Slot = TempSlot;
|
||||
|
||||
if (TempSlot > 30) {
|
||||
RoFSlot.Slot = int(TempSlot / EQEmu::inventory::ContainerCount) - 3;
|
||||
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::inventory::ContainerCount);
|
||||
RoFSlot.Slot = int(TempSlot / EQEmu::invbag::SLOT_COUNT) - 3;
|
||||
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::invbag::SLOT_COUNT);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -5720,9 +5609,9 @@ namespace RoF
|
||||
*/
|
||||
}
|
||||
|
||||
else if (serverSlot >= EQEmu::legacy::WORLD_BEGIN && serverSlot <= EQEmu::legacy::WORLD_END) {
|
||||
RoFSlot.Type = invtype::InvTypeWorld;
|
||||
TempSlot = serverSlot - EQEmu::legacy::WORLD_BEGIN;
|
||||
else if (serverSlot >= EQEmu::invslot::WORLD_BEGIN && serverSlot <= EQEmu::invslot::WORLD_END) {
|
||||
RoFSlot.Type = invtype::typeWorld;
|
||||
TempSlot = serverSlot - EQEmu::invslot::WORLD_BEGIN;
|
||||
RoFSlot.Slot = TempSlot;
|
||||
}
|
||||
|
||||
@@ -5741,16 +5630,16 @@ namespace RoF
|
||||
|
||||
uint32 TempSlot = 0;
|
||||
|
||||
if (serverSlot < 56 || serverSlot == EQEmu::inventory::slotPowerSource) { // (< 52)
|
||||
if (serverSlot < 56 || serverSlot == EQEmu::invslot::SLOT_POWER_SOURCE) { // (< 52)
|
||||
RoFSlot.Slot = serverSlot;
|
||||
|
||||
if (serverSlot == EQEmu::inventory::slotPowerSource)
|
||||
RoFSlot.Slot = invslot::PossessionsPowerSource;
|
||||
if (serverSlot == EQEmu::invslot::SLOT_POWER_SOURCE)
|
||||
RoFSlot.Slot = invslot::slotPowerSource;
|
||||
|
||||
else if (serverSlot >= EQEmu::inventory::slotCursor) // Cursor and Extended Corpse Inventory
|
||||
else if (serverSlot >= EQEmu::invslot::slotCursor) // Cursor and Extended Corpse Inventory
|
||||
RoFSlot.Slot += 3;
|
||||
|
||||
else if (serverSlot >= EQEmu::inventory::slotAmmo) // Ammo and Personl Inventory
|
||||
else if (serverSlot >= EQEmu::invslot::slotAmmo) // Ammo and Personl Inventory
|
||||
RoFSlot.Slot += 1;
|
||||
|
||||
/*else if (ServerSlot >= MainCursor) { // Cursor
|
||||
@@ -5761,10 +5650,10 @@ namespace RoF
|
||||
}*/
|
||||
}
|
||||
|
||||
else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END) {
|
||||
else if (serverSlot >= EQEmu::invbag::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::invbag::CURSOR_BAG_END) {
|
||||
TempSlot = serverSlot - 1;
|
||||
RoFSlot.Slot = int(TempSlot / EQEmu::inventory::ContainerCount) - 2;
|
||||
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::inventory::ContainerCount);
|
||||
RoFSlot.Slot = int(TempSlot / EQEmu::invbag::SLOT_COUNT) - 2;
|
||||
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::invbag::SLOT_COUNT);
|
||||
}
|
||||
|
||||
Log(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoFSlot.Slot, RoFSlot.SubIndex, RoFSlot.AugIndex, RoFSlot.Unknown01);
|
||||
@@ -5782,11 +5671,11 @@ namespace RoF
|
||||
uint32 ServerSlot = INVALID_INDEX;
|
||||
uint32 TempSlot = 0;
|
||||
|
||||
if (rofSlot.Type == invtype::InvTypePossessions && rofSlot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 51)
|
||||
if (rofSlot.Slot == invslot::PossessionsPowerSource)
|
||||
TempSlot = EQEmu::inventory::slotPowerSource;
|
||||
if (rofSlot.Type == invtype::typePossessions && rofSlot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 51)
|
||||
if (rofSlot.Slot == invslot::slotPowerSource)
|
||||
TempSlot = EQEmu::invslot::SLOT_POWER_SOURCE;
|
||||
|
||||
else if (rofSlot.Slot >= invslot::PossessionsCursor) // Cursor and Extended Corpse Inventory
|
||||
else if (rofSlot.Slot >= invslot::slotCursor) // Cursor and Extended Corpse Inventory
|
||||
TempSlot = rofSlot.Slot - 3;
|
||||
|
||||
/*else if (RoFSlot.MainSlot == slots::MainGeneral9 || RoFSlot.MainSlot == slots::MainGeneral10) { // 9th and 10th RoF inventory/corpse slots
|
||||
@@ -5800,23 +5689,23 @@ namespace RoF
|
||||
// For now, it's probably best to leave as-is and let this work itself out in the inventory rework.
|
||||
}*/
|
||||
|
||||
else if (rofSlot.Slot >= invslot::PossessionsAmmo) // Ammo and Main Inventory
|
||||
else if (rofSlot.Slot >= invslot::slotAmmo) // Ammo and Main Inventory
|
||||
TempSlot = rofSlot.Slot - 1;
|
||||
|
||||
else // Worn Slots
|
||||
TempSlot = rofSlot.Slot;
|
||||
|
||||
if (rofSlot.SubIndex >= EQEmu::inventory::containerBegin) // Bag Slots
|
||||
TempSlot = ((TempSlot + 3) * EQEmu::inventory::ContainerCount) + rofSlot.SubIndex + 1;
|
||||
if (rofSlot.SubIndex >= EQEmu::invbag::SLOT_BEGIN) // Bag Slots
|
||||
TempSlot = ((TempSlot + 3) * EQEmu::invbag::SLOT_COUNT) + rofSlot.SubIndex + 1;
|
||||
|
||||
ServerSlot = TempSlot;
|
||||
}
|
||||
|
||||
else if (rofSlot.Type == invtype::InvTypeBank) {
|
||||
TempSlot = EQEmu::legacy::BANK_BEGIN;
|
||||
else if (rofSlot.Type == invtype::typeBank) {
|
||||
TempSlot = EQEmu::invslot::BANK_BEGIN;
|
||||
|
||||
if (rofSlot.SubIndex >= EQEmu::inventory::containerBegin)
|
||||
TempSlot += ((rofSlot.Slot + 3) * EQEmu::inventory::ContainerCount) + rofSlot.SubIndex + 1;
|
||||
if (rofSlot.SubIndex >= EQEmu::invbag::SLOT_BEGIN)
|
||||
TempSlot += ((rofSlot.Slot + 3) * EQEmu::invbag::SLOT_COUNT) + rofSlot.SubIndex + 1;
|
||||
|
||||
else
|
||||
TempSlot += rofSlot.Slot;
|
||||
@@ -5824,11 +5713,11 @@ namespace RoF
|
||||
ServerSlot = TempSlot;
|
||||
}
|
||||
|
||||
else if (rofSlot.Type == invtype::InvTypeSharedBank) {
|
||||
TempSlot = EQEmu::legacy::SHARED_BANK_BEGIN;
|
||||
else if (rofSlot.Type == invtype::typeSharedBank) {
|
||||
TempSlot = EQEmu::invslot::SHARED_BANK_BEGIN;
|
||||
|
||||
if (rofSlot.SubIndex >= EQEmu::inventory::containerBegin)
|
||||
TempSlot += ((rofSlot.Slot + 3) * EQEmu::inventory::ContainerCount) + rofSlot.SubIndex + 1;
|
||||
if (rofSlot.SubIndex >= EQEmu::invbag::SLOT_BEGIN)
|
||||
TempSlot += ((rofSlot.Slot + 3) * EQEmu::invbag::SLOT_COUNT) + rofSlot.SubIndex + 1;
|
||||
|
||||
else
|
||||
TempSlot += rofSlot.Slot;
|
||||
@@ -5836,11 +5725,11 @@ namespace RoF
|
||||
ServerSlot = TempSlot;
|
||||
}
|
||||
|
||||
else if (rofSlot.Type == invtype::InvTypeTrade) {
|
||||
TempSlot = EQEmu::legacy::TRADE_BEGIN;
|
||||
else if (rofSlot.Type == invtype::typeTrade) {
|
||||
TempSlot = EQEmu::invslot::TRADE_BEGIN;
|
||||
|
||||
if (rofSlot.SubIndex >= EQEmu::inventory::containerBegin)
|
||||
TempSlot += ((rofSlot.Slot + 3) * EQEmu::inventory::ContainerCount) + rofSlot.SubIndex + 1;
|
||||
if (rofSlot.SubIndex >= EQEmu::invbag::SLOT_BEGIN)
|
||||
TempSlot += ((rofSlot.Slot + 3) * EQEmu::invbag::SLOT_COUNT) + rofSlot.SubIndex + 1;
|
||||
// OLD CODE:
|
||||
//TempSlot += 100 + (RoFSlot.MainSlot * EQEmu::inventory::ContainerCount) + RoFSlot.SubSlot;
|
||||
|
||||
@@ -5850,10 +5739,10 @@ namespace RoF
|
||||
ServerSlot = TempSlot;
|
||||
}
|
||||
|
||||
else if (rofSlot.Type == invtype::InvTypeWorld) {
|
||||
TempSlot = EQEmu::legacy::WORLD_BEGIN;
|
||||
else if (rofSlot.Type == invtype::typeWorld) {
|
||||
TempSlot = EQEmu::invslot::WORLD_BEGIN;
|
||||
|
||||
if (rofSlot.Slot >= EQEmu::inventory::containerBegin)
|
||||
if (rofSlot.Slot >= EQEmu::invbag::SLOT_BEGIN)
|
||||
TempSlot += rofSlot.Slot;
|
||||
|
||||
ServerSlot = TempSlot;
|
||||
@@ -5868,7 +5757,7 @@ namespace RoF
|
||||
ServerSlot = TempSlot;
|
||||
}*/
|
||||
|
||||
else if (rofSlot.Type == invtype::InvTypeGuildTribute) {
|
||||
else if (rofSlot.Type == invtype::typeGuildTribute) {
|
||||
ServerSlot = INVALID_INDEX;
|
||||
}
|
||||
|
||||
@@ -5883,10 +5772,10 @@ namespace RoF
|
||||
uint32 TempSlot = 0;
|
||||
|
||||
if (rofSlot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 33)
|
||||
if (rofSlot.Slot == invslot::PossessionsPowerSource)
|
||||
TempSlot = EQEmu::inventory::slotPowerSource;
|
||||
if (rofSlot.Slot == invslot::slotPowerSource)
|
||||
TempSlot = EQEmu::invslot::SLOT_POWER_SOURCE;
|
||||
|
||||
else if (rofSlot.Slot >= invslot::PossessionsCursor) // Cursor and Extended Corpse Inventory
|
||||
else if (rofSlot.Slot >= invslot::slotCursor) // Cursor and Extended Corpse Inventory
|
||||
TempSlot = rofSlot.Slot - 3;
|
||||
|
||||
/*else if (RoFSlot.MainSlot == slots::MainGeneral9 || RoFSlot.MainSlot == slots::MainGeneral10) { // 9th and 10th RoF inventory slots
|
||||
@@ -5895,14 +5784,14 @@ namespace RoF
|
||||
// Same as above
|
||||
}*/
|
||||
|
||||
else if (rofSlot.Slot >= invslot::PossessionsAmmo) // Main Inventory and Ammo Slots
|
||||
else if (rofSlot.Slot >= invslot::slotAmmo) // Main Inventory and Ammo Slots
|
||||
TempSlot = rofSlot.Slot - 1;
|
||||
|
||||
else
|
||||
TempSlot = rofSlot.Slot;
|
||||
|
||||
if (rofSlot.SubIndex >= EQEmu::inventory::containerBegin) // Bag Slots
|
||||
TempSlot = ((TempSlot + 3) * EQEmu::inventory::ContainerCount) + rofSlot.SubIndex + 1;
|
||||
if (rofSlot.SubIndex >= EQEmu::invbag::SLOT_BEGIN) // Bag Slots
|
||||
TempSlot = ((TempSlot + 3) * EQEmu::invbag::SLOT_COUNT) + rofSlot.SubIndex + 1;
|
||||
|
||||
ServerSlot = TempSlot;
|
||||
}
|
||||
@@ -5919,7 +5808,7 @@ namespace RoF
|
||||
|
||||
static inline void ServerToRoFSayLink(std::string& rofSayLink, const std::string& serverSayLink)
|
||||
{
|
||||
if ((constants::SayLinkBodySize == EQEmu::constants::SayLinkBodySize) || (serverSayLink.find('\x12') == std::string::npos)) {
|
||||
if ((constants::SAY_LINK_BODY_SIZE == EQEmu::constants::SAY_LINK_BODY_SIZE) || (serverSayLink.find('\x12') == std::string::npos)) {
|
||||
rofSayLink = serverSayLink;
|
||||
return;
|
||||
}
|
||||
@@ -5928,7 +5817,7 @@ namespace RoF
|
||||
|
||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||
if (segment_iter & 1) {
|
||||
if (segments[segment_iter].length() <= EQEmu::constants::SayLinkBodySize) {
|
||||
if (segments[segment_iter].length() <= EQEmu::constants::SAY_LINK_BODY_SIZE) {
|
||||
rofSayLink.append(segments[segment_iter]);
|
||||
// TODO: log size mismatch error
|
||||
continue;
|
||||
@@ -5958,7 +5847,7 @@ namespace RoF
|
||||
|
||||
static inline void RoFToServerSayLink(std::string& serverSayLink, const std::string& rofSayLink)
|
||||
{
|
||||
if ((EQEmu::constants::SayLinkBodySize == constants::SayLinkBodySize) || (rofSayLink.find('\x12') == std::string::npos)) {
|
||||
if ((EQEmu::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (rofSayLink.find('\x12') == std::string::npos)) {
|
||||
serverSayLink = rofSayLink;
|
||||
return;
|
||||
}
|
||||
@@ -5967,7 +5856,7 @@ namespace RoF
|
||||
|
||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||
if (segment_iter & 1) {
|
||||
if (segments[segment_iter].length() <= constants::SayLinkBodySize) {
|
||||
if (segments[segment_iter].length() <= constants::SAY_LINK_BODY_SIZE) {
|
||||
serverSayLink.append(segments[segment_iter]);
|
||||
// TODO: log size mismatch error
|
||||
continue;
|
||||
|
||||
+107
-218
@@ -1940,120 +1940,6 @@ namespace RoF2
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
|
||||
/*
|
||||
ENCODE(OP_OpenNewTasksWindow)
|
||||
{
|
||||
AvailableTaskHeader_Struct* __emu_AvailableTaskHeader;
|
||||
AvailableTaskData1_Struct* __emu_AvailableTaskData1;
|
||||
AvailableTaskData2_Struct* __emu_AvailableTaskData2;
|
||||
AvailableTaskTrailer_Struct* __emu_AvailableTaskTrailer;
|
||||
|
||||
structs::AvailableTaskHeader_Struct* __eq_AvailableTaskHeader;
|
||||
structs::AvailableTaskData1_Struct* __eq_AvailableTaskData1;
|
||||
structs::AvailableTaskData2_Struct* __eq_AvailableTaskData2;
|
||||
structs::AvailableTaskTrailer_Struct* __eq_AvailableTaskTrailer;
|
||||
|
||||
EQApplicationPacket *in = *p;
|
||||
*p = nullptr;
|
||||
|
||||
unsigned char *__emu_buffer = in->pBuffer;
|
||||
|
||||
__emu_AvailableTaskHeader = (AvailableTaskHeader_Struct*)__emu_buffer;
|
||||
|
||||
// For each task, SoF has an extra uint32 and what appears to be space for a null terminated string.
|
||||
//
|
||||
in->size = in->size + (__emu_AvailableTaskHeader->TaskCount * 5);
|
||||
|
||||
in->pBuffer = new unsigned char[in->size];
|
||||
|
||||
unsigned char *__eq_buffer = in->pBuffer;
|
||||
|
||||
__eq_AvailableTaskHeader = (structs::AvailableTaskHeader_Struct*)__eq_buffer;
|
||||
|
||||
char *__eq_ptr, *__emu_Ptr;
|
||||
|
||||
// Copy Header
|
||||
//
|
||||
//
|
||||
|
||||
__eq_AvailableTaskHeader->TaskCount = __emu_AvailableTaskHeader->TaskCount;
|
||||
__eq_AvailableTaskHeader->unknown1 = __emu_AvailableTaskHeader->unknown1;
|
||||
__eq_AvailableTaskHeader->TaskGiver = __emu_AvailableTaskHeader->TaskGiver;
|
||||
|
||||
__emu_Ptr = (char *) __emu_AvailableTaskHeader + sizeof(AvailableTaskHeader_Struct);
|
||||
__eq_ptr = (char *) __eq_AvailableTaskHeader + sizeof(structs::AvailableTaskHeader_Struct);
|
||||
|
||||
for(uint32 i=0; i<__emu_AvailableTaskHeader->TaskCount; i++) {
|
||||
|
||||
__emu_AvailableTaskData1 = (AvailableTaskData1_Struct*)__emu_Ptr;
|
||||
__eq_AvailableTaskData1 = (structs::AvailableTaskData1_Struct*)__eq_ptr;
|
||||
|
||||
__eq_AvailableTaskData1->TaskID = __emu_AvailableTaskData1->TaskID;
|
||||
// This next unknown seems to affect the colour of the task title. 0x3f80000 is what I have seen
|
||||
// in RoF2 packets. Changing it to 0x3f000000 makes the title red.
|
||||
__eq_AvailableTaskData1->unknown1 = 0x3f800000;
|
||||
__eq_AvailableTaskData1->TimeLimit = __emu_AvailableTaskData1->TimeLimit;
|
||||
__eq_AvailableTaskData1->unknown2 = __emu_AvailableTaskData1->unknown2;
|
||||
|
||||
__emu_Ptr += sizeof(AvailableTaskData1_Struct);
|
||||
__eq_ptr += sizeof(structs::AvailableTaskData1_Struct);
|
||||
|
||||
strcpy(__eq_ptr, __emu_Ptr); // Title
|
||||
|
||||
__emu_Ptr += strlen(__emu_Ptr) + 1;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
|
||||
strcpy(__eq_ptr, __emu_Ptr); // Description
|
||||
|
||||
__emu_Ptr += strlen(__emu_Ptr) + 1;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
|
||||
__eq_ptr[0] = 0;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
|
||||
__emu_AvailableTaskData2 = (AvailableTaskData2_Struct*)__emu_Ptr;
|
||||
__eq_AvailableTaskData2 = (structs::AvailableTaskData2_Struct*)__eq_ptr;
|
||||
|
||||
__eq_AvailableTaskData2->unknown1 = __emu_AvailableTaskData2->unknown1;
|
||||
__eq_AvailableTaskData2->unknown2 = __emu_AvailableTaskData2->unknown2;
|
||||
__eq_AvailableTaskData2->unknown3 = __emu_AvailableTaskData2->unknown3;
|
||||
__eq_AvailableTaskData2->unknown4 = __emu_AvailableTaskData2->unknown4;
|
||||
|
||||
__emu_Ptr += sizeof(AvailableTaskData2_Struct);
|
||||
__eq_ptr += sizeof(structs::AvailableTaskData2_Struct);
|
||||
|
||||
strcpy(__eq_ptr, __emu_Ptr); // Unknown string
|
||||
|
||||
__emu_Ptr += strlen(__emu_Ptr) + 1;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
|
||||
strcpy(__eq_ptr, __emu_Ptr); // Unknown string
|
||||
|
||||
__emu_Ptr += strlen(__emu_Ptr) + 1;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
|
||||
__emu_AvailableTaskTrailer = (AvailableTaskTrailer_Struct*)__emu_Ptr;
|
||||
__eq_AvailableTaskTrailer = (structs::AvailableTaskTrailer_Struct*)__eq_ptr;
|
||||
|
||||
__eq_AvailableTaskTrailer->ItemCount = __emu_AvailableTaskTrailer->ItemCount;
|
||||
__eq_AvailableTaskTrailer->unknown1 = __emu_AvailableTaskTrailer->unknown1;
|
||||
__eq_AvailableTaskTrailer->unknown2 = __emu_AvailableTaskTrailer->unknown2;
|
||||
__eq_AvailableTaskTrailer->StartZone = __emu_AvailableTaskTrailer->StartZone;
|
||||
|
||||
__emu_Ptr += sizeof(AvailableTaskTrailer_Struct);
|
||||
__eq_ptr += sizeof(structs::AvailableTaskTrailer_Struct);
|
||||
|
||||
strcpy(__eq_ptr, __emu_Ptr); // Unknown string
|
||||
|
||||
__emu_Ptr += strlen(__emu_Ptr) + 1;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
}
|
||||
|
||||
delete[] __emu_buffer;
|
||||
dest->FastQueuePacket(&in, ack_req);
|
||||
}
|
||||
*/
|
||||
|
||||
ENCODE(OP_PetBuffWindow)
|
||||
{
|
||||
// The format of the RoF2 packet is identical to the OP_BuffCreate packet.
|
||||
@@ -2415,12 +2301,12 @@ namespace RoF2
|
||||
outapp->WriteUInt8(0); // Unknown
|
||||
outapp->WriteUInt8(0); // Unknown
|
||||
|
||||
outapp->WriteUInt32(profile::BandoliersSize);
|
||||
outapp->WriteUInt32(profile::BANDOLIERS_SIZE);
|
||||
|
||||
// Copy bandoliers where server and client indexes converge
|
||||
for (uint32 r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < profile::BandoliersSize; ++r) {
|
||||
for (uint32 r = 0; r < EQEmu::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
|
||||
outapp->WriteString(emu->bandoliers[r].Name);
|
||||
for (uint32 j = 0; j < profile::BandolierItemCount; ++j) { // Will need adjusting if 'server != client' is ever true
|
||||
for (uint32 j = 0; j < profile::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
|
||||
outapp->WriteString(emu->bandoliers[r].Items[j].Name);
|
||||
outapp->WriteUInt32(emu->bandoliers[r].Items[j].ID);
|
||||
if (emu->bandoliers[r].Items[j].Icon) {
|
||||
@@ -2433,19 +2319,19 @@ namespace RoF2
|
||||
}
|
||||
}
|
||||
// Nullify bandoliers where server and client indexes diverge, with a client bias
|
||||
for (uint32 r = EQEmu::legacy::BANDOLIERS_SIZE; r < profile::BandoliersSize; ++r) {
|
||||
for (uint32 r = EQEmu::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
|
||||
outapp->WriteString("");
|
||||
for (uint32 j = 0; j < profile::BandolierItemCount; ++j) { // Will need adjusting if 'server != client' is ever true
|
||||
for (uint32 j = 0; j < profile::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
|
||||
outapp->WriteString("");
|
||||
outapp->WriteUInt32(0);
|
||||
outapp->WriteSInt32(-1);
|
||||
}
|
||||
}
|
||||
|
||||
outapp->WriteUInt32(profile::PotionBeltSize);
|
||||
outapp->WriteUInt32(profile::POTION_BELT_SIZE);
|
||||
|
||||
// Copy potion belt where server and client indexes converge
|
||||
for (uint32 r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < profile::PotionBeltSize; ++r) {
|
||||
for (uint32 r = 0; r < EQEmu::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
|
||||
outapp->WriteString(emu->potionbelt.Items[r].Name);
|
||||
outapp->WriteUInt32(emu->potionbelt.Items[r].ID);
|
||||
if (emu->potionbelt.Items[r].Icon) {
|
||||
@@ -2457,7 +2343,7 @@ namespace RoF2
|
||||
}
|
||||
}
|
||||
// Nullify potion belt where server and client indexes diverge, with a client bias
|
||||
for (uint32 r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < profile::PotionBeltSize; ++r) {
|
||||
for (uint32 r = EQEmu::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
|
||||
outapp->WriteString("");
|
||||
outapp->WriteUInt32(0);
|
||||
outapp->WriteSInt32(-1);
|
||||
@@ -2574,9 +2460,9 @@ namespace RoF2
|
||||
outapp->WriteUInt8(0); // Unknown
|
||||
outapp->WriteUInt8(0); // Unknown
|
||||
|
||||
outapp->WriteUInt32(EQEmu::legacy::TRIBUTE_SIZE);
|
||||
outapp->WriteUInt32(EQEmu::invtype::TRIBUTE_SIZE);
|
||||
|
||||
for (uint32 r = 0; r < EQEmu::legacy::TRIBUTE_SIZE; r++)
|
||||
for (uint32 r = 0; r < EQEmu::invtype::TRIBUTE_SIZE; r++)
|
||||
{
|
||||
outapp->WriteUInt32(emu->tributes[r].tribute);
|
||||
outapp->WriteUInt32(emu->tributes[r].tier);
|
||||
@@ -3081,7 +2967,7 @@ namespace RoF2
|
||||
|
||||
size_t names_length = 0;
|
||||
size_t character_count = 0;
|
||||
for (; character_count < emu->CharCount && character_count < constants::CharacterCreationLimit; ++character_count) {
|
||||
for (; character_count < emu->CharCount && character_count < constants::CHARACTER_CREATION_LIMIT; ++character_count) {
|
||||
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
|
||||
names_length += strlen(emu_cse->Name);
|
||||
emu_ptr += sizeof(CharacterSelectEntry_Struct);
|
||||
@@ -3437,13 +3323,16 @@ namespace RoF2
|
||||
InBuffer += description_size;
|
||||
InBuffer += sizeof(TaskDescriptionData2_Struct);
|
||||
|
||||
std::string old_message = InBuffer; // start 'Reward' as string
|
||||
uint32 reward_size = strlen(InBuffer) + 1;
|
||||
InBuffer += reward_size;
|
||||
|
||||
std::string old_message = InBuffer; // start item link string
|
||||
std::string new_message;
|
||||
ServerToRoF2SayLink(new_message, old_message);
|
||||
|
||||
in->size = sizeof(TaskDescriptionHeader_Struct) + sizeof(TaskDescriptionData1_Struct)+
|
||||
sizeof(TaskDescriptionData2_Struct) + sizeof(TaskDescriptionTrailer_Struct)+
|
||||
title_size + description_size + new_message.length() + 1;
|
||||
title_size + description_size + reward_size + new_message.length() + 1;
|
||||
|
||||
in->pBuffer = new unsigned char[in->size];
|
||||
|
||||
@@ -5051,7 +4940,7 @@ namespace RoF2
|
||||
|
||||
IN(item_id);
|
||||
int r;
|
||||
for (r = EQEmu::inventory::socketBegin; r < EQEmu::inventory::SocketCount; r++) {
|
||||
for (r = EQEmu::invaug::SOCKET_BEGIN; r <= EQEmu::invaug::SOCKET_END; r++) {
|
||||
IN(augments[r]);
|
||||
}
|
||||
IN(link_hash);
|
||||
@@ -5500,7 +5389,7 @@ namespace RoF2
|
||||
|
||||
structs::InventorySlot_Struct slot_id = ServerToRoF2Slot(slot_id_in, packet_type);
|
||||
|
||||
hdr.slot_type = (inst->GetMerchantSlot() ? invtype::InvTypeMerchant : slot_id.Type);
|
||||
hdr.slot_type = (inst->GetMerchantSlot() ? invtype::typeMerchant : slot_id.Type);
|
||||
hdr.main_slot = (inst->GetMerchantSlot() ? inst->GetMerchantSlot() : slot_id.Slot);
|
||||
hdr.sub_slot = (inst->GetMerchantSlot() ? 0xffff : slot_id.SubIndex);
|
||||
hdr.aug_slot = (inst->GetMerchantSlot() ? 0xffff : slot_id.AugIndex);
|
||||
@@ -5594,7 +5483,7 @@ namespace RoF2
|
||||
ibs.nodrop = item->NoDrop;
|
||||
ibs.attune = item->Attuneable;
|
||||
ibs.size = item->Size;
|
||||
ibs.slots = SwapBits21and22(item->Slots);
|
||||
ibs.slots = SwapBits21And22(item->Slots);
|
||||
ibs.price = item->Price;
|
||||
ibs.icon = item->Icon;
|
||||
ibs.unknown1 = 1;
|
||||
@@ -5688,7 +5577,7 @@ namespace RoF2
|
||||
isbs.augrestrict2 = -1;
|
||||
isbs.augrestrict = item->AugRestrict;
|
||||
|
||||
for (int index = 0; index < invaug::ItemAugSize; ++index) {
|
||||
for (int index = invaug::SOCKET_BEGIN; index <= invaug::SOCKET_END; ++index) {
|
||||
isbs.augslots[index].type = item->AugSlotType[index];
|
||||
isbs.augslots[index].visible = item->AugSlotVisible[index];
|
||||
isbs.augslots[index].unknown = item->AugSlotUnk2[index];
|
||||
@@ -5908,18 +5797,18 @@ namespace RoF2
|
||||
|
||||
ob.write((const char*)&subitem_count, sizeof(uint32));
|
||||
|
||||
for (uint32 index = EQEmu::inventory::containerBegin; index < EQEmu::inventory::ContainerCount; ++index) {
|
||||
for (uint32 index = EQEmu::invbag::SLOT_BEGIN; index <= EQEmu::invbag::SLOT_END; ++index) {
|
||||
EQEmu::ItemInstance* sub = inst->GetItem(index);
|
||||
if (!sub)
|
||||
continue;
|
||||
|
||||
int SubSlotNumber = INVALID_INDEX;
|
||||
if (slot_id_in >= EQEmu::legacy::GENERAL_BEGIN && slot_id_in <= EQEmu::legacy::GENERAL_END)
|
||||
SubSlotNumber = (((slot_id_in + 3) * EQEmu::inventory::ContainerCount) + index + 1);
|
||||
else if (slot_id_in >= EQEmu::legacy::BANK_BEGIN && slot_id_in <= EQEmu::legacy::BANK_END)
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::legacy::BANK_BEGIN) * EQEmu::inventory::ContainerCount) + EQEmu::legacy::BANK_BAGS_BEGIN + index);
|
||||
else if (slot_id_in >= EQEmu::legacy::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::legacy::SHARED_BANK_END)
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::legacy::SHARED_BANK_BEGIN) * EQEmu::inventory::ContainerCount) + EQEmu::legacy::SHARED_BANK_BAGS_BEGIN + index);
|
||||
if (slot_id_in >= EQEmu::invslot::GENERAL_BEGIN && slot_id_in <= EQEmu::invslot::GENERAL_END)
|
||||
SubSlotNumber = (((slot_id_in + 3) * EQEmu::invbag::SLOT_COUNT) + index + 1);
|
||||
else if (slot_id_in >= EQEmu::invslot::BANK_BEGIN && slot_id_in <= EQEmu::invslot::BANK_END)
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::invslot::BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT) + EQEmu::invbag::BANK_BAGS_BEGIN + index);
|
||||
else if (slot_id_in >= EQEmu::invslot::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::invslot::SHARED_BANK_END)
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::invslot::SHARED_BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT) + EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + index);
|
||||
else
|
||||
SubSlotNumber = slot_id_in;
|
||||
|
||||
@@ -5945,25 +5834,25 @@ namespace RoF2
|
||||
|
||||
uint32 TempSlot = 0;
|
||||
|
||||
if (serverSlot < 56 || serverSlot == EQEmu::inventory::slotPowerSource) { // Main Inventory and Cursor
|
||||
if (serverSlot < 56 || serverSlot == EQEmu::invslot::SLOT_POWER_SOURCE) { // Main Inventory and Cursor
|
||||
if (PacketType == ItemPacketLoot)
|
||||
{
|
||||
RoF2Slot.Type = invtype::InvTypeCorpse;
|
||||
RoF2Slot.Slot = serverSlot - EQEmu::legacy::CORPSE_BEGIN;
|
||||
RoF2Slot.Type = invtype::typeCorpse;
|
||||
RoF2Slot.Slot = serverSlot - EQEmu::invslot::CORPSE_BEGIN;
|
||||
}
|
||||
else
|
||||
{
|
||||
RoF2Slot.Type = invtype::InvTypePossessions;
|
||||
RoF2Slot.Type = invtype::typePossessions;
|
||||
RoF2Slot.Slot = serverSlot;
|
||||
}
|
||||
|
||||
if (serverSlot == EQEmu::inventory::slotPowerSource)
|
||||
RoF2Slot.Slot = invslot::PossessionsPowerSource;
|
||||
if (serverSlot == EQEmu::invslot::SLOT_POWER_SOURCE)
|
||||
RoF2Slot.Slot = invslot::slotPowerSource;
|
||||
|
||||
else if (serverSlot >= EQEmu::inventory::slotCursor && PacketType != ItemPacketLoot) // Cursor and Extended Corpse Inventory
|
||||
else if (serverSlot >= EQEmu::invslot::slotCursor && PacketType != ItemPacketLoot) // Cursor and Extended Corpse Inventory
|
||||
RoF2Slot.Slot += 3;
|
||||
|
||||
else if (serverSlot >= EQEmu::inventory::slotAmmo) // (> 20)
|
||||
else if (serverSlot >= EQEmu::invslot::slotAmmo) // (> 20)
|
||||
RoF2Slot.Slot += 1;
|
||||
}
|
||||
|
||||
@@ -5972,51 +5861,51 @@ namespace RoF2
|
||||
RoF2Slot.MainSlot = ServerSlot - 31;
|
||||
}*/
|
||||
|
||||
else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END) { // (> 250 && < 341)
|
||||
RoF2Slot.Type = invtype::InvTypePossessions;
|
||||
else if (serverSlot >= EQEmu::invbag::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::invbag::CURSOR_BAG_END) { // (> 250 && < 341)
|
||||
RoF2Slot.Type = invtype::typePossessions;
|
||||
TempSlot = serverSlot - 1;
|
||||
RoF2Slot.Slot = int(TempSlot / EQEmu::inventory::ContainerCount) - 2;
|
||||
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::inventory::ContainerCount);
|
||||
RoF2Slot.Slot = int(TempSlot / EQEmu::invbag::SLOT_COUNT) - 2;
|
||||
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::invbag::SLOT_COUNT);
|
||||
|
||||
if (RoF2Slot.Slot >= invslot::PossessionsGeneral9) // (> 30)
|
||||
RoF2Slot.Slot = invslot::PossessionsCursor;
|
||||
if (RoF2Slot.Slot >= invslot::slotGeneral9) // (> 30)
|
||||
RoF2Slot.Slot = invslot::slotCursor;
|
||||
}
|
||||
|
||||
else if (serverSlot >= EQEmu::legacy::TRIBUTE_BEGIN && serverSlot <= EQEmu::legacy::TRIBUTE_END) { // Tribute
|
||||
RoF2Slot.Type = invtype::InvTypeTribute;
|
||||
RoF2Slot.Slot = serverSlot - EQEmu::legacy::TRIBUTE_BEGIN;
|
||||
else if (serverSlot >= EQEmu::invslot::TRIBUTE_BEGIN && serverSlot <= EQEmu::invslot::TRIBUTE_END) { // Tribute
|
||||
RoF2Slot.Type = invtype::typeTribute;
|
||||
RoF2Slot.Slot = serverSlot - EQEmu::invslot::TRIBUTE_BEGIN;
|
||||
}
|
||||
|
||||
else if (serverSlot >= EQEmu::legacy::BANK_BEGIN && serverSlot <= EQEmu::legacy::BANK_BAGS_END) {
|
||||
RoF2Slot.Type = invtype::InvTypeBank;
|
||||
TempSlot = serverSlot - EQEmu::legacy::BANK_BEGIN;
|
||||
else if (serverSlot >= EQEmu::invslot::BANK_BEGIN && serverSlot <= EQEmu::invbag::BANK_BAGS_END) {
|
||||
RoF2Slot.Type = invtype::typeBank;
|
||||
TempSlot = serverSlot - EQEmu::invslot::BANK_BEGIN;
|
||||
RoF2Slot.Slot = TempSlot;
|
||||
|
||||
if (TempSlot > 30) { // (> 30)
|
||||
RoF2Slot.Slot = int(TempSlot / EQEmu::inventory::ContainerCount) - 3;
|
||||
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::inventory::ContainerCount);
|
||||
RoF2Slot.Slot = int(TempSlot / EQEmu::invbag::SLOT_COUNT) - 3;
|
||||
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::invbag::SLOT_COUNT);
|
||||
}
|
||||
}
|
||||
|
||||
else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END) {
|
||||
RoF2Slot.Type = invtype::InvTypeSharedBank;
|
||||
TempSlot = serverSlot - EQEmu::legacy::SHARED_BANK_BEGIN;
|
||||
else if (serverSlot >= EQEmu::invslot::SHARED_BANK_BEGIN && serverSlot <= EQEmu::invbag::SHARED_BANK_BAGS_END) {
|
||||
RoF2Slot.Type = invtype::typeSharedBank;
|
||||
TempSlot = serverSlot - EQEmu::invslot::SHARED_BANK_BEGIN;
|
||||
RoF2Slot.Slot = TempSlot;
|
||||
|
||||
if (TempSlot > 30) { // (> 30)
|
||||
RoF2Slot.Slot = int(TempSlot / EQEmu::inventory::ContainerCount) - 3;
|
||||
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::inventory::ContainerCount);
|
||||
RoF2Slot.Slot = int(TempSlot / EQEmu::invbag::SLOT_COUNT) - 3;
|
||||
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::invbag::SLOT_COUNT);
|
||||
}
|
||||
}
|
||||
|
||||
else if (serverSlot >= EQEmu::legacy::TRADE_BEGIN && serverSlot <= EQEmu::legacy::TRADE_BAGS_END) {
|
||||
RoF2Slot.Type = invtype::InvTypeTrade;
|
||||
TempSlot = serverSlot - EQEmu::legacy::TRADE_BEGIN;
|
||||
else if (serverSlot >= EQEmu::invslot::TRADE_BEGIN && serverSlot <= EQEmu::invbag::TRADE_BAGS_END) {
|
||||
RoF2Slot.Type = invtype::typeTrade;
|
||||
TempSlot = serverSlot - EQEmu::invslot::TRADE_BEGIN;
|
||||
RoF2Slot.Slot = TempSlot;
|
||||
|
||||
if (TempSlot > 30) {
|
||||
RoF2Slot.Slot = int(TempSlot / EQEmu::inventory::ContainerCount) - 3;
|
||||
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::inventory::ContainerCount);
|
||||
RoF2Slot.Slot = int(TempSlot / EQEmu::invbag::SLOT_COUNT) - 3;
|
||||
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::invbag::SLOT_COUNT);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -6033,9 +5922,9 @@ namespace RoF2
|
||||
*/
|
||||
}
|
||||
|
||||
else if (serverSlot >= EQEmu::legacy::WORLD_BEGIN && serverSlot <= EQEmu::legacy::WORLD_END) {
|
||||
RoF2Slot.Type = invtype::InvTypeWorld;
|
||||
TempSlot = serverSlot - EQEmu::legacy::WORLD_BEGIN;
|
||||
else if (serverSlot >= EQEmu::invslot::WORLD_BEGIN && serverSlot <= EQEmu::invslot::WORLD_END) {
|
||||
RoF2Slot.Type = invtype::typeWorld;
|
||||
TempSlot = serverSlot - EQEmu::invslot::WORLD_BEGIN;
|
||||
RoF2Slot.Slot = TempSlot;
|
||||
}
|
||||
|
||||
@@ -6054,16 +5943,16 @@ namespace RoF2
|
||||
|
||||
uint32 TempSlot = 0;
|
||||
|
||||
if (serverSlot < 56 || serverSlot == EQEmu::inventory::slotPowerSource) { // (< 52)
|
||||
if (serverSlot < 56 || serverSlot == EQEmu::invslot::SLOT_POWER_SOURCE) { // (< 52)
|
||||
RoF2Slot.Slot = serverSlot;
|
||||
|
||||
if (serverSlot == EQEmu::inventory::slotPowerSource)
|
||||
RoF2Slot.Slot = invslot::PossessionsPowerSource;
|
||||
if (serverSlot == EQEmu::invslot::SLOT_POWER_SOURCE)
|
||||
RoF2Slot.Slot = invslot::slotPowerSource;
|
||||
|
||||
else if (serverSlot >= EQEmu::inventory::slotCursor) // Cursor and Extended Corpse Inventory
|
||||
else if (serverSlot >= EQEmu::invslot::slotCursor) // Cursor and Extended Corpse Inventory
|
||||
RoF2Slot.Slot += 3;
|
||||
|
||||
else if (serverSlot >= EQEmu::inventory::slotAmmo) // Ammo and Personl Inventory
|
||||
else if (serverSlot >= EQEmu::invslot::slotAmmo) // Ammo and Personl Inventory
|
||||
RoF2Slot.Slot += 1;
|
||||
|
||||
/*else if (ServerSlot >= MainCursor) { // Cursor
|
||||
@@ -6074,10 +5963,10 @@ namespace RoF2
|
||||
}*/
|
||||
}
|
||||
|
||||
else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END) {
|
||||
else if (serverSlot >= EQEmu::invbag::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::invbag::CURSOR_BAG_END) {
|
||||
TempSlot = serverSlot - 1;
|
||||
RoF2Slot.Slot = int(TempSlot / EQEmu::inventory::ContainerCount) - 2;
|
||||
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::inventory::ContainerCount);
|
||||
RoF2Slot.Slot = int(TempSlot / EQEmu::invbag::SLOT_COUNT) - 2;
|
||||
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::invbag::SLOT_COUNT);
|
||||
}
|
||||
|
||||
Log(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoF2Slot.Slot, RoF2Slot.SubIndex, RoF2Slot.AugIndex, RoF2Slot.Unknown01);
|
||||
@@ -6087,7 +5976,7 @@ namespace RoF2
|
||||
|
||||
static inline uint32 ServerToRoF2CorpseSlot(uint32 serverCorpseSlot)
|
||||
{
|
||||
return (serverCorpseSlot - EQEmu::legacy::CORPSE_BEGIN + 1);
|
||||
return (serverCorpseSlot - EQEmu::invslot::CORPSE_BEGIN + 1);
|
||||
}
|
||||
|
||||
static inline uint32 RoF2ToServerSlot(structs::InventorySlot_Struct rof2Slot, ItemPacketType PacketType)
|
||||
@@ -6095,11 +5984,11 @@ namespace RoF2
|
||||
uint32 ServerSlot = INVALID_INDEX;
|
||||
uint32 TempSlot = 0;
|
||||
|
||||
if (rof2Slot.Type == invtype::InvTypePossessions && rof2Slot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 51)
|
||||
if (rof2Slot.Slot == invslot::PossessionsPowerSource)
|
||||
TempSlot = EQEmu::inventory::slotPowerSource;
|
||||
if (rof2Slot.Type == invtype::typePossessions && rof2Slot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 51)
|
||||
if (rof2Slot.Slot == invslot::slotPowerSource)
|
||||
TempSlot = EQEmu::invslot::SLOT_POWER_SOURCE;
|
||||
|
||||
else if (rof2Slot.Slot >= invslot::PossessionsCursor) // Cursor and Extended Corpse Inventory
|
||||
else if (rof2Slot.Slot >= invslot::slotCursor) // Cursor and Extended Corpse Inventory
|
||||
TempSlot = rof2Slot.Slot - 3;
|
||||
|
||||
/*else if (RoF2Slot.MainSlot == slots::MainGeneral9 || RoF2Slot.MainSlot == slots::MainGeneral10) { // 9th and 10th RoF2 inventory/corpse slots
|
||||
@@ -6113,23 +6002,23 @@ namespace RoF2
|
||||
// For now, it's probably best to leave as-is and let this work itself out in the inventory rework.
|
||||
}*/
|
||||
|
||||
else if (rof2Slot.Slot >= invslot::PossessionsAmmo) // Ammo and Main Inventory
|
||||
else if (rof2Slot.Slot >= invslot::slotAmmo) // Ammo and Main Inventory
|
||||
TempSlot = rof2Slot.Slot - 1;
|
||||
|
||||
else // Worn Slots
|
||||
TempSlot = rof2Slot.Slot;
|
||||
|
||||
if (rof2Slot.SubIndex >= EQEmu::inventory::containerBegin) // Bag Slots
|
||||
TempSlot = ((TempSlot + 3) * EQEmu::inventory::ContainerCount) + rof2Slot.SubIndex + 1;
|
||||
if (rof2Slot.SubIndex >= EQEmu::invbag::SLOT_BEGIN) // Bag Slots
|
||||
TempSlot = ((TempSlot + 3) * EQEmu::invbag::SLOT_COUNT) + rof2Slot.SubIndex + 1;
|
||||
|
||||
ServerSlot = TempSlot;
|
||||
}
|
||||
|
||||
else if (rof2Slot.Type == invtype::InvTypeBank) {
|
||||
TempSlot = EQEmu::legacy::BANK_BEGIN;
|
||||
else if (rof2Slot.Type == invtype::typeBank) {
|
||||
TempSlot = EQEmu::invslot::BANK_BEGIN;
|
||||
|
||||
if (rof2Slot.SubIndex >= EQEmu::inventory::containerBegin)
|
||||
TempSlot += ((rof2Slot.Slot + 3) * EQEmu::inventory::ContainerCount) + rof2Slot.SubIndex + 1;
|
||||
if (rof2Slot.SubIndex >= EQEmu::invbag::SLOT_BEGIN)
|
||||
TempSlot += ((rof2Slot.Slot + 3) * EQEmu::invbag::SLOT_COUNT) + rof2Slot.SubIndex + 1;
|
||||
|
||||
else
|
||||
TempSlot += rof2Slot.Slot;
|
||||
@@ -6137,11 +6026,11 @@ namespace RoF2
|
||||
ServerSlot = TempSlot;
|
||||
}
|
||||
|
||||
else if (rof2Slot.Type == invtype::InvTypeSharedBank) {
|
||||
TempSlot = EQEmu::legacy::SHARED_BANK_BEGIN;
|
||||
else if (rof2Slot.Type == invtype::typeSharedBank) {
|
||||
TempSlot = EQEmu::invslot::SHARED_BANK_BEGIN;
|
||||
|
||||
if (rof2Slot.SubIndex >= EQEmu::inventory::containerBegin)
|
||||
TempSlot += ((rof2Slot.Slot + 3) * EQEmu::inventory::ContainerCount) + rof2Slot.SubIndex + 1;
|
||||
if (rof2Slot.SubIndex >= EQEmu::invbag::SLOT_BEGIN)
|
||||
TempSlot += ((rof2Slot.Slot + 3) * EQEmu::invbag::SLOT_COUNT) + rof2Slot.SubIndex + 1;
|
||||
|
||||
else
|
||||
TempSlot += rof2Slot.Slot;
|
||||
@@ -6149,11 +6038,11 @@ namespace RoF2
|
||||
ServerSlot = TempSlot;
|
||||
}
|
||||
|
||||
else if (rof2Slot.Type == invtype::InvTypeTrade) {
|
||||
TempSlot = EQEmu::legacy::TRADE_BEGIN;
|
||||
else if (rof2Slot.Type == invtype::typeTrade) {
|
||||
TempSlot = EQEmu::invslot::TRADE_BEGIN;
|
||||
|
||||
if (rof2Slot.SubIndex >= EQEmu::inventory::containerBegin)
|
||||
TempSlot += ((rof2Slot.Slot + 3) * EQEmu::inventory::ContainerCount) + rof2Slot.SubIndex + 1;
|
||||
if (rof2Slot.SubIndex >= EQEmu::invbag::SLOT_BEGIN)
|
||||
TempSlot += ((rof2Slot.Slot + 3) * EQEmu::invbag::SLOT_COUNT) + rof2Slot.SubIndex + 1;
|
||||
// OLD CODE:
|
||||
//TempSlot += 100 + (RoF2Slot.MainSlot * EmuConstants::ITEM_CONTAINER_SIZE) + RoF2Slot.SubSlot;
|
||||
|
||||
@@ -6163,10 +6052,10 @@ namespace RoF2
|
||||
ServerSlot = TempSlot;
|
||||
}
|
||||
|
||||
else if (rof2Slot.Type == invtype::InvTypeWorld) {
|
||||
TempSlot = EQEmu::legacy::WORLD_BEGIN;
|
||||
else if (rof2Slot.Type == invtype::typeWorld) {
|
||||
TempSlot = EQEmu::invslot::WORLD_BEGIN;
|
||||
|
||||
if (rof2Slot.Slot >= EQEmu::inventory::containerBegin)
|
||||
if (rof2Slot.Slot >= EQEmu::invbag::SLOT_BEGIN)
|
||||
TempSlot += rof2Slot.Slot;
|
||||
|
||||
ServerSlot = TempSlot;
|
||||
@@ -6181,12 +6070,12 @@ namespace RoF2
|
||||
ServerSlot = TempSlot;
|
||||
}*/
|
||||
|
||||
else if (rof2Slot.Type == invtype::InvTypeGuildTribute) {
|
||||
else if (rof2Slot.Type == invtype::typeGuildTribute) {
|
||||
ServerSlot = INVALID_INDEX;
|
||||
}
|
||||
|
||||
else if (rof2Slot.Type == invtype::InvTypeCorpse) {
|
||||
ServerSlot = rof2Slot.Slot + EQEmu::legacy::CORPSE_BEGIN;
|
||||
else if (rof2Slot.Type == invtype::typeCorpse) {
|
||||
ServerSlot = rof2Slot.Slot + EQEmu::invslot::CORPSE_BEGIN;
|
||||
}
|
||||
|
||||
Log(Logs::General, Logs::Netcode, "[ERROR] Convert RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rof2Slot.Type, rof2Slot.Unknown02, rof2Slot.Slot, rof2Slot.SubIndex, rof2Slot.AugIndex, rof2Slot.Unknown01, ServerSlot);
|
||||
@@ -6200,10 +6089,10 @@ namespace RoF2
|
||||
uint32 TempSlot = 0;
|
||||
|
||||
if (rof2Slot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 33)
|
||||
if (rof2Slot.Slot == invslot::PossessionsPowerSource)
|
||||
TempSlot = EQEmu::inventory::slotPowerSource;
|
||||
if (rof2Slot.Slot == invslot::slotPowerSource)
|
||||
TempSlot = EQEmu::invslot::SLOT_POWER_SOURCE;
|
||||
|
||||
else if (rof2Slot.Slot >= invslot::PossessionsCursor) // Cursor and Extended Corpse Inventory
|
||||
else if (rof2Slot.Slot >= invslot::slotCursor) // Cursor and Extended Corpse Inventory
|
||||
TempSlot = rof2Slot.Slot - 3;
|
||||
|
||||
/*else if (RoF2Slot.MainSlot == slots::MainGeneral9 || RoF2Slot.MainSlot == slots::MainGeneral10) { // 9th and 10th RoF2 inventory slots
|
||||
@@ -6212,14 +6101,14 @@ namespace RoF2
|
||||
// Same as above
|
||||
}*/
|
||||
|
||||
else if (rof2Slot.Slot >= invslot::PossessionsAmmo) // Main Inventory and Ammo Slots
|
||||
else if (rof2Slot.Slot >= invslot::slotAmmo) // Main Inventory and Ammo Slots
|
||||
TempSlot = rof2Slot.Slot - 1;
|
||||
|
||||
else
|
||||
TempSlot = rof2Slot.Slot;
|
||||
|
||||
if (rof2Slot.SubIndex >= EQEmu::inventory::containerBegin) // Bag Slots
|
||||
TempSlot = ((TempSlot + 3) * EQEmu::inventory::ContainerCount) + rof2Slot.SubIndex + 1;
|
||||
if (rof2Slot.SubIndex >= EQEmu::invbag::SLOT_BEGIN) // Bag Slots
|
||||
TempSlot = ((TempSlot + 3) * EQEmu::invbag::SLOT_COUNT) + rof2Slot.SubIndex + 1;
|
||||
|
||||
ServerSlot = TempSlot;
|
||||
}
|
||||
@@ -6231,12 +6120,12 @@ namespace RoF2
|
||||
|
||||
static inline uint32 RoF2ToServerCorpseSlot(uint32 rof2CorpseSlot)
|
||||
{
|
||||
return (rof2CorpseSlot + EQEmu::legacy::CORPSE_BEGIN - 1);
|
||||
return (rof2CorpseSlot + EQEmu::invslot::CORPSE_BEGIN - 1);
|
||||
}
|
||||
|
||||
static inline void ServerToRoF2SayLink(std::string& rof2SayLink, const std::string& serverSayLink)
|
||||
{
|
||||
if ((constants::SayLinkBodySize == EQEmu::constants::SayLinkBodySize) || (serverSayLink.find('\x12') == std::string::npos)) {
|
||||
if ((constants::SAY_LINK_BODY_SIZE == EQEmu::constants::SAY_LINK_BODY_SIZE) || (serverSayLink.find('\x12') == std::string::npos)) {
|
||||
rof2SayLink = serverSayLink;
|
||||
return;
|
||||
}
|
||||
@@ -6245,7 +6134,7 @@ namespace RoF2
|
||||
|
||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||
if (segment_iter & 1) {
|
||||
if (segments[segment_iter].length() <= EQEmu::constants::SayLinkBodySize) {
|
||||
if (segments[segment_iter].length() <= EQEmu::constants::SAY_LINK_BODY_SIZE) {
|
||||
rof2SayLink.append(segments[segment_iter]);
|
||||
// TODO: log size mismatch error
|
||||
continue;
|
||||
@@ -6268,7 +6157,7 @@ namespace RoF2
|
||||
|
||||
static inline void RoF2ToServerSayLink(std::string& serverSayLink, const std::string& rof2SayLink)
|
||||
{
|
||||
if ((EQEmu::constants::SayLinkBodySize == constants::SayLinkBodySize) || (rof2SayLink.find('\x12') == std::string::npos)) {
|
||||
if ((EQEmu::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (rof2SayLink.find('\x12') == std::string::npos)) {
|
||||
serverSayLink = rof2SayLink;
|
||||
return;
|
||||
}
|
||||
@@ -6277,7 +6166,7 @@ namespace RoF2
|
||||
|
||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||
if (segment_iter & 1) {
|
||||
if (segments[segment_iter].length() <= constants::SayLinkBodySize) {
|
||||
if (segments[segment_iter].length() <= constants::SAY_LINK_BODY_SIZE) {
|
||||
serverSayLink.append(segments[segment_iter]);
|
||||
// TODO: log size mismatch error
|
||||
continue;
|
||||
|
||||
+136
-136
@@ -22,231 +22,231 @@
|
||||
#include "../string_util.h"
|
||||
|
||||
|
||||
size_t RoF2::invtype::GetInvTypeSize(int inv_type)
|
||||
int16 RoF2::invtype::GetInvTypeSize(int16 inv_type)
|
||||
{
|
||||
switch (inv_type) {
|
||||
case invtype::InvTypePossessions:
|
||||
return invtype::InvTypePossessionsSize;
|
||||
case invtype::InvTypeBank:
|
||||
return invtype::InvTypeBankSize;
|
||||
case invtype::InvTypeSharedBank:
|
||||
return invtype::InvTypeSharedBankSize;
|
||||
case invtype::InvTypeTrade:
|
||||
return invtype::InvTypeTradeSize;
|
||||
case invtype::InvTypeWorld:
|
||||
return invtype::InvTypeWorldSize;
|
||||
case invtype::InvTypeLimbo:
|
||||
return invtype::InvTypeLimboSize;
|
||||
case invtype::InvTypeTribute:
|
||||
return invtype::InvTypeTributeSize;
|
||||
case invtype::InvTypeTrophyTribute:
|
||||
return invtype::InvTypeTrophyTributeSize;
|
||||
case invtype::InvTypeGuildTribute:
|
||||
return invtype::InvTypeGuildTributeSize;
|
||||
case invtype::InvTypeMerchant:
|
||||
return invtype::InvTypeMerchantSize;
|
||||
case invtype::InvTypeDeleted:
|
||||
return invtype::InvTypeDeletedSize;
|
||||
case invtype::InvTypeCorpse:
|
||||
return invtype::InvTypeCorpseSize;
|
||||
case invtype::InvTypeBazaar:
|
||||
return invtype::InvTypeBazaarSize;
|
||||
case invtype::InvTypeInspect:
|
||||
return invtype::InvTypeInspectSize;
|
||||
case invtype::InvTypeRealEstate:
|
||||
return invtype::InvTypeRealEstateSize;
|
||||
case invtype::InvTypeViewMODPC:
|
||||
return invtype::InvTypeViewMODPCSize;
|
||||
case invtype::InvTypeViewMODBank:
|
||||
return invtype::InvTypeViewMODBankSize;
|
||||
case invtype::InvTypeViewMODSharedBank:
|
||||
return invtype::InvTypeViewMODSharedBankSize;
|
||||
case invtype::InvTypeViewMODLimbo:
|
||||
return invtype::InvTypeViewMODLimboSize;
|
||||
case invtype::InvTypeAltStorage:
|
||||
return invtype::InvTypeAltStorageSize;
|
||||
case invtype::InvTypeArchived:
|
||||
return invtype::InvTypeArchivedSize;
|
||||
case invtype::InvTypeMail:
|
||||
return invtype::InvTypeMailSize;
|
||||
case invtype::InvTypeGuildTrophyTribute:
|
||||
return invtype::InvTypeGuildTrophyTributeSize;
|
||||
case invtype::InvTypeKrono:
|
||||
return invtype::InvTypeKronoSize;
|
||||
case invtype::InvTypeOther:
|
||||
return invtype::InvTypeOtherSize;
|
||||
case invtype::typePossessions:
|
||||
return invtype::POSSESSIONS_SIZE;
|
||||
case invtype::typeBank:
|
||||
return invtype::BANK_SIZE;
|
||||
case invtype::typeSharedBank:
|
||||
return invtype::SHARED_BANK_SIZE;
|
||||
case invtype::typeTrade:
|
||||
return invtype::TRADE_SIZE;
|
||||
case invtype::typeWorld:
|
||||
return invtype::WORLD_SIZE;
|
||||
case invtype::typeLimbo:
|
||||
return invtype::LIMBO_SIZE;
|
||||
case invtype::typeTribute:
|
||||
return invtype::TRIBUTE_SIZE;
|
||||
case invtype::typeTrophyTribute:
|
||||
return invtype::TROPHY_TRIBUTE_SIZE;
|
||||
case invtype::typeGuildTribute:
|
||||
return invtype::GUILD_TRIBUTE_SIZE;
|
||||
case invtype::typeMerchant:
|
||||
return invtype::MERCHANT_SIZE;
|
||||
case invtype::typeDeleted:
|
||||
return invtype::DELETED_SIZE;
|
||||
case invtype::typeCorpse:
|
||||
return invtype::CORPSE_SIZE;
|
||||
case invtype::typeBazaar:
|
||||
return invtype::BAZAAR_SIZE;
|
||||
case invtype::typeInspect:
|
||||
return invtype::INSPECT_SIZE;
|
||||
case invtype::typeRealEstate:
|
||||
return invtype::REAL_ESTATE_SIZE;
|
||||
case invtype::typeViewMODPC:
|
||||
return invtype::VIEW_MOD_PC_SIZE;
|
||||
case invtype::typeViewMODBank:
|
||||
return invtype::VIEW_MOD_BANK_SIZE;
|
||||
case invtype::typeViewMODSharedBank:
|
||||
return invtype::VIEW_MOD_SHARED_BANK_SIZE;
|
||||
case invtype::typeViewMODLimbo:
|
||||
return invtype::VIEW_MOD_LIMBO_SIZE;
|
||||
case invtype::typeAltStorage:
|
||||
return invtype::ALT_STORAGE_SIZE;
|
||||
case invtype::typeArchived:
|
||||
return invtype::ARCHIVED_SIZE;
|
||||
case invtype::typeMail:
|
||||
return invtype::MAIL_SIZE;
|
||||
case invtype::typeGuildTrophyTribute:
|
||||
return invtype::GUILD_TROPHY_TRIBUTE_SIZE;
|
||||
case invtype::typeKrono:
|
||||
return invtype::KRONO_SIZE;
|
||||
case invtype::typeOther:
|
||||
return invtype::OTHER_SIZE;
|
||||
default:
|
||||
return 0;
|
||||
return INULL;
|
||||
}
|
||||
}
|
||||
|
||||
const char* RoF2::invtype::GetInvTypeName(int inv_type)
|
||||
const char* RoF2::invtype::GetInvTypeName(int16 inv_type)
|
||||
{
|
||||
switch (inv_type) {
|
||||
case invtype::InvTypeInvalid:
|
||||
case invtype::TYPE_INVALID:
|
||||
return "Invalid Type";
|
||||
case invtype::InvTypePossessions:
|
||||
case invtype::typePossessions:
|
||||
return "Possessions";
|
||||
case invtype::InvTypeBank:
|
||||
case invtype::typeBank:
|
||||
return "Bank";
|
||||
case invtype::InvTypeSharedBank:
|
||||
case invtype::typeSharedBank:
|
||||
return "Shared Bank";
|
||||
case invtype::InvTypeTrade:
|
||||
case invtype::typeTrade:
|
||||
return "Trade";
|
||||
case invtype::InvTypeWorld:
|
||||
case invtype::typeWorld:
|
||||
return "World";
|
||||
case invtype::InvTypeLimbo:
|
||||
case invtype::typeLimbo:
|
||||
return "Limbo";
|
||||
case invtype::InvTypeTribute:
|
||||
case invtype::typeTribute:
|
||||
return "Tribute";
|
||||
case invtype::InvTypeTrophyTribute:
|
||||
case invtype::typeTrophyTribute:
|
||||
return "Trophy Tribute";
|
||||
case invtype::InvTypeGuildTribute:
|
||||
case invtype::typeGuildTribute:
|
||||
return "Guild Tribute";
|
||||
case invtype::InvTypeMerchant:
|
||||
case invtype::typeMerchant:
|
||||
return "Merchant";
|
||||
case invtype::InvTypeDeleted:
|
||||
case invtype::typeDeleted:
|
||||
return "Deleted";
|
||||
case invtype::InvTypeCorpse:
|
||||
case invtype::typeCorpse:
|
||||
return "Corpse";
|
||||
case invtype::InvTypeBazaar:
|
||||
case invtype::typeBazaar:
|
||||
return "Bazaar";
|
||||
case invtype::InvTypeInspect:
|
||||
case invtype::typeInspect:
|
||||
return "Inspect";
|
||||
case invtype::InvTypeRealEstate:
|
||||
case invtype::typeRealEstate:
|
||||
return "Real Estate";
|
||||
case invtype::InvTypeViewMODPC:
|
||||
case invtype::typeViewMODPC:
|
||||
return "View MOD PC";
|
||||
case invtype::InvTypeViewMODBank:
|
||||
case invtype::typeViewMODBank:
|
||||
return "View MOD Bank";
|
||||
case invtype::InvTypeViewMODSharedBank:
|
||||
case invtype::typeViewMODSharedBank:
|
||||
return "View MOD Shared Bank";
|
||||
case invtype::InvTypeViewMODLimbo:
|
||||
case invtype::typeViewMODLimbo:
|
||||
return "View MOD Limbo";
|
||||
case invtype::InvTypeAltStorage:
|
||||
case invtype::typeAltStorage:
|
||||
return "Alt Storage";
|
||||
case invtype::InvTypeArchived:
|
||||
case invtype::typeArchived:
|
||||
return "Archived";
|
||||
case invtype::InvTypeMail:
|
||||
case invtype::typeMail:
|
||||
return "Mail";
|
||||
case invtype::InvTypeGuildTrophyTribute:
|
||||
case invtype::typeGuildTrophyTribute:
|
||||
return "Guild Trophy Tribute";
|
||||
case invtype::InvTypeKrono:
|
||||
case invtype::typeKrono:
|
||||
return "Krono";
|
||||
case invtype::InvTypeOther:
|
||||
case invtype::typeOther:
|
||||
return "Other";
|
||||
default:
|
||||
return "Unknown Type";
|
||||
}
|
||||
}
|
||||
|
||||
bool RoF2::invtype::IsInvTypePersistent(int inv_type)
|
||||
bool RoF2::invtype::IsInvTypePersistent(int16 inv_type)
|
||||
{
|
||||
switch (inv_type) {
|
||||
case invtype::InvTypePossessions:
|
||||
case invtype::InvTypeBank:
|
||||
case invtype::InvTypeSharedBank:
|
||||
case invtype::InvTypeTrade:
|
||||
case invtype::InvTypeWorld:
|
||||
case invtype::InvTypeLimbo:
|
||||
case invtype::InvTypeTribute:
|
||||
case invtype::InvTypeTrophyTribute:
|
||||
case invtype::InvTypeGuildTribute:
|
||||
case invtype::typePossessions:
|
||||
case invtype::typeBank:
|
||||
case invtype::typeSharedBank:
|
||||
case invtype::typeTrade:
|
||||
case invtype::typeWorld:
|
||||
case invtype::typeLimbo:
|
||||
case invtype::typeTribute:
|
||||
case invtype::typeTrophyTribute:
|
||||
case invtype::typeGuildTribute:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const char* RoF2::invslot::GetInvPossessionsSlotName(int inv_slot)
|
||||
const char* RoF2::invslot::GetInvPossessionsSlotName(int16 inv_slot)
|
||||
{
|
||||
switch (inv_slot) {
|
||||
case invslot::InvSlotInvalid:
|
||||
case invslot::SLOT_INVALID:
|
||||
return "Invalid Slot";
|
||||
case invslot::PossessionsCharm:
|
||||
case invslot::slotCharm:
|
||||
return "Charm";
|
||||
case invslot::PossessionsEar1:
|
||||
case invslot::slotEar1:
|
||||
return "Ear 1";
|
||||
case invslot::PossessionsHead:
|
||||
case invslot::slotHead:
|
||||
return "Head";
|
||||
case invslot::PossessionsFace:
|
||||
case invslot::slotFace:
|
||||
return "Face";
|
||||
case invslot::PossessionsEar2:
|
||||
case invslot::slotEar2:
|
||||
return "Ear 2";
|
||||
case invslot::PossessionsNeck:
|
||||
case invslot::slotNeck:
|
||||
return "Neck";
|
||||
case invslot::PossessionsShoulders:
|
||||
case invslot::slotShoulders:
|
||||
return "Shoulders";
|
||||
case invslot::PossessionsArms:
|
||||
case invslot::slotArms:
|
||||
return "Arms";
|
||||
case invslot::PossessionsBack:
|
||||
case invslot::slotBack:
|
||||
return "Back";
|
||||
case invslot::PossessionsWrist1:
|
||||
case invslot::slotWrist1:
|
||||
return "Wrist 1";
|
||||
case invslot::PossessionsWrist2:
|
||||
case invslot::slotWrist2:
|
||||
return "Wrist 2";
|
||||
case invslot::PossessionsRange:
|
||||
case invslot::slotRange:
|
||||
return "Range";
|
||||
case invslot::PossessionsHands:
|
||||
case invslot::slotHands:
|
||||
return "Hands";
|
||||
case invslot::PossessionsPrimary:
|
||||
case invslot::slotPrimary:
|
||||
return "Primary";
|
||||
case invslot::PossessionsSecondary:
|
||||
case invslot::slotSecondary:
|
||||
return "Secondary";
|
||||
case invslot::PossessionsFinger1:
|
||||
case invslot::slotFinger1:
|
||||
return "Finger 1";
|
||||
case invslot::PossessionsFinger2:
|
||||
case invslot::slotFinger2:
|
||||
return "Finger 2";
|
||||
case invslot::PossessionsChest:
|
||||
case invslot::slotChest:
|
||||
return "Chest";
|
||||
case invslot::PossessionsLegs:
|
||||
case invslot::slotLegs:
|
||||
return "Legs";
|
||||
case invslot::PossessionsFeet:
|
||||
case invslot::slotFeet:
|
||||
return "Feet";
|
||||
case invslot::PossessionsWaist:
|
||||
case invslot::slotWaist:
|
||||
return "Waist";
|
||||
case invslot::PossessionsPowerSource:
|
||||
case invslot::slotPowerSource:
|
||||
return "Power Source";
|
||||
case invslot::PossessionsAmmo:
|
||||
case invslot::slotAmmo:
|
||||
return "Ammo";
|
||||
case invslot::PossessionsGeneral1:
|
||||
case invslot::slotGeneral1:
|
||||
return "General 1";
|
||||
case invslot::PossessionsGeneral2:
|
||||
case invslot::slotGeneral2:
|
||||
return "General 2";
|
||||
case invslot::PossessionsGeneral3:
|
||||
case invslot::slotGeneral3:
|
||||
return "General 3";
|
||||
case invslot::PossessionsGeneral4:
|
||||
case invslot::slotGeneral4:
|
||||
return "General 4";
|
||||
case invslot::PossessionsGeneral5:
|
||||
case invslot::slotGeneral5:
|
||||
return "General 5";
|
||||
case invslot::PossessionsGeneral6:
|
||||
case invslot::slotGeneral6:
|
||||
return "General 6";
|
||||
case invslot::PossessionsGeneral7:
|
||||
case invslot::slotGeneral7:
|
||||
return "General 7";
|
||||
case invslot::PossessionsGeneral8:
|
||||
case invslot::slotGeneral8:
|
||||
return "General 8";
|
||||
case invslot::PossessionsGeneral9:
|
||||
case invslot::slotGeneral9:
|
||||
return "General 9";
|
||||
case invslot::PossessionsGeneral10:
|
||||
case invslot::slotGeneral10:
|
||||
return "General 10";
|
||||
case invslot::PossessionsCursor:
|
||||
case invslot::slotCursor:
|
||||
return "Cursor";
|
||||
default:
|
||||
return "Unknown Slot";
|
||||
}
|
||||
}
|
||||
|
||||
const char* RoF2::invslot::GetInvSlotName(int inv_type, int inv_slot)
|
||||
const char* RoF2::invslot::GetInvSlotName(int16 inv_type, int16 inv_slot)
|
||||
{
|
||||
if (inv_type == invtype::InvTypePossessions)
|
||||
if (inv_type == invtype::typePossessions)
|
||||
return invslot::GetInvPossessionsSlotName(inv_slot);
|
||||
|
||||
size_t type_size = invtype::GetInvTypeSize(inv_type);
|
||||
int16 type_size = invtype::GetInvTypeSize(inv_type);
|
||||
|
||||
if (!type_size || inv_slot == invslot::InvSlotInvalid)
|
||||
if (!type_size || inv_slot == invslot::SLOT_INVALID)
|
||||
return "Invalid Slot";
|
||||
|
||||
if ((size_t)(inv_slot + 1) >= type_size)
|
||||
if ((inv_slot + 1) >= type_size)
|
||||
return "Unknown Slot";
|
||||
|
||||
static std::string ret_str;
|
||||
@@ -255,12 +255,12 @@ const char* RoF2::invslot::GetInvSlotName(int inv_type, int inv_slot)
|
||||
return ret_str.c_str();
|
||||
}
|
||||
|
||||
const char* RoF2::invbag::GetInvBagIndexName(int bag_index)
|
||||
const char* RoF2::invbag::GetInvBagIndexName(int16 bag_index)
|
||||
{
|
||||
if (bag_index == invbag::InvBagInvalid)
|
||||
if (bag_index == invbag::SLOT_INVALID)
|
||||
return "Invalid Bag";
|
||||
|
||||
if ((size_t)bag_index >= invbag::ItemBagSize)
|
||||
if (bag_index >= invbag::SLOT_COUNT)
|
||||
return "Unknown Bag";
|
||||
|
||||
static std::string ret_str;
|
||||
@@ -269,12 +269,12 @@ const char* RoF2::invbag::GetInvBagIndexName(int bag_index)
|
||||
return ret_str.c_str();
|
||||
}
|
||||
|
||||
const char* RoF2::invaug::GetInvAugIndexName(int aug_index)
|
||||
const char* RoF2::invaug::GetInvAugIndexName(int16 aug_index)
|
||||
{
|
||||
if (aug_index == invaug::InvAugInvalid)
|
||||
if (aug_index == invaug::SOCKET_INVALID)
|
||||
return "Invalid Augment";
|
||||
|
||||
if ((size_t)aug_index >= invaug::ItemAugSize)
|
||||
if (aug_index >= invaug::SOCKET_COUNT)
|
||||
return "Unknown Augment";
|
||||
|
||||
static std::string ret_str;
|
||||
|
||||
+167
-177
@@ -27,116 +27,191 @@
|
||||
|
||||
namespace RoF2
|
||||
{
|
||||
enum : int { Invalid = -1, Null, Safety };
|
||||
const int16 IINVALID = -1;
|
||||
const int16 INULL = 0;
|
||||
|
||||
enum : bool { False = false, True = true };
|
||||
|
||||
// pre-declarations
|
||||
namespace inventory {
|
||||
inline EQEmu::versions::ClientVersion GetInventoryRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||
|
||||
const bool ConcatenateInvTypeLimbo = false;
|
||||
|
||||
const bool AllowOverLevelEquipment = true;
|
||||
|
||||
const bool AllowEmptyBagInBag = true;
|
||||
const bool AllowClickCastFromBag = true;
|
||||
|
||||
} /*inventory*/
|
||||
|
||||
namespace invtype {
|
||||
inline EQEmu::versions::ClientVersion GetInvTypeRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||
|
||||
enum : int { InvTypeInvalid = -1, InvTypeBegin };
|
||||
namespace enum_ {
|
||||
enum InventoryTypes : int16 {
|
||||
typePossessions = INULL,
|
||||
typeBank,
|
||||
typeSharedBank,
|
||||
typeTrade,
|
||||
typeWorld,
|
||||
typeLimbo,
|
||||
typeTribute,
|
||||
typeTrophyTribute,
|
||||
typeGuildTribute,
|
||||
typeMerchant,
|
||||
typeDeleted,
|
||||
typeCorpse,
|
||||
typeBazaar,
|
||||
typeInspect,
|
||||
typeRealEstate,
|
||||
typeViewMODPC,
|
||||
typeViewMODBank,
|
||||
typeViewMODSharedBank,
|
||||
typeViewMODLimbo,
|
||||
typeAltStorage,
|
||||
typeArchived,
|
||||
typeMail,
|
||||
typeGuildTrophyTribute,
|
||||
typeKrono,
|
||||
typeOther
|
||||
};
|
||||
|
||||
enum InventoryType : int {
|
||||
InvTypePossessions = InvTypeBegin,
|
||||
InvTypeBank,
|
||||
InvTypeSharedBank,
|
||||
InvTypeTrade,
|
||||
InvTypeWorld,
|
||||
InvTypeLimbo,
|
||||
InvTypeTribute,
|
||||
InvTypeTrophyTribute,
|
||||
InvTypeGuildTribute,
|
||||
InvTypeMerchant,
|
||||
InvTypeDeleted,
|
||||
InvTypeCorpse,
|
||||
InvTypeBazaar,
|
||||
InvTypeInspect,
|
||||
InvTypeRealEstate,
|
||||
InvTypeViewMODPC,
|
||||
InvTypeViewMODBank,
|
||||
InvTypeViewMODSharedBank,
|
||||
InvTypeViewMODLimbo,
|
||||
InvTypeAltStorage,
|
||||
InvTypeArchived,
|
||||
InvTypeMail,
|
||||
InvTypeGuildTrophyTribute,
|
||||
InvTypeKrono,
|
||||
InvTypeOther,
|
||||
InvTypeCount
|
||||
};
|
||||
} // namespace enum_
|
||||
using namespace enum_;
|
||||
|
||||
const int16 POSSESSIONS_SIZE = 34;
|
||||
const int16 BANK_SIZE = 24;
|
||||
const int16 SHARED_BANK_SIZE = 2;
|
||||
const int16 TRADE_SIZE = 8;
|
||||
const int16 WORLD_SIZE = 10;
|
||||
const int16 LIMBO_SIZE = 36;
|
||||
const int16 TRIBUTE_SIZE = 5;
|
||||
const int16 TROPHY_TRIBUTE_SIZE = 0;//unknown
|
||||
const int16 GUILD_TRIBUTE_SIZE = 2;//unverified
|
||||
const int16 MERCHANT_SIZE = 200;
|
||||
const int16 DELETED_SIZE = 0;//unknown - "Recovery Tab"
|
||||
const int16 CORPSE_SIZE = POSSESSIONS_SIZE;
|
||||
const int16 BAZAAR_SIZE = 200;
|
||||
const int16 INSPECT_SIZE = 23;
|
||||
const int16 REAL_ESTATE_SIZE = 0;//unknown
|
||||
const int16 VIEW_MOD_PC_SIZE = POSSESSIONS_SIZE;
|
||||
const int16 VIEW_MOD_BANK_SIZE = BANK_SIZE;
|
||||
const int16 VIEW_MOD_SHARED_BANK_SIZE = SHARED_BANK_SIZE;
|
||||
const int16 VIEW_MOD_LIMBO_SIZE = LIMBO_SIZE;
|
||||
const int16 ALT_STORAGE_SIZE = 0;//unknown - "Shroud Bank"
|
||||
const int16 ARCHIVED_SIZE = 0;//unknown
|
||||
const int16 MAIL_SIZE = 0;//unknown
|
||||
const int16 GUILD_TROPHY_TRIBUTE_SIZE = 0;//unknown
|
||||
const int16 KRONO_SIZE = 0;//unknown
|
||||
const int16 OTHER_SIZE = 0;//unknown
|
||||
|
||||
const int16 TRADE_NPC_SIZE = 4; // defined by implication
|
||||
|
||||
const int16 TYPE_INVALID = IINVALID;
|
||||
const int16 TYPE_BEGIN = typePossessions;
|
||||
const int16 TYPE_END = typeOther;
|
||||
const int16 TYPE_COUNT = (TYPE_END - TYPE_BEGIN) + 1;
|
||||
|
||||
int16 GetInvTypeSize(int16 inv_type);
|
||||
const char* GetInvTypeName(int16 inv_type);
|
||||
|
||||
bool IsInvTypePersistent(int16 inv_type);
|
||||
|
||||
} /*invtype*/
|
||||
|
||||
namespace invslot {
|
||||
inline EQEmu::versions::ClientVersion GetInvSlotRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||
|
||||
enum : int { InvSlotInvalid = -1, InvSlotBegin };
|
||||
namespace enum_ {
|
||||
enum InventorySlots : int16 {
|
||||
slotCharm = INULL,
|
||||
slotEar1,
|
||||
slotHead,
|
||||
slotFace,
|
||||
slotEar2,
|
||||
slotNeck,
|
||||
slotShoulders,
|
||||
slotArms,
|
||||
slotBack,
|
||||
slotWrist1,
|
||||
slotWrist2,
|
||||
slotRange,
|
||||
slotHands,
|
||||
slotPrimary,
|
||||
slotSecondary,
|
||||
slotFinger1,
|
||||
slotFinger2,
|
||||
slotChest,
|
||||
slotLegs,
|
||||
slotFeet,
|
||||
slotWaist,
|
||||
slotPowerSource,
|
||||
slotAmmo,
|
||||
slotGeneral1,
|
||||
slotGeneral2,
|
||||
slotGeneral3,
|
||||
slotGeneral4,
|
||||
slotGeneral5,
|
||||
slotGeneral6,
|
||||
slotGeneral7,
|
||||
slotGeneral8,
|
||||
slotGeneral9,
|
||||
slotGeneral10,
|
||||
slotCursor
|
||||
};
|
||||
|
||||
enum PossessionsSlot : int {
|
||||
PossessionsCharm = InvSlotBegin,
|
||||
PossessionsEar1,
|
||||
PossessionsHead,
|
||||
PossessionsFace,
|
||||
PossessionsEar2,
|
||||
PossessionsNeck,
|
||||
PossessionsShoulders,
|
||||
PossessionsArms,
|
||||
PossessionsBack,
|
||||
PossessionsWrist1,
|
||||
PossessionsWrist2,
|
||||
PossessionsRange,
|
||||
PossessionsHands,
|
||||
PossessionsPrimary,
|
||||
PossessionsSecondary,
|
||||
PossessionsFinger1,
|
||||
PossessionsFinger2,
|
||||
PossessionsChest,
|
||||
PossessionsLegs,
|
||||
PossessionsFeet,
|
||||
PossessionsWaist,
|
||||
PossessionsPowerSource,
|
||||
PossessionsAmmo,
|
||||
PossessionsGeneral1,
|
||||
PossessionsGeneral2,
|
||||
PossessionsGeneral3,
|
||||
PossessionsGeneral4,
|
||||
PossessionsGeneral5,
|
||||
PossessionsGeneral6,
|
||||
PossessionsGeneral7,
|
||||
PossessionsGeneral8,
|
||||
PossessionsGeneral9,
|
||||
PossessionsGeneral10,
|
||||
PossessionsCursor,
|
||||
PossessionsCount
|
||||
};
|
||||
} // namespace enum_
|
||||
using namespace enum_;
|
||||
|
||||
const int EquipmentBegin = PossessionsCharm;
|
||||
const int EquipmentEnd = PossessionsAmmo;
|
||||
const int EquipmentCount = (EquipmentEnd - EquipmentBegin + 1);
|
||||
const int16 SLOT_INVALID = IINVALID;
|
||||
const int16 SLOT_BEGIN = INULL;
|
||||
|
||||
const int GeneralBegin = PossessionsGeneral1;
|
||||
const int GeneralEnd = PossessionsGeneral10;
|
||||
const int GeneralCount = (GeneralEnd - GeneralBegin + 1);
|
||||
const int16 POSSESSIONS_BEGIN = slotCharm;
|
||||
const int16 POSSESSIONS_END = slotCursor;
|
||||
const int16 POSSESSIONS_COUNT = (POSSESSIONS_END - POSSESSIONS_BEGIN) + 1;
|
||||
|
||||
const int16 EQUIPMENT_BEGIN = slotCharm;
|
||||
const int16 EQUIPMENT_END = slotAmmo;
|
||||
const int16 EQUIPMENT_COUNT = (EQUIPMENT_END - EQUIPMENT_BEGIN) + 1;
|
||||
|
||||
const int16 GENERAL_BEGIN = slotGeneral1;
|
||||
const int16 GENERAL_END = slotGeneral10;
|
||||
const int16 GENERAL_COUNT = (GENERAL_END - GENERAL_BEGIN) + 1;
|
||||
|
||||
const int16 BONUS_BEGIN = invslot::slotCharm;
|
||||
const int16 BONUS_STAT_END = invslot::slotPowerSource;
|
||||
const int16 BONUS_SKILL_END = invslot::slotAmmo;
|
||||
|
||||
const int16 CORPSE_BEGIN = invslot::slotGeneral1;
|
||||
const int16 CORPSE_END = invslot::slotGeneral1 + invslot::slotCursor;
|
||||
|
||||
const uint64 POSSESSIONS_BITMASK = 0x00000003FFFFFFFF; // based on 34-slot count (RoF+)
|
||||
const uint64 CORPSE_BITMASK = 0x01FFFFFFFF800000; // based on 34-slot count (RoF+)
|
||||
|
||||
const char* GetInvPossessionsSlotName(int16 inv_slot);
|
||||
const char* GetInvSlotName(int16 inv_type, int16 inv_slot);
|
||||
|
||||
} /*invslot*/
|
||||
|
||||
namespace invbag {
|
||||
inline EQEmu::versions::ClientVersion GetInvBagRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||
|
||||
enum : int { InvBagInvalid = -1, InvBagBegin };
|
||||
const int16 SLOT_INVALID = IINVALID;
|
||||
const int16 SLOT_BEGIN = INULL;
|
||||
const int16 SLOT_END = 9; //254;
|
||||
const int16 SLOT_COUNT = 10; //255; // server Size will be 255..unsure what actual client is (test)
|
||||
|
||||
const char* GetInvBagIndexName(int16 bag_index);
|
||||
|
||||
} /*invbag*/
|
||||
|
||||
namespace invaug {
|
||||
inline EQEmu::versions::ClientVersion GetInvAugRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||
|
||||
enum : int { InvAugInvalid = -1, InvAugBegin };
|
||||
const int16 SOCKET_INVALID = IINVALID;
|
||||
const int16 SOCKET_BEGIN = INULL;
|
||||
const int16 SOCKET_END = 5;
|
||||
const int16 SOCKET_COUNT = 6;
|
||||
|
||||
const char* GetInvAugIndexName(int16 aug_index);
|
||||
|
||||
} /*invaug*/
|
||||
|
||||
@@ -172,110 +247,21 @@ namespace RoF2
|
||||
namespace profile {
|
||||
inline EQEmu::versions::ClientVersion GetProfileRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||
|
||||
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
|
||||
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
||||
|
||||
const int16 POTION_BELT_SIZE = 5;
|
||||
|
||||
const int16 SKILL_ARRAY_SIZE = 100;
|
||||
|
||||
} /*profile*/
|
||||
|
||||
namespace constants {
|
||||
inline EQEmu::versions::ClientVersion GetConstantsRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||
|
||||
} /*constants*/
|
||||
const size_t CHARACTER_CREATION_LIMIT = 12;
|
||||
|
||||
namespace behavior {
|
||||
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||
|
||||
} /*behavior*/
|
||||
|
||||
namespace skills {
|
||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||
|
||||
} /*skills*/
|
||||
|
||||
|
||||
// declarations
|
||||
namespace inventory {
|
||||
const bool ConcatenateInvTypeLimbo = false;
|
||||
|
||||
const bool AllowOverLevelEquipment = true;
|
||||
|
||||
const bool AllowEmptyBagInBag = true;
|
||||
const bool AllowClickCastFromBag = true;
|
||||
|
||||
} /*inventory*/
|
||||
|
||||
namespace invtype {
|
||||
const size_t InvTypePossessionsSize = invslot::PossessionsCount;
|
||||
const size_t InvTypeBankSize = 24;
|
||||
const size_t InvTypeSharedBankSize = 2;
|
||||
const size_t InvTypeTradeSize = 8;
|
||||
const size_t InvTypeWorldSize = 10;
|
||||
const size_t InvTypeLimboSize = 36;
|
||||
const size_t InvTypeTributeSize = 5;
|
||||
const size_t InvTypeTrophyTributeSize = 0;//unknown
|
||||
const size_t InvTypeGuildTributeSize = 2;//unverified
|
||||
const size_t InvTypeMerchantSize = 200;
|
||||
const size_t InvTypeDeletedSize = 0;//unknown - "Recovery Tab"
|
||||
const size_t InvTypeCorpseSize = InvTypePossessionsSize;
|
||||
const size_t InvTypeBazaarSize = 200;
|
||||
const size_t InvTypeInspectSize = invslot::EquipmentCount;
|
||||
const size_t InvTypeRealEstateSize = 0;//unknown
|
||||
const size_t InvTypeViewMODPCSize = InvTypePossessionsSize;
|
||||
const size_t InvTypeViewMODBankSize = InvTypeBankSize;
|
||||
const size_t InvTypeViewMODSharedBankSize = InvTypeSharedBankSize;
|
||||
const size_t InvTypeViewMODLimboSize = InvTypeLimboSize;
|
||||
const size_t InvTypeAltStorageSize = 0;//unknown - "Shroud Bank"
|
||||
const size_t InvTypeArchivedSize = 0;//unknown
|
||||
const size_t InvTypeMailSize = 0;//unknown
|
||||
const size_t InvTypeGuildTrophyTributeSize = 0;//unknown
|
||||
const size_t InvTypeKronoSize = 0;//unknown
|
||||
const size_t InvTypeOtherSize = 0;//unknown
|
||||
|
||||
extern size_t GetInvTypeSize(int inv_type);
|
||||
extern const char* GetInvTypeName(int inv_type);
|
||||
|
||||
extern bool IsInvTypePersistent(int inv_type);
|
||||
|
||||
} /*invtype*/
|
||||
|
||||
namespace invslot {
|
||||
extern const char* GetInvPossessionsSlotName(int inv_slot);
|
||||
extern const char* GetInvSlotName(int inv_type, int inv_slot);
|
||||
|
||||
} /*invslot*/
|
||||
|
||||
namespace invbag {
|
||||
const size_t ItemBagSize = 255; // server Size will be 255..unsure what actual client is (test)
|
||||
|
||||
extern const char* GetInvBagIndexName(int bag_index);
|
||||
|
||||
} /*invbag*/
|
||||
|
||||
namespace invaug {
|
||||
const size_t ItemAugSize = 6;
|
||||
|
||||
extern const char* GetInvAugIndexName(int aug_index);
|
||||
|
||||
} /*invaug*/
|
||||
|
||||
namespace item {
|
||||
|
||||
} /*item*/
|
||||
|
||||
namespace profile {
|
||||
const size_t TributeSize = invtype::InvTypeTributeSize;
|
||||
const size_t GuildTributeSize = invtype::InvTypeGuildTributeSize;
|
||||
|
||||
const size_t BandoliersSize = 20; // number of bandolier instances
|
||||
const size_t BandolierItemCount = 4; // number of equipment slots in bandolier instance
|
||||
|
||||
const size_t PotionBeltSize = 5;
|
||||
|
||||
const size_t SkillArraySize = 100;
|
||||
|
||||
} /*profile*/
|
||||
|
||||
namespace constants {
|
||||
const size_t CharacterCreationLimit = 12;
|
||||
|
||||
const size_t SayLinkBodySize = 56;
|
||||
const size_t SAY_LINK_BODY_SIZE = 56;
|
||||
|
||||
const int LongBuffs = 42;
|
||||
const int ShortBuffs = 20;
|
||||
@@ -288,11 +274,15 @@ namespace RoF2
|
||||
} /*constants*/
|
||||
|
||||
namespace behavior {
|
||||
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||
|
||||
const bool CoinHasWeight = false;
|
||||
|
||||
} /*behavior*/
|
||||
|
||||
namespace skills {
|
||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||
|
||||
const size_t LastUsableSkill = EQEmu::skills::Skill2HPiercing;
|
||||
|
||||
} /*skills*/
|
||||
|
||||
@@ -98,7 +98,6 @@ E(OP_MoveItem)
|
||||
E(OP_NewSpawn)
|
||||
E(OP_NewZone)
|
||||
E(OP_OnLevelMessage)
|
||||
//E(OP_OpenNewTasksWindow)
|
||||
E(OP_PetBuffWindow)
|
||||
E(OP_PlayerProfile)
|
||||
E(OP_RaidJoin)
|
||||
|
||||
@@ -957,13 +957,13 @@ struct BandolierItem_Struct_Old
|
||||
struct Bandolier_Struct
|
||||
{
|
||||
char Name[1]; // Variable Length
|
||||
BandolierItem_Struct Items[profile::BandolierItemCount];
|
||||
BandolierItem_Struct Items[profile::BANDOLIER_ITEM_COUNT];
|
||||
};
|
||||
|
||||
struct Bandolier_Struct_Old
|
||||
{
|
||||
char Name[32];
|
||||
BandolierItem_Struct Items[profile::BandolierItemCount];
|
||||
BandolierItem_Struct Items[profile::BANDOLIER_ITEM_COUNT];
|
||||
};
|
||||
|
||||
struct PotionBeltItem_Struct
|
||||
@@ -983,12 +983,12 @@ struct PotionBeltItem_Struct_Old
|
||||
|
||||
struct PotionBelt_Struct
|
||||
{
|
||||
PotionBeltItem_Struct Items[profile::PotionBeltSize];
|
||||
PotionBeltItem_Struct Items[profile::POTION_BELT_SIZE];
|
||||
};
|
||||
|
||||
struct PotionBelt_Struct_Old
|
||||
{
|
||||
PotionBeltItem_Struct_Old Items[profile::PotionBeltSize];
|
||||
PotionBeltItem_Struct_Old Items[profile::POTION_BELT_SIZE];
|
||||
};
|
||||
|
||||
struct GroupLeadershipAA_Struct {
|
||||
@@ -1198,7 +1198,7 @@ union
|
||||
/*12949*/ uint32 aapoints; // Unspent AA points - Seen 1
|
||||
/*12953*/ uint16 unknown_rof20; //
|
||||
/*12955*/ uint32 bandolier_count; // Seen 20
|
||||
/*12959*/ Bandolier_Struct bandoliers[profile::BandoliersSize]; // [20] 740 bytes (Variable Name Sizes) - bandolier contents
|
||||
/*12959*/ Bandolier_Struct bandoliers[profile::BANDOLIERS_SIZE]; // [20] 740 bytes (Variable Name Sizes) - bandolier contents
|
||||
/*13699*/ uint32 potionbelt_count; // Seen 5
|
||||
/*13703*/ PotionBelt_Struct potionbelt; // [5] 45 bytes potion belt - (Variable Name Sizes)
|
||||
/*13748*/ int32 unknown_rof21; // Seen -1
|
||||
|
||||
+133
-133
@@ -22,227 +22,227 @@
|
||||
#include "../string_util.h"
|
||||
|
||||
|
||||
size_t RoF::invtype::GetInvTypeSize(int inv_type)
|
||||
int16 RoF::invtype::GetInvTypeSize(int16 inv_type)
|
||||
{
|
||||
switch (inv_type) {
|
||||
case invtype::InvTypePossessions:
|
||||
return invtype::InvTypePossessionsSize;
|
||||
case invtype::InvTypeBank:
|
||||
return invtype::InvTypeBankSize;
|
||||
case invtype::InvTypeSharedBank:
|
||||
return invtype::InvTypeSharedBankSize;
|
||||
case invtype::InvTypeTrade:
|
||||
return invtype::InvTypeTradeSize;
|
||||
case invtype::InvTypeWorld:
|
||||
return invtype::InvTypeWorldSize;
|
||||
case invtype::InvTypeLimbo:
|
||||
return invtype::InvTypeLimboSize;
|
||||
case invtype::InvTypeTribute:
|
||||
return invtype::InvTypeTributeSize;
|
||||
case invtype::InvTypeTrophyTribute:
|
||||
return invtype::InvTypeTrophyTributeSize;
|
||||
case invtype::InvTypeGuildTribute:
|
||||
return invtype::InvTypeGuildTributeSize;
|
||||
case invtype::InvTypeMerchant:
|
||||
return invtype::InvTypeMerchantSize;
|
||||
case invtype::InvTypeDeleted:
|
||||
return invtype::InvTypeDeletedSize;
|
||||
case invtype::InvTypeCorpse:
|
||||
return invtype::InvTypeCorpseSize;
|
||||
case invtype::InvTypeBazaar:
|
||||
return invtype::InvTypeBazaarSize;
|
||||
case invtype::InvTypeInspect:
|
||||
return invtype::InvTypeInspectSize;
|
||||
case invtype::InvTypeRealEstate:
|
||||
return invtype::InvTypeRealEstateSize;
|
||||
case invtype::InvTypeViewMODPC:
|
||||
return invtype::InvTypeViewMODPCSize;
|
||||
case invtype::InvTypeViewMODBank:
|
||||
return invtype::InvTypeViewMODBankSize;
|
||||
case invtype::InvTypeViewMODSharedBank:
|
||||
return invtype::InvTypeViewMODSharedBankSize;
|
||||
case invtype::InvTypeViewMODLimbo:
|
||||
return invtype::InvTypeViewMODLimboSize;
|
||||
case invtype::InvTypeAltStorage:
|
||||
return invtype::InvTypeAltStorageSize;
|
||||
case invtype::InvTypeArchived:
|
||||
return invtype::InvTypeArchivedSize;
|
||||
case invtype::InvTypeMail:
|
||||
return invtype::InvTypeMailSize;
|
||||
case invtype::InvTypeGuildTrophyTribute:
|
||||
return invtype::InvTypeGuildTrophyTributeSize;
|
||||
case invtype::InvTypeOther:
|
||||
return invtype::InvTypeOtherSize;
|
||||
case invtype::typePossessions:
|
||||
return invtype::POSSESSIONS_SIZE;
|
||||
case invtype::typeBank:
|
||||
return invtype::BANK_SIZE;
|
||||
case invtype::typeSharedBank:
|
||||
return invtype::SHARED_BANK_SIZE;
|
||||
case invtype::typeTrade:
|
||||
return invtype::TRADE_SIZE;
|
||||
case invtype::typeWorld:
|
||||
return invtype::WORLD_SIZE;
|
||||
case invtype::typeLimbo:
|
||||
return invtype::LIMBO_SIZE;
|
||||
case invtype::typeTribute:
|
||||
return invtype::TRIBUTE_SIZE;
|
||||
case invtype::typeTrophyTribute:
|
||||
return invtype::TROPHY_TRIBUTE_SIZE;
|
||||
case invtype::typeGuildTribute:
|
||||
return invtype::GUILD_TRIBUTE_SIZE;
|
||||
case invtype::typeMerchant:
|
||||
return invtype::MERCHANT_SIZE;
|
||||
case invtype::typeDeleted:
|
||||
return invtype::DELETED_SIZE;
|
||||
case invtype::typeCorpse:
|
||||
return invtype::CORPSE_SIZE;
|
||||
case invtype::typeBazaar:
|
||||
return invtype::BAZAAR_SIZE;
|
||||
case invtype::typeInspect:
|
||||
return invtype::INSPECT_SIZE;
|
||||
case invtype::typeRealEstate:
|
||||
return invtype::REAL_ESTATE_SIZE;
|
||||
case invtype::typeViewMODPC:
|
||||
return invtype::VIEW_MOD_PC_SIZE;
|
||||
case invtype::typeViewMODBank:
|
||||
return invtype::VIEW_MOD_BANK_SIZE;
|
||||
case invtype::typeViewMODSharedBank:
|
||||
return invtype::VIEW_MOD_SHARED_BANK_SIZE;
|
||||
case invtype::typeViewMODLimbo:
|
||||
return invtype::VIEW_MOD_LIMBO_SIZE;
|
||||
case invtype::typeAltStorage:
|
||||
return invtype::ALT_STORAGE_SIZE;
|
||||
case invtype::typeArchived:
|
||||
return invtype::ARCHIVED_SIZE;
|
||||
case invtype::typeMail:
|
||||
return invtype::MAIL_SIZE;
|
||||
case invtype::typeGuildTrophyTribute:
|
||||
return invtype::GUILD_TROPHY_TRIBUTE_SIZE;
|
||||
case invtype::typeOther:
|
||||
return invtype::OTHER_SIZE;
|
||||
default:
|
||||
return 0;
|
||||
return INULL;
|
||||
}
|
||||
}
|
||||
|
||||
const char* RoF::invtype::GetInvTypeName(int inv_type)
|
||||
const char* RoF::invtype::GetInvTypeName(int16 inv_type)
|
||||
{
|
||||
switch (inv_type) {
|
||||
case invtype::InvTypeInvalid:
|
||||
case invtype::TYPE_INVALID:
|
||||
return "Invalid Type";
|
||||
case invtype::InvTypePossessions:
|
||||
case invtype::typePossessions:
|
||||
return "Possessions";
|
||||
case invtype::InvTypeBank:
|
||||
case invtype::typeBank:
|
||||
return "Bank";
|
||||
case invtype::InvTypeSharedBank:
|
||||
case invtype::typeSharedBank:
|
||||
return "Shared Bank";
|
||||
case invtype::InvTypeTrade:
|
||||
case invtype::typeTrade:
|
||||
return "Trade";
|
||||
case invtype::InvTypeWorld:
|
||||
case invtype::typeWorld:
|
||||
return "World";
|
||||
case invtype::InvTypeLimbo:
|
||||
case invtype::typeLimbo:
|
||||
return "Limbo";
|
||||
case invtype::InvTypeTribute:
|
||||
case invtype::typeTribute:
|
||||
return "Tribute";
|
||||
case invtype::InvTypeTrophyTribute:
|
||||
case invtype::typeTrophyTribute:
|
||||
return "Trophy Tribute";
|
||||
case invtype::InvTypeGuildTribute:
|
||||
case invtype::typeGuildTribute:
|
||||
return "Guild Tribute";
|
||||
case invtype::InvTypeMerchant:
|
||||
case invtype::typeMerchant:
|
||||
return "Merchant";
|
||||
case invtype::InvTypeDeleted:
|
||||
case invtype::typeDeleted:
|
||||
return "Deleted";
|
||||
case invtype::InvTypeCorpse:
|
||||
case invtype::typeCorpse:
|
||||
return "Corpse";
|
||||
case invtype::InvTypeBazaar:
|
||||
case invtype::typeBazaar:
|
||||
return "Bazaar";
|
||||
case invtype::InvTypeInspect:
|
||||
case invtype::typeInspect:
|
||||
return "Inspect";
|
||||
case invtype::InvTypeRealEstate:
|
||||
case invtype::typeRealEstate:
|
||||
return "Real Estate";
|
||||
case invtype::InvTypeViewMODPC:
|
||||
case invtype::typeViewMODPC:
|
||||
return "View MOD PC";
|
||||
case invtype::InvTypeViewMODBank:
|
||||
case invtype::typeViewMODBank:
|
||||
return "View MOD Bank";
|
||||
case invtype::InvTypeViewMODSharedBank:
|
||||
case invtype::typeViewMODSharedBank:
|
||||
return "View MOD Shared Bank";
|
||||
case invtype::InvTypeViewMODLimbo:
|
||||
case invtype::typeViewMODLimbo:
|
||||
return "View MOD Limbo";
|
||||
case invtype::InvTypeAltStorage:
|
||||
case invtype::typeAltStorage:
|
||||
return "Alt Storage";
|
||||
case invtype::InvTypeArchived:
|
||||
case invtype::typeArchived:
|
||||
return "Archived";
|
||||
case invtype::InvTypeMail:
|
||||
case invtype::typeMail:
|
||||
return "Mail";
|
||||
case invtype::InvTypeGuildTrophyTribute:
|
||||
case invtype::typeGuildTrophyTribute:
|
||||
return "Guild Trophy Tribute";
|
||||
case invtype::InvTypeOther:
|
||||
case invtype::typeOther:
|
||||
return "Other";
|
||||
default:
|
||||
return "Unknown Type";
|
||||
}
|
||||
}
|
||||
|
||||
bool RoF::invtype::IsInvTypePersistent(int inv_type)
|
||||
bool RoF::invtype::IsInvTypePersistent(int16 inv_type)
|
||||
{
|
||||
switch (inv_type) {
|
||||
case invtype::InvTypePossessions:
|
||||
case invtype::InvTypeBank:
|
||||
case invtype::InvTypeSharedBank:
|
||||
case invtype::InvTypeTrade:
|
||||
case invtype::InvTypeWorld:
|
||||
case invtype::InvTypeLimbo:
|
||||
case invtype::InvTypeTribute:
|
||||
case invtype::InvTypeTrophyTribute:
|
||||
case invtype::InvTypeGuildTribute:
|
||||
case invtype::typePossessions:
|
||||
case invtype::typeBank:
|
||||
case invtype::typeSharedBank:
|
||||
case invtype::typeTrade:
|
||||
case invtype::typeWorld:
|
||||
case invtype::typeLimbo:
|
||||
case invtype::typeTribute:
|
||||
case invtype::typeTrophyTribute:
|
||||
case invtype::typeGuildTribute:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const char* RoF::invslot::GetInvPossessionsSlotName(int inv_slot)
|
||||
const char* RoF::invslot::GetInvPossessionsSlotName(int16 inv_slot)
|
||||
{
|
||||
switch (inv_slot) {
|
||||
case invslot::InvSlotInvalid:
|
||||
case invslot::SLOT_INVALID:
|
||||
return "Invalid Slot";
|
||||
case invslot::PossessionsCharm:
|
||||
case invslot::slotCharm:
|
||||
return "Charm";
|
||||
case invslot::PossessionsEar1:
|
||||
case invslot::slotEar1:
|
||||
return "Ear 1";
|
||||
case invslot::PossessionsHead:
|
||||
case invslot::slotHead:
|
||||
return "Head";
|
||||
case invslot::PossessionsFace:
|
||||
case invslot::slotFace:
|
||||
return "Face";
|
||||
case invslot::PossessionsEar2:
|
||||
case invslot::slotEar2:
|
||||
return "Ear 2";
|
||||
case invslot::PossessionsNeck:
|
||||
case invslot::slotNeck:
|
||||
return "Neck";
|
||||
case invslot::PossessionsShoulders:
|
||||
case invslot::slotShoulders:
|
||||
return "Shoulders";
|
||||
case invslot::PossessionsArms:
|
||||
case invslot::slotArms:
|
||||
return "Arms";
|
||||
case invslot::PossessionsBack:
|
||||
case invslot::slotBack:
|
||||
return "Back";
|
||||
case invslot::PossessionsWrist1:
|
||||
case invslot::slotWrist1:
|
||||
return "Wrist 1";
|
||||
case invslot::PossessionsWrist2:
|
||||
case invslot::slotWrist2:
|
||||
return "Wrist 2";
|
||||
case invslot::PossessionsRange:
|
||||
case invslot::slotRange:
|
||||
return "Range";
|
||||
case invslot::PossessionsHands:
|
||||
case invslot::slotHands:
|
||||
return "Hands";
|
||||
case invslot::PossessionsPrimary:
|
||||
case invslot::slotPrimary:
|
||||
return "Primary";
|
||||
case invslot::PossessionsSecondary:
|
||||
case invslot::slotSecondary:
|
||||
return "Secondary";
|
||||
case invslot::PossessionsFinger1:
|
||||
case invslot::slotFinger1:
|
||||
return "Finger 1";
|
||||
case invslot::PossessionsFinger2:
|
||||
case invslot::slotFinger2:
|
||||
return "Finger 2";
|
||||
case invslot::PossessionsChest:
|
||||
case invslot::slotChest:
|
||||
return "Chest";
|
||||
case invslot::PossessionsLegs:
|
||||
case invslot::slotLegs:
|
||||
return "Legs";
|
||||
case invslot::PossessionsFeet:
|
||||
case invslot::slotFeet:
|
||||
return "Feet";
|
||||
case invslot::PossessionsWaist:
|
||||
case invslot::slotWaist:
|
||||
return "Waist";
|
||||
case invslot::PossessionsPowerSource:
|
||||
case invslot::slotPowerSource:
|
||||
return "Power Source";
|
||||
case invslot::PossessionsAmmo:
|
||||
case invslot::slotAmmo:
|
||||
return "Ammo";
|
||||
case invslot::PossessionsGeneral1:
|
||||
case invslot::slotGeneral1:
|
||||
return "General 1";
|
||||
case invslot::PossessionsGeneral2:
|
||||
case invslot::slotGeneral2:
|
||||
return "General 2";
|
||||
case invslot::PossessionsGeneral3:
|
||||
case invslot::slotGeneral3:
|
||||
return "General 3";
|
||||
case invslot::PossessionsGeneral4:
|
||||
case invslot::slotGeneral4:
|
||||
return "General 4";
|
||||
case invslot::PossessionsGeneral5:
|
||||
case invslot::slotGeneral5:
|
||||
return "General 5";
|
||||
case invslot::PossessionsGeneral6:
|
||||
case invslot::slotGeneral6:
|
||||
return "General 6";
|
||||
case invslot::PossessionsGeneral7:
|
||||
case invslot::slotGeneral7:
|
||||
return "General 7";
|
||||
case invslot::PossessionsGeneral8:
|
||||
case invslot::slotGeneral8:
|
||||
return "General 8";
|
||||
case invslot::PossessionsGeneral9:
|
||||
case invslot::slotGeneral9:
|
||||
return "General 9";
|
||||
case invslot::PossessionsGeneral10:
|
||||
case invslot::slotGeneral10:
|
||||
return "General 10";
|
||||
case invslot::PossessionsCursor:
|
||||
case invslot::slotCursor:
|
||||
return "Cursor";
|
||||
default:
|
||||
return "Unknown Slot";
|
||||
}
|
||||
}
|
||||
|
||||
const char* RoF::invslot::GetInvSlotName(int inv_type, int inv_slot)
|
||||
const char* RoF::invslot::GetInvSlotName(int16 inv_type, int16 inv_slot)
|
||||
{
|
||||
if (inv_type == invtype::InvTypePossessions)
|
||||
if (inv_type == invtype::typePossessions)
|
||||
return invslot::GetInvPossessionsSlotName(inv_slot);
|
||||
|
||||
size_t type_size = invtype::GetInvTypeSize(inv_type);
|
||||
int16 type_size = invtype::GetInvTypeSize(inv_type);
|
||||
|
||||
if (!type_size || inv_slot == invslot::InvSlotInvalid)
|
||||
if (!type_size || inv_slot == invslot::SLOT_INVALID)
|
||||
return "Invalid Slot";
|
||||
|
||||
if ((size_t)(inv_slot + 1) >= type_size)
|
||||
if ((inv_slot + 1) >= type_size)
|
||||
return "Unknown Slot";
|
||||
|
||||
static std::string ret_str;
|
||||
@@ -251,12 +251,12 @@ const char* RoF::invslot::GetInvSlotName(int inv_type, int inv_slot)
|
||||
return ret_str.c_str();
|
||||
}
|
||||
|
||||
const char* RoF::invbag::GetInvBagIndexName(int bag_index)
|
||||
const char* RoF::invbag::GetInvBagIndexName(int16 bag_index)
|
||||
{
|
||||
if (bag_index == invbag::InvBagInvalid)
|
||||
if (bag_index == invbag::SLOT_INVALID)
|
||||
return "Invalid Bag";
|
||||
|
||||
if ((size_t)bag_index >= invbag::ItemBagSize)
|
||||
if (bag_index >= invbag::SLOT_COUNT)
|
||||
return "Unknown Bag";
|
||||
|
||||
static std::string ret_str;
|
||||
@@ -265,12 +265,12 @@ const char* RoF::invbag::GetInvBagIndexName(int bag_index)
|
||||
return ret_str.c_str();
|
||||
}
|
||||
|
||||
const char* RoF::invaug::GetInvAugIndexName(int aug_index)
|
||||
const char* RoF::invaug::GetInvAugIndexName(int16 aug_index)
|
||||
{
|
||||
if (aug_index == invaug::InvAugInvalid)
|
||||
if (aug_index == invaug::SOCKET_INVALID)
|
||||
return "Invalid Augment";
|
||||
|
||||
if ((size_t)aug_index >= invaug::ItemAugSize)
|
||||
if (aug_index >= invaug::SOCKET_COUNT)
|
||||
return "Unknown Augment";
|
||||
|
||||
static std::string ret_str;
|
||||
|
||||
+165
-175
@@ -27,115 +27,189 @@
|
||||
|
||||
namespace RoF
|
||||
{
|
||||
enum : int { Invalid = -1, Null, Safety };
|
||||
const int16 IINVALID = -1;
|
||||
const int16 INULL = 0;
|
||||
|
||||
enum : bool { False = false, True = true };
|
||||
|
||||
// pre-declarations
|
||||
namespace inventory {
|
||||
inline EQEmu::versions::ClientVersion GetInventoryRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||
|
||||
const bool ConcatenateInvTypeLimbo = false;
|
||||
|
||||
const bool AllowOverLevelEquipment = true;
|
||||
|
||||
const bool AllowEmptyBagInBag = true;
|
||||
const bool AllowClickCastFromBag = true;
|
||||
|
||||
} /*inventory*/
|
||||
|
||||
namespace invtype {
|
||||
inline EQEmu::versions::ClientVersion GetInvTypeRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||
|
||||
enum : int { InvTypeInvalid = -1, InvTypeBegin };
|
||||
namespace enum_ {
|
||||
enum InventoryTypes : int16 {
|
||||
typePossessions = INULL,
|
||||
typeBank,
|
||||
typeSharedBank,
|
||||
typeTrade,
|
||||
typeWorld,
|
||||
typeLimbo,
|
||||
typeTribute,
|
||||
typeTrophyTribute,
|
||||
typeGuildTribute,
|
||||
typeMerchant,
|
||||
typeDeleted,
|
||||
typeCorpse,
|
||||
typeBazaar,
|
||||
typeInspect,
|
||||
typeRealEstate,
|
||||
typeViewMODPC,
|
||||
typeViewMODBank,
|
||||
typeViewMODSharedBank,
|
||||
typeViewMODLimbo,
|
||||
typeAltStorage,
|
||||
typeArchived,
|
||||
typeMail,
|
||||
typeGuildTrophyTribute,
|
||||
typeOther
|
||||
};
|
||||
|
||||
enum InventoryType : int {
|
||||
InvTypePossessions = InvTypeBegin,
|
||||
InvTypeBank,
|
||||
InvTypeSharedBank,
|
||||
InvTypeTrade,
|
||||
InvTypeWorld,
|
||||
InvTypeLimbo,
|
||||
InvTypeTribute,
|
||||
InvTypeTrophyTribute,
|
||||
InvTypeGuildTribute,
|
||||
InvTypeMerchant,
|
||||
InvTypeDeleted,
|
||||
InvTypeCorpse,
|
||||
InvTypeBazaar,
|
||||
InvTypeInspect,
|
||||
InvTypeRealEstate,
|
||||
InvTypeViewMODPC,
|
||||
InvTypeViewMODBank,
|
||||
InvTypeViewMODSharedBank,
|
||||
InvTypeViewMODLimbo,
|
||||
InvTypeAltStorage,
|
||||
InvTypeArchived,
|
||||
InvTypeMail,
|
||||
InvTypeGuildTrophyTribute,
|
||||
InvTypeOther,
|
||||
InvTypeCount
|
||||
};
|
||||
} // namespace enum_
|
||||
using namespace enum_;
|
||||
|
||||
const int16 POSSESSIONS_SIZE = 34;
|
||||
const int16 BANK_SIZE = 24;
|
||||
const int16 SHARED_BANK_SIZE = 2;
|
||||
const int16 TRADE_SIZE = 8;
|
||||
const int16 WORLD_SIZE = 10;
|
||||
const int16 LIMBO_SIZE = 36;
|
||||
const int16 TRIBUTE_SIZE = 5;
|
||||
const int16 TROPHY_TRIBUTE_SIZE = 0;//unknown
|
||||
const int16 GUILD_TRIBUTE_SIZE = 2;//unverified
|
||||
const int16 MERCHANT_SIZE = 200;
|
||||
const int16 DELETED_SIZE = 0;//unknown - "Recovery Tab"
|
||||
const int16 CORPSE_SIZE = POSSESSIONS_SIZE;
|
||||
const int16 BAZAAR_SIZE = 200;
|
||||
const int16 INSPECT_SIZE = 23;
|
||||
const int16 REAL_ESTATE_SIZE = 0;//unknown
|
||||
const int16 VIEW_MOD_PC_SIZE = POSSESSIONS_SIZE;
|
||||
const int16 VIEW_MOD_BANK_SIZE = BANK_SIZE;
|
||||
const int16 VIEW_MOD_SHARED_BANK_SIZE = SHARED_BANK_SIZE;
|
||||
const int16 VIEW_MOD_LIMBO_SIZE = LIMBO_SIZE;
|
||||
const int16 ALT_STORAGE_SIZE = 0;//unknown - "Shroud Bank"
|
||||
const int16 ARCHIVED_SIZE = 0;//unknown
|
||||
const int16 MAIL_SIZE = 0;//unknown
|
||||
const int16 GUILD_TROPHY_TRIBUTE_SIZE = 0;//unknown
|
||||
const int16 OTHER_SIZE = 0;//unknown
|
||||
|
||||
const int16 TRADE_NPC_SIZE = 4; // defined by implication
|
||||
|
||||
const int16 TYPE_INVALID = IINVALID;
|
||||
const int16 TYPE_BEGIN = typePossessions;
|
||||
const int16 TYPE_END = typeOther;
|
||||
const int16 TYPE_COUNT = (TYPE_END - TYPE_BEGIN) + 1;
|
||||
|
||||
int16 GetInvTypeSize(int16 inv_type);
|
||||
const char* GetInvTypeName(int16 inv_type);
|
||||
|
||||
bool IsInvTypePersistent(int16 inv_type);
|
||||
|
||||
} /*invtype*/
|
||||
|
||||
namespace invslot {
|
||||
inline EQEmu::versions::ClientVersion GetInvSlotRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||
|
||||
enum : int { InvSlotInvalid = -1, InvSlotBegin };
|
||||
namespace enum_ {
|
||||
enum InventorySlots : int16 {
|
||||
slotCharm = INULL,
|
||||
slotEar1,
|
||||
slotHead,
|
||||
slotFace,
|
||||
slotEar2,
|
||||
slotNeck,
|
||||
slotShoulders,
|
||||
slotArms,
|
||||
slotBack,
|
||||
slotWrist1,
|
||||
slotWrist2,
|
||||
slotRange,
|
||||
slotHands,
|
||||
slotPrimary,
|
||||
slotSecondary,
|
||||
slotFinger1,
|
||||
slotFinger2,
|
||||
slotChest,
|
||||
slotLegs,
|
||||
slotFeet,
|
||||
slotWaist,
|
||||
slotPowerSource,
|
||||
slotAmmo,
|
||||
slotGeneral1,
|
||||
slotGeneral2,
|
||||
slotGeneral3,
|
||||
slotGeneral4,
|
||||
slotGeneral5,
|
||||
slotGeneral6,
|
||||
slotGeneral7,
|
||||
slotGeneral8,
|
||||
slotGeneral9,
|
||||
slotGeneral10,
|
||||
slotCursor
|
||||
};
|
||||
|
||||
enum PossessionsSlot : int {
|
||||
PossessionsCharm = InvSlotBegin,
|
||||
PossessionsEar1,
|
||||
PossessionsHead,
|
||||
PossessionsFace,
|
||||
PossessionsEar2,
|
||||
PossessionsNeck,
|
||||
PossessionsShoulders,
|
||||
PossessionsArms,
|
||||
PossessionsBack,
|
||||
PossessionsWrist1,
|
||||
PossessionsWrist2,
|
||||
PossessionsRange,
|
||||
PossessionsHands,
|
||||
PossessionsPrimary,
|
||||
PossessionsSecondary,
|
||||
PossessionsFinger1,
|
||||
PossessionsFinger2,
|
||||
PossessionsChest,
|
||||
PossessionsLegs,
|
||||
PossessionsFeet,
|
||||
PossessionsWaist,
|
||||
PossessionsPowerSource,
|
||||
PossessionsAmmo,
|
||||
PossessionsGeneral1,
|
||||
PossessionsGeneral2,
|
||||
PossessionsGeneral3,
|
||||
PossessionsGeneral4,
|
||||
PossessionsGeneral5,
|
||||
PossessionsGeneral6,
|
||||
PossessionsGeneral7,
|
||||
PossessionsGeneral8,
|
||||
PossessionsGeneral9,
|
||||
PossessionsGeneral10,
|
||||
PossessionsCursor,
|
||||
PossessionsCount
|
||||
};
|
||||
} // namespace enum_
|
||||
using namespace enum_;
|
||||
|
||||
const int EquipmentBegin = PossessionsCharm;
|
||||
const int EquipmentEnd = PossessionsAmmo;
|
||||
const int EquipmentCount = (EquipmentEnd - EquipmentBegin + 1);
|
||||
const int16 SLOT_INVALID = IINVALID;
|
||||
const int16 SLOT_BEGIN = INULL;
|
||||
|
||||
const int GeneralBegin = PossessionsGeneral1;
|
||||
const int GeneralEnd = PossessionsGeneral10;
|
||||
const int GeneralCount = (GeneralEnd - GeneralBegin + 1);
|
||||
const int16 POSSESSIONS_BEGIN = slotCharm;
|
||||
const int16 POSSESSIONS_END = slotCursor;
|
||||
const int16 POSSESSIONS_COUNT = (POSSESSIONS_END - POSSESSIONS_BEGIN) + 1;
|
||||
|
||||
const int16 EQUIPMENT_BEGIN = slotCharm;
|
||||
const int16 EQUIPMENT_END = slotAmmo;
|
||||
const int16 EQUIPMENT_COUNT = (EQUIPMENT_END - EQUIPMENT_BEGIN + 1);
|
||||
|
||||
const int16 GENERAL_BEGIN = slotGeneral1;
|
||||
const int16 GENERAL_END = slotGeneral10;
|
||||
const int16 GENERAL_COUNT = (GENERAL_END - GENERAL_BEGIN + 1);
|
||||
|
||||
const int16 BONUS_BEGIN = invslot::slotCharm;
|
||||
const int16 BONUS_STAT_END = invslot::slotPowerSource;
|
||||
const int16 BONUS_SKILL_END = invslot::slotAmmo;
|
||||
|
||||
const int16 CORPSE_BEGIN = invslot::slotGeneral1;
|
||||
const int16 CORPSE_END = invslot::slotGeneral1 + invslot::slotCursor;
|
||||
|
||||
const uint64 POSSESSIONS_BITMASK = 0x00000003FFFFFFFF; // based on 34-slot count (RoF+)
|
||||
const uint64 CORPSE_BITMASK = 0x01FFFFFFFF800000; // based on 34-slot count (RoF+)
|
||||
|
||||
const char* GetInvPossessionsSlotName(int16 inv_slot);
|
||||
const char* GetInvSlotName(int16 inv_type, int16 inv_slot);
|
||||
|
||||
} /*invslot*/
|
||||
|
||||
namespace invbag {
|
||||
inline EQEmu::versions::ClientVersion GetInvBagRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||
|
||||
enum : int { InvBagInvalid = -1, InvBagBegin };
|
||||
const int16 SLOT_INVALID = IINVALID;
|
||||
const int16 SLOT_BEGIN = INULL;
|
||||
const int16 SLOT_END = 9; //254;
|
||||
const int16 SLOT_COUNT = 10; //255; // server Size will be 255..unsure what actual client is (test)
|
||||
|
||||
const char* GetInvBagIndexName(int16 bag_index);
|
||||
|
||||
} /*invbag*/
|
||||
|
||||
namespace invaug {
|
||||
inline EQEmu::versions::ClientVersion GetInvAugRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||
|
||||
enum : int { InvAugInvalid = -1, InvAugBegin };
|
||||
const int16 SOCKET_INVALID = IINVALID;
|
||||
const int16 SOCKET_BEGIN = INULL;
|
||||
const int16 SOCKET_END = 5;
|
||||
const int16 SOCKET_COUNT = 6;
|
||||
|
||||
const char* GetInvAugIndexName(int16 aug_index);
|
||||
|
||||
} /*invaug*/
|
||||
|
||||
@@ -164,109 +238,21 @@ namespace RoF
|
||||
namespace profile {
|
||||
inline EQEmu::versions::ClientVersion GetProfileRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||
|
||||
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
|
||||
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
||||
|
||||
const int16 POTION_BELT_SIZE = 5;
|
||||
|
||||
const int16 SKILL_ARRAY_SIZE = 100;
|
||||
|
||||
} /*profile*/
|
||||
|
||||
namespace constants {
|
||||
inline EQEmu::versions::ClientVersion GetConstantsRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||
|
||||
} /*constants*/
|
||||
const size_t CHARACTER_CREATION_LIMIT = 12;
|
||||
|
||||
namespace behavior {
|
||||
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||
|
||||
} /*behavior*/
|
||||
|
||||
namespace skills {
|
||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||
|
||||
} /*skills*/
|
||||
|
||||
|
||||
// declarations
|
||||
namespace inventory {
|
||||
const bool ConcatenateInvTypeLimbo = false;
|
||||
|
||||
const bool AllowOverLevelEquipment = true;
|
||||
|
||||
const bool AllowEmptyBagInBag = true;
|
||||
const bool AllowClickCastFromBag = true;
|
||||
|
||||
} /*inventory*/
|
||||
|
||||
namespace invtype {
|
||||
const size_t InvTypePossessionsSize = invslot::PossessionsCount;
|
||||
const size_t InvTypeBankSize = 24;
|
||||
const size_t InvTypeSharedBankSize = 2;
|
||||
const size_t InvTypeTradeSize = 8;
|
||||
const size_t InvTypeWorldSize = 10;
|
||||
const size_t InvTypeLimboSize = 36;
|
||||
const size_t InvTypeTributeSize = 5;
|
||||
const size_t InvTypeTrophyTributeSize = 0;//unknown
|
||||
const size_t InvTypeGuildTributeSize = 2;//unverified
|
||||
const size_t InvTypeMerchantSize = 200;
|
||||
const size_t InvTypeDeletedSize = 0;//unknown - "Recovery Tab"
|
||||
const size_t InvTypeCorpseSize = InvTypePossessionsSize;
|
||||
const size_t InvTypeBazaarSize = 200;
|
||||
const size_t InvTypeInspectSize = invslot::EquipmentCount;
|
||||
const size_t InvTypeRealEstateSize = 0;//unknown
|
||||
const size_t InvTypeViewMODPCSize = InvTypePossessionsSize;
|
||||
const size_t InvTypeViewMODBankSize = InvTypeBankSize;
|
||||
const size_t InvTypeViewMODSharedBankSize = InvTypeSharedBankSize;
|
||||
const size_t InvTypeViewMODLimboSize = InvTypeLimboSize;
|
||||
const size_t InvTypeAltStorageSize = 0;//unknown - "Shroud Bank"
|
||||
const size_t InvTypeArchivedSize = 0;//unknown
|
||||
const size_t InvTypeMailSize = 0;//unknown
|
||||
const size_t InvTypeGuildTrophyTributeSize = 0;//unknown
|
||||
const size_t InvTypeOtherSize = 0;//unknown
|
||||
|
||||
extern size_t GetInvTypeSize(int inv_type);
|
||||
extern const char* GetInvTypeName(int inv_type);
|
||||
|
||||
extern bool IsInvTypePersistent(int inv_type);
|
||||
|
||||
} /*invtype*/
|
||||
|
||||
namespace invslot {
|
||||
extern const char* GetInvPossessionsSlotName(int inv_slot);
|
||||
extern const char* GetInvSlotName(int inv_type, int inv_slot);
|
||||
|
||||
} /*invslot*/
|
||||
|
||||
namespace invbag {
|
||||
const size_t ItemBagSize = 255; // server Size will be 255..unsure what actual client is (test)
|
||||
|
||||
extern const char* GetInvBagIndexName(int bag_index);
|
||||
|
||||
} /*invbag*/
|
||||
|
||||
namespace invaug {
|
||||
const size_t ItemAugSize = 6;
|
||||
|
||||
extern const char* GetInvAugIndexName(int aug_index);
|
||||
|
||||
} /*invaug*/
|
||||
|
||||
namespace item {
|
||||
|
||||
} /*item*/
|
||||
|
||||
namespace profile {
|
||||
const size_t TributeSize = invtype::InvTypeTributeSize;
|
||||
const size_t GuildTributeSize = invtype::InvTypeGuildTributeSize;
|
||||
|
||||
const size_t BandoliersSize = 20; // number of bandolier instances
|
||||
const size_t BandolierItemCount = 4; // number of equipment slots in bandolier instance
|
||||
|
||||
const size_t PotionBeltSize = 5;
|
||||
|
||||
const size_t SkillArraySize = 100;
|
||||
|
||||
} /*profile*/
|
||||
|
||||
namespace constants {
|
||||
const size_t CharacterCreationLimit = 12;
|
||||
|
||||
const size_t SayLinkBodySize = 55;
|
||||
const size_t SAY_LINK_BODY_SIZE = 55;
|
||||
|
||||
const int LongBuffs = 42;
|
||||
const int ShortBuffs = 20;
|
||||
@@ -279,11 +265,15 @@ namespace RoF
|
||||
} /*constants*/
|
||||
|
||||
namespace behavior {
|
||||
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||
|
||||
const bool CoinHasWeight = false;
|
||||
|
||||
} /*behavior*/
|
||||
|
||||
namespace skills {
|
||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||
|
||||
const size_t LastUsableSkill = EQEmu::skills::SkillTripleAttack;
|
||||
|
||||
} /*skills*/
|
||||
|
||||
@@ -83,7 +83,6 @@ E(OP_MoveItem)
|
||||
E(OP_NewSpawn)
|
||||
E(OP_NewZone)
|
||||
E(OP_OnLevelMessage)
|
||||
//E(OP_OpenNewTasksWindow)
|
||||
E(OP_PetBuffWindow)
|
||||
E(OP_PlayerProfile)
|
||||
E(OP_RaidJoin)
|
||||
|
||||
@@ -898,13 +898,13 @@ struct BandolierItem_Struct_Old
|
||||
struct Bandolier_Struct
|
||||
{
|
||||
char Name[1]; // Variable Length
|
||||
BandolierItem_Struct Items[profile::BandolierItemCount];
|
||||
BandolierItem_Struct Items[profile::BANDOLIER_ITEM_COUNT];
|
||||
};
|
||||
|
||||
struct Bandolier_Struct_Old
|
||||
{
|
||||
char Name[32];
|
||||
BandolierItem_Struct Items[profile::BandolierItemCount];
|
||||
BandolierItem_Struct Items[profile::BANDOLIER_ITEM_COUNT];
|
||||
};
|
||||
|
||||
struct PotionBeltItem_Struct
|
||||
@@ -924,12 +924,12 @@ struct PotionBeltItem_Struct_Old
|
||||
|
||||
struct PotionBelt_Struct
|
||||
{
|
||||
PotionBeltItem_Struct Items[profile::PotionBeltSize];
|
||||
PotionBeltItem_Struct Items[profile::POTION_BELT_SIZE];
|
||||
};
|
||||
|
||||
struct PotionBelt_Struct_Old
|
||||
{
|
||||
PotionBeltItem_Struct_Old Items[profile::PotionBeltSize];
|
||||
PotionBeltItem_Struct_Old Items[profile::POTION_BELT_SIZE];
|
||||
};
|
||||
|
||||
struct GroupLeadershipAA_Struct {
|
||||
@@ -1139,7 +1139,7 @@ union
|
||||
/*12949*/ uint32 aapoints; // Unspent AA points - Seen 1
|
||||
/*12953*/ uint16 unknown_rof20; //
|
||||
/*12955*/ uint32 bandolier_count; // Seen 20
|
||||
/*12959*/ Bandolier_Struct bandoliers[profile::BandoliersSize]; // [20] 740 bytes (Variable Name Sizes) - bandolier contents
|
||||
/*12959*/ Bandolier_Struct bandoliers[profile::BANDOLIERS_SIZE]; // [20] 740 bytes (Variable Name Sizes) - bandolier contents
|
||||
/*13699*/ uint32 potionbelt_count; // Seen 5
|
||||
/*13703*/ PotionBelt_Struct potionbelt; // [5] 45 bytes potion belt - (Variable Name Sizes)
|
||||
/*13748*/ int32 unknown_rof21; // Seen -1
|
||||
|
||||
+41
-146
@@ -1383,114 +1383,6 @@ namespace SoD
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
|
||||
ENCODE(OP_OpenNewTasksWindow)
|
||||
{
|
||||
AvailableTaskHeader_Struct* __emu_AvailableTaskHeader;
|
||||
AvailableTaskData1_Struct* __emu_AvailableTaskData1;
|
||||
AvailableTaskData2_Struct* __emu_AvailableTaskData2;
|
||||
AvailableTaskTrailer_Struct* __emu_AvailableTaskTrailer;
|
||||
|
||||
structs::AvailableTaskHeader_Struct* __eq_AvailableTaskHeader;
|
||||
structs::AvailableTaskData1_Struct* __eq_AvailableTaskData1;
|
||||
structs::AvailableTaskData2_Struct* __eq_AvailableTaskData2;
|
||||
structs::AvailableTaskTrailer_Struct* __eq_AvailableTaskTrailer;
|
||||
|
||||
EQApplicationPacket *in = *p;
|
||||
*p = nullptr;
|
||||
|
||||
unsigned char *__emu_buffer = in->pBuffer;
|
||||
|
||||
__emu_AvailableTaskHeader = (AvailableTaskHeader_Struct*)__emu_buffer;
|
||||
|
||||
// For each task, SoF has an extra uint32 and what appears to be space for a null terminated string.
|
||||
//
|
||||
in->size = in->size + (__emu_AvailableTaskHeader->TaskCount * 5);
|
||||
in->pBuffer = new unsigned char[in->size];
|
||||
unsigned char *__eq_buffer = in->pBuffer;
|
||||
__eq_AvailableTaskHeader = (structs::AvailableTaskHeader_Struct*)__eq_buffer;
|
||||
char *__eq_ptr, *__emu_Ptr;
|
||||
|
||||
// Copy Header
|
||||
//
|
||||
//
|
||||
|
||||
__eq_AvailableTaskHeader->TaskCount = __emu_AvailableTaskHeader->TaskCount;
|
||||
__eq_AvailableTaskHeader->unknown1 = __emu_AvailableTaskHeader->unknown1;
|
||||
__eq_AvailableTaskHeader->TaskGiver = __emu_AvailableTaskHeader->TaskGiver;
|
||||
|
||||
__emu_Ptr = (char *)__emu_AvailableTaskHeader + sizeof(AvailableTaskHeader_Struct);
|
||||
__eq_ptr = (char *)__eq_AvailableTaskHeader + sizeof(structs::AvailableTaskHeader_Struct);
|
||||
|
||||
for (uint32 i = 0; i<__emu_AvailableTaskHeader->TaskCount; i++) {
|
||||
|
||||
__emu_AvailableTaskData1 = (AvailableTaskData1_Struct*)__emu_Ptr;
|
||||
__eq_AvailableTaskData1 = (structs::AvailableTaskData1_Struct*)__eq_ptr;
|
||||
|
||||
__eq_AvailableTaskData1->TaskID = __emu_AvailableTaskData1->TaskID;
|
||||
// This next unknown seems to affect the colour of the task title. 0x3f80000 is what I have seen
|
||||
// in Live packets. Changing it to 0x3f000000 makes the title red.
|
||||
__eq_AvailableTaskData1->unknown1 = 0x3f800000;
|
||||
__eq_AvailableTaskData1->TimeLimit = __emu_AvailableTaskData1->TimeLimit;
|
||||
__eq_AvailableTaskData1->unknown2 = __emu_AvailableTaskData1->unknown2;
|
||||
|
||||
__emu_Ptr += sizeof(AvailableTaskData1_Struct);
|
||||
__eq_ptr += sizeof(structs::AvailableTaskData1_Struct);
|
||||
|
||||
strcpy(__eq_ptr, __emu_Ptr); // Title
|
||||
|
||||
__emu_Ptr += strlen(__emu_Ptr) + 1;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
|
||||
strcpy(__eq_ptr, __emu_Ptr); // Description
|
||||
|
||||
__emu_Ptr += strlen(__emu_Ptr) + 1;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
|
||||
__eq_ptr[0] = 0;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
|
||||
__emu_AvailableTaskData2 = (AvailableTaskData2_Struct*)__emu_Ptr;
|
||||
__eq_AvailableTaskData2 = (structs::AvailableTaskData2_Struct*)__eq_ptr;
|
||||
|
||||
__eq_AvailableTaskData2->unknown1 = __emu_AvailableTaskData2->unknown1;
|
||||
__eq_AvailableTaskData2->unknown2 = __emu_AvailableTaskData2->unknown2;
|
||||
__eq_AvailableTaskData2->unknown3 = __emu_AvailableTaskData2->unknown3;
|
||||
__eq_AvailableTaskData2->unknown4 = __emu_AvailableTaskData2->unknown4;
|
||||
|
||||
__emu_Ptr += sizeof(AvailableTaskData2_Struct);
|
||||
__eq_ptr += sizeof(structs::AvailableTaskData2_Struct);
|
||||
|
||||
strcpy(__eq_ptr, __emu_Ptr); // Unknown string
|
||||
|
||||
__emu_Ptr += strlen(__emu_Ptr) + 1;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
|
||||
strcpy(__eq_ptr, __emu_Ptr); // Unknown string
|
||||
|
||||
__emu_Ptr += strlen(__emu_Ptr) + 1;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
|
||||
__emu_AvailableTaskTrailer = (AvailableTaskTrailer_Struct*)__emu_Ptr;
|
||||
__eq_AvailableTaskTrailer = (structs::AvailableTaskTrailer_Struct*)__eq_ptr;
|
||||
|
||||
__eq_AvailableTaskTrailer->ItemCount = __emu_AvailableTaskTrailer->ItemCount;
|
||||
__eq_AvailableTaskTrailer->unknown1 = __emu_AvailableTaskTrailer->unknown1;
|
||||
__eq_AvailableTaskTrailer->unknown2 = __emu_AvailableTaskTrailer->unknown2;
|
||||
__eq_AvailableTaskTrailer->StartZone = __emu_AvailableTaskTrailer->StartZone;
|
||||
|
||||
__emu_Ptr += sizeof(AvailableTaskTrailer_Struct);
|
||||
__eq_ptr += sizeof(structs::AvailableTaskTrailer_Struct);
|
||||
|
||||
strcpy(__eq_ptr, __emu_Ptr); // Unknown string
|
||||
|
||||
__emu_Ptr += strlen(__emu_Ptr) + 1;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
}
|
||||
|
||||
delete[] __emu_buffer;
|
||||
dest->FastQueuePacket(&in, ack_req);
|
||||
}
|
||||
|
||||
ENCODE(OP_PetBuffWindow)
|
||||
{
|
||||
EQApplicationPacket *in = *p;
|
||||
@@ -1632,18 +1524,18 @@ namespace SoD
|
||||
// OUT(unknown06160[4]);
|
||||
|
||||
// Copy bandoliers where server and client indexes converge
|
||||
for (r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < profile::BandoliersSize; ++r) {
|
||||
for (r = 0; r < EQEmu::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
|
||||
OUT_str(bandoliers[r].Name);
|
||||
for (uint32 k = 0; k < profile::BandolierItemCount; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||
OUT(bandoliers[r].Items[k].ID);
|
||||
OUT(bandoliers[r].Items[k].Icon);
|
||||
OUT_str(bandoliers[r].Items[k].Name);
|
||||
}
|
||||
}
|
||||
// Nullify bandoliers where server and client indexes diverge, with a client bias
|
||||
for (r = EQEmu::legacy::BANDOLIERS_SIZE; r < profile::BandoliersSize; ++r) {
|
||||
for (r = EQEmu::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
|
||||
eq->bandoliers[r].Name[0] = '\0';
|
||||
for (uint32 k = 0; k < profile::BandolierItemCount; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||
eq->bandoliers[r].Items[k].ID = 0;
|
||||
eq->bandoliers[r].Items[k].Icon = 0;
|
||||
eq->bandoliers[r].Items[k].Name[0] = '\0';
|
||||
@@ -1653,13 +1545,13 @@ namespace SoD
|
||||
// OUT(unknown07444[5120]);
|
||||
|
||||
// Copy potion belt where server and client indexes converge
|
||||
for (r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < profile::PotionBeltSize; ++r) {
|
||||
for (r = 0; r < EQEmu::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
|
||||
OUT(potionbelt.Items[r].ID);
|
||||
OUT(potionbelt.Items[r].Icon);
|
||||
OUT_str(potionbelt.Items[r].Name);
|
||||
}
|
||||
// Nullify potion belt where server and client indexes diverge, with a client bias
|
||||
for (r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < profile::PotionBeltSize; ++r) {
|
||||
for (r = EQEmu::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
|
||||
eq->potionbelt.Items[r].ID = 0;
|
||||
eq->potionbelt.Items[r].Icon = 0;
|
||||
eq->potionbelt.Items[r].Name[0] = '\0';
|
||||
@@ -1947,8 +1839,8 @@ namespace SoD
|
||||
eq->CharCount = emu->CharCount;
|
||||
eq->TotalChars = emu->TotalChars;
|
||||
|
||||
if (eq->TotalChars > constants::CharacterCreationLimit)
|
||||
eq->TotalChars = constants::CharacterCreationLimit;
|
||||
if (eq->TotalChars > constants::CHARACTER_CREATION_LIMIT)
|
||||
eq->TotalChars = constants::CHARACTER_CREATION_LIMIT;
|
||||
|
||||
FINISH_ENCODE();
|
||||
return;
|
||||
@@ -1960,7 +1852,7 @@ namespace SoD
|
||||
|
||||
size_t names_length = 0;
|
||||
size_t character_count = 0;
|
||||
for (; character_count < emu->CharCount && character_count < constants::CharacterCreationLimit; ++character_count) {
|
||||
for (; character_count < emu->CharCount && character_count < constants::CHARACTER_CREATION_LIMIT; ++character_count) {
|
||||
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
|
||||
names_length += strlen(emu_cse->Name);
|
||||
emu_ptr += sizeof(CharacterSelectEntry_Struct);
|
||||
@@ -1976,8 +1868,8 @@ namespace SoD
|
||||
eq->CharCount = character_count;
|
||||
eq->TotalChars = emu->TotalChars;
|
||||
|
||||
if (eq->TotalChars > constants::CharacterCreationLimit)
|
||||
eq->TotalChars = constants::CharacterCreationLimit;
|
||||
if (eq->TotalChars > constants::CHARACTER_CREATION_LIMIT)
|
||||
eq->TotalChars = constants::CHARACTER_CREATION_LIMIT;
|
||||
|
||||
emu_ptr = __emu_buffer;
|
||||
emu_ptr += sizeof(CharacterSelect_Struct);
|
||||
@@ -2249,13 +2141,16 @@ namespace SoD
|
||||
InBuffer += description_size;
|
||||
InBuffer += sizeof(TaskDescriptionData2_Struct);
|
||||
|
||||
std::string old_message = InBuffer; // start 'Reward' as string
|
||||
uint32 reward_size = strlen(InBuffer) + 1;
|
||||
InBuffer += reward_size;
|
||||
|
||||
std::string old_message = InBuffer; // start item link string
|
||||
std::string new_message;
|
||||
ServerToSoDSayLink(new_message, old_message);
|
||||
|
||||
in->size = sizeof(TaskDescriptionHeader_Struct) + sizeof(TaskDescriptionData1_Struct)+
|
||||
sizeof(TaskDescriptionData2_Struct) + sizeof(TaskDescriptionTrailer_Struct)+
|
||||
title_size + description_size + new_message.length() + 1;
|
||||
title_size + description_size + reward_size + new_message.length() + 1;
|
||||
|
||||
in->pBuffer = new unsigned char[in->size];
|
||||
|
||||
@@ -3578,7 +3473,7 @@ namespace SoD
|
||||
ibs.nodrop = item->NoDrop;
|
||||
ibs.attune = item->Attuneable;
|
||||
ibs.size = item->Size;
|
||||
ibs.slots = SwapBits21and22(item->Slots);
|
||||
ibs.slots = SwapBits21And22(item->Slots);
|
||||
ibs.price = item->Price;
|
||||
ibs.icon = item->Icon;
|
||||
ibs.unknown1 = 1;
|
||||
@@ -3668,7 +3563,7 @@ namespace SoD
|
||||
isbs.augtype = item->AugType;
|
||||
isbs.augrestrict = item->AugRestrict;
|
||||
|
||||
for (int index = 0; index < invaug::ItemAugSize; ++index) {
|
||||
for (int index = invaug::SOCKET_BEGIN; index <= invaug::SOCKET_END; ++index) {
|
||||
isbs.augslots[index].type = item->AugSlotType[index];
|
||||
isbs.augslots[index].visible = item->AugSlotVisible[index];
|
||||
isbs.augslots[index].unknown = item->AugSlotUnk2[index];
|
||||
@@ -3841,18 +3736,18 @@ namespace SoD
|
||||
|
||||
ob.write((const char*)&subitem_count, sizeof(uint32));
|
||||
|
||||
for (uint32 index = EQEmu::inventory::containerBegin; index < EQEmu::inventory::ContainerCount; ++index) {
|
||||
for (uint32 index = EQEmu::invbag::SLOT_BEGIN; index <= EQEmu::invbag::SLOT_END; ++index) {
|
||||
EQEmu::ItemInstance* sub = inst->GetItem(index);
|
||||
if (!sub)
|
||||
continue;
|
||||
|
||||
int SubSlotNumber = INVALID_INDEX;
|
||||
if (slot_id_in >= EQEmu::legacy::GENERAL_BEGIN && slot_id_in <= EQEmu::legacy::GENERAL_END)
|
||||
SubSlotNumber = (((slot_id_in + 3) * EQEmu::inventory::ContainerCount) + index + 1);
|
||||
else if (slot_id_in >= EQEmu::legacy::BANK_BEGIN && slot_id_in <= EQEmu::legacy::BANK_END)
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::legacy::BANK_BEGIN) * EQEmu::inventory::ContainerCount) + EQEmu::legacy::BANK_BAGS_BEGIN + index);
|
||||
else if (slot_id_in >= EQEmu::legacy::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::legacy::SHARED_BANK_END)
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::legacy::SHARED_BANK_BEGIN) * EQEmu::inventory::ContainerCount) + EQEmu::legacy::SHARED_BANK_BAGS_BEGIN + index);
|
||||
if (slot_id_in >= EQEmu::invslot::GENERAL_BEGIN && slot_id_in <= EQEmu::invslot::GENERAL_END)
|
||||
SubSlotNumber = (((slot_id_in + 3) * EQEmu::invbag::SLOT_COUNT) + index + 1);
|
||||
else if (slot_id_in >= EQEmu::invslot::BANK_BEGIN && slot_id_in <= EQEmu::invslot::BANK_END)
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::invslot::BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT) + EQEmu::invbag::BANK_BAGS_BEGIN + index);
|
||||
else if (slot_id_in >= EQEmu::invslot::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::invslot::SHARED_BANK_END)
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::invslot::SHARED_BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT) + EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + index);
|
||||
else
|
||||
SubSlotNumber = slot_id_in;
|
||||
|
||||
@@ -3870,16 +3765,16 @@ namespace SoD
|
||||
{
|
||||
uint32 SoDSlot = 0;
|
||||
|
||||
if (serverSlot >= EQEmu::inventory::slotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||
if (serverSlot >= EQEmu::invslot::slotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||
SoDSlot = serverSlot + 1;
|
||||
else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END)
|
||||
else if (serverSlot >= EQEmu::invbag::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::invbag::CURSOR_BAG_END)
|
||||
SoDSlot = serverSlot + 11;
|
||||
else if (serverSlot >= EQEmu::legacy::BANK_BAGS_BEGIN && serverSlot <= EQEmu::legacy::BANK_BAGS_END)
|
||||
else if (serverSlot >= EQEmu::invbag::BANK_BAGS_BEGIN && serverSlot <= EQEmu::invbag::BANK_BAGS_END)
|
||||
SoDSlot = serverSlot + 1;
|
||||
else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END)
|
||||
else if (serverSlot >= EQEmu::invbag::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::invbag::SHARED_BANK_BAGS_END)
|
||||
SoDSlot = serverSlot + 1;
|
||||
else if (serverSlot == EQEmu::inventory::slotPowerSource)
|
||||
SoDSlot = invslot::PossessionsPowerSource;
|
||||
else if (serverSlot == EQEmu::invslot::SLOT_POWER_SOURCE)
|
||||
SoDSlot = invslot::slotPowerSource;
|
||||
else
|
||||
SoDSlot = serverSlot;
|
||||
return SoDSlot;
|
||||
@@ -3895,16 +3790,16 @@ namespace SoD
|
||||
{
|
||||
uint32 ServerSlot = 0;
|
||||
|
||||
if (sodSlot >= invslot::PossessionsAmmo && sodSlot <= invslot::CorpseEnd) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||
if (sodSlot >= invslot::slotAmmo && sodSlot <= invslot::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||
ServerSlot = sodSlot - 1;
|
||||
else if (sodSlot >= invbag::GeneralBagsBegin && sodSlot <= invbag::CursorBagEnd)
|
||||
else if (sodSlot >= invbag::GENERAL_BAGS_BEGIN && sodSlot <= invbag::CURSOR_BAG_END)
|
||||
ServerSlot = sodSlot - 11;
|
||||
else if (sodSlot >= invbag::BankBagsBegin && sodSlot <= invbag::BankBagsEnd)
|
||||
else if (sodSlot >= invbag::BANK_BAGS_BEGIN && sodSlot <= invbag::BANK_BAGS_END)
|
||||
ServerSlot = sodSlot - 1;
|
||||
else if (sodSlot >= invbag::SharedBankBagsBegin && sodSlot <= invbag::SharedBankBagsEnd)
|
||||
else if (sodSlot >= invbag::SHARED_BANK_BAGS_BEGIN && sodSlot <= invbag::SHARED_BANK_BAGS_END)
|
||||
ServerSlot = sodSlot - 1;
|
||||
else if (sodSlot == invslot::PossessionsPowerSource)
|
||||
ServerSlot = EQEmu::inventory::slotPowerSource;
|
||||
else if (sodSlot == invslot::slotPowerSource)
|
||||
ServerSlot = EQEmu::invslot::SLOT_POWER_SOURCE;
|
||||
else
|
||||
ServerSlot = sodSlot;
|
||||
return ServerSlot;
|
||||
@@ -3918,7 +3813,7 @@ namespace SoD
|
||||
|
||||
static inline void ServerToSoDSayLink(std::string& sodSayLink, const std::string& serverSayLink)
|
||||
{
|
||||
if ((constants::SayLinkBodySize == EQEmu::constants::SayLinkBodySize) || (serverSayLink.find('\x12') == std::string::npos)) {
|
||||
if ((constants::SAY_LINK_BODY_SIZE == EQEmu::constants::SAY_LINK_BODY_SIZE) || (serverSayLink.find('\x12') == std::string::npos)) {
|
||||
sodSayLink = serverSayLink;
|
||||
return;
|
||||
}
|
||||
@@ -3927,7 +3822,7 @@ namespace SoD
|
||||
|
||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||
if (segment_iter & 1) {
|
||||
if (segments[segment_iter].length() <= EQEmu::constants::SayLinkBodySize) {
|
||||
if (segments[segment_iter].length() <= EQEmu::constants::SAY_LINK_BODY_SIZE) {
|
||||
sodSayLink.append(segments[segment_iter]);
|
||||
// TODO: log size mismatch error
|
||||
continue;
|
||||
@@ -3958,7 +3853,7 @@ namespace SoD
|
||||
|
||||
static inline void SoDToServerSayLink(std::string& serverSayLink, const std::string& sodSayLink)
|
||||
{
|
||||
if ((EQEmu::constants::SayLinkBodySize == constants::SayLinkBodySize) || (sodSayLink.find('\x12') == std::string::npos)) {
|
||||
if ((EQEmu::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (sodSayLink.find('\x12') == std::string::npos)) {
|
||||
serverSayLink = sodSayLink;
|
||||
return;
|
||||
}
|
||||
@@ -3967,7 +3862,7 @@ namespace SoD
|
||||
|
||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||
if (segment_iter & 1) {
|
||||
if (segments[segment_iter].length() <= constants::SayLinkBodySize) {
|
||||
if (segments[segment_iter].length() <= constants::SAY_LINK_BODY_SIZE) {
|
||||
serverSayLink.append(segments[segment_iter]);
|
||||
// TODO: log size mismatch error
|
||||
continue;
|
||||
|
||||
+119
-119
@@ -22,198 +22,198 @@
|
||||
#include "../string_util.h"
|
||||
|
||||
|
||||
size_t SoD::invtype::GetInvTypeSize(int inv_type)
|
||||
int16 SoD::invtype::GetInvTypeSize(int16 inv_type)
|
||||
{
|
||||
switch (inv_type) {
|
||||
case invtype::InvTypePossessions:
|
||||
return invtype::InvTypePossessionsSize;
|
||||
case invtype::InvTypeBank:
|
||||
return invtype::InvTypeBankSize;
|
||||
case invtype::InvTypeSharedBank:
|
||||
return invtype::InvTypeSharedBankSize;
|
||||
case invtype::InvTypeTrade:
|
||||
return invtype::InvTypeTradeSize;
|
||||
case invtype::InvTypeWorld:
|
||||
return invtype::InvTypeWorldSize;
|
||||
case invtype::InvTypeLimbo:
|
||||
return invtype::InvTypeLimboSize;
|
||||
case invtype::InvTypeTribute:
|
||||
return invtype::InvTypeTributeSize;
|
||||
case invtype::InvTypeGuildTribute:
|
||||
return invtype::InvTypeGuildTributeSize;
|
||||
case invtype::InvTypeMerchant:
|
||||
return invtype::InvTypeMerchantSize;
|
||||
case invtype::InvTypeCorpse:
|
||||
return invtype::InvTypeCorpseSize;
|
||||
case invtype::InvTypeBazaar:
|
||||
return invtype::InvTypeBazaarSize;
|
||||
case invtype::InvTypeInspect:
|
||||
return invtype::InvTypeInspectSize;
|
||||
case invtype::InvTypeViewMODPC:
|
||||
return invtype::InvTypeViewMODPCSize;
|
||||
case invtype::InvTypeViewMODBank:
|
||||
return invtype::InvTypeViewMODBankSize;
|
||||
case invtype::InvTypeViewMODSharedBank:
|
||||
return invtype::InvTypeViewMODSharedBankSize;
|
||||
case invtype::InvTypeViewMODLimbo:
|
||||
return invtype::InvTypeViewMODLimboSize;
|
||||
case invtype::InvTypeAltStorage:
|
||||
return invtype::InvTypeAltStorageSize;
|
||||
case invtype::InvTypeArchived:
|
||||
return invtype::InvTypeArchivedSize;
|
||||
case invtype::InvTypeOther:
|
||||
return invtype::InvTypeOtherSize;
|
||||
case invtype::typePossessions:
|
||||
return invtype::POSSESSIONS_SIZE;
|
||||
case invtype::typeBank:
|
||||
return invtype::BANK_SIZE;
|
||||
case invtype::typeSharedBank:
|
||||
return invtype::SHARED_BANK_SIZE;
|
||||
case invtype::typeTrade:
|
||||
return invtype::TRADE_SIZE;
|
||||
case invtype::typeWorld:
|
||||
return invtype::WORLD_SIZE;
|
||||
case invtype::typeLimbo:
|
||||
return invtype::LIMBO_SIZE;
|
||||
case invtype::typeTribute:
|
||||
return invtype::TRIBUTE_SIZE;
|
||||
case invtype::typeGuildTribute:
|
||||
return invtype::GUILD_TRIBUTE_SIZE;
|
||||
case invtype::typeMerchant:
|
||||
return invtype::MERCHANT_SIZE;
|
||||
case invtype::typeCorpse:
|
||||
return invtype::CORPSE_SIZE;
|
||||
case invtype::typeBazaar:
|
||||
return invtype::BAZAAR_SIZE;
|
||||
case invtype::typeInspect:
|
||||
return invtype::INSPECT_SIZE;
|
||||
case invtype::typeViewMODPC:
|
||||
return invtype::VIEW_MOD_PC_SIZE;
|
||||
case invtype::typeViewMODBank:
|
||||
return invtype::VIEW_MOD_BANK_SIZE;
|
||||
case invtype::typeViewMODSharedBank:
|
||||
return invtype::VIEW_MOD_SHARED_BANK_SIZE;
|
||||
case invtype::typeViewMODLimbo:
|
||||
return invtype::VIEW_MOD_LIMBO_SIZE;
|
||||
case invtype::typeAltStorage:
|
||||
return invtype::ALT_STORAGE_SIZE;
|
||||
case invtype::typeArchived:
|
||||
return invtype::ARCHIVED_SIZE;
|
||||
case invtype::typeOther:
|
||||
return invtype::OTHER_SIZE;
|
||||
default:
|
||||
return 0;
|
||||
return INULL;
|
||||
}
|
||||
}
|
||||
|
||||
const char* SoD::invtype::GetInvTypeName(int inv_type)
|
||||
const char* SoD::invtype::GetInvTypeName(int16 inv_type)
|
||||
{
|
||||
switch (inv_type) {
|
||||
case invtype::InvTypeInvalid:
|
||||
case invtype::TYPE_INVALID:
|
||||
return "Invalid Type";
|
||||
case invtype::InvTypePossessions:
|
||||
case invtype::typePossessions:
|
||||
return "Possessions";
|
||||
case invtype::InvTypeBank:
|
||||
case invtype::typeBank:
|
||||
return "Bank";
|
||||
case invtype::InvTypeSharedBank:
|
||||
case invtype::typeSharedBank:
|
||||
return "Shared Bank";
|
||||
case invtype::InvTypeTrade:
|
||||
case invtype::typeTrade:
|
||||
return "Trade";
|
||||
case invtype::InvTypeWorld:
|
||||
case invtype::typeWorld:
|
||||
return "World";
|
||||
case invtype::InvTypeLimbo:
|
||||
case invtype::typeLimbo:
|
||||
return "Limbo";
|
||||
case invtype::InvTypeTribute:
|
||||
case invtype::typeTribute:
|
||||
return "Tribute";
|
||||
case invtype::InvTypeGuildTribute:
|
||||
case invtype::typeGuildTribute:
|
||||
return "Guild Tribute";
|
||||
case invtype::InvTypeMerchant:
|
||||
case invtype::typeMerchant:
|
||||
return "Merchant";
|
||||
case invtype::InvTypeCorpse:
|
||||
case invtype::typeCorpse:
|
||||
return "Corpse";
|
||||
case invtype::InvTypeBazaar:
|
||||
case invtype::typeBazaar:
|
||||
return "Bazaar";
|
||||
case invtype::InvTypeInspect:
|
||||
case invtype::typeInspect:
|
||||
return "Inspect";
|
||||
case invtype::InvTypeViewMODPC:
|
||||
case invtype::typeViewMODPC:
|
||||
return "View MOD PC";
|
||||
case invtype::InvTypeViewMODBank:
|
||||
case invtype::typeViewMODBank:
|
||||
return "View MOD Bank";
|
||||
case invtype::InvTypeViewMODSharedBank:
|
||||
case invtype::typeViewMODSharedBank:
|
||||
return "View MOD Shared Bank";
|
||||
case invtype::InvTypeViewMODLimbo:
|
||||
case invtype::typeViewMODLimbo:
|
||||
return "View MOD Limbo";
|
||||
case invtype::InvTypeAltStorage:
|
||||
case invtype::typeAltStorage:
|
||||
return "Alt Storage";
|
||||
case invtype::InvTypeArchived:
|
||||
case invtype::typeArchived:
|
||||
return "Archived";
|
||||
case invtype::InvTypeOther:
|
||||
case invtype::typeOther:
|
||||
return "Other";
|
||||
default:
|
||||
return "Unknown Type";
|
||||
}
|
||||
}
|
||||
|
||||
bool SoD::invtype::IsInvTypePersistent(int inv_type)
|
||||
bool SoD::invtype::IsInvTypePersistent(int16 inv_type)
|
||||
{
|
||||
switch (inv_type) {
|
||||
case invtype::InvTypePossessions:
|
||||
case invtype::InvTypeBank:
|
||||
case invtype::InvTypeSharedBank:
|
||||
case invtype::InvTypeTrade:
|
||||
case invtype::InvTypeWorld:
|
||||
case invtype::InvTypeLimbo:
|
||||
case invtype::InvTypeTribute:
|
||||
case invtype::InvTypeGuildTribute:
|
||||
case invtype::typePossessions:
|
||||
case invtype::typeBank:
|
||||
case invtype::typeSharedBank:
|
||||
case invtype::typeTrade:
|
||||
case invtype::typeWorld:
|
||||
case invtype::typeLimbo:
|
||||
case invtype::typeTribute:
|
||||
case invtype::typeGuildTribute:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const char* SoD::invslot::GetInvPossessionsSlotName(int inv_slot)
|
||||
const char* SoD::invslot::GetInvPossessionsSlotName(int16 inv_slot)
|
||||
{
|
||||
switch (inv_slot) {
|
||||
case invslot::InvSlotInvalid:
|
||||
case invslot::SLOT_INVALID:
|
||||
return "Invalid Slot";
|
||||
case invslot::PossessionsCharm:
|
||||
case invslot::slotCharm:
|
||||
return "Charm";
|
||||
case invslot::PossessionsEar1:
|
||||
case invslot::slotEar1:
|
||||
return "Ear 1";
|
||||
case invslot::PossessionsHead:
|
||||
case invslot::slotHead:
|
||||
return "Head";
|
||||
case invslot::PossessionsFace:
|
||||
case invslot::slotFace:
|
||||
return "Face";
|
||||
case invslot::PossessionsEar2:
|
||||
case invslot::slotEar2:
|
||||
return "Ear 2";
|
||||
case invslot::PossessionsNeck:
|
||||
case invslot::slotNeck:
|
||||
return "Neck";
|
||||
case invslot::PossessionsShoulders:
|
||||
case invslot::slotShoulders:
|
||||
return "Shoulders";
|
||||
case invslot::PossessionsArms:
|
||||
case invslot::slotArms:
|
||||
return "Arms";
|
||||
case invslot::PossessionsBack:
|
||||
case invslot::slotBack:
|
||||
return "Back";
|
||||
case invslot::PossessionsWrist1:
|
||||
case invslot::slotWrist1:
|
||||
return "Wrist 1";
|
||||
case invslot::PossessionsWrist2:
|
||||
case invslot::slotWrist2:
|
||||
return "Wrist 2";
|
||||
case invslot::PossessionsRange:
|
||||
case invslot::slotRange:
|
||||
return "Range";
|
||||
case invslot::PossessionsHands:
|
||||
case invslot::slotHands:
|
||||
return "Hands";
|
||||
case invslot::PossessionsPrimary:
|
||||
case invslot::slotPrimary:
|
||||
return "Primary";
|
||||
case invslot::PossessionsSecondary:
|
||||
case invslot::slotSecondary:
|
||||
return "Secondary";
|
||||
case invslot::PossessionsFinger1:
|
||||
case invslot::slotFinger1:
|
||||
return "Finger 1";
|
||||
case invslot::PossessionsFinger2:
|
||||
case invslot::slotFinger2:
|
||||
return "Finger 2";
|
||||
case invslot::PossessionsChest:
|
||||
case invslot::slotChest:
|
||||
return "Chest";
|
||||
case invslot::PossessionsLegs:
|
||||
case invslot::slotLegs:
|
||||
return "Legs";
|
||||
case invslot::PossessionsFeet:
|
||||
case invslot::slotFeet:
|
||||
return "Feet";
|
||||
case invslot::PossessionsWaist:
|
||||
case invslot::slotWaist:
|
||||
return "Waist";
|
||||
case invslot::PossessionsPowerSource:
|
||||
case invslot::slotPowerSource:
|
||||
return "Power Source";
|
||||
case invslot::PossessionsAmmo:
|
||||
case invslot::slotAmmo:
|
||||
return "Ammo";
|
||||
case invslot::PossessionsGeneral1:
|
||||
case invslot::slotGeneral1:
|
||||
return "General 1";
|
||||
case invslot::PossessionsGeneral2:
|
||||
case invslot::slotGeneral2:
|
||||
return "General 2";
|
||||
case invslot::PossessionsGeneral3:
|
||||
case invslot::slotGeneral3:
|
||||
return "General 3";
|
||||
case invslot::PossessionsGeneral4:
|
||||
case invslot::slotGeneral4:
|
||||
return "General 4";
|
||||
case invslot::PossessionsGeneral5:
|
||||
case invslot::slotGeneral5:
|
||||
return "General 5";
|
||||
case invslot::PossessionsGeneral6:
|
||||
case invslot::slotGeneral6:
|
||||
return "General 6";
|
||||
case invslot::PossessionsGeneral7:
|
||||
case invslot::slotGeneral7:
|
||||
return "General 7";
|
||||
case invslot::PossessionsGeneral8:
|
||||
case invslot::slotGeneral8:
|
||||
return "General 8";
|
||||
case invslot::PossessionsCursor:
|
||||
case invslot::slotCursor:
|
||||
return "Cursor";
|
||||
default:
|
||||
return "Unknown Slot";
|
||||
}
|
||||
}
|
||||
|
||||
const char* SoD::invslot::GetInvCorpseSlotName(int inv_slot)
|
||||
const char* SoD::invslot::GetInvCorpseSlotName(int16 inv_slot)
|
||||
{
|
||||
if (!invtype::GetInvTypeSize(invtype::InvTypeCorpse) || inv_slot == invslot::InvSlotInvalid)
|
||||
if (!invtype::GetInvTypeSize(invtype::typeCorpse) || inv_slot == invslot::SLOT_INVALID)
|
||||
return "Invalid Slot";
|
||||
|
||||
// needs work
|
||||
if ((size_t)(inv_slot + 1) < invslot::CorpseBegin || (size_t)(inv_slot + 1) >= invslot::CorpseEnd)
|
||||
if ((inv_slot + 1) < invslot::CORPSE_BEGIN || (inv_slot + 1) >= invslot::CORPSE_END)
|
||||
return "Unknown Slot";
|
||||
|
||||
static std::string ret_str;
|
||||
@@ -222,19 +222,19 @@ const char* SoD::invslot::GetInvCorpseSlotName(int inv_slot)
|
||||
return ret_str.c_str();
|
||||
}
|
||||
|
||||
const char* SoD::invslot::GetInvSlotName(int inv_type, int inv_slot)
|
||||
const char* SoD::invslot::GetInvSlotName(int16 inv_type, int16 inv_slot)
|
||||
{
|
||||
if (inv_type == invtype::InvTypePossessions)
|
||||
if (inv_type == invtype::typePossessions)
|
||||
return invslot::GetInvPossessionsSlotName(inv_slot);
|
||||
else if (inv_type == invtype::InvTypeCorpse)
|
||||
else if (inv_type == invtype::typeCorpse)
|
||||
return invslot::GetInvCorpseSlotName(inv_slot);
|
||||
|
||||
size_t type_size = invtype::GetInvTypeSize(inv_type);
|
||||
int16 type_size = invtype::GetInvTypeSize(inv_type);
|
||||
|
||||
if (!type_size || inv_slot == invslot::InvSlotInvalid)
|
||||
if (!type_size || inv_slot == invslot::SLOT_INVALID)
|
||||
return "Invalid Slot";
|
||||
|
||||
if ((size_t)(inv_slot + 1) >= type_size)
|
||||
if ((inv_slot + 1) >= type_size)
|
||||
return "Unknown Slot";
|
||||
|
||||
static std::string ret_str;
|
||||
@@ -243,12 +243,12 @@ const char* SoD::invslot::GetInvSlotName(int inv_type, int inv_slot)
|
||||
return ret_str.c_str();
|
||||
}
|
||||
|
||||
const char* SoD::invbag::GetInvBagIndexName(int bag_index)
|
||||
const char* SoD::invbag::GetInvBagIndexName(int16 bag_index)
|
||||
{
|
||||
if (bag_index == invbag::InvBagInvalid)
|
||||
if (bag_index == invbag::SLOT_INVALID)
|
||||
return "Invalid Bag";
|
||||
|
||||
if ((size_t)bag_index >= invbag::ItemBagSize)
|
||||
if (bag_index >= invbag::SLOT_COUNT)
|
||||
return "Unknown Bag";
|
||||
|
||||
static std::string ret_str;
|
||||
@@ -257,12 +257,12 @@ const char* SoD::invbag::GetInvBagIndexName(int bag_index)
|
||||
return ret_str.c_str();
|
||||
}
|
||||
|
||||
const char* SoD::invaug::GetInvAugIndexName(int aug_index)
|
||||
const char* SoD::invaug::GetInvAugIndexName(int16 aug_index)
|
||||
{
|
||||
if (aug_index == invaug::InvAugInvalid)
|
||||
if (aug_index == invaug::SOCKET_INVALID)
|
||||
return "Invalid Augment";
|
||||
|
||||
if ((size_t)aug_index >= invaug::ItemAugSize)
|
||||
if (aug_index >= invaug::SOCKET_COUNT)
|
||||
return "Unknown Augment";
|
||||
|
||||
static std::string ret_str;
|
||||
|
||||
+194
-206
@@ -27,108 +27,218 @@
|
||||
|
||||
namespace SoD
|
||||
{
|
||||
enum : int { Invalid = -1, Null, Safety };
|
||||
const int16 IINVALID = -1;
|
||||
const int16 INULL = 0;
|
||||
|
||||
enum : bool { False = false, True = true };
|
||||
|
||||
// pre-declarations
|
||||
namespace inventory {
|
||||
inline EQEmu::versions::ClientVersion GetInventoryRef() { return EQEmu::versions::ClientVersion::SoD; }
|
||||
|
||||
const bool ConcatenateInvTypeLimbo = true;
|
||||
|
||||
const bool AllowOverLevelEquipment = false;
|
||||
|
||||
const bool AllowEmptyBagInBag = false;
|
||||
const bool AllowClickCastFromBag = false;
|
||||
|
||||
} /*inventory*/
|
||||
|
||||
namespace invtype {
|
||||
inline EQEmu::versions::ClientVersion GetInvTypeRef() { return EQEmu::versions::ClientVersion::SoD; }
|
||||
|
||||
enum : int { InvTypeInvalid = -1, InvTypeBegin };
|
||||
namespace enum_ {
|
||||
enum InventoryTypes : int16 {
|
||||
typePossessions = INULL,
|
||||
typeBank,
|
||||
typeSharedBank,
|
||||
typeTrade,
|
||||
typeWorld,
|
||||
typeLimbo,
|
||||
typeTribute,
|
||||
typeGuildTribute,
|
||||
typeMerchant,
|
||||
typeCorpse,
|
||||
typeBazaar,
|
||||
typeInspect,
|
||||
typeViewMODPC,
|
||||
typeViewMODBank,
|
||||
typeViewMODSharedBank,
|
||||
typeViewMODLimbo,
|
||||
typeAltStorage,
|
||||
typeArchived,
|
||||
typeOther
|
||||
};
|
||||
|
||||
enum InventoryType : int {
|
||||
InvTypePossessions = InvTypeBegin,
|
||||
InvTypeBank,
|
||||
InvTypeSharedBank,
|
||||
InvTypeTrade,
|
||||
InvTypeWorld,
|
||||
InvTypeLimbo,
|
||||
InvTypeTribute,
|
||||
InvTypeGuildTribute,
|
||||
InvTypeMerchant,
|
||||
InvTypeCorpse,
|
||||
InvTypeBazaar,
|
||||
InvTypeInspect,
|
||||
InvTypeViewMODPC,
|
||||
InvTypeViewMODBank,
|
||||
InvTypeViewMODSharedBank,
|
||||
InvTypeViewMODLimbo,
|
||||
InvTypeAltStorage,
|
||||
InvTypeArchived,
|
||||
InvTypeOther,
|
||||
InvTypeCount
|
||||
};
|
||||
} // namespace enum_
|
||||
using namespace enum_;
|
||||
|
||||
const int16 POSSESSIONS_SIZE = 32;
|
||||
const int16 BANK_SIZE = 24;
|
||||
const int16 SHARED_BANK_SIZE = 2;
|
||||
const int16 TRADE_SIZE = 8;
|
||||
const int16 WORLD_SIZE = 10;
|
||||
const int16 LIMBO_SIZE = 36;
|
||||
const int16 TRIBUTE_SIZE = 5;
|
||||
const int16 GUILD_TRIBUTE_SIZE = 2;
|
||||
const int16 MERCHANT_SIZE = 80;
|
||||
const int16 CORPSE_SIZE = POSSESSIONS_SIZE;
|
||||
const int16 BAZAAR_SIZE = 80;
|
||||
const int16 INSPECT_SIZE = 23;
|
||||
const int16 VIEW_MOD_PC_SIZE = POSSESSIONS_SIZE;
|
||||
const int16 VIEW_MOD_BANK_SIZE = BANK_SIZE;
|
||||
const int16 VIEW_MOD_SHARED_BANK_SIZE = SHARED_BANK_SIZE;
|
||||
const int16 VIEW_MOD_LIMBO_SIZE = LIMBO_SIZE;
|
||||
const int16 ALT_STORAGE_SIZE = 0;//unknown - "Shroud Bank"
|
||||
const int16 ARCHIVED_SIZE = 0;//unknown
|
||||
const int16 OTHER_SIZE = 0;//unknown
|
||||
|
||||
const int16 TRADE_NPC_SIZE = 4; // defined by implication
|
||||
|
||||
const int16 TYPE_INVALID = IINVALID;
|
||||
const int16 TYPE_BEGIN = typePossessions;
|
||||
const int16 TYPE_END = typeOther;
|
||||
const int16 TYPE_COUNT = (TYPE_END - TYPE_BEGIN) + 1;
|
||||
|
||||
int16 GetInvTypeSize(int16 inv_type);
|
||||
const char* GetInvTypeName(int16 inv_type);
|
||||
|
||||
bool IsInvTypePersistent(int16 inv_type);
|
||||
|
||||
} /*invtype*/
|
||||
|
||||
namespace invslot {
|
||||
inline EQEmu::versions::ClientVersion GetInvSlotRef() { return EQEmu::versions::ClientVersion::SoD; }
|
||||
|
||||
enum : int { InvSlotInvalid = -1, InvSlotBegin };
|
||||
namespace enum_ {
|
||||
enum InventorySlots : int16 {
|
||||
slotCharm = INULL,
|
||||
slotEar1,
|
||||
slotHead,
|
||||
slotFace,
|
||||
slotEar2,
|
||||
slotNeck,
|
||||
slotShoulders,
|
||||
slotArms,
|
||||
slotBack,
|
||||
slotWrist1,
|
||||
slotWrist2,
|
||||
slotRange,
|
||||
slotHands,
|
||||
slotPrimary,
|
||||
slotSecondary,
|
||||
slotFinger1,
|
||||
slotFinger2,
|
||||
slotChest,
|
||||
slotLegs,
|
||||
slotFeet,
|
||||
slotWaist,
|
||||
slotPowerSource,
|
||||
slotAmmo,
|
||||
slotGeneral1,
|
||||
slotGeneral2,
|
||||
slotGeneral3,
|
||||
slotGeneral4,
|
||||
slotGeneral5,
|
||||
slotGeneral6,
|
||||
slotGeneral7,
|
||||
slotGeneral8,
|
||||
slotCursor
|
||||
};
|
||||
|
||||
enum PossessionsSlot : int {
|
||||
PossessionsCharm = InvSlotBegin,
|
||||
PossessionsEar1,
|
||||
PossessionsHead,
|
||||
PossessionsFace,
|
||||
PossessionsEar2,
|
||||
PossessionsNeck,
|
||||
PossessionsShoulders,
|
||||
PossessionsArms,
|
||||
PossessionsBack,
|
||||
PossessionsWrist1,
|
||||
PossessionsWrist2,
|
||||
PossessionsRange,
|
||||
PossessionsHands,
|
||||
PossessionsPrimary,
|
||||
PossessionsSecondary,
|
||||
PossessionsFinger1,
|
||||
PossessionsFinger2,
|
||||
PossessionsChest,
|
||||
PossessionsLegs,
|
||||
PossessionsFeet,
|
||||
PossessionsWaist,
|
||||
PossessionsPowerSource,
|
||||
PossessionsAmmo,
|
||||
PossessionsGeneral1,
|
||||
PossessionsGeneral2,
|
||||
PossessionsGeneral3,
|
||||
PossessionsGeneral4,
|
||||
PossessionsGeneral5,
|
||||
PossessionsGeneral6,
|
||||
PossessionsGeneral7,
|
||||
PossessionsGeneral8,
|
||||
PossessionsCursor,
|
||||
PossessionsCount
|
||||
};
|
||||
} // namespace enum_
|
||||
using namespace enum_;
|
||||
|
||||
const int EquipmentBegin = PossessionsCharm;
|
||||
const int EquipmentEnd = PossessionsAmmo;
|
||||
const int EquipmentCount = (EquipmentEnd - EquipmentBegin + 1);
|
||||
const int16 SLOT_INVALID = IINVALID;
|
||||
const int16 SLOT_BEGIN = INULL;
|
||||
|
||||
const int GeneralBegin = PossessionsGeneral1;
|
||||
const int GeneralEnd = PossessionsGeneral8;
|
||||
const int GeneralCount = (GeneralEnd - GeneralBegin + 1);
|
||||
const int16 POSSESSIONS_BEGIN = slotCharm;
|
||||
const int16 POSSESSIONS_END = slotCursor;
|
||||
const int16 POSSESSIONS_COUNT = (POSSESSIONS_END - POSSESSIONS_BEGIN) + 1;
|
||||
|
||||
const int16 EQUIPMENT_BEGIN = slotCharm;
|
||||
const int16 EQUIPMENT_END = slotAmmo;
|
||||
const int16 EQUIPMENT_COUNT = (EQUIPMENT_END - EQUIPMENT_BEGIN + 1);
|
||||
|
||||
const int16 GENERAL_BEGIN = slotGeneral1;
|
||||
const int16 GENERAL_END = slotGeneral8;
|
||||
const int16 GENERAL_COUNT = (GENERAL_END - GENERAL_BEGIN + 1);
|
||||
|
||||
const int16 BONUS_BEGIN = invslot::slotCharm;
|
||||
const int16 BONUS_STAT_END = invslot::slotPowerSource;
|
||||
const int16 BONUS_SKILL_END = invslot::slotAmmo;
|
||||
|
||||
const int16 BANK_BEGIN = 2000;
|
||||
const int16 BANK_END = (BANK_BEGIN + invtype::BANK_SIZE) - 1;
|
||||
|
||||
const int16 SHARED_BANK_BEGIN = 2500;
|
||||
const int16 SHARED_BANK_END = (SHARED_BANK_BEGIN + invtype::SHARED_BANK_SIZE) - 1;
|
||||
|
||||
const int16 TRADE_BEGIN = 3000;
|
||||
const int16 TRADE_END = (TRADE_BEGIN + invtype::TRADE_SIZE) - 1;
|
||||
|
||||
const int16 TRADE_NPC_END = (TRADE_BEGIN + invtype::TRADE_NPC_SIZE) - 1; // defined by implication
|
||||
|
||||
const int16 WORLD_BEGIN = 4000;
|
||||
const int16 WORLD_END = (WORLD_BEGIN + invtype::WORLD_SIZE) - 1;
|
||||
|
||||
const int16 TRIBUTE_BEGIN = 400;
|
||||
const int16 TRIBUTE_END = (TRIBUTE_BEGIN + invtype::TRIBUTE_SIZE) - 1;
|
||||
|
||||
const int16 GUILD_TRIBUTE_BEGIN = 450;
|
||||
const int16 GUILD_TRIBUTE_END = (GUILD_TRIBUTE_BEGIN + invtype::GUILD_TRIBUTE_SIZE) - 1;
|
||||
|
||||
const int16 CORPSE_BEGIN = invslot::slotGeneral1;
|
||||
const int16 CORPSE_END = invslot::slotGeneral1 + invslot::slotCursor;
|
||||
|
||||
const uint64 POSSESSIONS_BITMASK = 0x000000027FFFFFFF; // based on 34-slot count (RoF+)
|
||||
const uint64 CORPSE_BITMASK = 0x01FFFFFE7F800000; // based on 34-slot count (RoF+)
|
||||
|
||||
const char* GetInvPossessionsSlotName(int16 inv_slot);
|
||||
const char* GetInvCorpseSlotName(int16 inv_slot);
|
||||
const char* GetInvSlotName(int16 inv_type, int16 inv_slot);
|
||||
|
||||
} /*invslot*/
|
||||
|
||||
namespace invbag {
|
||||
inline EQEmu::versions::ClientVersion GetInvBagRef() { return EQEmu::versions::ClientVersion::SoD; }
|
||||
|
||||
enum : int { InvBagInvalid = -1, InvBagBegin };
|
||||
const int16 SLOT_INVALID = IINVALID;
|
||||
const int16 SLOT_BEGIN = INULL;
|
||||
const int16 SLOT_END = 9;
|
||||
const int16 SLOT_COUNT = 10;
|
||||
|
||||
const int16 GENERAL_BAGS_BEGIN = 262;
|
||||
const int16 GENERAL_BAGS_COUNT = invslot::GENERAL_COUNT * SLOT_COUNT;
|
||||
const int16 GENERAL_BAGS_END = (GENERAL_BAGS_BEGIN + GENERAL_BAGS_COUNT) - 1;
|
||||
|
||||
const int16 CURSOR_BAG_BEGIN = 342;
|
||||
const int16 CURSOR_BAG_COUNT = SLOT_COUNT;
|
||||
const int16 CURSOR_BAG_END = (CURSOR_BAG_BEGIN + CURSOR_BAG_COUNT) - 1;
|
||||
|
||||
const int16 BANK_BAGS_BEGIN = 2032;
|
||||
const int16 BANK_BAGS_COUNT = (invtype::BANK_SIZE * SLOT_COUNT);
|
||||
const int16 BANK_BAGS_END = (BANK_BAGS_BEGIN + BANK_BAGS_COUNT) - 1;
|
||||
|
||||
const int16 SHARED_BANK_BAGS_BEGIN = 2532;
|
||||
const int16 SHARED_BANK_BAGS_COUNT = invtype::SHARED_BANK_SIZE * SLOT_COUNT;
|
||||
const int16 SHARED_BANK_BAGS_END = (SHARED_BANK_BAGS_BEGIN + SHARED_BANK_BAGS_COUNT) - 1;
|
||||
|
||||
const int16 TRADE_BAGS_BEGIN = 3031;
|
||||
const int16 TRADE_BAGS_COUNT = invtype::TRADE_SIZE * SLOT_COUNT;
|
||||
const int16 TRADE_BAGS_END = (TRADE_BAGS_BEGIN + TRADE_BAGS_COUNT) - 1;
|
||||
|
||||
const char* GetInvBagIndexName(int16 bag_index);
|
||||
|
||||
} /*invbag*/
|
||||
|
||||
namespace invaug {
|
||||
inline EQEmu::versions::ClientVersion GetInvAugRef() { return EQEmu::versions::ClientVersion::SoD; }
|
||||
|
||||
enum : int { InvAugInvalid = -1, InvAugBegin };
|
||||
const int16 SOCKET_INVALID = IINVALID;
|
||||
const int16 SOCKET_BEGIN = INULL;
|
||||
const int16 SOCKET_END = 4;
|
||||
const int16 SOCKET_COUNT = 5;
|
||||
|
||||
const char* GetInvAugIndexName(int16 aug_index);
|
||||
|
||||
} /*invaug*/
|
||||
|
||||
@@ -153,147 +263,21 @@ namespace SoD
|
||||
namespace profile {
|
||||
inline EQEmu::versions::ClientVersion GetProfileRef() { return EQEmu::versions::ClientVersion::SoD; }
|
||||
|
||||
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
|
||||
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
||||
|
||||
const int16 POTION_BELT_SIZE = 5;
|
||||
|
||||
const int16 SKILL_ARRAY_SIZE = 100;
|
||||
|
||||
} /*profile*/
|
||||
|
||||
namespace constants {
|
||||
inline EQEmu::versions::ClientVersion GetConstantsRef() { return EQEmu::versions::ClientVersion::SoD; }
|
||||
|
||||
} /*constants*/
|
||||
const size_t CHARACTER_CREATION_LIMIT = 12;
|
||||
|
||||
namespace behavior {
|
||||
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::SoD; }
|
||||
|
||||
} /*behavior*/
|
||||
|
||||
namespace skills {
|
||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::SoD; }
|
||||
|
||||
} /*skills*/
|
||||
|
||||
|
||||
// declarations
|
||||
namespace inventory {
|
||||
const bool ConcatenateInvTypeLimbo = true;
|
||||
|
||||
const bool AllowOverLevelEquipment = false;
|
||||
|
||||
const bool AllowEmptyBagInBag = false;
|
||||
const bool AllowClickCastFromBag = false;
|
||||
|
||||
} /*inventory*/
|
||||
|
||||
namespace invtype {
|
||||
const size_t InvTypePossessionsSize = invslot::PossessionsCount;
|
||||
const size_t InvTypeBankSize = 24;
|
||||
const size_t InvTypeSharedBankSize = 2;
|
||||
const size_t InvTypeTradeSize = 8;
|
||||
const size_t InvTypeWorldSize = 10;
|
||||
const size_t InvTypeLimboSize = 36;
|
||||
const size_t InvTypeTributeSize = 5;
|
||||
const size_t InvTypeGuildTributeSize = 2;
|
||||
const size_t InvTypeMerchantSize = 80;
|
||||
const size_t InvTypeCorpseSize = InvTypePossessionsSize;
|
||||
const size_t InvTypeBazaarSize = 80;
|
||||
const size_t InvTypeInspectSize = invslot::EquipmentCount;
|
||||
const size_t InvTypeViewMODPCSize = InvTypePossessionsSize;
|
||||
const size_t InvTypeViewMODBankSize = InvTypeBankSize;
|
||||
const size_t InvTypeViewMODSharedBankSize = InvTypeSharedBankSize;
|
||||
const size_t InvTypeViewMODLimboSize = InvTypeLimboSize;
|
||||
const size_t InvTypeAltStorageSize = 0;//unknown - "Shroud Bank"
|
||||
const size_t InvTypeArchivedSize = 0;//unknown
|
||||
const size_t InvTypeOtherSize = 0;//unknown
|
||||
|
||||
extern size_t GetInvTypeSize(int inv_type);
|
||||
extern const char* GetInvTypeName(int inv_type);
|
||||
|
||||
extern bool IsInvTypePersistent(int inv_type);
|
||||
|
||||
} /*invtype*/
|
||||
|
||||
namespace invslot {
|
||||
const int BankBegin = 2000;
|
||||
const int BankEnd = (BankBegin + invtype::InvTypeBankSize) - 1;
|
||||
|
||||
const int SharedBankBegin = 2500;
|
||||
const int SharedBankEnd = (SharedBankBegin + invtype::InvTypeSharedBankSize) - 1;
|
||||
|
||||
const int TradeBegin = 3000;
|
||||
const int TradeEnd = (TradeBegin + invtype::InvTypeTradeSize) - 1;
|
||||
const int TradeNPCEnd = 3003;
|
||||
|
||||
const int WorldBegin = 4000;
|
||||
const int WorldEnd = (WorldBegin + invtype::InvTypeWorldSize) - 1;
|
||||
|
||||
const int TributeBegin = 400;
|
||||
const int TributeEnd = (TributeBegin + invtype::InvTypeTributeSize) - 1;
|
||||
|
||||
const int GuildTributeBegin = 450;
|
||||
const int GuildTributeEnd = (GuildTributeBegin + invtype::InvTypeGuildTributeSize) - 1;
|
||||
|
||||
const int CorpseBegin = invslot::PossessionsGeneral1;
|
||||
const int CorpseEnd = invslot::PossessionsGeneral1 + invslot::PossessionsCursor;
|
||||
|
||||
extern const char* GetInvPossessionsSlotName(int inv_slot);
|
||||
extern const char* GetInvCorpseSlotName(int inv_slot);
|
||||
extern const char* GetInvSlotName(int inv_type, int inv_slot);
|
||||
|
||||
} /*invslot*/
|
||||
|
||||
namespace invbag {
|
||||
const size_t ItemBagSize = 10;
|
||||
|
||||
const int GeneralBagsBegin = 262;
|
||||
const int GeneralBagsSize = invslot::GeneralCount * ItemBagSize;
|
||||
const int GeneralBagsEnd = (GeneralBagsBegin + GeneralBagsSize) - 1;
|
||||
|
||||
const int CursorBagBegin = 342;
|
||||
const int CursorBagSize = ItemBagSize;
|
||||
const int CursorBagEnd = (CursorBagBegin + CursorBagSize) - 1;
|
||||
|
||||
const int BankBagsBegin = 2032;
|
||||
const int BankBagsSize = (invtype::InvTypeBankSize * ItemBagSize);
|
||||
const int BankBagsEnd = (BankBagsBegin + BankBagsSize) - 1;
|
||||
|
||||
const int SharedBankBagsBegin = 2532;
|
||||
const int SharedBankBagsSize = invtype::InvTypeSharedBankSize * ItemBagSize;
|
||||
const int SharedBankBagsEnd = (SharedBankBagsBegin + SharedBankBagsSize) - 1;
|
||||
|
||||
const int TradeBagsBegin = 3031;
|
||||
const int TradeBagsSize = invtype::InvTypeTradeSize * ItemBagSize;
|
||||
const int TradeBagsEnd = (TradeBagsBegin + TradeBagsSize) - 1;
|
||||
|
||||
extern const char* GetInvBagIndexName(int bag_index);
|
||||
|
||||
} /*invbag*/
|
||||
|
||||
namespace invaug {
|
||||
const size_t ItemAugSize = 5;
|
||||
|
||||
extern const char* GetInvAugIndexName(int aug_index);
|
||||
|
||||
} /*invaug*/
|
||||
|
||||
namespace item {
|
||||
|
||||
} /*item*/
|
||||
|
||||
namespace profile {
|
||||
const size_t TributeSize = invtype::InvTypeTributeSize;
|
||||
const size_t GuildTributeSize = invtype::InvTypeGuildTributeSize;
|
||||
|
||||
const size_t BandoliersSize = 20; // number of bandolier instances
|
||||
const size_t BandolierItemCount = 4; // number of equipment slots in bandolier instance
|
||||
|
||||
const size_t PotionBeltSize = 5;
|
||||
|
||||
const size_t SkillArraySize = 100;
|
||||
|
||||
} /*profile*/
|
||||
|
||||
namespace constants {
|
||||
const size_t CharacterCreationLimit = 12;
|
||||
|
||||
const size_t SayLinkBodySize = 50;
|
||||
const size_t SAY_LINK_BODY_SIZE = 50;
|
||||
|
||||
const int LongBuffs = 25;
|
||||
const int ShortBuffs = 15;
|
||||
@@ -306,11 +290,15 @@ namespace SoD
|
||||
} /*constants*/
|
||||
|
||||
namespace behavior {
|
||||
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::SoD; }
|
||||
|
||||
const bool CoinHasWeight = false;
|
||||
|
||||
} /*behavior*/
|
||||
|
||||
namespace skills {
|
||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::SoD; }
|
||||
|
||||
const size_t LastUsableSkill = EQEmu::skills::SkillTripleAttack;
|
||||
|
||||
} /*skills*/
|
||||
|
||||
@@ -67,7 +67,6 @@ E(OP_MoveItem)
|
||||
E(OP_NewSpawn)
|
||||
E(OP_NewZone)
|
||||
E(OP_OnLevelMessage)
|
||||
E(OP_OpenNewTasksWindow)
|
||||
E(OP_PetBuffWindow)
|
||||
E(OP_PlayerProfile)
|
||||
E(OP_RaidJoin)
|
||||
|
||||
@@ -716,7 +716,7 @@ struct BandolierItem_Struct
|
||||
struct Bandolier_Struct
|
||||
{
|
||||
char Name[32];
|
||||
BandolierItem_Struct Items[profile::BandolierItemCount];
|
||||
BandolierItem_Struct Items[profile::BANDOLIER_ITEM_COUNT];
|
||||
};
|
||||
|
||||
//len = 72
|
||||
@@ -730,7 +730,7 @@ struct PotionBeltItem_Struct
|
||||
//len = 288
|
||||
struct PotionBelt_Struct
|
||||
{
|
||||
PotionBeltItem_Struct Items[profile::PotionBeltSize];
|
||||
PotionBeltItem_Struct Items[profile::POTION_BELT_SIZE];
|
||||
};
|
||||
|
||||
static const uint32 MAX_GROUP_LEADERSHIP_AA_ARRAY = 16;
|
||||
@@ -937,7 +937,7 @@ struct PlayerProfile_Struct
|
||||
/*08288*/ uint32 aapoints_spent; // Number of spent AA points
|
||||
/*08292*/ uint32 aapoints; // Unspent AA points
|
||||
/*08296*/ uint8 unknown06160[4];
|
||||
/*08300*/ Bandolier_Struct bandoliers[profile::BandoliersSize]; // [6400] bandolier contents
|
||||
/*08300*/ Bandolier_Struct bandoliers[profile::BANDOLIERS_SIZE]; // [6400] bandolier contents
|
||||
/*14700*/ PotionBelt_Struct potionbelt; // [360] potion belt 72 extra octets by adding 1 more belt slot
|
||||
/*15060*/ uint8 unknown12852[8];
|
||||
/*15068*/ uint32 available_slots;
|
||||
|
||||
+41
-150
@@ -1060,118 +1060,6 @@ namespace SoF
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
|
||||
ENCODE(OP_OpenNewTasksWindow)
|
||||
{
|
||||
AvailableTaskHeader_Struct* __emu_AvailableTaskHeader;
|
||||
AvailableTaskData1_Struct* __emu_AvailableTaskData1;
|
||||
AvailableTaskData2_Struct* __emu_AvailableTaskData2;
|
||||
AvailableTaskTrailer_Struct* __emu_AvailableTaskTrailer;
|
||||
|
||||
structs::AvailableTaskHeader_Struct* __eq_AvailableTaskHeader;
|
||||
structs::AvailableTaskData1_Struct* __eq_AvailableTaskData1;
|
||||
structs::AvailableTaskData2_Struct* __eq_AvailableTaskData2;
|
||||
structs::AvailableTaskTrailer_Struct* __eq_AvailableTaskTrailer;
|
||||
|
||||
EQApplicationPacket *in = *p;
|
||||
*p = nullptr;
|
||||
|
||||
unsigned char *__emu_buffer = in->pBuffer;
|
||||
|
||||
__emu_AvailableTaskHeader = (AvailableTaskHeader_Struct*)__emu_buffer;
|
||||
|
||||
// For each task, SoF has an extra uint32 and what appears to be space for a null terminated string.
|
||||
//
|
||||
in->size = in->size + (__emu_AvailableTaskHeader->TaskCount * 5);
|
||||
|
||||
in->pBuffer = new unsigned char[in->size];
|
||||
|
||||
unsigned char *__eq_buffer = in->pBuffer;
|
||||
|
||||
__eq_AvailableTaskHeader = (structs::AvailableTaskHeader_Struct*)__eq_buffer;
|
||||
|
||||
char *__eq_ptr, *__emu_Ptr;
|
||||
|
||||
// Copy Header
|
||||
//
|
||||
//
|
||||
|
||||
__eq_AvailableTaskHeader->TaskCount = __emu_AvailableTaskHeader->TaskCount;
|
||||
__eq_AvailableTaskHeader->unknown1 = __emu_AvailableTaskHeader->unknown1;
|
||||
__eq_AvailableTaskHeader->TaskGiver = __emu_AvailableTaskHeader->TaskGiver;
|
||||
|
||||
__emu_Ptr = (char *)__emu_AvailableTaskHeader + sizeof(AvailableTaskHeader_Struct);
|
||||
__eq_ptr = (char *)__eq_AvailableTaskHeader + sizeof(structs::AvailableTaskHeader_Struct);
|
||||
|
||||
for (uint32 i = 0; i<__emu_AvailableTaskHeader->TaskCount; i++) {
|
||||
|
||||
__emu_AvailableTaskData1 = (AvailableTaskData1_Struct*)__emu_Ptr;
|
||||
__eq_AvailableTaskData1 = (structs::AvailableTaskData1_Struct*)__eq_ptr;
|
||||
|
||||
__eq_AvailableTaskData1->TaskID = __emu_AvailableTaskData1->TaskID;
|
||||
// This next unknown seems to affect the colour of the task title. 0x3f80000 is what I have seen
|
||||
// in Live packets. Changing it to 0x3f000000 makes the title red.
|
||||
__eq_AvailableTaskData1->unknown1 = 0x3f800000;
|
||||
__eq_AvailableTaskData1->TimeLimit = __emu_AvailableTaskData1->TimeLimit;
|
||||
__eq_AvailableTaskData1->unknown2 = __emu_AvailableTaskData1->unknown2;
|
||||
|
||||
__emu_Ptr += sizeof(AvailableTaskData1_Struct);
|
||||
__eq_ptr += sizeof(structs::AvailableTaskData1_Struct);
|
||||
|
||||
strcpy(__eq_ptr, __emu_Ptr); // Title
|
||||
|
||||
__emu_Ptr += strlen(__emu_Ptr) + 1;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
|
||||
strcpy(__eq_ptr, __emu_Ptr); // Description
|
||||
|
||||
__emu_Ptr += strlen(__emu_Ptr) + 1;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
|
||||
__eq_ptr[0] = 0;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
|
||||
__emu_AvailableTaskData2 = (AvailableTaskData2_Struct*)__emu_Ptr;
|
||||
__eq_AvailableTaskData2 = (structs::AvailableTaskData2_Struct*)__eq_ptr;
|
||||
|
||||
__eq_AvailableTaskData2->unknown1 = __emu_AvailableTaskData2->unknown1;
|
||||
__eq_AvailableTaskData2->unknown2 = __emu_AvailableTaskData2->unknown2;
|
||||
__eq_AvailableTaskData2->unknown3 = __emu_AvailableTaskData2->unknown3;
|
||||
__eq_AvailableTaskData2->unknown4 = __emu_AvailableTaskData2->unknown4;
|
||||
|
||||
__emu_Ptr += sizeof(AvailableTaskData2_Struct);
|
||||
__eq_ptr += sizeof(structs::AvailableTaskData2_Struct);
|
||||
|
||||
strcpy(__eq_ptr, __emu_Ptr); // Unknown string
|
||||
|
||||
__emu_Ptr += strlen(__emu_Ptr) + 1;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
|
||||
strcpy(__eq_ptr, __emu_Ptr); // Unknown string
|
||||
|
||||
__emu_Ptr += strlen(__emu_Ptr) + 1;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
|
||||
__emu_AvailableTaskTrailer = (AvailableTaskTrailer_Struct*)__emu_Ptr;
|
||||
__eq_AvailableTaskTrailer = (structs::AvailableTaskTrailer_Struct*)__eq_ptr;
|
||||
|
||||
__eq_AvailableTaskTrailer->ItemCount = __emu_AvailableTaskTrailer->ItemCount;
|
||||
__eq_AvailableTaskTrailer->unknown1 = __emu_AvailableTaskTrailer->unknown1;
|
||||
__eq_AvailableTaskTrailer->unknown2 = __emu_AvailableTaskTrailer->unknown2;
|
||||
__eq_AvailableTaskTrailer->StartZone = __emu_AvailableTaskTrailer->StartZone;
|
||||
|
||||
__emu_Ptr += sizeof(AvailableTaskTrailer_Struct);
|
||||
__eq_ptr += sizeof(structs::AvailableTaskTrailer_Struct);
|
||||
|
||||
strcpy(__eq_ptr, __emu_Ptr); // Unknown string
|
||||
|
||||
__emu_Ptr += strlen(__emu_Ptr) + 1;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
}
|
||||
|
||||
delete[] __emu_buffer;
|
||||
dest->FastQueuePacket(&in, ack_req);
|
||||
}
|
||||
|
||||
ENCODE(OP_PetBuffWindow)
|
||||
{
|
||||
ENCODE_LENGTH_EXACT(PetBuff_Struct);
|
||||
@@ -1303,18 +1191,18 @@ namespace SoF
|
||||
// OUT(unknown06160[4]);
|
||||
|
||||
// Copy bandoliers where server and client indexes converge
|
||||
for (r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < profile::BandoliersSize; ++r) {
|
||||
for (r = 0; r < EQEmu::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
|
||||
OUT_str(bandoliers[r].Name);
|
||||
for (uint32 k = 0; k < profile::BandolierItemCount; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||
OUT(bandoliers[r].Items[k].ID);
|
||||
OUT(bandoliers[r].Items[k].Icon);
|
||||
OUT_str(bandoliers[r].Items[k].Name);
|
||||
}
|
||||
}
|
||||
// Nullify bandoliers where server and client indexes diverge, with a client bias
|
||||
for (r = EQEmu::legacy::BANDOLIERS_SIZE; r < profile::BandoliersSize; ++r) {
|
||||
for (r = EQEmu::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
|
||||
eq->bandoliers[r].Name[0] = '\0';
|
||||
for (uint32 k = 0; k < profile::BandolierItemCount; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||
eq->bandoliers[r].Items[k].ID = 0;
|
||||
eq->bandoliers[r].Items[k].Icon = 0;
|
||||
eq->bandoliers[r].Items[k].Name[0] = '\0';
|
||||
@@ -1324,13 +1212,13 @@ namespace SoF
|
||||
// OUT(unknown07444[5120]);
|
||||
|
||||
// Copy potion belt where server and client indexes converge
|
||||
for (r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < profile::PotionBeltSize; ++r) {
|
||||
for (r = 0; r < EQEmu::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
|
||||
OUT(potionbelt.Items[r].ID);
|
||||
OUT(potionbelt.Items[r].Icon);
|
||||
OUT_str(potionbelt.Items[r].Name);
|
||||
}
|
||||
// Nullify potion belt where server and client indexes diverge, with a client bias
|
||||
for (r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < profile::PotionBeltSize; ++r) {
|
||||
for (r = EQEmu::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
|
||||
eq->potionbelt.Items[r].ID = 0;
|
||||
eq->potionbelt.Items[r].Icon = 0;
|
||||
eq->potionbelt.Items[r].Name[0] = '\0';
|
||||
@@ -1618,8 +1506,8 @@ namespace SoF
|
||||
eq->CharCount = emu->CharCount;
|
||||
eq->TotalChars = emu->TotalChars;
|
||||
|
||||
if (eq->TotalChars > constants::CharacterCreationLimit)
|
||||
eq->TotalChars = constants::CharacterCreationLimit;
|
||||
if (eq->TotalChars > constants::CHARACTER_CREATION_LIMIT)
|
||||
eq->TotalChars = constants::CHARACTER_CREATION_LIMIT;
|
||||
|
||||
FINISH_ENCODE();
|
||||
return;
|
||||
@@ -1631,7 +1519,7 @@ namespace SoF
|
||||
|
||||
size_t names_length = 0;
|
||||
size_t character_count = 0;
|
||||
for (; character_count < emu->CharCount && character_count < constants::CharacterCreationLimit; ++character_count) {
|
||||
for (; character_count < emu->CharCount && character_count < constants::CHARACTER_CREATION_LIMIT; ++character_count) {
|
||||
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
|
||||
names_length += strlen(emu_cse->Name);
|
||||
emu_ptr += sizeof(CharacterSelectEntry_Struct);
|
||||
@@ -1647,8 +1535,8 @@ namespace SoF
|
||||
eq->CharCount = character_count;
|
||||
eq->TotalChars = emu->TotalChars;
|
||||
|
||||
if (eq->TotalChars > constants::CharacterCreationLimit)
|
||||
eq->TotalChars = constants::CharacterCreationLimit;
|
||||
if (eq->TotalChars > constants::CHARACTER_CREATION_LIMIT)
|
||||
eq->TotalChars = constants::CHARACTER_CREATION_LIMIT;
|
||||
|
||||
emu_ptr = __emu_buffer;
|
||||
emu_ptr += sizeof(CharacterSelect_Struct);
|
||||
@@ -1879,13 +1767,16 @@ namespace SoF
|
||||
InBuffer += description_size;
|
||||
InBuffer += sizeof(TaskDescriptionData2_Struct);
|
||||
|
||||
std::string old_message = InBuffer; // start 'Reward' as string
|
||||
uint32 reward_size = strlen(InBuffer) + 1;
|
||||
InBuffer += reward_size;
|
||||
|
||||
std::string old_message = InBuffer; // start item link string
|
||||
std::string new_message;
|
||||
ServerToSoFSayLink(new_message, old_message);
|
||||
|
||||
in->size = sizeof(TaskDescriptionHeader_Struct) + sizeof(TaskDescriptionData1_Struct)+
|
||||
sizeof(TaskDescriptionData2_Struct) + sizeof(TaskDescriptionTrailer_Struct)+
|
||||
title_size + description_size + new_message.length() + 1;
|
||||
title_size + description_size + reward_size + new_message.length() + 1;
|
||||
|
||||
in->pBuffer = new unsigned char[in->size];
|
||||
|
||||
@@ -2976,7 +2867,7 @@ namespace SoF
|
||||
ibs.nodrop = item->NoDrop;
|
||||
ibs.attune = item->Attuneable;
|
||||
ibs.size = item->Size;
|
||||
ibs.slots = SwapBits21and22(item->Slots);
|
||||
ibs.slots = SwapBits21And22(item->Slots);
|
||||
ibs.price = item->Price;
|
||||
ibs.icon = item->Icon;
|
||||
ibs.unknown1 = 1;
|
||||
@@ -3066,7 +2957,7 @@ namespace SoF
|
||||
isbs.augtype = item->AugType;
|
||||
isbs.augrestrict = item->AugRestrict;
|
||||
|
||||
for (int index = 0; index < invaug::ItemAugSize; ++index) {
|
||||
for (int index = invaug::SOCKET_BEGIN; index <= invaug::SOCKET_END; ++index) {
|
||||
isbs.augslots[index].type = item->AugSlotType[index];
|
||||
isbs.augslots[index].visible = item->AugSlotVisible[index];
|
||||
isbs.augslots[index].unknown = item->AugSlotUnk2[index];
|
||||
@@ -3238,18 +3129,18 @@ namespace SoF
|
||||
|
||||
ob.write((const char*)&subitem_count, sizeof(uint32));
|
||||
|
||||
for (uint32 index = EQEmu::inventory::containerBegin; index < EQEmu::inventory::ContainerCount; ++index) {
|
||||
for (uint32 index = EQEmu::invbag::SLOT_BEGIN; index <= EQEmu::invbag::SLOT_END; ++index) {
|
||||
EQEmu::ItemInstance* sub = inst->GetItem(index);
|
||||
if (!sub)
|
||||
continue;
|
||||
|
||||
int SubSlotNumber = INVALID_INDEX;
|
||||
if (slot_id_in >= EQEmu::legacy::GENERAL_BEGIN && slot_id_in <= EQEmu::legacy::GENERAL_END)
|
||||
SubSlotNumber = (((slot_id_in + 3) * EQEmu::inventory::ContainerCount) + index + 1);
|
||||
else if (slot_id_in >= EQEmu::legacy::BANK_BEGIN && slot_id_in <= EQEmu::legacy::BANK_END)
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::legacy::BANK_BEGIN) * EQEmu::inventory::ContainerCount) + EQEmu::legacy::BANK_BAGS_BEGIN + index);
|
||||
else if (slot_id_in >= EQEmu::legacy::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::legacy::SHARED_BANK_END)
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::legacy::SHARED_BANK_BEGIN) * EQEmu::inventory::ContainerCount) + EQEmu::legacy::SHARED_BANK_BAGS_BEGIN + index);
|
||||
if (slot_id_in >= EQEmu::invslot::GENERAL_BEGIN && slot_id_in <= EQEmu::invslot::GENERAL_END)
|
||||
SubSlotNumber = (((slot_id_in + 3) * EQEmu::invbag::SLOT_COUNT) + index + 1);
|
||||
else if (slot_id_in >= EQEmu::invslot::BANK_BEGIN && slot_id_in <= EQEmu::invslot::BANK_END)
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::invslot::BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT) + EQEmu::invbag::BANK_BAGS_BEGIN + index);
|
||||
else if (slot_id_in >= EQEmu::invslot::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::invslot::SHARED_BANK_END)
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::invslot::SHARED_BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT) + EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + index);
|
||||
else
|
||||
SubSlotNumber = slot_id_in;
|
||||
|
||||
@@ -3267,16 +3158,16 @@ namespace SoF
|
||||
{
|
||||
uint32 SoFSlot = 0;
|
||||
|
||||
if (serverSlot >= EQEmu::inventory::slotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||
if (serverSlot >= EQEmu::invslot::slotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||
SoFSlot = serverSlot + 1;
|
||||
else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END)
|
||||
else if (serverSlot >= EQEmu::invbag::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::invbag::CURSOR_BAG_END)
|
||||
SoFSlot = serverSlot + 11;
|
||||
else if (serverSlot >= EQEmu::legacy::BANK_BAGS_BEGIN && serverSlot <= EQEmu::legacy::BANK_BAGS_END)
|
||||
else if (serverSlot >= EQEmu::invbag::BANK_BAGS_BEGIN && serverSlot <= EQEmu::invbag::BANK_BAGS_END)
|
||||
SoFSlot = serverSlot + 1;
|
||||
else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END)
|
||||
else if (serverSlot >= EQEmu::invbag::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::invbag::SHARED_BANK_BAGS_END)
|
||||
SoFSlot = serverSlot + 1;
|
||||
else if (serverSlot == EQEmu::inventory::slotPowerSource)
|
||||
SoFSlot = invslot::PossessionsPowerSource;
|
||||
else if (serverSlot == EQEmu::invslot::SLOT_POWER_SOURCE)
|
||||
SoFSlot = invslot::slotPowerSource;
|
||||
else
|
||||
SoFSlot = serverSlot;
|
||||
|
||||
@@ -3293,16 +3184,16 @@ namespace SoF
|
||||
{
|
||||
uint32 ServerSlot = 0;
|
||||
|
||||
if (sofSlot >= invslot::PossessionsAmmo && sofSlot <= invslot::CorpseEnd) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||
if (sofSlot >= invslot::slotAmmo && sofSlot <= invslot::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||
ServerSlot = sofSlot - 1;
|
||||
else if (sofSlot >= invbag::GeneralBagsBegin && sofSlot <= invbag::CursorBagEnd)
|
||||
else if (sofSlot >= invbag::GENERAL_BAGS_BEGIN && sofSlot <= invbag::CURSOR_BAG_END)
|
||||
ServerSlot = sofSlot - 11;
|
||||
else if (sofSlot >= invbag::BankBagsBegin && sofSlot <= invbag::BankBagsEnd)
|
||||
else if (sofSlot >= invbag::BANK_BAGS_BEGIN && sofSlot <= invbag::BANK_BAGS_END)
|
||||
ServerSlot = sofSlot - 1;
|
||||
else if (sofSlot >= invbag::SharedBankBagsBegin && sofSlot <= invbag::SharedBankBagsEnd)
|
||||
else if (sofSlot >= invbag::SHARED_BANK_BAGS_BEGIN && sofSlot <= invbag::SHARED_BANK_BAGS_END)
|
||||
ServerSlot = sofSlot - 1;
|
||||
else if (sofSlot == invslot::PossessionsPowerSource)
|
||||
ServerSlot = EQEmu::inventory::slotPowerSource;
|
||||
else if (sofSlot == invslot::slotPowerSource)
|
||||
ServerSlot = EQEmu::invslot::SLOT_POWER_SOURCE;
|
||||
else
|
||||
ServerSlot = sofSlot;
|
||||
|
||||
@@ -3317,7 +3208,7 @@ namespace SoF
|
||||
|
||||
static inline void ServerToSoFSayLink(std::string& sofSayLink, const std::string& serverSayLink)
|
||||
{
|
||||
if ((constants::SayLinkBodySize == EQEmu::constants::SayLinkBodySize) || (serverSayLink.find('\x12') == std::string::npos)) {
|
||||
if ((constants::SAY_LINK_BODY_SIZE == EQEmu::constants::SAY_LINK_BODY_SIZE) || (serverSayLink.find('\x12') == std::string::npos)) {
|
||||
sofSayLink = serverSayLink;
|
||||
return;
|
||||
}
|
||||
@@ -3326,7 +3217,7 @@ namespace SoF
|
||||
|
||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||
if (segment_iter & 1) {
|
||||
if (segments[segment_iter].length() <= EQEmu::constants::SayLinkBodySize) {
|
||||
if (segments[segment_iter].length() <= EQEmu::constants::SAY_LINK_BODY_SIZE) {
|
||||
sofSayLink.append(segments[segment_iter]);
|
||||
// TODO: log size mismatch error
|
||||
continue;
|
||||
@@ -3357,7 +3248,7 @@ namespace SoF
|
||||
|
||||
static inline void SoFToServerSayLink(std::string& serverSayLink, const std::string& sofSayLink)
|
||||
{
|
||||
if ((EQEmu::constants::SayLinkBodySize == constants::SayLinkBodySize) || (sofSayLink.find('\x12') == std::string::npos)) {
|
||||
if ((EQEmu::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (sofSayLink.find('\x12') == std::string::npos)) {
|
||||
serverSayLink = sofSayLink;
|
||||
return;
|
||||
}
|
||||
@@ -3366,7 +3257,7 @@ namespace SoF
|
||||
|
||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||
if (segment_iter & 1) {
|
||||
if (segments[segment_iter].length() <= constants::SayLinkBodySize) {
|
||||
if (segments[segment_iter].length() <= constants::SAY_LINK_BODY_SIZE) {
|
||||
serverSayLink.append(segments[segment_iter]);
|
||||
// TODO: log size mismatch error
|
||||
continue;
|
||||
|
||||
+119
-119
@@ -22,198 +22,198 @@
|
||||
#include "../string_util.h"
|
||||
|
||||
|
||||
size_t SoF::invtype::GetInvTypeSize(int inv_type)
|
||||
int16 SoF::invtype::GetInvTypeSize(int16 inv_type)
|
||||
{
|
||||
switch (inv_type) {
|
||||
case invtype::InvTypePossessions:
|
||||
return invtype::InvTypePossessionsSize;
|
||||
case invtype::InvTypeBank:
|
||||
return invtype::InvTypeBankSize;
|
||||
case invtype::InvTypeSharedBank:
|
||||
return invtype::InvTypeSharedBankSize;
|
||||
case invtype::InvTypeTrade:
|
||||
return invtype::InvTypeTradeSize;
|
||||
case invtype::InvTypeWorld:
|
||||
return invtype::InvTypeWorldSize;
|
||||
case invtype::InvTypeLimbo:
|
||||
return invtype::InvTypeLimboSize;
|
||||
case invtype::InvTypeTribute:
|
||||
return invtype::InvTypeTributeSize;
|
||||
case invtype::InvTypeGuildTribute:
|
||||
return invtype::InvTypeGuildTributeSize;
|
||||
case invtype::InvTypeMerchant:
|
||||
return invtype::InvTypeMerchantSize;
|
||||
case invtype::InvTypeCorpse:
|
||||
return invtype::InvTypeCorpseSize;
|
||||
case invtype::InvTypeBazaar:
|
||||
return invtype::InvTypeBazaarSize;
|
||||
case invtype::InvTypeInspect:
|
||||
return invtype::InvTypeInspectSize;
|
||||
case invtype::InvTypeViewMODPC:
|
||||
return invtype::InvTypeViewMODPCSize;
|
||||
case invtype::InvTypeViewMODBank:
|
||||
return invtype::InvTypeViewMODBankSize;
|
||||
case invtype::InvTypeViewMODSharedBank:
|
||||
return invtype::InvTypeViewMODSharedBankSize;
|
||||
case invtype::InvTypeViewMODLimbo:
|
||||
return invtype::InvTypeViewMODLimboSize;
|
||||
case invtype::InvTypeAltStorage:
|
||||
return invtype::InvTypeAltStorageSize;
|
||||
case invtype::InvTypeArchived:
|
||||
return invtype::InvTypeArchivedSize;
|
||||
case invtype::InvTypeOther:
|
||||
return invtype::InvTypeOtherSize;
|
||||
case invtype::typePossessions:
|
||||
return invtype::POSSESSIONS_SIZE;
|
||||
case invtype::typeBank:
|
||||
return invtype::BANK_SIZE;
|
||||
case invtype::typeSharedBank:
|
||||
return invtype::SHARED_BANK_SIZE;
|
||||
case invtype::typeTrade:
|
||||
return invtype::TRADE_SIZE;
|
||||
case invtype::typeWorld:
|
||||
return invtype::WORLD_SIZE;
|
||||
case invtype::typeLimbo:
|
||||
return invtype::LIMBO_SIZE;
|
||||
case invtype::typeTribute:
|
||||
return invtype::TRIBUTE_SIZE;
|
||||
case invtype::typeGuildTribute:
|
||||
return invtype::GUILD_TRIBUTE_SIZE;
|
||||
case invtype::typeMerchant:
|
||||
return invtype::MERCHANT_SIZE;
|
||||
case invtype::typeCorpse:
|
||||
return invtype::CORPSE_SIZE;
|
||||
case invtype::typeBazaar:
|
||||
return invtype::BAZAAR_SIZE;
|
||||
case invtype::typeInspect:
|
||||
return invtype::INSPECT_SIZE;
|
||||
case invtype::typeViewMODPC:
|
||||
return invtype::VIEW_MOD_PC_SIZE;
|
||||
case invtype::typeViewMODBank:
|
||||
return invtype::VIEW_MOD_BANK_SIZE;
|
||||
case invtype::typeViewMODSharedBank:
|
||||
return invtype::VIEW_MOD_SHARED_BANK_SIZE;
|
||||
case invtype::typeViewMODLimbo:
|
||||
return invtype::VIEW_MOD_LIMBO_SIZE;
|
||||
case invtype::typeAltStorage:
|
||||
return invtype::ALT_STORAGE_SIZE;
|
||||
case invtype::typeArchived:
|
||||
return invtype::ARCHIVED_SIZE;
|
||||
case invtype::typeOther:
|
||||
return invtype::OTHER_SIZE;
|
||||
default:
|
||||
return 0;
|
||||
return INULL;
|
||||
}
|
||||
}
|
||||
|
||||
const char* SoF::invtype::GetInvTypeName(int inv_type)
|
||||
const char* SoF::invtype::GetInvTypeName(int16 inv_type)
|
||||
{
|
||||
switch (inv_type) {
|
||||
case invtype::InvTypeInvalid:
|
||||
case invtype::TYPE_INVALID:
|
||||
return "Invalid Type";
|
||||
case invtype::InvTypePossessions:
|
||||
case invtype::typePossessions:
|
||||
return "Possessions";
|
||||
case invtype::InvTypeBank:
|
||||
case invtype::typeBank:
|
||||
return "Bank";
|
||||
case invtype::InvTypeSharedBank:
|
||||
case invtype::typeSharedBank:
|
||||
return "Shared Bank";
|
||||
case invtype::InvTypeTrade:
|
||||
case invtype::typeTrade:
|
||||
return "Trade";
|
||||
case invtype::InvTypeWorld:
|
||||
case invtype::typeWorld:
|
||||
return "World";
|
||||
case invtype::InvTypeLimbo:
|
||||
case invtype::typeLimbo:
|
||||
return "Limbo";
|
||||
case invtype::InvTypeTribute:
|
||||
case invtype::typeTribute:
|
||||
return "Tribute";
|
||||
case invtype::InvTypeGuildTribute:
|
||||
case invtype::typeGuildTribute:
|
||||
return "Guild Tribute";
|
||||
case invtype::InvTypeMerchant:
|
||||
case invtype::typeMerchant:
|
||||
return "Merchant";
|
||||
case invtype::InvTypeCorpse:
|
||||
case invtype::typeCorpse:
|
||||
return "Corpse";
|
||||
case invtype::InvTypeBazaar:
|
||||
case invtype::typeBazaar:
|
||||
return "Bazaar";
|
||||
case invtype::InvTypeInspect:
|
||||
case invtype::typeInspect:
|
||||
return "Inspect";
|
||||
case invtype::InvTypeViewMODPC:
|
||||
case invtype::typeViewMODPC:
|
||||
return "View MOD PC";
|
||||
case invtype::InvTypeViewMODBank:
|
||||
case invtype::typeViewMODBank:
|
||||
return "View MOD Bank";
|
||||
case invtype::InvTypeViewMODSharedBank:
|
||||
case invtype::typeViewMODSharedBank:
|
||||
return "View MOD Shared Bank";
|
||||
case invtype::InvTypeViewMODLimbo:
|
||||
case invtype::typeViewMODLimbo:
|
||||
return "View MOD Limbo";
|
||||
case invtype::InvTypeAltStorage:
|
||||
case invtype::typeAltStorage:
|
||||
return "Alt Storage";
|
||||
case invtype::InvTypeArchived:
|
||||
case invtype::typeArchived:
|
||||
return "Archived";
|
||||
case invtype::InvTypeOther:
|
||||
case invtype::typeOther:
|
||||
return "Other";
|
||||
default:
|
||||
return "Unknown Type";
|
||||
}
|
||||
}
|
||||
|
||||
bool SoF::invtype::IsInvTypePersistent(int inv_type)
|
||||
bool SoF::invtype::IsInvTypePersistent(int16 inv_type)
|
||||
{
|
||||
switch (inv_type) {
|
||||
case invtype::InvTypePossessions:
|
||||
case invtype::InvTypeBank:
|
||||
case invtype::InvTypeSharedBank:
|
||||
case invtype::InvTypeTrade:
|
||||
case invtype::InvTypeWorld:
|
||||
case invtype::InvTypeLimbo:
|
||||
case invtype::InvTypeTribute:
|
||||
case invtype::InvTypeGuildTribute:
|
||||
case invtype::typePossessions:
|
||||
case invtype::typeBank:
|
||||
case invtype::typeSharedBank:
|
||||
case invtype::typeTrade:
|
||||
case invtype::typeWorld:
|
||||
case invtype::typeLimbo:
|
||||
case invtype::typeTribute:
|
||||
case invtype::typeGuildTribute:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const char* SoF::invslot::GetInvPossessionsSlotName(int inv_slot)
|
||||
const char* SoF::invslot::GetInvPossessionsSlotName(int16 inv_slot)
|
||||
{
|
||||
switch (inv_slot) {
|
||||
case invslot::InvSlotInvalid:
|
||||
case invslot::SLOT_INVALID:
|
||||
return "Invalid Slot";
|
||||
case invslot::PossessionsCharm:
|
||||
case invslot::slotCharm:
|
||||
return "Charm";
|
||||
case invslot::PossessionsEar1:
|
||||
case invslot::slotEar1:
|
||||
return "Ear 1";
|
||||
case invslot::PossessionsHead:
|
||||
case invslot::slotHead:
|
||||
return "Head";
|
||||
case invslot::PossessionsFace:
|
||||
case invslot::slotFace:
|
||||
return "Face";
|
||||
case invslot::PossessionsEar2:
|
||||
case invslot::slotEar2:
|
||||
return "Ear 2";
|
||||
case invslot::PossessionsNeck:
|
||||
case invslot::slotNeck:
|
||||
return "Neck";
|
||||
case invslot::PossessionsShoulders:
|
||||
case invslot::slotShoulders:
|
||||
return "Shoulders";
|
||||
case invslot::PossessionsArms:
|
||||
case invslot::slotArms:
|
||||
return "Arms";
|
||||
case invslot::PossessionsBack:
|
||||
case invslot::slotBack:
|
||||
return "Back";
|
||||
case invslot::PossessionsWrist1:
|
||||
case invslot::slotWrist1:
|
||||
return "Wrist 1";
|
||||
case invslot::PossessionsWrist2:
|
||||
case invslot::slotWrist2:
|
||||
return "Wrist 2";
|
||||
case invslot::PossessionsRange:
|
||||
case invslot::slotRange:
|
||||
return "Range";
|
||||
case invslot::PossessionsHands:
|
||||
case invslot::slotHands:
|
||||
return "Hands";
|
||||
case invslot::PossessionsPrimary:
|
||||
case invslot::slotPrimary:
|
||||
return "Primary";
|
||||
case invslot::PossessionsSecondary:
|
||||
case invslot::slotSecondary:
|
||||
return "Secondary";
|
||||
case invslot::PossessionsFinger1:
|
||||
case invslot::slotFinger1:
|
||||
return "Finger 1";
|
||||
case invslot::PossessionsFinger2:
|
||||
case invslot::slotFinger2:
|
||||
return "Finger 2";
|
||||
case invslot::PossessionsChest:
|
||||
case invslot::slotChest:
|
||||
return "Chest";
|
||||
case invslot::PossessionsLegs:
|
||||
case invslot::slotLegs:
|
||||
return "Legs";
|
||||
case invslot::PossessionsFeet:
|
||||
case invslot::slotFeet:
|
||||
return "Feet";
|
||||
case invslot::PossessionsWaist:
|
||||
case invslot::slotWaist:
|
||||
return "Waist";
|
||||
case invslot::PossessionsPowerSource:
|
||||
case invslot::slotPowerSource:
|
||||
return "Power Source";
|
||||
case invslot::PossessionsAmmo:
|
||||
case invslot::slotAmmo:
|
||||
return "Ammo";
|
||||
case invslot::PossessionsGeneral1:
|
||||
case invslot::slotGeneral1:
|
||||
return "General 1";
|
||||
case invslot::PossessionsGeneral2:
|
||||
case invslot::slotGeneral2:
|
||||
return "General 2";
|
||||
case invslot::PossessionsGeneral3:
|
||||
case invslot::slotGeneral3:
|
||||
return "General 3";
|
||||
case invslot::PossessionsGeneral4:
|
||||
case invslot::slotGeneral4:
|
||||
return "General 4";
|
||||
case invslot::PossessionsGeneral5:
|
||||
case invslot::slotGeneral5:
|
||||
return "General 5";
|
||||
case invslot::PossessionsGeneral6:
|
||||
case invslot::slotGeneral6:
|
||||
return "General 6";
|
||||
case invslot::PossessionsGeneral7:
|
||||
case invslot::slotGeneral7:
|
||||
return "General 7";
|
||||
case invslot::PossessionsGeneral8:
|
||||
case invslot::slotGeneral8:
|
||||
return "General 8";
|
||||
case invslot::PossessionsCursor:
|
||||
case invslot::slotCursor:
|
||||
return "Cursor";
|
||||
default:
|
||||
return "Unknown Slot";
|
||||
}
|
||||
}
|
||||
|
||||
const char* SoF::invslot::GetInvCorpseSlotName(int inv_slot)
|
||||
const char* SoF::invslot::GetInvCorpseSlotName(int16 inv_slot)
|
||||
{
|
||||
if (!invtype::GetInvTypeSize(invtype::InvTypeCorpse) || inv_slot == invslot::InvSlotInvalid)
|
||||
if (!invtype::GetInvTypeSize(invtype::typeCorpse) || inv_slot == invslot::SLOT_INVALID)
|
||||
return "Invalid Slot";
|
||||
|
||||
// needs work
|
||||
if ((size_t)(inv_slot + 1) < invslot::CorpseBegin || (size_t)(inv_slot + 1) >= invslot::CorpseEnd)
|
||||
if ((inv_slot + 1) < invslot::CORPSE_BEGIN || (inv_slot + 1) >= invslot::CORPSE_END)
|
||||
return "Unknown Slot";
|
||||
|
||||
static std::string ret_str;
|
||||
@@ -222,19 +222,19 @@ const char* SoF::invslot::GetInvCorpseSlotName(int inv_slot)
|
||||
return ret_str.c_str();
|
||||
}
|
||||
|
||||
const char* SoF::invslot::GetInvSlotName(int inv_type, int inv_slot)
|
||||
const char* SoF::invslot::GetInvSlotName(int16 inv_type, int16 inv_slot)
|
||||
{
|
||||
if (inv_type == invtype::InvTypePossessions)
|
||||
if (inv_type == invtype::typePossessions)
|
||||
return invslot::GetInvPossessionsSlotName(inv_slot);
|
||||
else if (inv_type == invtype::InvTypeCorpse)
|
||||
else if (inv_type == invtype::typeCorpse)
|
||||
return invslot::GetInvCorpseSlotName(inv_slot);
|
||||
|
||||
size_t type_size = invtype::GetInvTypeSize(inv_type);
|
||||
int16 type_size = invtype::GetInvTypeSize(inv_type);
|
||||
|
||||
if (!type_size || inv_slot == invslot::InvSlotInvalid)
|
||||
if (!type_size || inv_slot == invslot::SLOT_INVALID)
|
||||
return "Invalid Slot";
|
||||
|
||||
if ((size_t)(inv_slot + 1) >= type_size)
|
||||
if ((inv_slot + 1) >= type_size)
|
||||
return "Unknown Slot";
|
||||
|
||||
static std::string ret_str;
|
||||
@@ -243,12 +243,12 @@ const char* SoF::invslot::GetInvSlotName(int inv_type, int inv_slot)
|
||||
return ret_str.c_str();
|
||||
}
|
||||
|
||||
const char* SoF::invbag::GetInvBagIndexName(int bag_index)
|
||||
const char* SoF::invbag::GetInvBagIndexName(int16 bag_index)
|
||||
{
|
||||
if (bag_index == invbag::InvBagInvalid)
|
||||
if (bag_index == invbag::SLOT_INVALID)
|
||||
return "Invalid Bag";
|
||||
|
||||
if ((size_t)bag_index >= invbag::ItemBagSize)
|
||||
if (bag_index >= invbag::SLOT_COUNT)
|
||||
return "Unknown Bag";
|
||||
|
||||
static std::string ret_str;
|
||||
@@ -257,12 +257,12 @@ const char* SoF::invbag::GetInvBagIndexName(int bag_index)
|
||||
return ret_str.c_str();
|
||||
}
|
||||
|
||||
const char* SoF::invaug::GetInvAugIndexName(int aug_index)
|
||||
const char* SoF::invaug::GetInvAugIndexName(int16 aug_index)
|
||||
{
|
||||
if (aug_index == invaug::InvAugInvalid)
|
||||
if (aug_index == invaug::SOCKET_INVALID)
|
||||
return "Invalid Augment";
|
||||
|
||||
if ((size_t)aug_index >= invaug::ItemAugSize)
|
||||
if (aug_index >= invaug::SOCKET_COUNT)
|
||||
return "Unknown Augment";
|
||||
|
||||
static std::string ret_str;
|
||||
|
||||
+194
-206
@@ -27,108 +27,218 @@
|
||||
|
||||
namespace SoF
|
||||
{
|
||||
enum : int { Invalid = -1, Null, Safety };
|
||||
const int16 IINVALID = -1;
|
||||
const int16 INULL = 0;
|
||||
|
||||
enum : bool { False = false, True = true };
|
||||
|
||||
// pre-declarations
|
||||
namespace inventory {
|
||||
inline EQEmu::versions::ClientVersion GetInventoryRef() { return EQEmu::versions::ClientVersion::SoF; }
|
||||
|
||||
const bool ConcatenateInvTypeLimbo = true;
|
||||
|
||||
const bool AllowOverLevelEquipment = false;
|
||||
|
||||
const bool AllowEmptyBagInBag = false;
|
||||
const bool AllowClickCastFromBag = false;
|
||||
|
||||
} /*inventory*/
|
||||
|
||||
namespace invtype {
|
||||
inline EQEmu::versions::ClientVersion GetInvTypeRef() { return EQEmu::versions::ClientVersion::SoF; }
|
||||
|
||||
enum : int { InvTypeInvalid = -1, InvTypeBegin };
|
||||
namespace enum_ {
|
||||
enum InventoryTypes : int16 {
|
||||
typePossessions = INULL,
|
||||
typeBank,
|
||||
typeSharedBank,
|
||||
typeTrade,
|
||||
typeWorld,
|
||||
typeLimbo,
|
||||
typeTribute,
|
||||
typeGuildTribute,
|
||||
typeMerchant,
|
||||
typeCorpse,
|
||||
typeBazaar,
|
||||
typeInspect,
|
||||
typeViewMODPC,
|
||||
typeViewMODBank,
|
||||
typeViewMODSharedBank,
|
||||
typeViewMODLimbo,
|
||||
typeAltStorage,
|
||||
typeArchived,
|
||||
typeOther
|
||||
};
|
||||
|
||||
enum InventoryType : int {
|
||||
InvTypePossessions = InvTypeBegin,
|
||||
InvTypeBank,
|
||||
InvTypeSharedBank,
|
||||
InvTypeTrade,
|
||||
InvTypeWorld,
|
||||
InvTypeLimbo,
|
||||
InvTypeTribute,
|
||||
InvTypeGuildTribute,
|
||||
InvTypeMerchant,
|
||||
InvTypeCorpse,
|
||||
InvTypeBazaar,
|
||||
InvTypeInspect,
|
||||
InvTypeViewMODPC,
|
||||
InvTypeViewMODBank,
|
||||
InvTypeViewMODSharedBank,
|
||||
InvTypeViewMODLimbo,
|
||||
InvTypeAltStorage,
|
||||
InvTypeArchived,
|
||||
InvTypeOther,
|
||||
InvTypeCount
|
||||
};
|
||||
} // namespace enum_
|
||||
using namespace enum_;
|
||||
|
||||
const int16 POSSESSIONS_SIZE = 32;
|
||||
const int16 BANK_SIZE = 24;
|
||||
const int16 SHARED_BANK_SIZE = 2;
|
||||
const int16 TRADE_SIZE = 8;
|
||||
const int16 WORLD_SIZE = 10;
|
||||
const int16 LIMBO_SIZE = 36;
|
||||
const int16 TRIBUTE_SIZE = 5;
|
||||
const int16 GUILD_TRIBUTE_SIZE = 2;
|
||||
const int16 MERCHANT_SIZE = 80;
|
||||
const int16 CORPSE_SIZE = POSSESSIONS_SIZE;
|
||||
const int16 BAZAAR_SIZE = 80;
|
||||
const int16 INSPECT_SIZE = 23;
|
||||
const int16 VIEW_MOD_PC_SIZE = POSSESSIONS_SIZE;
|
||||
const int16 VIEW_MOD_BANK_SIZE = BANK_SIZE;
|
||||
const int16 VIEW_MOD_SHARED_BANK_SIZE = SHARED_BANK_SIZE;
|
||||
const int16 VIEW_MOD_LIMBO_SIZE = LIMBO_SIZE;
|
||||
const int16 ALT_STORAGE_SIZE = 0;//unknown - "Shroud Bank"
|
||||
const int16 ARCHIVED_SIZE = 0;//unknown
|
||||
const int16 OTHER_SIZE = 0;//unknown
|
||||
|
||||
const int16 TRADE_NPC_SIZE = 4; // defined by implication
|
||||
|
||||
const int16 TYPE_INVALID = IINVALID;
|
||||
const int16 TYPE_BEGIN = typePossessions;
|
||||
const int16 TYPE_END = typeOther;
|
||||
const int16 TYPE_COUNT = (TYPE_END - TYPE_BEGIN) + 1;
|
||||
|
||||
int16 GetInvTypeSize(int16 inv_type);
|
||||
const char* GetInvTypeName(int16 inv_type);
|
||||
|
||||
bool IsInvTypePersistent(int16 inv_type);
|
||||
|
||||
} /*invtype*/
|
||||
|
||||
namespace invslot {
|
||||
inline EQEmu::versions::ClientVersion GetInvSlotRef() { return EQEmu::versions::ClientVersion::SoF; }
|
||||
|
||||
enum : int { InvSlotInvalid = -1, InvSlotBegin };
|
||||
namespace enum_ {
|
||||
enum InventorySlots : int16 {
|
||||
slotCharm = INULL,
|
||||
slotEar1,
|
||||
slotHead,
|
||||
slotFace,
|
||||
slotEar2,
|
||||
slotNeck,
|
||||
slotShoulders,
|
||||
slotArms,
|
||||
slotBack,
|
||||
slotWrist1,
|
||||
slotWrist2,
|
||||
slotRange,
|
||||
slotHands,
|
||||
slotPrimary,
|
||||
slotSecondary,
|
||||
slotFinger1,
|
||||
slotFinger2,
|
||||
slotChest,
|
||||
slotLegs,
|
||||
slotFeet,
|
||||
slotWaist,
|
||||
slotPowerSource,
|
||||
slotAmmo,
|
||||
slotGeneral1,
|
||||
slotGeneral2,
|
||||
slotGeneral3,
|
||||
slotGeneral4,
|
||||
slotGeneral5,
|
||||
slotGeneral6,
|
||||
slotGeneral7,
|
||||
slotGeneral8,
|
||||
slotCursor
|
||||
};
|
||||
|
||||
enum PossessionsSlot : int {
|
||||
PossessionsCharm = InvSlotBegin,
|
||||
PossessionsEar1,
|
||||
PossessionsHead,
|
||||
PossessionsFace,
|
||||
PossessionsEar2,
|
||||
PossessionsNeck,
|
||||
PossessionsShoulders,
|
||||
PossessionsArms,
|
||||
PossessionsBack,
|
||||
PossessionsWrist1,
|
||||
PossessionsWrist2,
|
||||
PossessionsRange,
|
||||
PossessionsHands,
|
||||
PossessionsPrimary,
|
||||
PossessionsSecondary,
|
||||
PossessionsFinger1,
|
||||
PossessionsFinger2,
|
||||
PossessionsChest,
|
||||
PossessionsLegs,
|
||||
PossessionsFeet,
|
||||
PossessionsWaist,
|
||||
PossessionsPowerSource,
|
||||
PossessionsAmmo,
|
||||
PossessionsGeneral1,
|
||||
PossessionsGeneral2,
|
||||
PossessionsGeneral3,
|
||||
PossessionsGeneral4,
|
||||
PossessionsGeneral5,
|
||||
PossessionsGeneral6,
|
||||
PossessionsGeneral7,
|
||||
PossessionsGeneral8,
|
||||
PossessionsCursor,
|
||||
PossessionsCount
|
||||
};
|
||||
} // namespace enum_
|
||||
using namespace enum_;
|
||||
|
||||
const int EquipmentBegin = PossessionsCharm;
|
||||
const int EquipmentEnd = PossessionsAmmo;
|
||||
const int EquipmentCount = (EquipmentEnd - EquipmentBegin + 1);
|
||||
const int16 SLOT_INVALID = IINVALID;
|
||||
const int16 SLOT_BEGIN = INULL;
|
||||
|
||||
const int GeneralBegin = PossessionsGeneral1;
|
||||
const int GeneralEnd = PossessionsGeneral8;
|
||||
const int GeneralCount = (GeneralEnd - GeneralBegin + 1);
|
||||
const int16 POSSESSIONS_BEGIN = slotCharm;
|
||||
const int16 POSSESSIONS_END = slotCursor;
|
||||
const int16 POSSESSIONS_COUNT = (POSSESSIONS_END - POSSESSIONS_BEGIN) + 1;
|
||||
|
||||
const int16 EQUIPMENT_BEGIN = slotCharm;
|
||||
const int16 EQUIPMENT_END = slotAmmo;
|
||||
const int16 EQUIPMENT_COUNT = (EQUIPMENT_END - EQUIPMENT_BEGIN + 1);
|
||||
|
||||
const int16 GENERAL_BEGIN = slotGeneral1;
|
||||
const int16 GENERAL_END = slotGeneral8;
|
||||
const int16 GENERAL_COUNT = (GENERAL_END - GENERAL_BEGIN + 1);
|
||||
|
||||
const int16 BONUS_BEGIN = invslot::slotCharm;
|
||||
const int16 BONUS_STAT_END = invslot::slotPowerSource;
|
||||
const int16 BONUS_SKILL_END = invslot::slotAmmo;
|
||||
|
||||
const int16 BANK_BEGIN = 2000;
|
||||
const int16 BANK_END = (BANK_BEGIN + invtype::BANK_SIZE) - 1;
|
||||
|
||||
const int16 SHARED_BANK_BEGIN = 2500;
|
||||
const int16 SHARED_BANK_END = (SHARED_BANK_BEGIN + invtype::SHARED_BANK_SIZE) - 1;
|
||||
|
||||
const int16 TRADE_BEGIN = 3000;
|
||||
const int16 TRADE_END = (TRADE_BEGIN + invtype::TRADE_SIZE) - 1;
|
||||
|
||||
const int16 TRADE_NPC_END = (TRADE_BEGIN + invtype::TRADE_NPC_SIZE) - 1; // defined by implication
|
||||
|
||||
const int16 WORLD_BEGIN = 4000;
|
||||
const int16 WORLD_END = (WORLD_BEGIN + invtype::WORLD_SIZE) - 1;
|
||||
|
||||
const int16 TRIBUTE_BEGIN = 400;
|
||||
const int16 TRIBUTE_END = (TRIBUTE_BEGIN + invtype::TRIBUTE_SIZE) - 1;
|
||||
|
||||
const int16 GUILD_TRIBUTE_BEGIN = 450;
|
||||
const int16 GUILD_TRIBUTE_END = (GUILD_TRIBUTE_BEGIN + invtype::GUILD_TRIBUTE_SIZE) - 1;
|
||||
|
||||
const int16 CORPSE_BEGIN = invslot::slotGeneral1;
|
||||
const int16 CORPSE_END = invslot::slotGeneral1 + invslot::slotCursor;
|
||||
|
||||
const uint64 POSSESSIONS_BITMASK = 0x000000027FFFFFFF; // based on 34-slot count (RoF+)
|
||||
const uint64 CORPSE_BITMASK = 0x01FFFFFE7F800000; // based on 34-slot count (RoF+)
|
||||
|
||||
const char* GetInvPossessionsSlotName(int16 inv_slot);
|
||||
const char* GetInvCorpseSlotName(int16 inv_slot);
|
||||
const char* GetInvSlotName(int16 inv_type, int16 inv_slot);
|
||||
|
||||
} /*invslot*/
|
||||
|
||||
namespace invbag {
|
||||
inline EQEmu::versions::ClientVersion GetInvBagRef() { return EQEmu::versions::ClientVersion::SoF; }
|
||||
|
||||
enum : int { InvBagInvalid = -1, InvBagBegin };
|
||||
const int16 SLOT_INVALID = IINVALID;
|
||||
const int16 SLOT_BEGIN = INULL;
|
||||
const int16 SLOT_END = 9;
|
||||
const int16 SLOT_COUNT = 10;
|
||||
|
||||
const int16 GENERAL_BAGS_BEGIN = 262;
|
||||
const int16 GENERAL_BAGS_COUNT = invslot::GENERAL_COUNT * SLOT_COUNT;
|
||||
const int16 GENERAL_BAGS_END = (GENERAL_BAGS_BEGIN + GENERAL_BAGS_COUNT) - 1;
|
||||
|
||||
const int16 CURSOR_BAG_BEGIN = 342;
|
||||
const int16 CURSOR_BAG_COUNT = SLOT_COUNT;
|
||||
const int16 CURSOR_BAG_END = (CURSOR_BAG_BEGIN + CURSOR_BAG_COUNT) - 1;
|
||||
|
||||
const int16 BANK_BAGS_BEGIN = 2032;
|
||||
const int16 BANK_BAGS_COUNT = (invtype::BANK_SIZE * SLOT_COUNT);
|
||||
const int16 BANK_BAGS_END = (BANK_BAGS_BEGIN + BANK_BAGS_COUNT) - 1;
|
||||
|
||||
const int16 SHARED_BANK_BAGS_BEGIN = 2532;
|
||||
const int16 SHARED_BANK_BAGS_COUNT = invtype::SHARED_BANK_SIZE * SLOT_COUNT;
|
||||
const int16 SHARED_BANK_BAGS_END = (SHARED_BANK_BAGS_BEGIN + SHARED_BANK_BAGS_COUNT) - 1;
|
||||
|
||||
const int16 TRADE_BAGS_BEGIN = 3031;
|
||||
const int16 TRADE_BAGS_COUNT = invtype::TRADE_SIZE * SLOT_COUNT;
|
||||
const int16 TRADE_BAGS_END = (TRADE_BAGS_BEGIN + TRADE_BAGS_COUNT) - 1;
|
||||
|
||||
const char* GetInvBagIndexName(int16 bag_index);
|
||||
|
||||
} /*invbag*/
|
||||
|
||||
namespace invaug {
|
||||
inline EQEmu::versions::ClientVersion GetInvAugRef() { return EQEmu::versions::ClientVersion::SoF; }
|
||||
|
||||
enum : int { InvAugInvalid = -1, InvAugBegin };
|
||||
const int16 SOCKET_INVALID = IINVALID;
|
||||
const int16 SOCKET_BEGIN = INULL;
|
||||
const int16 SOCKET_END = 4;
|
||||
const int16 SOCKET_COUNT = 5;
|
||||
|
||||
const char* GetInvAugIndexName(int16 aug_index);
|
||||
|
||||
} /*invaug*/
|
||||
|
||||
@@ -153,147 +263,21 @@ namespace SoF
|
||||
namespace profile {
|
||||
inline EQEmu::versions::ClientVersion GetProfileRef() { return EQEmu::versions::ClientVersion::SoF; }
|
||||
|
||||
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
|
||||
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
||||
|
||||
const int16 POTION_BELT_SIZE = 5;
|
||||
|
||||
const int16 SKILL_ARRAY_SIZE = 100;
|
||||
|
||||
} /*profile*/
|
||||
|
||||
namespace constants {
|
||||
inline EQEmu::versions::ClientVersion GetConstantsRef() { return EQEmu::versions::ClientVersion::SoF; }
|
||||
|
||||
} /*constants*/
|
||||
const size_t CHARACTER_CREATION_LIMIT = 12;
|
||||
|
||||
namespace behavior {
|
||||
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::SoF; }
|
||||
|
||||
} /*behavior*/
|
||||
|
||||
namespace skills {
|
||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::SoF; }
|
||||
|
||||
} /*skills*/
|
||||
|
||||
|
||||
// declarations
|
||||
namespace inventory {
|
||||
const bool ConcatenateInvTypeLimbo = true;
|
||||
|
||||
const bool AllowOverLevelEquipment = false;
|
||||
|
||||
const bool AllowEmptyBagInBag = false;
|
||||
const bool AllowClickCastFromBag = false;
|
||||
|
||||
} /*inventory*/
|
||||
|
||||
namespace invtype {
|
||||
const size_t InvTypePossessionsSize = invslot::PossessionsCount;
|
||||
const size_t InvTypeBankSize = 24;
|
||||
const size_t InvTypeSharedBankSize = 2;
|
||||
const size_t InvTypeTradeSize = 8;
|
||||
const size_t InvTypeWorldSize = 10;
|
||||
const size_t InvTypeLimboSize = 36;
|
||||
const size_t InvTypeTributeSize = 5;
|
||||
const size_t InvTypeGuildTributeSize = 2;
|
||||
const size_t InvTypeMerchantSize = 80;
|
||||
const size_t InvTypeCorpseSize = InvTypePossessionsSize;
|
||||
const size_t InvTypeBazaarSize = 80;
|
||||
const size_t InvTypeInspectSize = invslot::EquipmentCount;
|
||||
const size_t InvTypeViewMODPCSize = InvTypePossessionsSize;
|
||||
const size_t InvTypeViewMODBankSize = InvTypeBankSize;
|
||||
const size_t InvTypeViewMODSharedBankSize = InvTypeSharedBankSize;
|
||||
const size_t InvTypeViewMODLimboSize = InvTypeLimboSize;
|
||||
const size_t InvTypeAltStorageSize = 0;//unknown - "Shroud Bank"
|
||||
const size_t InvTypeArchivedSize = 0;//unknown
|
||||
const size_t InvTypeOtherSize = 0;//unknown
|
||||
|
||||
extern size_t GetInvTypeSize(int inv_type);
|
||||
extern const char* GetInvTypeName(int inv_type);
|
||||
|
||||
extern bool IsInvTypePersistent(int inv_type);
|
||||
|
||||
} /*invtype*/
|
||||
|
||||
namespace invslot {
|
||||
const int BankBegin = 2000;
|
||||
const int BankEnd = (BankBegin + invtype::InvTypeBankSize) - 1;
|
||||
|
||||
const int SharedBankBegin = 2500;
|
||||
const int SharedBankEnd = (SharedBankBegin + invtype::InvTypeSharedBankSize) - 1;
|
||||
|
||||
const int TradeBegin = 3000;
|
||||
const int TradeEnd = (TradeBegin + invtype::InvTypeTradeSize) - 1;
|
||||
const int TradeNPCEnd = 3003;
|
||||
|
||||
const int WorldBegin = 4000;
|
||||
const int WorldEnd = (WorldBegin + invtype::InvTypeWorldSize) - 1;
|
||||
|
||||
const int TributeBegin = 400;
|
||||
const int TributeEnd = (TributeBegin + invtype::InvTypeTributeSize) - 1;
|
||||
|
||||
const int GuildTributeBegin = 450;
|
||||
const int GuildTributeEnd = (GuildTributeBegin + invtype::InvTypeGuildTributeSize) - 1;
|
||||
|
||||
const int CorpseBegin = PossessionsGeneral1;
|
||||
const int CorpseEnd = PossessionsGeneral1 + PossessionsCursor;
|
||||
|
||||
extern const char* GetInvPossessionsSlotName(int inv_slot);
|
||||
extern const char* GetInvCorpseSlotName(int inv_slot);
|
||||
extern const char* GetInvSlotName(int inv_type, int inv_slot);
|
||||
|
||||
} /*invslot*/
|
||||
|
||||
namespace invbag {
|
||||
const size_t ItemBagSize = 10;
|
||||
|
||||
const int GeneralBagsBegin = 262;
|
||||
const int GeneralBagsSize = invslot::GeneralCount * ItemBagSize;
|
||||
const int GeneralBagsEnd = (GeneralBagsBegin + GeneralBagsSize) - 1;
|
||||
|
||||
const int CursorBagBegin = 342;
|
||||
const int CursorBagSize = ItemBagSize;
|
||||
const int CursorBagEnd = (CursorBagBegin + CursorBagSize) - 1;
|
||||
|
||||
const int BankBagsBegin = 2032;
|
||||
const int BankBagsSize = (invtype::InvTypeBankSize * ItemBagSize);
|
||||
const int BankBagsEnd = (BankBagsBegin + BankBagsSize) - 1;
|
||||
|
||||
const int SharedBankBagsBegin = 2532;
|
||||
const int SharedBankBagsSize = invtype::InvTypeSharedBankSize * ItemBagSize;
|
||||
const int SharedBankBagsEnd = (SharedBankBagsBegin + SharedBankBagsSize) - 1;
|
||||
|
||||
const int TradeBagsBegin = 3031;
|
||||
const int TradeBagsSize = invtype::InvTypeTradeSize * ItemBagSize;
|
||||
const int TradeBagsEnd = (TradeBagsBegin + TradeBagsSize) - 1;
|
||||
|
||||
extern const char* GetInvBagIndexName(int bag_index);
|
||||
|
||||
} /*invbag*/
|
||||
|
||||
namespace invaug {
|
||||
const size_t ItemAugSize = 5;
|
||||
|
||||
extern const char* GetInvAugIndexName(int aug_index);
|
||||
|
||||
} /*invaug*/
|
||||
|
||||
namespace item {
|
||||
|
||||
} /*item*/
|
||||
|
||||
namespace profile {
|
||||
const size_t TributeSize = invtype::InvTypeTributeSize;
|
||||
const size_t GuildTributeSize = invtype::InvTypeGuildTributeSize;
|
||||
|
||||
const size_t BandoliersSize = 20; // number of bandolier instances
|
||||
const size_t BandolierItemCount = 4; // number of equipment slots in bandolier instance
|
||||
|
||||
const size_t PotionBeltSize = 5;
|
||||
|
||||
const size_t SkillArraySize = 100;
|
||||
|
||||
} /*profile*/
|
||||
|
||||
namespace constants {
|
||||
const size_t CharacterCreationLimit = 12;
|
||||
|
||||
const size_t SayLinkBodySize = 50;
|
||||
const size_t SAY_LINK_BODY_SIZE = 50;
|
||||
|
||||
const int LongBuffs = 25;
|
||||
const int ShortBuffs = 15;
|
||||
@@ -306,11 +290,15 @@ namespace SoF
|
||||
} /*constants*/
|
||||
|
||||
namespace behavior {
|
||||
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::SoF; }
|
||||
|
||||
const bool CoinHasWeight = true;
|
||||
|
||||
} /*behavior*/
|
||||
|
||||
namespace skills {
|
||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::SoF; }
|
||||
|
||||
const size_t LastUsableSkill = EQEmu::skills::SkillTripleAttack;
|
||||
|
||||
} /*skills*/
|
||||
|
||||
@@ -62,7 +62,6 @@ E(OP_MoveItem)
|
||||
E(OP_NewSpawn)
|
||||
E(OP_NewZone)
|
||||
E(OP_OnLevelMessage)
|
||||
E(OP_OpenNewTasksWindow)
|
||||
E(OP_PetBuffWindow)
|
||||
E(OP_PlayerProfile)
|
||||
E(OP_RaidJoin)
|
||||
|
||||
@@ -717,7 +717,7 @@ struct BandolierItem_Struct
|
||||
struct Bandolier_Struct
|
||||
{
|
||||
char Name[32];
|
||||
BandolierItem_Struct Items[profile::BandolierItemCount];
|
||||
BandolierItem_Struct Items[profile::BANDOLIER_ITEM_COUNT];
|
||||
};
|
||||
|
||||
//len = 72
|
||||
@@ -731,7 +731,7 @@ struct PotionBeltItem_Struct
|
||||
//len = 288
|
||||
struct PotionBelt_Struct
|
||||
{
|
||||
PotionBeltItem_Struct Items[profile::PotionBeltSize];
|
||||
PotionBeltItem_Struct Items[profile::POTION_BELT_SIZE];
|
||||
};
|
||||
|
||||
static const uint32 MAX_GROUP_LEADERSHIP_AA_ARRAY = 16;
|
||||
@@ -937,7 +937,7 @@ struct PlayerProfile_Struct //23576 Octets
|
||||
/*08288*/ uint32 aapoints_spent; // Number of spent AA points
|
||||
/*08292*/ uint32 aapoints; // Unspent AA points
|
||||
/*08296*/ uint8 unknown06160[4];
|
||||
/*08300*/ Bandolier_Struct bandoliers[profile::BandoliersSize]; // [6400] bandolier contents
|
||||
/*08300*/ Bandolier_Struct bandoliers[profile::BANDOLIERS_SIZE]; // [6400] bandolier contents
|
||||
/*14700*/ PotionBelt_Struct potionbelt; // [360] potion belt 72 extra octets by adding 1 more belt slot
|
||||
/*15060*/ uint8 unknown12852[8];
|
||||
/*15068*/ uint32 available_slots;
|
||||
|
||||
+17
-13
@@ -1051,18 +1051,18 @@ namespace Titanium
|
||||
// OUT(unknown06160[4]);
|
||||
|
||||
// Copy bandoliers where server and client indexes converge
|
||||
for (r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < profile::BandoliersSize; ++r) {
|
||||
for (r = 0; r < EQEmu::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
|
||||
OUT_str(bandoliers[r].Name);
|
||||
for (uint32 k = 0; k < profile::BandolierItemCount; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||
OUT(bandoliers[r].Items[k].ID);
|
||||
OUT(bandoliers[r].Items[k].Icon);
|
||||
OUT_str(bandoliers[r].Items[k].Name);
|
||||
}
|
||||
}
|
||||
// Nullify bandoliers where server and client indexes diverge, with a client bias
|
||||
for (r = EQEmu::legacy::BANDOLIERS_SIZE; r < profile::BandoliersSize; ++r) {
|
||||
for (r = EQEmu::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
|
||||
eq->bandoliers[r].Name[0] = '\0';
|
||||
for (uint32 k = 0; k < profile::BandolierItemCount; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||
eq->bandoliers[r].Items[k].ID = 0;
|
||||
eq->bandoliers[r].Items[k].Icon = 0;
|
||||
eq->bandoliers[r].Items[k].Name[0] = '\0';
|
||||
@@ -1072,13 +1072,13 @@ namespace Titanium
|
||||
// OUT(unknown07444[5120]);
|
||||
|
||||
// Copy potion belt where server and client indexes converge
|
||||
for (r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < profile::PotionBeltSize; ++r) {
|
||||
for (r = 0; r < EQEmu::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
|
||||
OUT(potionbelt.Items[r].ID);
|
||||
OUT(potionbelt.Items[r].Icon);
|
||||
OUT_str(potionbelt.Items[r].Name);
|
||||
}
|
||||
// Nullify potion belt where server and client indexes diverge, with a client bias
|
||||
for (r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < profile::PotionBeltSize; ++r) {
|
||||
for (r = EQEmu::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
|
||||
eq->potionbelt.Items[r].ID = 0;
|
||||
eq->potionbelt.Items[r].Icon = 0;
|
||||
eq->potionbelt.Items[r].Name[0] = '\0';
|
||||
@@ -1459,13 +1459,16 @@ namespace Titanium
|
||||
InBuffer += description_size;
|
||||
InBuffer += sizeof(TaskDescriptionData2_Struct);
|
||||
|
||||
std::string old_message = InBuffer; // start 'Reward' as string
|
||||
uint32 reward_size = strlen(InBuffer) + 1;
|
||||
InBuffer += reward_size;
|
||||
|
||||
std::string old_message = InBuffer; // start item link string
|
||||
std::string new_message;
|
||||
ServerToTitaniumSayLink(new_message, old_message);
|
||||
|
||||
in->size = sizeof(TaskDescriptionHeader_Struct) + sizeof(TaskDescriptionData1_Struct) +
|
||||
sizeof(TaskDescriptionData2_Struct) + sizeof(TaskDescriptionTrailer_Struct) +
|
||||
title_size + description_size + new_message.length() + 1;
|
||||
title_size + description_size + reward_size + new_message.length() + 1;
|
||||
|
||||
in->pBuffer = new unsigned char[in->size];
|
||||
|
||||
@@ -1479,6 +1482,7 @@ namespace Titanium
|
||||
InBuffer += strlen(InBuffer) + 1;
|
||||
|
||||
memcpy(OutBuffer, InBuffer, sizeof(TaskDescriptionTrailer_Struct));
|
||||
// we have an extra DWORD in the trailer struct, client should ignore it so w/e
|
||||
|
||||
delete[] __emu_buffer;
|
||||
dest->FastQueuePacket(&in, ack_req);
|
||||
@@ -2442,7 +2446,7 @@ namespace Titanium
|
||||
ob << StringFormat("%.*s\"", depth, protection); // Quotes (and protection, if needed) around static data
|
||||
|
||||
// Sub data
|
||||
for (int index = EQEmu::inventory::containerBegin; index < invbag::ItemBagSize; ++index) {
|
||||
for (int index = EQEmu::invbag::SLOT_BEGIN; index <= invbag::SLOT_END; ++index) {
|
||||
ob << '|';
|
||||
|
||||
EQEmu::ItemInstance* sub = inst->GetItem(index);
|
||||
@@ -2490,7 +2494,7 @@ namespace Titanium
|
||||
|
||||
static inline void ServerToTitaniumSayLink(std::string& titaniumSayLink, const std::string& serverSayLink)
|
||||
{
|
||||
if ((constants::SayLinkBodySize == EQEmu::constants::SayLinkBodySize) || (serverSayLink.find('\x12') == std::string::npos)) {
|
||||
if ((constants::SAY_LINK_BODY_SIZE == EQEmu::constants::SAY_LINK_BODY_SIZE) || (serverSayLink.find('\x12') == std::string::npos)) {
|
||||
titaniumSayLink = serverSayLink;
|
||||
return;
|
||||
}
|
||||
@@ -2499,7 +2503,7 @@ namespace Titanium
|
||||
|
||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||
if (segment_iter & 1) {
|
||||
if (segments[segment_iter].length() <= EQEmu::constants::SayLinkBodySize) {
|
||||
if (segments[segment_iter].length() <= EQEmu::constants::SAY_LINK_BODY_SIZE) {
|
||||
titaniumSayLink.append(segments[segment_iter]);
|
||||
// TODO: log size mismatch error
|
||||
continue;
|
||||
@@ -2530,7 +2534,7 @@ namespace Titanium
|
||||
|
||||
static inline void TitaniumToServerSayLink(std::string& serverSayLink, const std::string& titaniumSayLink)
|
||||
{
|
||||
if ((EQEmu::constants::SayLinkBodySize == constants::SayLinkBodySize) || (titaniumSayLink.find('\x12') == std::string::npos)) {
|
||||
if ((EQEmu::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (titaniumSayLink.find('\x12') == std::string::npos)) {
|
||||
serverSayLink = titaniumSayLink;
|
||||
return;
|
||||
}
|
||||
@@ -2539,7 +2543,7 @@ namespace Titanium
|
||||
|
||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||
if (segment_iter & 1) {
|
||||
if (segments[segment_iter].length() <= constants::SayLinkBodySize) {
|
||||
if (segments[segment_iter].length() <= constants::SAY_LINK_BODY_SIZE) {
|
||||
serverSayLink.append(segments[segment_iter]);
|
||||
// TODO: log size mismatch error
|
||||
continue;
|
||||
|
||||
+118
-118
@@ -22,196 +22,196 @@
|
||||
#include "../string_util.h"
|
||||
|
||||
|
||||
size_t Titanium::invtype::GetInvTypeSize(int inv_type)
|
||||
int16 Titanium::invtype::GetInvTypeSize(int16 inv_type)
|
||||
{
|
||||
switch (inv_type) {
|
||||
case invtype::InvTypePossessions:
|
||||
return invtype::InvTypePossessionsSize;
|
||||
case invtype::InvTypeBank:
|
||||
return invtype::InvTypeBankSize;
|
||||
case invtype::InvTypeSharedBank:
|
||||
return invtype::InvTypeSharedBankSize;
|
||||
case invtype::InvTypeTrade:
|
||||
return invtype::InvTypeTradeSize;
|
||||
case invtype::InvTypeWorld:
|
||||
return invtype::InvTypeWorldSize;
|
||||
case invtype::InvTypeLimbo:
|
||||
return invtype::InvTypeLimboSize;
|
||||
case invtype::InvTypeTribute:
|
||||
return invtype::InvTypeTributeSize;
|
||||
case invtype::InvTypeGuildTribute:
|
||||
return invtype::InvTypeGuildTributeSize;
|
||||
case invtype::InvTypeMerchant:
|
||||
return invtype::InvTypeMerchantSize;
|
||||
case invtype::InvTypeCorpse:
|
||||
return invtype::InvTypeCorpseSize;
|
||||
case invtype::InvTypeBazaar:
|
||||
return invtype::InvTypeBazaarSize;
|
||||
case invtype::InvTypeInspect:
|
||||
return invtype::InvTypeInspectSize;
|
||||
case invtype::InvTypeViewMODPC:
|
||||
return invtype::InvTypeViewMODPCSize;
|
||||
case invtype::InvTypeViewMODBank:
|
||||
return invtype::InvTypeViewMODBankSize;
|
||||
case invtype::InvTypeViewMODSharedBank:
|
||||
return invtype::InvTypeViewMODSharedBankSize;
|
||||
case invtype::InvTypeViewMODLimbo:
|
||||
return invtype::InvTypeViewMODLimboSize;
|
||||
case invtype::InvTypeAltStorage:
|
||||
return invtype::InvTypeAltStorageSize;
|
||||
case invtype::InvTypeArchived:
|
||||
return invtype::InvTypeArchivedSize;
|
||||
case invtype::InvTypeOther:
|
||||
return invtype::InvTypeOtherSize;
|
||||
case invtype::typePossessions:
|
||||
return invtype::POSSESSIONS_SIZE;
|
||||
case invtype::typeBank:
|
||||
return invtype::BANK_SIZE;
|
||||
case invtype::typeSharedBank:
|
||||
return invtype::SHARED_BANK_SIZE;
|
||||
case invtype::typeTrade:
|
||||
return invtype::TRADE_SIZE;
|
||||
case invtype::typeWorld:
|
||||
return invtype::WORLD_SIZE;
|
||||
case invtype::typeLimbo:
|
||||
return invtype::LIMBO_SIZE;
|
||||
case invtype::typeTribute:
|
||||
return invtype::TRIBUTE_SIZE;
|
||||
case invtype::typeGuildTribute:
|
||||
return invtype::GUILD_TRIBUTE_SIZE;
|
||||
case invtype::typeMerchant:
|
||||
return invtype::MERCHANT_SIZE;
|
||||
case invtype::typeCorpse:
|
||||
return invtype::CORPSE_SIZE;
|
||||
case invtype::typeBazaar:
|
||||
return invtype::BAZAAR_SIZE;
|
||||
case invtype::typeInspect:
|
||||
return invtype::INSPECT_SIZE;
|
||||
case invtype::typeViewMODPC:
|
||||
return invtype::VIEW_MOD_PC_SIZE;
|
||||
case invtype::typeViewMODBank:
|
||||
return invtype::VIEW_MOD_BANK_SIZE;
|
||||
case invtype::typeViewMODSharedBank:
|
||||
return invtype::VIEW_MOD_SHARED_BANK_SIZE;
|
||||
case invtype::typeViewMODLimbo:
|
||||
return invtype::VIEW_MOD_LIMBO_SIZE;
|
||||
case invtype::typeAltStorage:
|
||||
return invtype::ALT_STORAGE_SIZE;
|
||||
case invtype::typeArchived:
|
||||
return invtype::ARCHIVED_SIZE;
|
||||
case invtype::typeOther:
|
||||
return invtype::OTHER_SIZE;
|
||||
default:
|
||||
return 0;
|
||||
return INULL;
|
||||
}
|
||||
}
|
||||
|
||||
const char* Titanium::invtype::GetInvTypeName(int inv_type)
|
||||
const char* Titanium::invtype::GetInvTypeName(int16 inv_type)
|
||||
{
|
||||
switch (inv_type) {
|
||||
case invtype::InvTypeInvalid:
|
||||
case invtype::TYPE_INVALID:
|
||||
return "Invalid Type";
|
||||
case invtype::InvTypePossessions:
|
||||
case invtype::typePossessions:
|
||||
return "Possessions";
|
||||
case invtype::InvTypeBank:
|
||||
case invtype::typeBank:
|
||||
return "Bank";
|
||||
case invtype::InvTypeSharedBank:
|
||||
case invtype::typeSharedBank:
|
||||
return "Shared Bank";
|
||||
case invtype::InvTypeTrade:
|
||||
case invtype::typeTrade:
|
||||
return "Trade";
|
||||
case invtype::InvTypeWorld:
|
||||
case invtype::typeWorld:
|
||||
return "World";
|
||||
case invtype::InvTypeLimbo:
|
||||
case invtype::typeLimbo:
|
||||
return "Limbo";
|
||||
case invtype::InvTypeTribute:
|
||||
case invtype::typeTribute:
|
||||
return "Tribute";
|
||||
case invtype::InvTypeGuildTribute:
|
||||
case invtype::typeGuildTribute:
|
||||
return "Guild Tribute";
|
||||
case invtype::InvTypeMerchant:
|
||||
case invtype::typeMerchant:
|
||||
return "Merchant";
|
||||
case invtype::InvTypeCorpse:
|
||||
case invtype::typeCorpse:
|
||||
return "Corpse";
|
||||
case invtype::InvTypeBazaar:
|
||||
case invtype::typeBazaar:
|
||||
return "Bazaar";
|
||||
case invtype::InvTypeInspect:
|
||||
case invtype::typeInspect:
|
||||
return "Inspect";
|
||||
case invtype::InvTypeViewMODPC:
|
||||
case invtype::typeViewMODPC:
|
||||
return "View MOD PC";
|
||||
case invtype::InvTypeViewMODBank:
|
||||
case invtype::typeViewMODBank:
|
||||
return "View MOD Bank";
|
||||
case invtype::InvTypeViewMODSharedBank:
|
||||
case invtype::typeViewMODSharedBank:
|
||||
return "View MOD Shared Bank";
|
||||
case invtype::InvTypeViewMODLimbo:
|
||||
case invtype::typeViewMODLimbo:
|
||||
return "View MOD Limbo";
|
||||
case invtype::InvTypeAltStorage:
|
||||
case invtype::typeAltStorage:
|
||||
return "Alt Storage";
|
||||
case invtype::InvTypeArchived:
|
||||
case invtype::typeArchived:
|
||||
return "Archived";
|
||||
case invtype::InvTypeOther:
|
||||
case invtype::typeOther:
|
||||
return "Other";
|
||||
default:
|
||||
return "Unknown Type";
|
||||
}
|
||||
}
|
||||
|
||||
bool Titanium::invtype::IsInvTypePersistent(int inv_type)
|
||||
bool Titanium::invtype::IsInvTypePersistent(int16 inv_type)
|
||||
{
|
||||
switch (inv_type) {
|
||||
case invtype::InvTypePossessions:
|
||||
case invtype::InvTypeBank:
|
||||
case invtype::InvTypeSharedBank:
|
||||
case invtype::InvTypeTrade:
|
||||
case invtype::InvTypeWorld:
|
||||
case invtype::InvTypeLimbo:
|
||||
case invtype::InvTypeTribute:
|
||||
case invtype::InvTypeGuildTribute:
|
||||
case invtype::typePossessions:
|
||||
case invtype::typeBank:
|
||||
case invtype::typeSharedBank:
|
||||
case invtype::typeTrade:
|
||||
case invtype::typeWorld:
|
||||
case invtype::typeLimbo:
|
||||
case invtype::typeTribute:
|
||||
case invtype::typeGuildTribute:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const char* Titanium::invslot::GetInvPossessionsSlotName(int inv_slot)
|
||||
const char* Titanium::invslot::GetInvPossessionsSlotName(int16 inv_slot)
|
||||
{
|
||||
switch (inv_slot) {
|
||||
case invslot::InvSlotInvalid:
|
||||
case invslot::SLOT_INVALID:
|
||||
return "Invalid Slot";
|
||||
case invslot::PossessionsCharm:
|
||||
case invslot::slotCharm:
|
||||
return "Charm";
|
||||
case invslot::PossessionsEar1:
|
||||
case invslot::slotEar1:
|
||||
return "Ear 1";
|
||||
case invslot::PossessionsHead:
|
||||
case invslot::slotHead:
|
||||
return "Head";
|
||||
case invslot::PossessionsFace:
|
||||
case invslot::slotFace:
|
||||
return "Face";
|
||||
case invslot::PossessionsEar2:
|
||||
case invslot::slotEar2:
|
||||
return "Ear 2";
|
||||
case invslot::PossessionsNeck:
|
||||
case invslot::slotNeck:
|
||||
return "Neck";
|
||||
case invslot::PossessionsShoulders:
|
||||
case invslot::slotShoulders:
|
||||
return "Shoulders";
|
||||
case invslot::PossessionsArms:
|
||||
case invslot::slotArms:
|
||||
return "Arms";
|
||||
case invslot::PossessionsBack:
|
||||
case invslot::slotBack:
|
||||
return "Back";
|
||||
case invslot::PossessionsWrist1:
|
||||
case invslot::slotWrist1:
|
||||
return "Wrist 1";
|
||||
case invslot::PossessionsWrist2:
|
||||
case invslot::slotWrist2:
|
||||
return "Wrist 2";
|
||||
case invslot::PossessionsRange:
|
||||
case invslot::slotRange:
|
||||
return "Range";
|
||||
case invslot::PossessionsHands:
|
||||
case invslot::slotHands:
|
||||
return "Hands";
|
||||
case invslot::PossessionsPrimary:
|
||||
case invslot::slotPrimary:
|
||||
return "Primary";
|
||||
case invslot::PossessionsSecondary:
|
||||
case invslot::slotSecondary:
|
||||
return "Secondary";
|
||||
case invslot::PossessionsFinger1:
|
||||
case invslot::slotFinger1:
|
||||
return "Finger 1";
|
||||
case invslot::PossessionsFinger2:
|
||||
case invslot::slotFinger2:
|
||||
return "Finger 2";
|
||||
case invslot::PossessionsChest:
|
||||
case invslot::slotChest:
|
||||
return "Chest";
|
||||
case invslot::PossessionsLegs:
|
||||
case invslot::slotLegs:
|
||||
return "Legs";
|
||||
case invslot::PossessionsFeet:
|
||||
case invslot::slotFeet:
|
||||
return "Feet";
|
||||
case invslot::PossessionsWaist:
|
||||
case invslot::slotWaist:
|
||||
return "Waist";
|
||||
case invslot::PossessionsAmmo:
|
||||
case invslot::slotAmmo:
|
||||
return "Ammo";
|
||||
case invslot::PossessionsGeneral1:
|
||||
case invslot::slotGeneral1:
|
||||
return "General 1";
|
||||
case invslot::PossessionsGeneral2:
|
||||
case invslot::slotGeneral2:
|
||||
return "General 2";
|
||||
case invslot::PossessionsGeneral3:
|
||||
case invslot::slotGeneral3:
|
||||
return "General 3";
|
||||
case invslot::PossessionsGeneral4:
|
||||
case invslot::slotGeneral4:
|
||||
return "General 4";
|
||||
case invslot::PossessionsGeneral5:
|
||||
case invslot::slotGeneral5:
|
||||
return "General 5";
|
||||
case invslot::PossessionsGeneral6:
|
||||
case invslot::slotGeneral6:
|
||||
return "General 6";
|
||||
case invslot::PossessionsGeneral7:
|
||||
case invslot::slotGeneral7:
|
||||
return "General 7";
|
||||
case invslot::PossessionsGeneral8:
|
||||
case invslot::slotGeneral8:
|
||||
return "General 8";
|
||||
case invslot::PossessionsCursor:
|
||||
case invslot::slotCursor:
|
||||
return "Cursor";
|
||||
default:
|
||||
return "Unknown Slot";
|
||||
}
|
||||
}
|
||||
|
||||
const char* Titanium::invslot::GetInvCorpseSlotName(int inv_slot)
|
||||
const char* Titanium::invslot::GetInvCorpseSlotName(int16 inv_slot)
|
||||
{
|
||||
if (!invtype::GetInvTypeSize(invtype::InvTypeCorpse) || inv_slot == invslot::InvSlotInvalid)
|
||||
if (!invtype::GetInvTypeSize(invtype::typeCorpse) || inv_slot == invslot::SLOT_INVALID)
|
||||
return "Invalid Slot";
|
||||
|
||||
// needs work
|
||||
if ((size_t)(inv_slot + 1) < invslot::CorpseBegin || (size_t)(inv_slot + 1) >= invslot::CorpseEnd)
|
||||
if ((inv_slot + 1) < invslot::CORPSE_BEGIN || (inv_slot + 1) >= invslot::CORPSE_END)
|
||||
return "Unknown Slot";
|
||||
|
||||
static std::string ret_str;
|
||||
@@ -220,19 +220,19 @@ const char* Titanium::invslot::GetInvCorpseSlotName(int inv_slot)
|
||||
return ret_str.c_str();
|
||||
}
|
||||
|
||||
const char* Titanium::invslot::GetInvSlotName(int inv_type, int inv_slot)
|
||||
const char* Titanium::invslot::GetInvSlotName(int16 inv_type, int16 inv_slot)
|
||||
{
|
||||
if (inv_type == invtype::InvTypePossessions)
|
||||
if (inv_type == invtype::typePossessions)
|
||||
return invslot::GetInvPossessionsSlotName(inv_slot);
|
||||
else if (inv_type == invtype::InvTypeCorpse)
|
||||
else if (inv_type == invtype::typeCorpse)
|
||||
return invslot::GetInvCorpseSlotName(inv_slot);
|
||||
|
||||
size_t type_size = invtype::GetInvTypeSize(inv_type);
|
||||
int16 type_size = invtype::GetInvTypeSize(inv_type);
|
||||
|
||||
if (!type_size || inv_slot == invslot::InvSlotInvalid)
|
||||
if (!type_size || inv_slot == invslot::SLOT_INVALID)
|
||||
return "Invalid Slot";
|
||||
|
||||
if ((size_t)(inv_slot + 1) >= type_size)
|
||||
if ((inv_slot + 1) >= type_size)
|
||||
return "Unknown Slot";
|
||||
|
||||
static std::string ret_str;
|
||||
@@ -241,12 +241,12 @@ const char* Titanium::invslot::GetInvSlotName(int inv_type, int inv_slot)
|
||||
return ret_str.c_str();
|
||||
}
|
||||
|
||||
const char* Titanium::invbag::GetInvBagIndexName(int bag_index)
|
||||
const char* Titanium::invbag::GetInvBagIndexName(int16 bag_index)
|
||||
{
|
||||
if (bag_index == invbag::InvBagInvalid)
|
||||
if (bag_index == invbag::SLOT_INVALID)
|
||||
return "Invalid Bag";
|
||||
|
||||
if ((size_t)bag_index >= invbag::ItemBagSize)
|
||||
if (bag_index >= invbag::SLOT_COUNT)
|
||||
return "Unknown Bag";
|
||||
|
||||
static std::string ret_str;
|
||||
@@ -255,12 +255,12 @@ const char* Titanium::invbag::GetInvBagIndexName(int bag_index)
|
||||
return ret_str.c_str();
|
||||
}
|
||||
|
||||
const char* Titanium::invaug::GetInvAugIndexName(int aug_index)
|
||||
const char* Titanium::invaug::GetInvAugIndexName(int16 aug_index)
|
||||
{
|
||||
if (aug_index == invaug::InvAugInvalid)
|
||||
if (aug_index == invaug::SOCKET_INVALID)
|
||||
return "Invalid Augment";
|
||||
|
||||
if ((size_t)aug_index >= invaug::ItemAugSize)
|
||||
if (aug_index >= invaug::SOCKET_COUNT)
|
||||
return "Unknown Augment";
|
||||
|
||||
static std::string ret_str;
|
||||
|
||||
+193
-205
@@ -27,107 +27,217 @@
|
||||
|
||||
namespace Titanium
|
||||
{
|
||||
enum : int { Invalid = -1, Null, Safety };
|
||||
const int16 IINVALID = -1;
|
||||
const int16 INULL = 0;
|
||||
|
||||
enum : bool { False = false, True = true };
|
||||
|
||||
// pre-declarations
|
||||
namespace inventory {
|
||||
inline EQEmu::versions::ClientVersion GetInventoryRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
||||
|
||||
const bool ConcatenateInvTypeLimbo = true;
|
||||
|
||||
const bool AllowOverLevelEquipment = false;
|
||||
|
||||
const bool AllowEmptyBagInBag = false;
|
||||
const bool AllowClickCastFromBag = false;
|
||||
|
||||
} /*inventory*/
|
||||
|
||||
namespace invtype {
|
||||
inline EQEmu::versions::ClientVersion GetInvTypeRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
||||
|
||||
enum : int { InvTypeInvalid = -1, InvTypeBegin };
|
||||
namespace enum_ {
|
||||
enum InventoryTypes : int16 {
|
||||
typePossessions = INULL,
|
||||
typeBank,
|
||||
typeSharedBank,
|
||||
typeTrade,
|
||||
typeWorld,
|
||||
typeLimbo,
|
||||
typeTribute,
|
||||
typeGuildTribute,
|
||||
typeMerchant,
|
||||
typeCorpse,
|
||||
typeBazaar,
|
||||
typeInspect,
|
||||
typeViewMODPC,
|
||||
typeViewMODBank,
|
||||
typeViewMODSharedBank,
|
||||
typeViewMODLimbo,
|
||||
typeAltStorage,
|
||||
typeArchived,
|
||||
typeOther
|
||||
};
|
||||
|
||||
enum InventoryType : int {
|
||||
InvTypePossessions = InvTypeBegin,
|
||||
InvTypeBank,
|
||||
InvTypeSharedBank,
|
||||
InvTypeTrade,
|
||||
InvTypeWorld,
|
||||
InvTypeLimbo,
|
||||
InvTypeTribute,
|
||||
InvTypeGuildTribute,
|
||||
InvTypeMerchant,
|
||||
InvTypeCorpse,
|
||||
InvTypeBazaar,
|
||||
InvTypeInspect,
|
||||
InvTypeViewMODPC,
|
||||
InvTypeViewMODBank,
|
||||
InvTypeViewMODSharedBank,
|
||||
InvTypeViewMODLimbo,
|
||||
InvTypeAltStorage,
|
||||
InvTypeArchived,
|
||||
InvTypeOther,
|
||||
InvTypeCount
|
||||
};
|
||||
} // namespace enum_
|
||||
using namespace enum_;
|
||||
|
||||
const int16 POSSESSIONS_SIZE = 31;
|
||||
const int16 BANK_SIZE = 16;
|
||||
const int16 SHARED_BANK_SIZE = 2;
|
||||
const int16 TRADE_SIZE = 8;
|
||||
const int16 WORLD_SIZE = 10;
|
||||
const int16 LIMBO_SIZE = 36;
|
||||
const int16 TRIBUTE_SIZE = 5;
|
||||
const int16 GUILD_TRIBUTE_SIZE = 2;
|
||||
const int16 MERCHANT_SIZE = 80;
|
||||
const int16 CORPSE_SIZE = POSSESSIONS_SIZE;
|
||||
const int16 BAZAAR_SIZE = 80;
|
||||
const int16 INSPECT_SIZE = 22;
|
||||
const int16 VIEW_MOD_PC_SIZE = POSSESSIONS_SIZE;
|
||||
const int16 VIEW_MOD_BANK_SIZE = BANK_SIZE;
|
||||
const int16 VIEW_MOD_SHARED_BANK_SIZE = SHARED_BANK_SIZE;
|
||||
const int16 VIEW_MOD_LIMBO_SIZE = LIMBO_SIZE;
|
||||
const int16 ALT_STORAGE_SIZE = 0;//unknown - "Shroud Bank"
|
||||
const int16 ARCHIVED_SIZE = 0;//unknown
|
||||
const int16 OTHER_SIZE = 0;//unknown
|
||||
|
||||
const int16 TRADE_NPC_SIZE = 4; // defined by implication
|
||||
|
||||
const int16 TYPE_INVALID = IINVALID;
|
||||
const int16 TYPE_BEGIN = typePossessions;
|
||||
const int16 TYPE_END = typeOther;
|
||||
const int16 TYPE_COUNT = (TYPE_END - TYPE_BEGIN) + 1;
|
||||
|
||||
int16 GetInvTypeSize(int16 inv_type);
|
||||
const char* GetInvTypeName(int16 inv_type);
|
||||
|
||||
bool IsInvTypePersistent(int16 inv_type);
|
||||
|
||||
} /*invtype*/
|
||||
|
||||
namespace invslot {
|
||||
inline EQEmu::versions::ClientVersion GetInvSlotRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
||||
|
||||
enum : int { InvSlotInvalid = -1, InvSlotBegin };
|
||||
namespace enum_ {
|
||||
enum InventorySlots : int16 {
|
||||
slotCharm = INULL,
|
||||
slotEar1,
|
||||
slotHead,
|
||||
slotFace,
|
||||
slotEar2,
|
||||
slotNeck,
|
||||
slotShoulders,
|
||||
slotArms,
|
||||
slotBack,
|
||||
slotWrist1,
|
||||
slotWrist2,
|
||||
slotRange,
|
||||
slotHands,
|
||||
slotPrimary,
|
||||
slotSecondary,
|
||||
slotFinger1,
|
||||
slotFinger2,
|
||||
slotChest,
|
||||
slotLegs,
|
||||
slotFeet,
|
||||
slotWaist,
|
||||
slotAmmo,
|
||||
slotGeneral1,
|
||||
slotGeneral2,
|
||||
slotGeneral3,
|
||||
slotGeneral4,
|
||||
slotGeneral5,
|
||||
slotGeneral6,
|
||||
slotGeneral7,
|
||||
slotGeneral8,
|
||||
slotCursor
|
||||
};
|
||||
|
||||
enum PossessionsSlot : int {
|
||||
PossessionsCharm = InvSlotBegin,
|
||||
PossessionsEar1,
|
||||
PossessionsHead,
|
||||
PossessionsFace,
|
||||
PossessionsEar2,
|
||||
PossessionsNeck,
|
||||
PossessionsShoulders,
|
||||
PossessionsArms,
|
||||
PossessionsBack,
|
||||
PossessionsWrist1,
|
||||
PossessionsWrist2,
|
||||
PossessionsRange,
|
||||
PossessionsHands,
|
||||
PossessionsPrimary,
|
||||
PossessionsSecondary,
|
||||
PossessionsFinger1,
|
||||
PossessionsFinger2,
|
||||
PossessionsChest,
|
||||
PossessionsLegs,
|
||||
PossessionsFeet,
|
||||
PossessionsWaist,
|
||||
PossessionsAmmo,
|
||||
PossessionsGeneral1,
|
||||
PossessionsGeneral2,
|
||||
PossessionsGeneral3,
|
||||
PossessionsGeneral4,
|
||||
PossessionsGeneral5,
|
||||
PossessionsGeneral6,
|
||||
PossessionsGeneral7,
|
||||
PossessionsGeneral8,
|
||||
PossessionsCursor,
|
||||
PossessionsCount
|
||||
};
|
||||
} // namespace enum_
|
||||
using namespace enum_;
|
||||
|
||||
const int EquipmentBegin = PossessionsCharm;
|
||||
const int EquipmentEnd = PossessionsAmmo;
|
||||
const int EquipmentCount = (EquipmentEnd - EquipmentBegin + 1);
|
||||
const int16 SLOT_INVALID = IINVALID;
|
||||
const int16 SLOT_BEGIN = INULL;
|
||||
|
||||
const int GeneralBegin = PossessionsGeneral1;
|
||||
const int GeneralEnd = PossessionsGeneral8;
|
||||
const int GeneralCount = (GeneralEnd - GeneralBegin + 1);
|
||||
const int16 POSSESSIONS_BEGIN = slotCharm;
|
||||
const int16 POSSESSIONS_END = slotCursor;
|
||||
const int16 POSSESSIONS_COUNT = (POSSESSIONS_END - POSSESSIONS_BEGIN) + 1;
|
||||
|
||||
const int16 EQUIPMENT_BEGIN = slotCharm;
|
||||
const int16 EQUIPMENT_END = slotAmmo;
|
||||
const int16 EQUIPMENT_COUNT = (EQUIPMENT_END - EQUIPMENT_BEGIN + 1);
|
||||
|
||||
const int16 GENERAL_BEGIN = slotGeneral1;
|
||||
const int16 GENERAL_END = slotGeneral8;
|
||||
const int16 GENERAL_COUNT = (GENERAL_END - GENERAL_BEGIN + 1);
|
||||
|
||||
const int16 BONUS_BEGIN = invslot::slotCharm;
|
||||
const int16 BONUS_STAT_END = invslot::slotWaist;
|
||||
const int16 BONUS_SKILL_END = invslot::slotAmmo;
|
||||
|
||||
const int16 BANK_BEGIN = 2000;
|
||||
const int16 BANK_END = (BANK_BEGIN + invtype::BANK_SIZE) - 1;
|
||||
|
||||
const int16 SHARED_BANK_BEGIN = 2500;
|
||||
const int16 SHARED_BANK_END = (SHARED_BANK_BEGIN + invtype::SHARED_BANK_SIZE) - 1;
|
||||
|
||||
const int16 TRADE_BEGIN = 3000;
|
||||
const int16 TRADE_END = (TRADE_BEGIN + invtype::TRADE_SIZE) - 1;
|
||||
|
||||
const int16 TRADE_NPC_END = (TRADE_BEGIN + invtype::TRADE_NPC_SIZE) - 1; // defined by implication
|
||||
|
||||
const int16 WORLD_BEGIN = 4000;
|
||||
const int16 WORLD_END = (WORLD_BEGIN + invtype::WORLD_SIZE) - 1;
|
||||
|
||||
const int16 TRIBUTE_BEGIN = 400;
|
||||
const int16 TRIBUTE_END = (TRIBUTE_BEGIN + invtype::TRIBUTE_SIZE) - 1;
|
||||
|
||||
const int16 GUILD_TRIBUTE_BEGIN = 450;
|
||||
const int16 GUILD_TRIBUTE_END = (GUILD_TRIBUTE_BEGIN + invtype::GUILD_TRIBUTE_SIZE) - 1;
|
||||
|
||||
const int16 CORPSE_BEGIN = invslot::slotGeneral1;
|
||||
const int16 CORPSE_END = invslot::slotGeneral1 + invslot::slotCursor;
|
||||
|
||||
const uint64 POSSESSIONS_BITMASK = 0x000000027FDFFFFF; // based on 34-slot count (RoF+)
|
||||
const uint64 CORPSE_BITMASK = 0x017FFFFE7F800000; // based on 34-slot count (RoF+)
|
||||
|
||||
const char* GetInvPossessionsSlotName(int16 inv_slot);
|
||||
const char* GetInvCorpseSlotName(int16 inv_slot);
|
||||
const char* GetInvSlotName(int16 inv_type, int16 inv_slot);
|
||||
|
||||
} /*invslot*/
|
||||
|
||||
namespace invbag {
|
||||
inline EQEmu::versions::ClientVersion GetInvBagRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
||||
|
||||
enum : int { InvBagInvalid = -1, InvBagBegin };
|
||||
const int16 SLOT_INVALID = IINVALID;
|
||||
const int16 SLOT_BEGIN = INULL;
|
||||
const int16 SLOT_END = 9;
|
||||
const int16 SLOT_COUNT = 10;
|
||||
|
||||
const int16 GENERAL_BAGS_BEGIN = 251;
|
||||
const int16 GENERAL_BAGS_COUNT = invslot::GENERAL_COUNT * SLOT_COUNT;
|
||||
const int16 GENERAL_BAGS_END = (GENERAL_BAGS_BEGIN + GENERAL_BAGS_COUNT) - 1;
|
||||
|
||||
const int16 CURSOR_BAG_BEGIN = 331;
|
||||
const int16 CURSOR_BAG_COUNT = SLOT_COUNT;
|
||||
const int16 CURSOR_BAG_END = (CURSOR_BAG_BEGIN + CURSOR_BAG_COUNT) - 1;
|
||||
|
||||
const int16 BANK_BAGS_BEGIN = 2031;
|
||||
const int16 BANK_BAGS_COUNT = (invtype::BANK_SIZE * SLOT_COUNT);
|
||||
const int16 BANK_BAGS_END = (BANK_BAGS_BEGIN + BANK_BAGS_COUNT) - 1;
|
||||
|
||||
const int16 SHARED_BANK_BAGS_BEGIN = 2531;
|
||||
const int16 SHARED_BANK_BAGS_COUNT = invtype::SHARED_BANK_SIZE * SLOT_COUNT;
|
||||
const int16 SHARED_BANK_BAGS_END = (SHARED_BANK_BAGS_BEGIN + SHARED_BANK_BAGS_COUNT) - 1;
|
||||
|
||||
const int16 TRADE_BAGS_BEGIN = 3031;
|
||||
const int16 TRADE_BAGS_COUNT = invtype::TRADE_SIZE * SLOT_COUNT;
|
||||
const int16 TRADE_BAGS_END = (TRADE_BAGS_BEGIN + TRADE_BAGS_COUNT) - 1;
|
||||
|
||||
const char* GetInvBagIndexName(int16 bag_index);
|
||||
|
||||
} /*invbag*/
|
||||
|
||||
namespace invaug {
|
||||
inline EQEmu::versions::ClientVersion GetInvAugRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
||||
|
||||
enum : int { InvAugInvalid = -1, InvAugBegin };
|
||||
const int16 SOCKET_INVALID = IINVALID;
|
||||
const int16 SOCKET_BEGIN = INULL;
|
||||
const int16 SOCKET_END = 4;
|
||||
const int16 SOCKET_COUNT = 5;
|
||||
|
||||
const char* GetInvAugIndexName(int16 aug_index);
|
||||
|
||||
} /*invaug*/
|
||||
|
||||
@@ -152,147 +262,21 @@ namespace Titanium
|
||||
namespace profile {
|
||||
inline EQEmu::versions::ClientVersion GetProfileRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
||||
|
||||
const int16 BANDOLIERS_SIZE = 4; // number of bandolier instances
|
||||
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
||||
|
||||
const int16 POTION_BELT_SIZE = 4;
|
||||
|
||||
const int16 SKILL_ARRAY_SIZE = 100;
|
||||
|
||||
} /*profile*/
|
||||
|
||||
namespace constants {
|
||||
inline EQEmu::versions::ClientVersion GetConstantsRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
||||
|
||||
} /*constants*/
|
||||
const size_t CHARACTER_CREATION_LIMIT = 8; // Hard-coded in client - DO NOT ALTER
|
||||
|
||||
namespace behavior {
|
||||
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
||||
|
||||
} /*behavior*/
|
||||
|
||||
namespace skills {
|
||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
||||
|
||||
} /*skills*/
|
||||
|
||||
|
||||
// declarations
|
||||
namespace inventory {
|
||||
const bool ConcatenateInvTypeLimbo = true;
|
||||
|
||||
const bool AllowOverLevelEquipment = false;
|
||||
|
||||
const bool AllowEmptyBagInBag = false;
|
||||
const bool AllowClickCastFromBag = false;
|
||||
|
||||
} /*inventory*/
|
||||
|
||||
namespace invtype {
|
||||
const size_t InvTypePossessionsSize = invslot::PossessionsCount;
|
||||
const size_t InvTypeBankSize = 16;
|
||||
const size_t InvTypeSharedBankSize = 2;
|
||||
const size_t InvTypeTradeSize = 8;
|
||||
const size_t InvTypeWorldSize = 10;
|
||||
const size_t InvTypeLimboSize = 36;
|
||||
const size_t InvTypeTributeSize = 5;
|
||||
const size_t InvTypeGuildTributeSize = 2;
|
||||
const size_t InvTypeMerchantSize = 80;
|
||||
const size_t InvTypeCorpseSize = InvTypePossessionsSize;
|
||||
const size_t InvTypeBazaarSize = 80;
|
||||
const size_t InvTypeInspectSize = invslot::EquipmentCount;
|
||||
const size_t InvTypeViewMODPCSize = InvTypePossessionsSize;
|
||||
const size_t InvTypeViewMODBankSize = InvTypeBankSize;
|
||||
const size_t InvTypeViewMODSharedBankSize = InvTypeSharedBankSize;
|
||||
const size_t InvTypeViewMODLimboSize = InvTypeLimboSize;
|
||||
const size_t InvTypeAltStorageSize = 0;//unknown - "Shroud Bank"
|
||||
const size_t InvTypeArchivedSize = 0;//unknown
|
||||
const size_t InvTypeOtherSize = 0;//unknown
|
||||
|
||||
extern size_t GetInvTypeSize(int inv_type);
|
||||
extern const char* GetInvTypeName(int inv_type);
|
||||
|
||||
extern bool IsInvTypePersistent(int inv_type);
|
||||
|
||||
} /*invtype*/
|
||||
|
||||
namespace invslot {
|
||||
const int BankBegin = 2000;
|
||||
const int BankEnd = (BankBegin + invtype::InvTypeBankSize) - 1;
|
||||
|
||||
const int SharedBankBegin = 2500;
|
||||
const int SharedBankEnd = (SharedBankBegin + invtype::InvTypeSharedBankSize) - 1;
|
||||
|
||||
const int TradeBegin = 3000;
|
||||
const int TradeEnd = (TradeBegin + invtype::InvTypeTradeSize) - 1;
|
||||
const int TradeNPCEnd = 3003;
|
||||
|
||||
const int WorldBegin = 4000;
|
||||
const int WorldEnd = (WorldBegin + invtype::InvTypeWorldSize) - 1;
|
||||
|
||||
const int TributeBegin = 400;
|
||||
const int TributeEnd = (TributeBegin + invtype::InvTypeTributeSize) - 1;
|
||||
|
||||
const int GuildTributeBegin = 450;
|
||||
const int GuildTributeEnd = (GuildTributeBegin + invtype::InvTypeGuildTributeSize) - 1;
|
||||
|
||||
const int CorpseBegin = PossessionsGeneral1;
|
||||
const int CorpseEnd = PossessionsGeneral1 + PossessionsCursor;
|
||||
|
||||
extern const char* GetInvPossessionsSlotName(int inv_slot);
|
||||
extern const char* GetInvCorpseSlotName(int inv_slot);
|
||||
extern const char* GetInvSlotName(int inv_type, int inv_slot);
|
||||
|
||||
} /*invslot*/
|
||||
|
||||
namespace invbag {
|
||||
const size_t ItemBagSize = 10;
|
||||
|
||||
const int GeneralBagsBegin = 251;
|
||||
const int GeneralBagsSize = invslot::GeneralCount * ItemBagSize;
|
||||
const int GeneralBagsEnd = (GeneralBagsBegin + GeneralBagsSize) - 1;
|
||||
|
||||
const int CursorBagBegin = 331;
|
||||
const int CursorBagSize = ItemBagSize;
|
||||
const int CursorBagEnd = (CursorBagBegin + CursorBagSize) - 1;
|
||||
|
||||
const int BankBagsBegin = 2031;
|
||||
const int BankBagsSize = (invtype::InvTypeBankSize * ItemBagSize);
|
||||
const int BankBagsEnd = (BankBagsBegin + BankBagsSize) - 1;
|
||||
|
||||
const int SharedBankBagsBegin = 2531;
|
||||
const int SharedBankBagsSize = invtype::InvTypeSharedBankSize * ItemBagSize;
|
||||
const int SharedBankBagsEnd = (SharedBankBagsBegin + SharedBankBagsSize) - 1;
|
||||
|
||||
const int TradeBagsBegin = 3031;
|
||||
const int TradeBagsSize = invtype::InvTypeTradeSize * ItemBagSize;
|
||||
const int TradeBagsEnd = (TradeBagsBegin + TradeBagsSize) - 1;
|
||||
|
||||
extern const char* GetInvBagIndexName(int bag_index);
|
||||
|
||||
} /*invbag*/
|
||||
|
||||
namespace invaug {
|
||||
const size_t ItemAugSize = 5;
|
||||
|
||||
extern const char* GetInvAugIndexName(int aug_index);
|
||||
|
||||
} /*invaug*/
|
||||
|
||||
namespace item {
|
||||
|
||||
} /*item*/
|
||||
|
||||
namespace profile {
|
||||
const size_t TributeSize = invtype::InvTypeTributeSize;
|
||||
const size_t GuildTributeSize = invtype::InvTypeGuildTributeSize;
|
||||
|
||||
const size_t BandoliersSize = 4; // number of bandolier instances
|
||||
const size_t BandolierItemCount = 4; // number of equipment slots in bandolier instance
|
||||
|
||||
const size_t PotionBeltSize = 4;
|
||||
|
||||
const size_t SkillArraySize = 100;
|
||||
|
||||
} /*profile*/
|
||||
|
||||
namespace constants {
|
||||
const size_t CharacterCreationLimit = 8; // Hard-coded in client - DO NOT ALTER
|
||||
|
||||
const size_t SayLinkBodySize = 45;
|
||||
const size_t SAY_LINK_BODY_SIZE = 45;
|
||||
|
||||
const int LongBuffs = 25;
|
||||
const int ShortBuffs = 12;
|
||||
@@ -305,11 +289,15 @@ namespace Titanium
|
||||
} /*constants*/
|
||||
|
||||
namespace behavior {
|
||||
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
||||
|
||||
const bool CoinHasWeight = true;
|
||||
|
||||
} /*behavior*/
|
||||
|
||||
namespace skills {
|
||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
||||
|
||||
const size_t LastUsableSkill = EQEmu::skills::SkillFrenzy;
|
||||
|
||||
} /*skills*/
|
||||
|
||||
@@ -655,7 +655,7 @@ struct BandolierItem_Struct
|
||||
struct Bandolier_Struct
|
||||
{
|
||||
char Name[32];
|
||||
BandolierItem_Struct Items[profile::BandolierItemCount];
|
||||
BandolierItem_Struct Items[profile::BANDOLIER_ITEM_COUNT];
|
||||
};
|
||||
|
||||
//len = 72
|
||||
@@ -669,7 +669,7 @@ struct PotionBeltItem_Struct
|
||||
//len = 288
|
||||
struct PotionBelt_Struct
|
||||
{
|
||||
PotionBeltItem_Struct Items[profile::PotionBeltSize];
|
||||
PotionBeltItem_Struct Items[profile::POTION_BELT_SIZE];
|
||||
};
|
||||
|
||||
static const uint32 MAX_GROUP_LEADERSHIP_AA_ARRAY = 16;
|
||||
@@ -875,7 +875,7 @@ struct PlayerProfile_Struct
|
||||
/*06152*/ uint32 aapoints_spent; // Number of spent AA points
|
||||
/*06156*/ uint32 aapoints; // Unspent AA points
|
||||
/*06160*/ uint8 unknown06160[4];
|
||||
/*06164*/ Bandolier_Struct bandoliers[profile::BandoliersSize]; // bandolier contents
|
||||
/*06164*/ Bandolier_Struct bandoliers[profile::BANDOLIERS_SIZE]; // bandolier contents
|
||||
/*07444*/ uint8 unknown07444[5120];
|
||||
/*12564*/ PotionBelt_Struct potionbelt; // potion belt
|
||||
/*12852*/ uint8 unknown12852[8];
|
||||
|
||||
+41
-149
@@ -1609,117 +1609,6 @@ namespace UF
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
|
||||
ENCODE(OP_OpenNewTasksWindow)
|
||||
{
|
||||
AvailableTaskHeader_Struct* __emu_AvailableTaskHeader;
|
||||
AvailableTaskData1_Struct* __emu_AvailableTaskData1;
|
||||
AvailableTaskData2_Struct* __emu_AvailableTaskData2;
|
||||
AvailableTaskTrailer_Struct* __emu_AvailableTaskTrailer;
|
||||
|
||||
structs::AvailableTaskHeader_Struct* __eq_AvailableTaskHeader;
|
||||
structs::AvailableTaskData1_Struct* __eq_AvailableTaskData1;
|
||||
structs::AvailableTaskData2_Struct* __eq_AvailableTaskData2;
|
||||
structs::AvailableTaskTrailer_Struct* __eq_AvailableTaskTrailer;
|
||||
|
||||
EQApplicationPacket *in = *p;
|
||||
*p = nullptr;
|
||||
|
||||
unsigned char *__emu_buffer = in->pBuffer;
|
||||
|
||||
__emu_AvailableTaskHeader = (AvailableTaskHeader_Struct*)__emu_buffer;
|
||||
|
||||
// For each task, SoF has an extra uint32 and what appears to be space for a null terminated string.
|
||||
//
|
||||
in->size = in->size + (__emu_AvailableTaskHeader->TaskCount * 5);
|
||||
in->pBuffer = new unsigned char[in->size];
|
||||
|
||||
unsigned char *__eq_buffer = in->pBuffer;
|
||||
|
||||
__eq_AvailableTaskHeader = (structs::AvailableTaskHeader_Struct*)__eq_buffer;
|
||||
|
||||
char *__eq_ptr, *__emu_Ptr;
|
||||
|
||||
// Copy Header
|
||||
//
|
||||
//
|
||||
|
||||
__eq_AvailableTaskHeader->TaskCount = __emu_AvailableTaskHeader->TaskCount;
|
||||
__eq_AvailableTaskHeader->unknown1 = __emu_AvailableTaskHeader->unknown1;
|
||||
__eq_AvailableTaskHeader->TaskGiver = __emu_AvailableTaskHeader->TaskGiver;
|
||||
|
||||
__emu_Ptr = (char *)__emu_AvailableTaskHeader + sizeof(AvailableTaskHeader_Struct);
|
||||
__eq_ptr = (char *)__eq_AvailableTaskHeader + sizeof(structs::AvailableTaskHeader_Struct);
|
||||
|
||||
for (uint32 i = 0; i<__emu_AvailableTaskHeader->TaskCount; i++) {
|
||||
|
||||
__emu_AvailableTaskData1 = (AvailableTaskData1_Struct*)__emu_Ptr;
|
||||
__eq_AvailableTaskData1 = (structs::AvailableTaskData1_Struct*)__eq_ptr;
|
||||
|
||||
__eq_AvailableTaskData1->TaskID = __emu_AvailableTaskData1->TaskID;
|
||||
// This next unknown seems to affect the colour of the task title. 0x3f80000 is what I have seen
|
||||
// in Underfoot packets. Changing it to 0x3f000000 makes the title red.
|
||||
__eq_AvailableTaskData1->unknown1 = 0x3f800000;
|
||||
__eq_AvailableTaskData1->TimeLimit = __emu_AvailableTaskData1->TimeLimit;
|
||||
__eq_AvailableTaskData1->unknown2 = __emu_AvailableTaskData1->unknown2;
|
||||
|
||||
__emu_Ptr += sizeof(AvailableTaskData1_Struct);
|
||||
__eq_ptr += sizeof(structs::AvailableTaskData1_Struct);
|
||||
|
||||
strcpy(__eq_ptr, __emu_Ptr); // Title
|
||||
|
||||
__emu_Ptr += strlen(__emu_Ptr) + 1;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
|
||||
strcpy(__eq_ptr, __emu_Ptr); // Description
|
||||
|
||||
__emu_Ptr += strlen(__emu_Ptr) + 1;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
|
||||
__eq_ptr[0] = 0;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
|
||||
__emu_AvailableTaskData2 = (AvailableTaskData2_Struct*)__emu_Ptr;
|
||||
__eq_AvailableTaskData2 = (structs::AvailableTaskData2_Struct*)__eq_ptr;
|
||||
|
||||
__eq_AvailableTaskData2->unknown1 = __emu_AvailableTaskData2->unknown1;
|
||||
__eq_AvailableTaskData2->unknown2 = __emu_AvailableTaskData2->unknown2;
|
||||
__eq_AvailableTaskData2->unknown3 = __emu_AvailableTaskData2->unknown3;
|
||||
__eq_AvailableTaskData2->unknown4 = __emu_AvailableTaskData2->unknown4;
|
||||
|
||||
__emu_Ptr += sizeof(AvailableTaskData2_Struct);
|
||||
__eq_ptr += sizeof(structs::AvailableTaskData2_Struct);
|
||||
|
||||
strcpy(__eq_ptr, __emu_Ptr); // Unknown string
|
||||
|
||||
__emu_Ptr += strlen(__emu_Ptr) + 1;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
|
||||
strcpy(__eq_ptr, __emu_Ptr); // Unknown string
|
||||
|
||||
__emu_Ptr += strlen(__emu_Ptr) + 1;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
|
||||
__emu_AvailableTaskTrailer = (AvailableTaskTrailer_Struct*)__emu_Ptr;
|
||||
__eq_AvailableTaskTrailer = (structs::AvailableTaskTrailer_Struct*)__eq_ptr;
|
||||
|
||||
__eq_AvailableTaskTrailer->ItemCount = __emu_AvailableTaskTrailer->ItemCount;
|
||||
__eq_AvailableTaskTrailer->unknown1 = __emu_AvailableTaskTrailer->unknown1;
|
||||
__eq_AvailableTaskTrailer->unknown2 = __emu_AvailableTaskTrailer->unknown2;
|
||||
__eq_AvailableTaskTrailer->StartZone = __emu_AvailableTaskTrailer->StartZone;
|
||||
|
||||
__emu_Ptr += sizeof(AvailableTaskTrailer_Struct);
|
||||
__eq_ptr += sizeof(structs::AvailableTaskTrailer_Struct);
|
||||
|
||||
strcpy(__eq_ptr, __emu_Ptr); // Unknown string
|
||||
|
||||
__emu_Ptr += strlen(__emu_Ptr) + 1;
|
||||
__eq_ptr += strlen(__eq_ptr) + 1;
|
||||
}
|
||||
|
||||
delete[] __emu_buffer;
|
||||
dest->FastQueuePacket(&in, ack_req);
|
||||
}
|
||||
|
||||
ENCODE(OP_PetBuffWindow)
|
||||
{
|
||||
EQApplicationPacket *in = *p;
|
||||
@@ -1881,18 +1770,18 @@ namespace UF
|
||||
// OUT(unknown06160[4]);
|
||||
|
||||
// Copy bandoliers where server and client indexes converge
|
||||
for (r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < profile::BandoliersSize; ++r) {
|
||||
for (r = 0; r < EQEmu::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
|
||||
OUT_str(bandoliers[r].Name);
|
||||
for (uint32 k = 0; k < profile::BandolierItemCount; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||
OUT(bandoliers[r].Items[k].ID);
|
||||
OUT(bandoliers[r].Items[k].Icon);
|
||||
OUT_str(bandoliers[r].Items[k].Name);
|
||||
}
|
||||
}
|
||||
// Nullify bandoliers where server and client indexes diverge, with a client bias
|
||||
for (r = EQEmu::legacy::BANDOLIERS_SIZE; r < profile::BandoliersSize; ++r) {
|
||||
for (r = EQEmu::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
|
||||
eq->bandoliers[r].Name[0] = '\0';
|
||||
for (uint32 k = 0; k < profile::BandolierItemCount; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||
eq->bandoliers[r].Items[k].ID = 0;
|
||||
eq->bandoliers[r].Items[k].Icon = 0;
|
||||
eq->bandoliers[r].Items[k].Name[0] = '\0';
|
||||
@@ -1902,13 +1791,13 @@ namespace UF
|
||||
// OUT(unknown07444[5120]);
|
||||
|
||||
// Copy potion belt where server and client indexes converge
|
||||
for (r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < profile::PotionBeltSize; ++r) {
|
||||
for (r = 0; r < EQEmu::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
|
||||
OUT(potionbelt.Items[r].ID);
|
||||
OUT(potionbelt.Items[r].Icon);
|
||||
OUT_str(potionbelt.Items[r].Name);
|
||||
}
|
||||
// Nullify potion belt where server and client indexes diverge, with a client bias
|
||||
for (r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < profile::PotionBeltSize; ++r) {
|
||||
for (r = EQEmu::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
|
||||
eq->potionbelt.Items[r].ID = 0;
|
||||
eq->potionbelt.Items[r].Icon = 0;
|
||||
eq->potionbelt.Items[r].Name[0] = '\0';
|
||||
@@ -2217,8 +2106,8 @@ namespace UF
|
||||
eq->CharCount = emu->CharCount;
|
||||
eq->TotalChars = emu->TotalChars;
|
||||
|
||||
if (eq->TotalChars > constants::CharacterCreationLimit)
|
||||
eq->TotalChars = constants::CharacterCreationLimit;
|
||||
if (eq->TotalChars > constants::CHARACTER_CREATION_LIMIT)
|
||||
eq->TotalChars = constants::CHARACTER_CREATION_LIMIT;
|
||||
|
||||
// Special Underfoot adjustment - field should really be 'AdditionalChars' or 'BonusChars'
|
||||
uint32 adjusted_total = eq->TotalChars - 8; // Yes, it rolls under for '< 8' - probably an int32 field
|
||||
@@ -2234,7 +2123,7 @@ namespace UF
|
||||
|
||||
size_t names_length = 0;
|
||||
size_t character_count = 0;
|
||||
for (; character_count < emu->CharCount && character_count < constants::CharacterCreationLimit; ++character_count) {
|
||||
for (; character_count < emu->CharCount && character_count < constants::CHARACTER_CREATION_LIMIT; ++character_count) {
|
||||
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
|
||||
names_length += strlen(emu_cse->Name);
|
||||
emu_ptr += sizeof(CharacterSelectEntry_Struct);
|
||||
@@ -2250,8 +2139,8 @@ namespace UF
|
||||
eq->CharCount = character_count;
|
||||
eq->TotalChars = emu->TotalChars;
|
||||
|
||||
if (eq->TotalChars > constants::CharacterCreationLimit)
|
||||
eq->TotalChars = constants::CharacterCreationLimit;
|
||||
if (eq->TotalChars > constants::CHARACTER_CREATION_LIMIT)
|
||||
eq->TotalChars = constants::CHARACTER_CREATION_LIMIT;
|
||||
|
||||
// Special Underfoot adjustment - field should really be 'AdditionalChars' or 'BonusChars' in this client
|
||||
uint32 adjusted_total = eq->TotalChars - 8; // Yes, it rolls under for '< 8' - probably an int32 field
|
||||
@@ -2528,13 +2417,16 @@ namespace UF
|
||||
InBuffer += description_size;
|
||||
InBuffer += sizeof(TaskDescriptionData2_Struct);
|
||||
|
||||
std::string old_message = InBuffer; // start 'Reward' as string
|
||||
uint32 reward_size = strlen(InBuffer) + 1;
|
||||
InBuffer += reward_size;
|
||||
|
||||
std::string old_message = InBuffer; // start item link string
|
||||
std::string new_message;
|
||||
ServerToUFSayLink(new_message, old_message);
|
||||
|
||||
in->size = sizeof(TaskDescriptionHeader_Struct) + sizeof(TaskDescriptionData1_Struct)+
|
||||
sizeof(TaskDescriptionData2_Struct) + sizeof(TaskDescriptionTrailer_Struct)+
|
||||
title_size + description_size + new_message.length() + 1;
|
||||
title_size + description_size + reward_size + new_message.length() + 1;
|
||||
|
||||
in->pBuffer = new unsigned char[in->size];
|
||||
|
||||
@@ -3918,7 +3810,7 @@ namespace UF
|
||||
ibs.nodrop = item->NoDrop;
|
||||
ibs.attune = item->Attuneable;
|
||||
ibs.size = item->Size;
|
||||
ibs.slots = SwapBits21and22(item->Slots);
|
||||
ibs.slots = SwapBits21And22(item->Slots);
|
||||
ibs.price = item->Price;
|
||||
ibs.icon = item->Icon;
|
||||
ibs.unknown1 = 1;
|
||||
@@ -4008,7 +3900,7 @@ namespace UF
|
||||
isbs.augtype = item->AugType;
|
||||
isbs.augrestrict = item->AugRestrict;
|
||||
|
||||
for (int index = 0; index < invaug::ItemAugSize; ++index) {
|
||||
for (int index = invaug::SOCKET_BEGIN; index <= invaug::SOCKET_END; ++index) {
|
||||
isbs.augslots[index].type = item->AugSlotType[index];
|
||||
isbs.augslots[index].visible = item->AugSlotVisible[index];
|
||||
isbs.augslots[index].unknown = item->AugSlotUnk2[index];
|
||||
@@ -4204,18 +4096,18 @@ namespace UF
|
||||
|
||||
ob.write((const char*)&subitem_count, sizeof(uint32));
|
||||
|
||||
for (uint32 index = EQEmu::inventory::containerBegin; index < EQEmu::inventory::ContainerCount; ++index) {
|
||||
for (uint32 index = EQEmu::invbag::SLOT_BEGIN; index <= EQEmu::invbag::SLOT_END; ++index) {
|
||||
EQEmu::ItemInstance* sub = inst->GetItem(index);
|
||||
if (!sub)
|
||||
continue;
|
||||
|
||||
int SubSlotNumber = INVALID_INDEX;
|
||||
if (slot_id_in >= EQEmu::legacy::GENERAL_BEGIN && slot_id_in <= EQEmu::legacy::GENERAL_END)
|
||||
SubSlotNumber = (((slot_id_in + 3) * EQEmu::inventory::ContainerCount) + index + 1);
|
||||
else if (slot_id_in >= EQEmu::legacy::BANK_BEGIN && slot_id_in <= EQEmu::legacy::BANK_END)
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::legacy::BANK_BEGIN) * EQEmu::inventory::ContainerCount) + EQEmu::legacy::BANK_BAGS_BEGIN + index);
|
||||
else if (slot_id_in >= EQEmu::legacy::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::legacy::SHARED_BANK_END)
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::legacy::SHARED_BANK_BEGIN) * EQEmu::inventory::ContainerCount) + EQEmu::legacy::SHARED_BANK_BAGS_BEGIN + index);
|
||||
if (slot_id_in >= EQEmu::invslot::GENERAL_BEGIN && slot_id_in <= EQEmu::invslot::GENERAL_END)
|
||||
SubSlotNumber = (((slot_id_in + 3) * EQEmu::invbag::SLOT_COUNT) + index + 1);
|
||||
else if (slot_id_in >= EQEmu::invslot::BANK_BEGIN && slot_id_in <= EQEmu::invslot::BANK_END)
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::invslot::BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT) + EQEmu::invbag::BANK_BAGS_BEGIN + index);
|
||||
else if (slot_id_in >= EQEmu::invslot::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::invslot::SHARED_BANK_END)
|
||||
SubSlotNumber = (((slot_id_in - EQEmu::invslot::SHARED_BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT) + EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + index);
|
||||
else
|
||||
SubSlotNumber = slot_id_in;
|
||||
|
||||
@@ -4233,16 +4125,16 @@ namespace UF
|
||||
{
|
||||
uint32 UnderfootSlot = 0;
|
||||
|
||||
if (serverSlot >= EQEmu::inventory::slotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||
if (serverSlot >= EQEmu::invslot::slotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||
UnderfootSlot = serverSlot + 1;
|
||||
else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END)
|
||||
else if (serverSlot >= EQEmu::invbag::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::invbag::CURSOR_BAG_END)
|
||||
UnderfootSlot = serverSlot + 11;
|
||||
else if (serverSlot >= EQEmu::legacy::BANK_BAGS_BEGIN && serverSlot <= EQEmu::legacy::BANK_BAGS_END)
|
||||
else if (serverSlot >= EQEmu::invbag::BANK_BAGS_BEGIN && serverSlot <= EQEmu::invbag::BANK_BAGS_END)
|
||||
UnderfootSlot = serverSlot + 1;
|
||||
else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END)
|
||||
else if (serverSlot >= EQEmu::invbag::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::invbag::SHARED_BANK_BAGS_END)
|
||||
UnderfootSlot = serverSlot + 1;
|
||||
else if (serverSlot == EQEmu::inventory::slotPowerSource)
|
||||
UnderfootSlot = invslot::PossessionsPowerSource;
|
||||
else if (serverSlot == EQEmu::invslot::SLOT_POWER_SOURCE)
|
||||
UnderfootSlot = invslot::slotPowerSource;
|
||||
else
|
||||
UnderfootSlot = serverSlot;
|
||||
|
||||
@@ -4259,16 +4151,16 @@ namespace UF
|
||||
{
|
||||
uint32 ServerSlot = 0;
|
||||
|
||||
if (ufSlot >= invslot::PossessionsAmmo && ufSlot <= invslot::CorpseEnd) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||
if (ufSlot >= invslot::slotAmmo && ufSlot <= invslot::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||
ServerSlot = ufSlot - 1;
|
||||
else if (ufSlot >= invbag::GeneralBagsBegin && ufSlot <= invbag::CursorBagEnd)
|
||||
else if (ufSlot >= invbag::GENERAL_BAGS_BEGIN && ufSlot <= invbag::CURSOR_BAG_END)
|
||||
ServerSlot = ufSlot - 11;
|
||||
else if (ufSlot >= invbag::BankBagsBegin && ufSlot <= invbag::BankBagsEnd)
|
||||
else if (ufSlot >= invbag::BANK_BAGS_BEGIN && ufSlot <= invbag::BANK_BAGS_END)
|
||||
ServerSlot = ufSlot - 1;
|
||||
else if (ufSlot >= invbag::SharedBankBagsBegin && ufSlot <= invbag::SharedBankBagsEnd)
|
||||
else if (ufSlot >= invbag::SHARED_BANK_BAGS_BEGIN && ufSlot <= invbag::SHARED_BANK_BAGS_END)
|
||||
ServerSlot = ufSlot - 1;
|
||||
else if (ufSlot == invslot::PossessionsPowerSource)
|
||||
ServerSlot = EQEmu::inventory::slotPowerSource;
|
||||
else if (ufSlot == invslot::slotPowerSource)
|
||||
ServerSlot = EQEmu::invslot::SLOT_POWER_SOURCE;
|
||||
else
|
||||
ServerSlot = ufSlot;
|
||||
|
||||
@@ -4283,7 +4175,7 @@ namespace UF
|
||||
|
||||
static inline void ServerToUFSayLink(std::string& ufSayLink, const std::string& serverSayLink)
|
||||
{
|
||||
if ((constants::SayLinkBodySize == EQEmu::constants::SayLinkBodySize) || (serverSayLink.find('\x12') == std::string::npos)) {
|
||||
if ((constants::SAY_LINK_BODY_SIZE == EQEmu::constants::SAY_LINK_BODY_SIZE) || (serverSayLink.find('\x12') == std::string::npos)) {
|
||||
ufSayLink = serverSayLink;
|
||||
return;
|
||||
}
|
||||
@@ -4292,7 +4184,7 @@ namespace UF
|
||||
|
||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||
if (segment_iter & 1) {
|
||||
if (segments[segment_iter].length() <= EQEmu::constants::SayLinkBodySize) {
|
||||
if (segments[segment_iter].length() <= EQEmu::constants::SAY_LINK_BODY_SIZE) {
|
||||
ufSayLink.append(segments[segment_iter]);
|
||||
// TODO: log size mismatch error
|
||||
continue;
|
||||
@@ -4323,7 +4215,7 @@ namespace UF
|
||||
|
||||
static inline void UFToServerSayLink(std::string& serverSayLink, const std::string& ufSayLink)
|
||||
{
|
||||
if ((EQEmu::constants::SayLinkBodySize == constants::SayLinkBodySize) || (ufSayLink.find('\x12') == std::string::npos)) {
|
||||
if ((EQEmu::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (ufSayLink.find('\x12') == std::string::npos)) {
|
||||
serverSayLink = ufSayLink;
|
||||
return;
|
||||
}
|
||||
@@ -4332,7 +4224,7 @@ namespace UF
|
||||
|
||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||
if (segment_iter & 1) {
|
||||
if (segments[segment_iter].length() <= constants::SayLinkBodySize) {
|
||||
if (segments[segment_iter].length() <= constants::SAY_LINK_BODY_SIZE) {
|
||||
serverSayLink.append(segments[segment_iter]);
|
||||
// TODO: log size mismatch error
|
||||
continue;
|
||||
|
||||
+119
-119
@@ -22,198 +22,198 @@
|
||||
#include "../string_util.h"
|
||||
|
||||
|
||||
size_t UF::invtype::GetInvTypeSize(int inv_type)
|
||||
int16 UF::invtype::GetInvTypeSize(int16 inv_type)
|
||||
{
|
||||
switch (inv_type) {
|
||||
case invtype::InvTypePossessions:
|
||||
return invtype::InvTypePossessionsSize;
|
||||
case invtype::InvTypeBank:
|
||||
return invtype::InvTypeBankSize;
|
||||
case invtype::InvTypeSharedBank:
|
||||
return invtype::InvTypeSharedBankSize;
|
||||
case invtype::InvTypeTrade:
|
||||
return invtype::InvTypeTradeSize;
|
||||
case invtype::InvTypeWorld:
|
||||
return invtype::InvTypeWorldSize;
|
||||
case invtype::InvTypeLimbo:
|
||||
return invtype::InvTypeLimboSize;
|
||||
case invtype::InvTypeTribute:
|
||||
return invtype::InvTypeTributeSize;
|
||||
case invtype::InvTypeGuildTribute:
|
||||
return invtype::InvTypeGuildTributeSize;
|
||||
case invtype::InvTypeMerchant:
|
||||
return invtype::InvTypeMerchantSize;
|
||||
case invtype::InvTypeCorpse:
|
||||
return invtype::InvTypeCorpseSize;
|
||||
case invtype::InvTypeBazaar:
|
||||
return invtype::InvTypeBazaarSize;
|
||||
case invtype::InvTypeInspect:
|
||||
return invtype::InvTypeInspectSize;
|
||||
case invtype::InvTypeViewMODPC:
|
||||
return invtype::InvTypeViewMODPCSize;
|
||||
case invtype::InvTypeViewMODBank:
|
||||
return invtype::InvTypeViewMODBankSize;
|
||||
case invtype::InvTypeViewMODSharedBank:
|
||||
return invtype::InvTypeViewMODSharedBankSize;
|
||||
case invtype::InvTypeViewMODLimbo:
|
||||
return invtype::InvTypeViewMODLimboSize;
|
||||
case invtype::InvTypeAltStorage:
|
||||
return invtype::InvTypeAltStorageSize;
|
||||
case invtype::InvTypeArchived:
|
||||
return invtype::InvTypeArchivedSize;
|
||||
case invtype::InvTypeOther:
|
||||
return invtype::InvTypeOtherSize;
|
||||
case invtype::typePossessions:
|
||||
return invtype::POSSESSIONS_SIZE;
|
||||
case invtype::typeBank:
|
||||
return invtype::BANK_SIZE;
|
||||
case invtype::typeSharedBank:
|
||||
return invtype::SHARED_BANK_SIZE;
|
||||
case invtype::typeTrade:
|
||||
return invtype::TRADE_SIZE;
|
||||
case invtype::typeWorld:
|
||||
return invtype::WORLD_SIZE;
|
||||
case invtype::typeLimbo:
|
||||
return invtype::LIMBO_SIZE;
|
||||
case invtype::typeTribute:
|
||||
return invtype::TRIBUTE_SIZE;
|
||||
case invtype::typeGuildTribute:
|
||||
return invtype::GUILD_TRIBUTE_SIZE;
|
||||
case invtype::typeMerchant:
|
||||
return invtype::MERCHANT_SIZE;
|
||||
case invtype::typeCorpse:
|
||||
return invtype::CORPSE_SIZE;
|
||||
case invtype::typeBazaar:
|
||||
return invtype::BAZAAR_SIZE;
|
||||
case invtype::typeInspect:
|
||||
return invtype::INSPECT_SIZE;
|
||||
case invtype::typeViewMODPC:
|
||||
return invtype::VIEW_MOD_PC_SIZE;
|
||||
case invtype::typeViewMODBank:
|
||||
return invtype::VIEW_MOD_BANK_SIZE;
|
||||
case invtype::typeViewMODSharedBank:
|
||||
return invtype::VIEW_MOD_SHARED_BANK_SIZE;
|
||||
case invtype::typeViewMODLimbo:
|
||||
return invtype::VIEW_MOD_LIMBO_SIZE;
|
||||
case invtype::typeAltStorage:
|
||||
return invtype::ALT_STORAGE_SIZE;
|
||||
case invtype::typeArchived:
|
||||
return invtype::ARCHIVED_SIZE;
|
||||
case invtype::typeOther:
|
||||
return invtype::OTHER_SIZE;
|
||||
default:
|
||||
return 0;
|
||||
return INULL;
|
||||
}
|
||||
}
|
||||
|
||||
const char* UF::invtype::GetInvTypeName(int inv_type)
|
||||
const char* UF::invtype::GetInvTypeName(int16 inv_type)
|
||||
{
|
||||
switch (inv_type) {
|
||||
case invtype::InvTypeInvalid:
|
||||
case invtype::TYPE_INVALID:
|
||||
return "Invalid Type";
|
||||
case invtype::InvTypePossessions:
|
||||
case invtype::typePossessions:
|
||||
return "Possessions";
|
||||
case invtype::InvTypeBank:
|
||||
case invtype::typeBank:
|
||||
return "Bank";
|
||||
case invtype::InvTypeSharedBank:
|
||||
case invtype::typeSharedBank:
|
||||
return "Shared Bank";
|
||||
case invtype::InvTypeTrade:
|
||||
case invtype::typeTrade:
|
||||
return "Trade";
|
||||
case invtype::InvTypeWorld:
|
||||
case invtype::typeWorld:
|
||||
return "World";
|
||||
case invtype::InvTypeLimbo:
|
||||
case invtype::typeLimbo:
|
||||
return "Limbo";
|
||||
case invtype::InvTypeTribute:
|
||||
case invtype::typeTribute:
|
||||
return "Tribute";
|
||||
case invtype::InvTypeGuildTribute:
|
||||
case invtype::typeGuildTribute:
|
||||
return "Guild Tribute";
|
||||
case invtype::InvTypeMerchant:
|
||||
case invtype::typeMerchant:
|
||||
return "Merchant";
|
||||
case invtype::InvTypeCorpse:
|
||||
case invtype::typeCorpse:
|
||||
return "Corpse";
|
||||
case invtype::InvTypeBazaar:
|
||||
case invtype::typeBazaar:
|
||||
return "Bazaar";
|
||||
case invtype::InvTypeInspect:
|
||||
case invtype::typeInspect:
|
||||
return "Inspect";
|
||||
case invtype::InvTypeViewMODPC:
|
||||
case invtype::typeViewMODPC:
|
||||
return "View MOD PC";
|
||||
case invtype::InvTypeViewMODBank:
|
||||
case invtype::typeViewMODBank:
|
||||
return "View MOD Bank";
|
||||
case invtype::InvTypeViewMODSharedBank:
|
||||
case invtype::typeViewMODSharedBank:
|
||||
return "View MOD Shared Bank";
|
||||
case invtype::InvTypeViewMODLimbo:
|
||||
case invtype::typeViewMODLimbo:
|
||||
return "View MOD Limbo";
|
||||
case invtype::InvTypeAltStorage:
|
||||
case invtype::typeAltStorage:
|
||||
return "Alt Storage";
|
||||
case invtype::InvTypeArchived:
|
||||
case invtype::typeArchived:
|
||||
return "Archived";
|
||||
case invtype::InvTypeOther:
|
||||
case invtype::typeOther:
|
||||
return "Other";
|
||||
default:
|
||||
return "Unknown Type";
|
||||
}
|
||||
}
|
||||
|
||||
bool UF::invtype::IsInvTypePersistent(int inv_type)
|
||||
bool UF::invtype::IsInvTypePersistent(int16 inv_type)
|
||||
{
|
||||
switch (inv_type) {
|
||||
case invtype::InvTypePossessions:
|
||||
case invtype::InvTypeBank:
|
||||
case invtype::InvTypeSharedBank:
|
||||
case invtype::InvTypeTrade:
|
||||
case invtype::InvTypeWorld:
|
||||
case invtype::InvTypeLimbo:
|
||||
case invtype::InvTypeTribute:
|
||||
case invtype::InvTypeGuildTribute:
|
||||
case invtype::typePossessions:
|
||||
case invtype::typeBank:
|
||||
case invtype::typeSharedBank:
|
||||
case invtype::typeTrade:
|
||||
case invtype::typeWorld:
|
||||
case invtype::typeLimbo:
|
||||
case invtype::typeTribute:
|
||||
case invtype::typeGuildTribute:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const char* UF::invslot::GetInvPossessionsSlotName(int inv_slot)
|
||||
const char* UF::invslot::GetInvPossessionsSlotName(int16 inv_slot)
|
||||
{
|
||||
switch (inv_slot) {
|
||||
case invslot::InvSlotInvalid:
|
||||
case invslot::SLOT_INVALID:
|
||||
return "Invalid Slot";
|
||||
case invslot::PossessionsCharm:
|
||||
case invslot::slotCharm:
|
||||
return "Charm";
|
||||
case invslot::PossessionsEar1:
|
||||
case invslot::slotEar1:
|
||||
return "Ear 1";
|
||||
case invslot::PossessionsHead:
|
||||
case invslot::slotHead:
|
||||
return "Head";
|
||||
case invslot::PossessionsFace:
|
||||
case invslot::slotFace:
|
||||
return "Face";
|
||||
case invslot::PossessionsEar2:
|
||||
case invslot::slotEar2:
|
||||
return "Ear 2";
|
||||
case invslot::PossessionsNeck:
|
||||
case invslot::slotNeck:
|
||||
return "Neck";
|
||||
case invslot::PossessionsShoulders:
|
||||
case invslot::slotShoulders:
|
||||
return "Shoulders";
|
||||
case invslot::PossessionsArms:
|
||||
case invslot::slotArms:
|
||||
return "Arms";
|
||||
case invslot::PossessionsBack:
|
||||
case invslot::slotBack:
|
||||
return "Back";
|
||||
case invslot::PossessionsWrist1:
|
||||
case invslot::slotWrist1:
|
||||
return "Wrist 1";
|
||||
case invslot::PossessionsWrist2:
|
||||
case invslot::slotWrist2:
|
||||
return "Wrist 2";
|
||||
case invslot::PossessionsRange:
|
||||
case invslot::slotRange:
|
||||
return "Range";
|
||||
case invslot::PossessionsHands:
|
||||
case invslot::slotHands:
|
||||
return "Hands";
|
||||
case invslot::PossessionsPrimary:
|
||||
case invslot::slotPrimary:
|
||||
return "Primary";
|
||||
case invslot::PossessionsSecondary:
|
||||
case invslot::slotSecondary:
|
||||
return "Secondary";
|
||||
case invslot::PossessionsFinger1:
|
||||
case invslot::slotFinger1:
|
||||
return "Finger 1";
|
||||
case invslot::PossessionsFinger2:
|
||||
case invslot::slotFinger2:
|
||||
return "Finger 2";
|
||||
case invslot::PossessionsChest:
|
||||
case invslot::slotChest:
|
||||
return "Chest";
|
||||
case invslot::PossessionsLegs:
|
||||
case invslot::slotLegs:
|
||||
return "Legs";
|
||||
case invslot::PossessionsFeet:
|
||||
case invslot::slotFeet:
|
||||
return "Feet";
|
||||
case invslot::PossessionsWaist:
|
||||
case invslot::slotWaist:
|
||||
return "Waist";
|
||||
case invslot::PossessionsPowerSource:
|
||||
case invslot::slotPowerSource:
|
||||
return "Power Source";
|
||||
case invslot::PossessionsAmmo:
|
||||
case invslot::slotAmmo:
|
||||
return "Ammo";
|
||||
case invslot::PossessionsGeneral1:
|
||||
case invslot::slotGeneral1:
|
||||
return "General 1";
|
||||
case invslot::PossessionsGeneral2:
|
||||
case invslot::slotGeneral2:
|
||||
return "General 2";
|
||||
case invslot::PossessionsGeneral3:
|
||||
case invslot::slotGeneral3:
|
||||
return "General 3";
|
||||
case invslot::PossessionsGeneral4:
|
||||
case invslot::slotGeneral4:
|
||||
return "General 4";
|
||||
case invslot::PossessionsGeneral5:
|
||||
case invslot::slotGeneral5:
|
||||
return "General 5";
|
||||
case invslot::PossessionsGeneral6:
|
||||
case invslot::slotGeneral6:
|
||||
return "General 6";
|
||||
case invslot::PossessionsGeneral7:
|
||||
case invslot::slotGeneral7:
|
||||
return "General 7";
|
||||
case invslot::PossessionsGeneral8:
|
||||
case invslot::slotGeneral8:
|
||||
return "General 8";
|
||||
case invslot::PossessionsCursor:
|
||||
case invslot::slotCursor:
|
||||
return "Cursor";
|
||||
default:
|
||||
return "Unknown Slot";
|
||||
}
|
||||
}
|
||||
|
||||
const char* UF::invslot::GetInvCorpseSlotName(int inv_slot)
|
||||
const char* UF::invslot::GetInvCorpseSlotName(int16 inv_slot)
|
||||
{
|
||||
if (!invtype::GetInvTypeSize(invtype::InvTypeCorpse) || inv_slot == invslot::InvSlotInvalid)
|
||||
if (!invtype::GetInvTypeSize(invtype::typeCorpse) || inv_slot == invslot::SLOT_INVALID)
|
||||
return "Invalid Slot";
|
||||
|
||||
// needs work
|
||||
if ((size_t)(inv_slot + 1) < invslot::CorpseBegin || (size_t)(inv_slot + 1) >= invslot::CorpseEnd)
|
||||
if ((inv_slot + 1) < invslot::CORPSE_BEGIN || (inv_slot + 1) >= invslot::CORPSE_END)
|
||||
return "Unknown Slot";
|
||||
|
||||
static std::string ret_str;
|
||||
@@ -222,19 +222,19 @@ const char* UF::invslot::GetInvCorpseSlotName(int inv_slot)
|
||||
return ret_str.c_str();
|
||||
}
|
||||
|
||||
const char* UF::invslot::GetInvSlotName(int inv_type, int inv_slot)
|
||||
const char* UF::invslot::GetInvSlotName(int16 inv_type, int16 inv_slot)
|
||||
{
|
||||
if (inv_type == invtype::InvTypePossessions)
|
||||
if (inv_type == invtype::typePossessions)
|
||||
return invslot::GetInvPossessionsSlotName(inv_slot);
|
||||
else if (inv_type == invtype::InvTypeCorpse)
|
||||
else if (inv_type == invtype::typeCorpse)
|
||||
return invslot::GetInvCorpseSlotName(inv_slot);
|
||||
|
||||
size_t type_size = invtype::GetInvTypeSize(inv_type);
|
||||
int16 type_size = invtype::GetInvTypeSize(inv_type);
|
||||
|
||||
if (!type_size || inv_slot == invslot::InvSlotInvalid)
|
||||
if (!type_size || inv_slot == invslot::SLOT_INVALID)
|
||||
return "Invalid Slot";
|
||||
|
||||
if ((size_t)(inv_slot + 1) >= type_size)
|
||||
if ((inv_slot + 1) >= type_size)
|
||||
return "Unknown Slot";
|
||||
|
||||
static std::string ret_str;
|
||||
@@ -243,12 +243,12 @@ const char* UF::invslot::GetInvSlotName(int inv_type, int inv_slot)
|
||||
return ret_str.c_str();
|
||||
}
|
||||
|
||||
const char* UF::invbag::GetInvBagIndexName(int bag_index)
|
||||
const char* UF::invbag::GetInvBagIndexName(int16 bag_index)
|
||||
{
|
||||
if (bag_index == invbag::InvBagInvalid)
|
||||
if (bag_index == invbag::SLOT_INVALID)
|
||||
return "Invalid Bag";
|
||||
|
||||
if ((size_t)bag_index >= invbag::ItemBagSize)
|
||||
if (bag_index >= invbag::SLOT_COUNT)
|
||||
return "Unknown Bag";
|
||||
|
||||
static std::string ret_str;
|
||||
@@ -257,12 +257,12 @@ const char* UF::invbag::GetInvBagIndexName(int bag_index)
|
||||
return ret_str.c_str();
|
||||
}
|
||||
|
||||
const char* UF::invaug::GetInvAugIndexName(int aug_index)
|
||||
const char* UF::invaug::GetInvAugIndexName(int16 aug_index)
|
||||
{
|
||||
if (aug_index == invaug::InvAugInvalid)
|
||||
if (aug_index == invaug::SOCKET_INVALID)
|
||||
return "Invalid Augment";
|
||||
|
||||
if ((size_t)aug_index >= invaug::ItemAugSize)
|
||||
if (aug_index >= invaug::SOCKET_COUNT)
|
||||
return "Unknown Augment";
|
||||
|
||||
static std::string ret_str;
|
||||
|
||||
+194
-206
@@ -27,109 +27,219 @@
|
||||
|
||||
namespace UF
|
||||
{
|
||||
enum : int { Invalid = -1, Null, Safety };
|
||||
const int16 IINVALID = -1;
|
||||
const int16 INULL = 0;
|
||||
|
||||
enum : bool { False = false, True = true };
|
||||
|
||||
// pre-declarations
|
||||
namespace inventory {
|
||||
inline EQEmu::versions::ClientVersion GetInventoryRef() { return EQEmu::versions::ClientVersion::UF; }
|
||||
|
||||
const bool ConcatenateInvTypeLimbo = true;
|
||||
|
||||
const bool AllowOverLevelEquipment = true;
|
||||
|
||||
const bool AllowEmptyBagInBag = false;
|
||||
const bool AllowClickCastFromBag = false;
|
||||
|
||||
} /*inventory*/
|
||||
|
||||
namespace invtype {
|
||||
inline EQEmu::versions::ClientVersion GetInvTypeRef() { return EQEmu::versions::ClientVersion::UF; }
|
||||
|
||||
enum : int { InvTypeInvalid = -1, InvTypeBegin };
|
||||
namespace enum_ {
|
||||
enum InventoryTypes : int16 {
|
||||
typePossessions = INULL,
|
||||
typeBank,
|
||||
typeSharedBank,
|
||||
typeTrade,
|
||||
typeWorld,
|
||||
typeLimbo,
|
||||
typeTribute,
|
||||
typeGuildTribute,
|
||||
typeMerchant,
|
||||
typeCorpse,
|
||||
typeBazaar,
|
||||
typeInspect,
|
||||
typeViewMODPC,
|
||||
typeViewMODBank,
|
||||
typeViewMODSharedBank,
|
||||
typeViewMODLimbo,
|
||||
typeAltStorage,
|
||||
typeArchived,
|
||||
typeOther
|
||||
};
|
||||
|
||||
enum InventoryType : int {
|
||||
InvTypePossessions = InvTypeBegin,
|
||||
InvTypeBank,
|
||||
InvTypeSharedBank,
|
||||
InvTypeTrade,
|
||||
InvTypeWorld,
|
||||
InvTypeLimbo,
|
||||
InvTypeTribute,
|
||||
InvTypeGuildTribute,
|
||||
InvTypeMerchant,
|
||||
InvTypeCorpse,
|
||||
InvTypeBazaar,
|
||||
InvTypeInspect,
|
||||
InvTypeViewMODPC,
|
||||
InvTypeViewMODBank,
|
||||
InvTypeViewMODSharedBank,
|
||||
InvTypeViewMODLimbo,
|
||||
InvTypeAltStorage,
|
||||
InvTypeArchived,
|
||||
InvTypeOther,
|
||||
InvTypeCount
|
||||
};
|
||||
} // namespace enum_
|
||||
using namespace enum_;
|
||||
|
||||
const int16 POSSESSIONS_SIZE = 32;
|
||||
const int16 BANK_SIZE = 24;
|
||||
const int16 SHARED_BANK_SIZE = 2;
|
||||
const int16 TRADE_SIZE = 8;
|
||||
const int16 WORLD_SIZE = 10;
|
||||
const int16 LIMBO_SIZE = 36;
|
||||
const int16 TRIBUTE_SIZE = 5;
|
||||
const int16 GUILD_TRIBUTE_SIZE = 2;
|
||||
const int16 MERCHANT_SIZE = 80;
|
||||
const int16 CORPSE_SIZE = POSSESSIONS_SIZE;
|
||||
const int16 BAZAAR_SIZE = 80;
|
||||
const int16 INSPECT_SIZE = 23;
|
||||
const int16 VIEW_MOD_PC_SIZE = POSSESSIONS_SIZE;
|
||||
const int16 VIEW_MOD_BANK_SIZE = BANK_SIZE;
|
||||
const int16 VIEW_MOD_SHARED_BANK_SIZE = SHARED_BANK_SIZE;
|
||||
const int16 VIEW_MOD_LIMBO_SIZE = LIMBO_SIZE;
|
||||
const int16 ALT_STORAGE_SIZE = 0;//unknown - "Shroud Bank"
|
||||
const int16 ARCHIVED_SIZE = 0;//unknown
|
||||
const int16 OTHER_SIZE = 0;//unknown
|
||||
|
||||
const int16 TRADE_NPC_SIZE = 4; // defined by implication
|
||||
|
||||
const int16 TYPE_INVALID = IINVALID;
|
||||
const int16 TYPE_BEGIN = typePossessions;
|
||||
const int16 TYPE_END = typeOther;
|
||||
const int16 TYPE_COUNT = (TYPE_END - TYPE_BEGIN) + 1;
|
||||
|
||||
int16 GetInvTypeSize(int16 inv_type);
|
||||
const char* GetInvTypeName(int16 inv_type);
|
||||
|
||||
bool IsInvTypePersistent(int16 inv_type);
|
||||
|
||||
} /*invtype*/
|
||||
|
||||
namespace invslot {
|
||||
inline EQEmu::versions::ClientVersion GetInvSlotRef() { return EQEmu::versions::ClientVersion::UF; }
|
||||
|
||||
enum : int { InvSlotInvalid = -1, InvSlotBegin };
|
||||
namespace enum_ {
|
||||
enum InventorySlots : int16 {
|
||||
slotCharm = INULL,
|
||||
slotEar1,
|
||||
slotHead,
|
||||
slotFace,
|
||||
slotEar2,
|
||||
slotNeck,
|
||||
slotShoulders,
|
||||
slotArms,
|
||||
slotBack,
|
||||
slotWrist1,
|
||||
slotWrist2,
|
||||
slotRange,
|
||||
slotHands,
|
||||
slotPrimary,
|
||||
slotSecondary,
|
||||
slotFinger1,
|
||||
slotFinger2,
|
||||
slotChest,
|
||||
slotLegs,
|
||||
slotFeet,
|
||||
slotWaist,
|
||||
slotPowerSource,
|
||||
slotAmmo,
|
||||
slotGeneral1,
|
||||
slotGeneral2,
|
||||
slotGeneral3,
|
||||
slotGeneral4,
|
||||
slotGeneral5,
|
||||
slotGeneral6,
|
||||
slotGeneral7,
|
||||
slotGeneral8,
|
||||
slotCursor
|
||||
};
|
||||
|
||||
enum PossessionsSlot : int {
|
||||
PossessionsCharm = InvSlotBegin,
|
||||
PossessionsEar1,
|
||||
PossessionsHead,
|
||||
PossessionsFace,
|
||||
PossessionsEar2,
|
||||
PossessionsNeck,
|
||||
PossessionsShoulders,
|
||||
PossessionsArms,
|
||||
PossessionsBack,
|
||||
PossessionsWrist1,
|
||||
PossessionsWrist2,
|
||||
PossessionsRange,
|
||||
PossessionsHands,
|
||||
PossessionsPrimary,
|
||||
PossessionsSecondary,
|
||||
PossessionsFinger1,
|
||||
PossessionsFinger2,
|
||||
PossessionsChest,
|
||||
PossessionsLegs,
|
||||
PossessionsFeet,
|
||||
PossessionsWaist,
|
||||
PossessionsPowerSource,
|
||||
PossessionsAmmo,
|
||||
PossessionsGeneral1,
|
||||
PossessionsGeneral2,
|
||||
PossessionsGeneral3,
|
||||
PossessionsGeneral4,
|
||||
PossessionsGeneral5,
|
||||
PossessionsGeneral6,
|
||||
PossessionsGeneral7,
|
||||
PossessionsGeneral8,
|
||||
PossessionsCursor,
|
||||
PossessionsCount
|
||||
};
|
||||
} // namespace enum_
|
||||
using namespace enum_;
|
||||
|
||||
const int EquipmentBegin = PossessionsCharm;
|
||||
const int EquipmentEnd = PossessionsAmmo;
|
||||
const int EquipmentCount = (EquipmentEnd - EquipmentBegin + 1);
|
||||
const int16 SLOT_INVALID = IINVALID;
|
||||
const int16 SLOT_BEGIN = INULL;
|
||||
|
||||
const int GeneralBegin = PossessionsGeneral1;
|
||||
const int GeneralEnd = PossessionsGeneral8;
|
||||
const int GeneralCount = (GeneralEnd - GeneralBegin + 1);
|
||||
const int16 POSSESSIONS_BEGIN = slotCharm;
|
||||
const int16 POSSESSIONS_END = slotCursor;
|
||||
const int16 POSSESSIONS_COUNT = (POSSESSIONS_END - POSSESSIONS_BEGIN) + 1;
|
||||
|
||||
const int16 EQUIPMENT_BEGIN = slotCharm;
|
||||
const int16 EQUIPMENT_END = slotAmmo;
|
||||
const int16 EQUIPMENT_COUNT = (EQUIPMENT_END - EQUIPMENT_BEGIN + 1);
|
||||
|
||||
const int16 GENERAL_BEGIN = slotGeneral1;
|
||||
const int16 GENERAL_END = slotGeneral8;
|
||||
const int16 GENERAL_COUNT = (GENERAL_END - GENERAL_BEGIN + 1);
|
||||
|
||||
const int16 BONUS_BEGIN = invslot::slotCharm;
|
||||
const int16 BONUS_STAT_END = invslot::slotPowerSource;
|
||||
const int16 BONUS_SKILL_END = invslot::slotAmmo;
|
||||
|
||||
const int16 BANK_BEGIN = 2000;
|
||||
const int16 BANK_END = (BANK_BEGIN + invtype::BANK_SIZE) - 1;
|
||||
|
||||
const int16 SHARED_BANK_BEGIN = 2500;
|
||||
const int16 SHARED_BANK_END = (SHARED_BANK_BEGIN + invtype::SHARED_BANK_SIZE) - 1;
|
||||
|
||||
const int16 TRADE_BEGIN = 3000;
|
||||
const int16 TRADE_END = (TRADE_BEGIN + invtype::TRADE_SIZE) - 1;
|
||||
|
||||
const int16 TRADE_NPC_END = (TRADE_BEGIN + invtype::TRADE_NPC_SIZE) - 1; // defined by implication
|
||||
|
||||
const int16 WORLD_BEGIN = 4000;
|
||||
const int16 WORLD_END = (WORLD_BEGIN + invtype::WORLD_SIZE) - 1;
|
||||
|
||||
const int16 TRIBUTE_BEGIN = 400;
|
||||
const int16 TRIBUTE_END = (TRIBUTE_BEGIN + invtype::TRIBUTE_SIZE) - 1;
|
||||
|
||||
const int16 GUILD_TRIBUTE_BEGIN = 450;
|
||||
const int16 GUILD_TRIBUTE_END = (GUILD_TRIBUTE_BEGIN + invtype::GUILD_TRIBUTE_SIZE) - 1;
|
||||
|
||||
const int16 CORPSE_BEGIN = invslot::slotGeneral1;
|
||||
const int16 CORPSE_END = invslot::slotGeneral1 + invslot::slotCursor;
|
||||
|
||||
const uint64 POSSESSIONS_BITMASK = 0x000000027FFFFFFF; // based on 34-slot count (RoF+)
|
||||
const uint64 CORPSE_BITMASK = 0x01FFFFFE7F800000; // based on 34-slot count (RoF+)
|
||||
|
||||
const char* GetInvPossessionsSlotName(int16 inv_slot);
|
||||
const char* GetInvCorpseSlotName(int16 inv_slot);
|
||||
const char* GetInvSlotName(int16 inv_type, int16 inv_slot);
|
||||
|
||||
} /*invslot*/
|
||||
|
||||
namespace invbag {
|
||||
inline EQEmu::versions::ClientVersion GetInvBagRef() { return EQEmu::versions::ClientVersion::UF; }
|
||||
|
||||
enum : int { InvBagInvalid = -1, InvBagBegin };
|
||||
const int16 SLOT_INVALID = IINVALID;
|
||||
const int16 SLOT_BEGIN = INULL;
|
||||
const int16 SLOT_END = 9;
|
||||
const int16 SLOT_COUNT = 10;
|
||||
|
||||
const int16 GENERAL_BAGS_BEGIN = 262;
|
||||
const int16 GENERAL_BAGS_COUNT = invslot::GENERAL_COUNT * SLOT_COUNT;
|
||||
const int16 GENERAL_BAGS_END = (GENERAL_BAGS_BEGIN + GENERAL_BAGS_COUNT) - 1;
|
||||
|
||||
const int16 CURSOR_BAG_BEGIN = 342;
|
||||
const int16 CURSOR_BAG_COUNT = SLOT_COUNT;
|
||||
const int16 CURSOR_BAG_END = (CURSOR_BAG_BEGIN + CURSOR_BAG_COUNT) - 1;
|
||||
|
||||
const int16 BANK_BAGS_BEGIN = 2032;
|
||||
const int16 BANK_BAGS_COUNT = (invtype::BANK_SIZE * SLOT_COUNT);
|
||||
const int16 BANK_BAGS_END = (BANK_BAGS_BEGIN + BANK_BAGS_COUNT) - 1;
|
||||
|
||||
const int16 SHARED_BANK_BAGS_BEGIN = 2532;
|
||||
const int16 SHARED_BANK_BAGS_COUNT = invtype::SHARED_BANK_SIZE * SLOT_COUNT;
|
||||
const int16 SHARED_BANK_BAGS_END = (SHARED_BANK_BAGS_BEGIN + SHARED_BANK_BAGS_COUNT) - 1;
|
||||
|
||||
const int16 TRADE_BAGS_BEGIN = 3031;
|
||||
const int16 TRADE_BAGS_COUNT = invtype::TRADE_SIZE * SLOT_COUNT;
|
||||
const int16 TRADE_BAGS_END = (TRADE_BAGS_BEGIN + TRADE_BAGS_COUNT) - 1;
|
||||
|
||||
const char* GetInvBagIndexName(int16 bag_index);
|
||||
|
||||
} /*invbag*/
|
||||
|
||||
namespace invaug {
|
||||
inline EQEmu::versions::ClientVersion GetInvAugRef() { return EQEmu::versions::ClientVersion::UF; }
|
||||
|
||||
enum : int { InvAugInvalid = -1, InvAugBegin };
|
||||
const int16 SOCKET_INVALID = IINVALID;
|
||||
const int16 SOCKET_BEGIN = INULL;
|
||||
const int16 SOCKET_END = 4;
|
||||
const int16 SOCKET_COUNT = 5;
|
||||
|
||||
const char* GetInvAugIndexName(int16 aug_index);
|
||||
|
||||
} /*invaug*/
|
||||
|
||||
namespace item {
|
||||
@@ -154,147 +264,21 @@ namespace UF
|
||||
namespace profile {
|
||||
inline EQEmu::versions::ClientVersion GetProfileRef() { return EQEmu::versions::ClientVersion::UF; }
|
||||
|
||||
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
|
||||
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
||||
|
||||
const int16 POTION_BELT_SIZE = 5;
|
||||
|
||||
const int16 SKILL_ARRAY_SIZE = 100;
|
||||
|
||||
} /*profile*/
|
||||
|
||||
namespace constants {
|
||||
inline EQEmu::versions::ClientVersion GetConstantsRef() { return EQEmu::versions::ClientVersion::UF; }
|
||||
|
||||
} /*constants*/
|
||||
const size_t CHARACTER_CREATION_LIMIT = 12;
|
||||
|
||||
namespace behavior {
|
||||
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::UF; }
|
||||
|
||||
} /*behavior*/
|
||||
|
||||
namespace skills {
|
||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::UF; }
|
||||
|
||||
} /*skills*/
|
||||
|
||||
|
||||
// declarations
|
||||
namespace inventory {
|
||||
const bool ConcatenateInvTypeLimbo = true;
|
||||
|
||||
const bool AllowOverLevelEquipment = true;
|
||||
|
||||
const bool AllowEmptyBagInBag = false;
|
||||
const bool AllowClickCastFromBag = false;
|
||||
|
||||
} /*inventory*/
|
||||
|
||||
namespace invtype {
|
||||
const size_t InvTypePossessionsSize = invslot::PossessionsCount;
|
||||
const size_t InvTypeBankSize = 24;
|
||||
const size_t InvTypeSharedBankSize = 2;
|
||||
const size_t InvTypeTradeSize = 8;
|
||||
const size_t InvTypeWorldSize = 10;
|
||||
const size_t InvTypeLimboSize = 36;
|
||||
const size_t InvTypeTributeSize = 5;
|
||||
const size_t InvTypeGuildTributeSize = 2;
|
||||
const size_t InvTypeMerchantSize = 80;
|
||||
const size_t InvTypeCorpseSize = InvTypePossessionsSize;
|
||||
const size_t InvTypeBazaarSize = 80;
|
||||
const size_t InvTypeInspectSize = invslot::EquipmentCount;
|
||||
const size_t InvTypeViewMODPCSize = InvTypePossessionsSize;
|
||||
const size_t InvTypeViewMODBankSize = InvTypeBankSize;
|
||||
const size_t InvTypeViewMODSharedBankSize = InvTypeSharedBankSize;
|
||||
const size_t InvTypeViewMODLimboSize = InvTypeLimboSize;
|
||||
const size_t InvTypeAltStorageSize = 0;//unknown - "Shroud Bank"
|
||||
const size_t InvTypeArchivedSize = 0;//unknown
|
||||
const size_t InvTypeOtherSize = 0;//unknown
|
||||
|
||||
extern size_t GetInvTypeSize(int inv_type);
|
||||
extern const char* GetInvTypeName(int inv_type);
|
||||
|
||||
extern bool IsInvTypePersistent(int inv_type);
|
||||
|
||||
} /*invtype*/
|
||||
|
||||
namespace invslot {
|
||||
const int BankBegin = 2000;
|
||||
const int BankEnd = (BankBegin + invtype::InvTypeBankSize) - 1;
|
||||
|
||||
const int SharedBankBegin = 2500;
|
||||
const int SharedBankEnd = (SharedBankBegin + invtype::InvTypeSharedBankSize) - 1;
|
||||
|
||||
const int TradeBegin = 3000;
|
||||
const int TradeEnd = (TradeBegin + invtype::InvTypeTradeSize) - 1;
|
||||
const int TradeNPCEnd = 3003;
|
||||
|
||||
const int WorldBegin = 4000;
|
||||
const int WorldEnd = (WorldBegin + invtype::InvTypeWorldSize) - 1;
|
||||
|
||||
const int TributeBegin = 400;
|
||||
const int TributeEnd = (TributeBegin + invtype::InvTypeTributeSize) - 1;
|
||||
|
||||
const int GuildTributeBegin = 450;
|
||||
const int GuildTributeEnd = (GuildTributeBegin + invtype::InvTypeGuildTributeSize) - 1;
|
||||
|
||||
const int CorpseBegin = invslot::PossessionsGeneral1;
|
||||
const int CorpseEnd = invslot::PossessionsGeneral1 + invslot::PossessionsCursor;
|
||||
|
||||
extern const char* GetInvPossessionsSlotName(int inv_slot);
|
||||
extern const char* GetInvCorpseSlotName(int inv_slot);
|
||||
extern const char* GetInvSlotName(int inv_type, int inv_slot);
|
||||
|
||||
} /*invslot*/
|
||||
|
||||
namespace invbag {
|
||||
const size_t ItemBagSize = 10;
|
||||
|
||||
const int GeneralBagsBegin = 262;
|
||||
const int GeneralBagsSize = invslot::GeneralCount * ItemBagSize;
|
||||
const int GeneralBagsEnd = (GeneralBagsBegin + GeneralBagsSize) - 1;
|
||||
|
||||
const int CursorBagBegin = 342;
|
||||
const int CursorBagSize = ItemBagSize;
|
||||
const int CursorBagEnd = (CursorBagBegin + CursorBagSize) - 1;
|
||||
|
||||
const int BankBagsBegin = 2032;
|
||||
const int BankBagsSize = (invtype::InvTypeBankSize * ItemBagSize);
|
||||
const int BankBagsEnd = (BankBagsBegin + BankBagsSize) - 1;
|
||||
|
||||
const int SharedBankBagsBegin = 2532;
|
||||
const int SharedBankBagsSize = invtype::InvTypeSharedBankSize * ItemBagSize;
|
||||
const int SharedBankBagsEnd = (SharedBankBagsBegin + SharedBankBagsSize) - 1;
|
||||
|
||||
const int TradeBagsBegin = 3031;
|
||||
const int TradeBagsSize = invtype::InvTypeTradeSize * ItemBagSize;
|
||||
const int TradeBagsEnd = (TradeBagsBegin + TradeBagsSize) - 1;
|
||||
|
||||
extern const char* GetInvBagIndexName(int bag_index);
|
||||
|
||||
} /*invbag*/
|
||||
|
||||
namespace invaug {
|
||||
const size_t ItemAugSize = 5;
|
||||
|
||||
extern const char* GetInvAugIndexName(int aug_index);
|
||||
|
||||
} /*invaug*/
|
||||
|
||||
namespace item {
|
||||
|
||||
} /*item*/
|
||||
|
||||
namespace profile {
|
||||
const size_t TributeSize = invtype::InvTypeTributeSize;
|
||||
const size_t GuildTributeSize = invtype::InvTypeGuildTributeSize;
|
||||
|
||||
const size_t BandoliersSize = 20; // number of bandolier instances
|
||||
const size_t BandolierItemCount = 4; // number of equipment slots in bandolier instance
|
||||
|
||||
const size_t PotionBeltSize = 5;
|
||||
|
||||
const size_t SkillArraySize = 100;
|
||||
|
||||
} /*profile*/
|
||||
|
||||
namespace constants {
|
||||
const size_t CharacterCreationLimit = 12;
|
||||
|
||||
const size_t SayLinkBodySize = 50;
|
||||
const size_t SAY_LINK_BODY_SIZE = 50;
|
||||
|
||||
const int LongBuffs = 30;
|
||||
const int ShortBuffs = 20;
|
||||
@@ -307,11 +291,15 @@ namespace UF
|
||||
} /*constants*/
|
||||
|
||||
namespace behavior {
|
||||
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::UF; }
|
||||
|
||||
const bool CoinHasWeight = false;
|
||||
|
||||
} /*behavior*/
|
||||
|
||||
namespace skills {
|
||||
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::UF; }
|
||||
|
||||
const size_t LastUsableSkill = EQEmu::skills::SkillTripleAttack;
|
||||
|
||||
} /*skills*/
|
||||
|
||||
@@ -72,7 +72,6 @@ E(OP_MoveItem)
|
||||
E(OP_NewSpawn)
|
||||
E(OP_NewZone)
|
||||
E(OP_OnLevelMessage)
|
||||
E(OP_OpenNewTasksWindow)
|
||||
E(OP_PetBuffWindow)
|
||||
E(OP_PlayerProfile)
|
||||
E(OP_RaidJoin)
|
||||
|
||||
@@ -746,7 +746,7 @@ struct BandolierItem_Struct
|
||||
struct Bandolier_Struct
|
||||
{
|
||||
char Name[32];
|
||||
BandolierItem_Struct Items[profile::BandolierItemCount];
|
||||
BandolierItem_Struct Items[profile::BANDOLIER_ITEM_COUNT];
|
||||
};
|
||||
|
||||
//len = 72
|
||||
@@ -760,7 +760,7 @@ struct PotionBeltItem_Struct
|
||||
//len = 288
|
||||
struct PotionBelt_Struct
|
||||
{
|
||||
PotionBeltItem_Struct Items[profile::PotionBeltSize];
|
||||
PotionBeltItem_Struct Items[profile::POTION_BELT_SIZE];
|
||||
};
|
||||
|
||||
static const uint32 MAX_GROUP_LEADERSHIP_AA_ARRAY = 16;
|
||||
@@ -969,7 +969,7 @@ struct PlayerProfile_Struct
|
||||
/*11236*/ uint32 aapoints_spent; // Number of spent AA points
|
||||
/*11240*/ uint32 aapoints; // Unspent AA points
|
||||
/*11244*/ uint8 unknown11244[4];
|
||||
/*11248*/ Bandolier_Struct bandoliers[profile::BandoliersSize]; // [6400] bandolier contents
|
||||
/*11248*/ Bandolier_Struct bandoliers[profile::BANDOLIERS_SIZE]; // [6400] bandolier contents
|
||||
/*17648*/ PotionBelt_Struct potionbelt; // [360] potion belt 72 extra octets by adding 1 more belt slot
|
||||
/*18008*/ uint8 unknown18008[8];
|
||||
/*18016*/ uint32 available_slots;
|
||||
|
||||
@@ -158,6 +158,7 @@ RULE_BOOL(Character, UseOldConSystem, false) // Grant Health of Target's Target
|
||||
RULE_BOOL(Character, OPClientUpdateVisualDebug, false) // Shows a pulse and forward directional particle each time the client sends its position to server
|
||||
RULE_BOOL(Character, AllowCrossClassTrainers, false)
|
||||
RULE_BOOL(Character, PetsUseReagents, true) //Pets use reagent on spells
|
||||
RULE_BOOL(Character, DismountWater, true) // Dismount horses when entering water
|
||||
RULE_CATEGORY_END()
|
||||
|
||||
RULE_CATEGORY(Mercs)
|
||||
@@ -601,6 +602,9 @@ RULE_BOOL(Bots, BotLevelsWithOwner, false) // Auto-updates spawned bots as owner
|
||||
RULE_BOOL(Bots, BotCharacterLevelEnabled, false) // Enables required level to spawn bots
|
||||
RULE_INT(Bots, BotCharacterLevel, 0) // 0 as default (if level > this value you can spawn bots if BotCharacterLevelEnabled is true)
|
||||
RULE_INT(Bots, CasterStopMeleeLevel, 13) // Level at which caster bots stop melee attacks
|
||||
RULE_INT(Bots, AllowedClasses, 0xFFFFFFFF) // Bitmask of allowed bot classes
|
||||
RULE_INT(Bots, AllowedRaces, 0xFFFFFFFF) // Bitmask of allowed bot races
|
||||
RULE_INT(Bots, AllowedGenders, 0x3) // Bitmask of allowed bot genders
|
||||
RULE_CATEGORY_END()
|
||||
#endif
|
||||
|
||||
|
||||
+7
-7
@@ -29,7 +29,7 @@
|
||||
bool EQEmu::saylink::DegenerateLinkBody(SayLinkBody_Struct& say_link_body_struct, const std::string& say_link_body)
|
||||
{
|
||||
memset(&say_link_body_struct, 0, sizeof(say_link_body_struct));
|
||||
if (say_link_body.length() != EQEmu::constants::SayLinkBodySize)
|
||||
if (say_link_body.length() != EQEmu::constants::SAY_LINK_BODY_SIZE)
|
||||
return false;
|
||||
|
||||
say_link_body_struct.action_id = (uint8)strtol(say_link_body.substr(0, 1).c_str(), nullptr, 16);
|
||||
@@ -68,7 +68,7 @@ bool EQEmu::saylink::GenerateLinkBody(std::string& say_link_body, const SayLinkB
|
||||
(0xFFFFFFFF & say_link_body_struct.hash)
|
||||
);
|
||||
|
||||
if (say_link_body.length() != EQEmu::constants::SayLinkBodySize)
|
||||
if (say_link_body.length() != EQEmu::constants::SAY_LINK_BODY_SIZE)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -88,25 +88,25 @@ const std::string& EQEmu::SayLinkEngine::GenerateLink()
|
||||
generate_body();
|
||||
generate_text();
|
||||
|
||||
if ((m_LinkBody.length() == EQEmu::constants::SayLinkBodySize) && (m_LinkText.length() > 0)) {
|
||||
if ((m_LinkBody.length() == EQEmu::constants::SAY_LINK_BODY_SIZE) && (m_LinkText.length() > 0)) {
|
||||
m_Link.push_back(0x12);
|
||||
m_Link.append(m_LinkBody);
|
||||
m_Link.append(m_LinkText);
|
||||
m_Link.push_back(0x12);
|
||||
}
|
||||
|
||||
if ((m_Link.length() == 0) || (m_Link.length() > (EQEmu::constants::SayLinkMaximumSize))) {
|
||||
if ((m_Link.length() == 0) || (m_Link.length() > (EQEmu::constants::SAY_LINK_MAXIMUM_SIZE))) {
|
||||
m_Error = true;
|
||||
m_Link = "<LINKER ERROR>";
|
||||
Log(Logs::General, Logs::Error, "SayLinkEngine::GenerateLink() failed to generate a useable say link");
|
||||
Log(Logs::General, Logs::Error, ">> LinkType: %i, Lengths: {link: %u(%u), body: %u(%u), text: %u(%u)}",
|
||||
m_LinkType,
|
||||
m_Link.length(),
|
||||
EQEmu::constants::SayLinkMaximumSize,
|
||||
EQEmu::constants::SAY_LINK_MAXIMUM_SIZE,
|
||||
m_LinkBody.length(),
|
||||
EQEmu::constants::SayLinkBodySize,
|
||||
EQEmu::constants::SAY_LINK_BODY_SIZE,
|
||||
m_LinkText.length(),
|
||||
EQEmu::constants::SayLinkTextSize
|
||||
EQEmu::constants::SAY_LINK_TEXT_SIZE
|
||||
);
|
||||
Log(Logs::General, Logs::Error, ">> LinkBody: %s", m_LinkBody.c_str());
|
||||
Log(Logs::General, Logs::Error, ">> LinkText: %s", m_LinkText.c_str());
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#include "serialize_buffer.h"
|
||||
|
||||
void SerializeBuffer::Grow(size_t new_size)
|
||||
{
|
||||
assert(new_size > m_capacity);
|
||||
auto new_buffer = new unsigned char[new_size * 2];
|
||||
memset(new_buffer, 0, new_size * 2);
|
||||
|
||||
if (m_buffer)
|
||||
memcpy(new_buffer, m_buffer, m_capacity);
|
||||
m_capacity = new_size * 2;
|
||||
delete[] m_buffer;
|
||||
m_buffer = new_buffer;
|
||||
}
|
||||
|
||||
void SerializeBuffer::Reset()
|
||||
{
|
||||
delete[] m_buffer;
|
||||
m_buffer = nullptr;
|
||||
m_capacity = 0;
|
||||
m_pos = 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,199 @@
|
||||
#ifndef SERIALIZE_BUFFER_H
|
||||
#define SERIALIZE_BUFFER_H
|
||||
|
||||
#include <cstring>
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
class SerializeBuffer
|
||||
{
|
||||
public:
|
||||
SerializeBuffer() : m_buffer(nullptr), m_capacity(0), m_pos(0) {}
|
||||
|
||||
explicit SerializeBuffer(size_t size) : m_capacity(size), m_pos(0)
|
||||
{
|
||||
m_buffer = new unsigned char[size];
|
||||
memset(m_buffer, 0, size);
|
||||
}
|
||||
|
||||
SerializeBuffer(const SerializeBuffer &rhs)
|
||||
: m_buffer(new unsigned char[rhs.m_capacity]), m_capacity(rhs.m_capacity), m_pos(rhs.m_pos)
|
||||
{
|
||||
memcpy(m_buffer, rhs.m_buffer, rhs.m_capacity);
|
||||
}
|
||||
|
||||
SerializeBuffer &operator=(const SerializeBuffer &rhs)
|
||||
{
|
||||
if (this != &rhs) {
|
||||
delete[] m_buffer;
|
||||
m_buffer = new unsigned char[rhs.m_capacity];
|
||||
m_capacity = rhs.m_capacity;
|
||||
m_pos = rhs.m_pos;
|
||||
memcpy(m_buffer, rhs.m_buffer, m_capacity);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
SerializeBuffer(SerializeBuffer &&rhs) : m_buffer(rhs.m_buffer), m_capacity(rhs.m_capacity), m_pos(rhs.m_pos)
|
||||
{
|
||||
rhs.m_buffer = nullptr;
|
||||
rhs.m_capacity = 0;
|
||||
rhs.m_pos = 0;
|
||||
}
|
||||
|
||||
SerializeBuffer &operator=(SerializeBuffer &&rhs)
|
||||
{
|
||||
if (this != &rhs) {
|
||||
delete[] m_buffer;
|
||||
|
||||
m_buffer = rhs.m_buffer;
|
||||
m_capacity = rhs.m_capacity;
|
||||
m_pos = rhs.m_pos;
|
||||
|
||||
rhs.m_buffer = nullptr;
|
||||
rhs.m_capacity = 0;
|
||||
rhs.m_pos = 0;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
~SerializeBuffer() { delete[] m_buffer; }
|
||||
|
||||
void WriteUInt8(uint8_t v)
|
||||
{
|
||||
if (m_pos + sizeof(uint8_t) > m_capacity)
|
||||
Grow(m_capacity + sizeof(uint8_t));
|
||||
*(uint8_t *)(m_buffer + m_pos) = v;
|
||||
m_pos += sizeof(uint8_t);
|
||||
}
|
||||
|
||||
void WriteUInt16(uint16_t v)
|
||||
{
|
||||
if (m_pos + sizeof(uint16_t) > m_capacity)
|
||||
Grow(m_capacity + sizeof(uint16_t));
|
||||
*(uint16_t *)(m_buffer + m_pos) = v;
|
||||
m_pos += sizeof(uint16_t);
|
||||
}
|
||||
|
||||
void WriteUInt32(uint32_t v)
|
||||
{
|
||||
if (m_pos + sizeof(uint32_t) > m_capacity)
|
||||
Grow(m_capacity + sizeof(uint32_t));
|
||||
*(uint32_t *)(m_buffer + m_pos) = v;
|
||||
m_pos += sizeof(uint32_t);
|
||||
}
|
||||
|
||||
void WriteUInt64(uint64_t v)
|
||||
{
|
||||
if (m_pos + sizeof(uint64_t) > m_capacity)
|
||||
Grow(m_capacity + sizeof(uint64_t));
|
||||
*(uint64_t *)(m_buffer + m_pos) = v;
|
||||
m_pos += sizeof(uint64_t);
|
||||
}
|
||||
|
||||
void WriteInt8(int8_t v)
|
||||
{
|
||||
if (m_pos + sizeof(int8_t) > m_capacity)
|
||||
Grow(m_capacity + sizeof(int8_t));
|
||||
*(int8_t *)(m_buffer + m_pos) = v;
|
||||
m_pos += sizeof(int8_t);
|
||||
}
|
||||
|
||||
void WriteInt16(int16_t v)
|
||||
{
|
||||
if (m_pos + sizeof(int16_t) > m_capacity)
|
||||
Grow(m_capacity + sizeof(int16_t));
|
||||
*(int16_t *)(m_buffer + m_pos) = v;
|
||||
m_pos += sizeof(int16_t);
|
||||
}
|
||||
|
||||
void WriteInt32(int32_t v)
|
||||
{
|
||||
if (m_pos + sizeof(int32_t) > m_capacity)
|
||||
Grow(m_capacity + sizeof(int32_t));
|
||||
*(int32_t *)(m_buffer + m_pos) = v;
|
||||
m_pos += sizeof(int32_t);
|
||||
}
|
||||
|
||||
void WriteInt64(int64_t v)
|
||||
{
|
||||
if (m_pos + sizeof(int64_t) > m_capacity)
|
||||
Grow(m_capacity + sizeof(int64_t));
|
||||
*(int64_t *)(m_buffer + m_pos) = v;
|
||||
m_pos += sizeof(int64_t);
|
||||
}
|
||||
|
||||
void WriteFloat(float v)
|
||||
{
|
||||
if (m_pos + sizeof(float) > m_capacity)
|
||||
Grow(m_capacity + sizeof(float));
|
||||
*(float *)(m_buffer + m_pos) = v;
|
||||
m_pos += sizeof(float);
|
||||
}
|
||||
|
||||
void WriteDouble(double v)
|
||||
{
|
||||
if (m_pos + sizeof(double) > m_capacity)
|
||||
Grow(m_capacity + sizeof(double));
|
||||
*(double *)(m_buffer + m_pos) = v;
|
||||
m_pos += sizeof(double);
|
||||
}
|
||||
|
||||
void WriteString(const char *str)
|
||||
{
|
||||
assert(str != nullptr);
|
||||
auto len = strlen(str) + 1;
|
||||
if (m_pos + len > m_capacity)
|
||||
Grow(m_capacity + len);
|
||||
memcpy(m_buffer + m_pos, str, len);
|
||||
m_pos += len;
|
||||
}
|
||||
|
||||
void WriteString(const std::string &str)
|
||||
{
|
||||
auto len = str.length() + 1;
|
||||
if (m_pos + len > m_capacity)
|
||||
Grow(m_capacity + len);
|
||||
memcpy(m_buffer + m_pos, str.c_str(), len);
|
||||
m_pos += len;
|
||||
}
|
||||
|
||||
void WriteLengthString(uint32_t len, const char *str)
|
||||
{
|
||||
assert(str != nullptr);
|
||||
if (m_pos + len + sizeof(uint32_t) > m_capacity)
|
||||
Grow(m_capacity + len + sizeof(uint32_t));
|
||||
*(uint32_t *)(m_buffer + m_pos) = len;
|
||||
m_pos += sizeof(uint32_t);
|
||||
memcpy(m_buffer + m_pos, str, len);
|
||||
m_pos += len;
|
||||
}
|
||||
|
||||
void WriteLengthString(const std::string &str)
|
||||
{
|
||||
uint32_t len = str.length();
|
||||
if (m_pos + len + sizeof(uint32_t) > m_capacity)
|
||||
Grow(m_capacity + len + sizeof(uint32_t));
|
||||
*(uint32_t *)(m_buffer + m_pos) = len;
|
||||
m_pos += sizeof(uint32_t);
|
||||
memcpy(m_buffer + m_pos, str.c_str(), len);
|
||||
m_pos += len;
|
||||
}
|
||||
|
||||
size_t size() const { return m_pos; }
|
||||
size_t length() const { return size(); }
|
||||
size_t capacity() const { return m_capacity; }
|
||||
const unsigned char *buffer() const { return m_buffer; }
|
||||
|
||||
friend class BasePacket;
|
||||
|
||||
private:
|
||||
void Grow(size_t new_size);
|
||||
void Reset();
|
||||
unsigned char *m_buffer;
|
||||
size_t m_capacity;
|
||||
size_t m_pos;
|
||||
};
|
||||
|
||||
#endif /* !SERIALIZE_BUFFER_H */
|
||||
+23
-21
@@ -151,8 +151,8 @@ bool SharedDatabase::SaveCursor(uint32 char_id, std::list<EQEmu::ItemInstance*>:
|
||||
std::string query = StringFormat("DELETE FROM inventory WHERE charid = %i "
|
||||
"AND ((slotid >= 8000 AND slotid <= 8999) "
|
||||
"OR slotid = %i OR (slotid >= %i AND slotid <= %i) )",
|
||||
char_id, EQEmu::inventory::slotCursor,
|
||||
EQEmu::legacy::CURSOR_BAG_BEGIN, EQEmu::legacy::CURSOR_BAG_END);
|
||||
char_id, EQEmu::invslot::slotCursor,
|
||||
EQEmu::invbag::CURSOR_BAG_BEGIN, EQEmu::invbag::CURSOR_BAG_END);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
std::cout << "Clearing cursor failed: " << results.ErrorMessage() << std::endl;
|
||||
@@ -163,7 +163,7 @@ bool SharedDatabase::SaveCursor(uint32 char_id, std::list<EQEmu::ItemInstance*>:
|
||||
for(auto it = start; it != end; ++it, i++) {
|
||||
if (i > 8999) { break; } // shouldn't be anything in the queue that indexes this high
|
||||
EQEmu::ItemInstance *inst = *it;
|
||||
int16 use_slot = (i == 8000) ? EQEmu::inventory::slotCursor : i;
|
||||
int16 use_slot = (i == 8000) ? EQEmu::invslot::slotCursor : i;
|
||||
if (!SaveInventory(char_id, inst, use_slot)) {
|
||||
return false;
|
||||
}
|
||||
@@ -208,10 +208,12 @@ bool SharedDatabase::VerifyInventory(uint32 account_id, int16 slot_id, const EQE
|
||||
bool SharedDatabase::SaveInventory(uint32 char_id, const EQEmu::ItemInstance* inst, int16 slot_id) {
|
||||
|
||||
//never save tribute slots:
|
||||
if (slot_id >= EQEmu::legacy::TRIBUTE_BEGIN && slot_id <= EQEmu::legacy::TRIBUTE_END)
|
||||
if (slot_id >= EQEmu::invslot::TRIBUTE_BEGIN && slot_id <= EQEmu::invslot::TRIBUTE_END)
|
||||
return true;
|
||||
if (slot_id >= EQEmu::invslot::GUILD_TRIBUTE_BEGIN && slot_id <= EQEmu::invslot::GUILD_TRIBUTE_END)
|
||||
return true;
|
||||
|
||||
if (slot_id >= EQEmu::legacy::SHARED_BANK_BEGIN && slot_id <= EQEmu::legacy::SHARED_BANK_BAGS_END) {
|
||||
if (slot_id >= EQEmu::invslot::SHARED_BANK_BEGIN && slot_id <= EQEmu::invbag::SHARED_BANK_BAGS_END) {
|
||||
// Shared bank inventory
|
||||
if (!inst) {
|
||||
return DeleteSharedBankSlot(char_id, slot_id);
|
||||
@@ -238,9 +240,9 @@ bool SharedDatabase::SaveInventory(uint32 char_id, const EQEmu::ItemInstance* in
|
||||
bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const EQEmu::ItemInstance* inst, int16 slot_id) {
|
||||
// need to check 'inst' argument for valid pointer
|
||||
|
||||
uint32 augslot[EQEmu::inventory::SocketCount] = { 0, 0, 0, 0, 0, 0 };
|
||||
uint32 augslot[EQEmu::invaug::SOCKET_COUNT] = { 0, 0, 0, 0, 0, 0 };
|
||||
if (inst->IsClassCommon()) {
|
||||
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
|
||||
for (int i = EQEmu::invaug::SOCKET_BEGIN; i <= EQEmu::invaug::SOCKET_END; i++) {
|
||||
EQEmu::ItemInstance *auginst = inst->GetItem(i);
|
||||
augslot[i] = (auginst && auginst->GetItem()) ? auginst->GetItem()->ID : 0;
|
||||
}
|
||||
@@ -270,7 +272,7 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const EQEmu::ItemInstan
|
||||
if (inst->IsClassBag() && EQEmu::InventoryProfile::SupportsContainers(slot_id))
|
||||
// Limiting to bag slot count will get rid of 'hidden' duplicated items and 'Invalid Slot ID'
|
||||
// messages through attrition (and the modded code in SaveInventory)
|
||||
for (uint8 idx = EQEmu::inventory::containerBegin; idx < inst->GetItem()->BagSlots && idx < EQEmu::inventory::ContainerCount; idx++) {
|
||||
for (uint8 idx = EQEmu::invbag::SLOT_BEGIN; idx < inst->GetItem()->BagSlots && idx <= EQEmu::invbag::SLOT_END; idx++) {
|
||||
const EQEmu::ItemInstance* baginst = inst->GetItem(idx);
|
||||
SaveInventory(char_id, baginst, EQEmu::InventoryProfile::CalcSlotId(slot_id, idx));
|
||||
}
|
||||
@@ -285,9 +287,9 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const EQEmu::ItemInstan
|
||||
bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const EQEmu::ItemInstance* inst, int16 slot_id) {
|
||||
// need to check 'inst' argument for valid pointer
|
||||
|
||||
uint32 augslot[EQEmu::inventory::SocketCount] = { 0, 0, 0, 0, 0, 0 };
|
||||
uint32 augslot[EQEmu::invaug::SOCKET_COUNT] = { 0, 0, 0, 0, 0, 0 };
|
||||
if (inst->IsClassCommon()) {
|
||||
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
|
||||
for (int i = EQEmu::invaug::SOCKET_BEGIN; i <= EQEmu::invaug::SOCKET_END; i++) {
|
||||
EQEmu::ItemInstance *auginst = inst->GetItem(i);
|
||||
augslot[i] = (auginst && auginst->GetItem()) ? auginst->GetItem()->ID : 0;
|
||||
}
|
||||
@@ -316,7 +318,7 @@ bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const EQEmu::ItemInsta
|
||||
if (inst->IsClassBag() && EQEmu::InventoryProfile::SupportsContainers(slot_id)) {
|
||||
// Limiting to bag slot count will get rid of 'hidden' duplicated items and 'Invalid Slot ID'
|
||||
// messages through attrition (and the modded code in SaveInventory)
|
||||
for (uint8 idx = EQEmu::inventory::containerBegin; idx < inst->GetItem()->BagSlots && idx < EQEmu::inventory::ContainerCount; idx++) {
|
||||
for (uint8 idx = EQEmu::invbag::SLOT_BEGIN; idx < inst->GetItem()->BagSlots && idx <= EQEmu::invbag::SLOT_END; idx++) {
|
||||
const EQEmu::ItemInstance* baginst = inst->GetItem(idx);
|
||||
SaveInventory(char_id, baginst, EQEmu::InventoryProfile::CalcSlotId(slot_id, idx));
|
||||
}
|
||||
@@ -342,7 +344,7 @@ bool SharedDatabase::DeleteInventorySlot(uint32 char_id, int16 slot_id) {
|
||||
if (!EQEmu::InventoryProfile::SupportsContainers(slot_id))
|
||||
return true;
|
||||
|
||||
int16 base_slot_id = EQEmu::InventoryProfile::CalcSlotId(slot_id, EQEmu::inventory::containerBegin);
|
||||
int16 base_slot_id = EQEmu::InventoryProfile::CalcSlotId(slot_id, EQEmu::invbag::SLOT_BEGIN);
|
||||
query = StringFormat("DELETE FROM inventory WHERE charid = %i AND slotid >= %i AND slotid < %i",
|
||||
char_id, base_slot_id, (base_slot_id+10));
|
||||
results = QueryDatabase(query);
|
||||
@@ -368,7 +370,7 @@ bool SharedDatabase::DeleteSharedBankSlot(uint32 char_id, int16 slot_id) {
|
||||
if (!EQEmu::InventoryProfile::SupportsContainers(slot_id))
|
||||
return true;
|
||||
|
||||
int16 base_slot_id = EQEmu::InventoryProfile::CalcSlotId(slot_id, EQEmu::inventory::containerBegin);
|
||||
int16 base_slot_id = EQEmu::InventoryProfile::CalcSlotId(slot_id, EQEmu::invbag::SLOT_BEGIN);
|
||||
query = StringFormat("DELETE FROM sharedbank WHERE acctid = %i "
|
||||
"AND slotid >= %i AND slotid < %i",
|
||||
account_id, base_slot_id, (base_slot_id+10));
|
||||
@@ -474,7 +476,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, EQEmu::InventoryProfile *inv, bool
|
||||
uint32 item_id = (uint32)atoi(row[1]);
|
||||
int8 charges = (int8)atoi(row[2]);
|
||||
|
||||
uint32 aug[EQEmu::inventory::SocketCount];
|
||||
uint32 aug[EQEmu::invaug::SOCKET_COUNT];
|
||||
aug[0] = (uint32)atoi(row[3]);
|
||||
aug[1] = (uint32)atoi(row[4]);
|
||||
aug[2] = (uint32)atoi(row[5]);
|
||||
@@ -495,7 +497,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, EQEmu::InventoryProfile *inv, bool
|
||||
|
||||
EQEmu::ItemInstance *inst = CreateBaseItem(item, charges);
|
||||
if (inst && item->IsClassCommon()) {
|
||||
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
|
||||
for (int i = EQEmu::invaug::SOCKET_BEGIN; i <= EQEmu::invaug::SOCKET_END; i++) {
|
||||
if (aug[i])
|
||||
inst->PutAugment(this, i, aug[i]);
|
||||
}
|
||||
@@ -570,7 +572,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQEmu::InventoryProfile *inv)
|
||||
uint16 charges = atoi(row[2]);
|
||||
uint32 color = atoul(row[3]);
|
||||
|
||||
uint32 aug[EQEmu::inventory::SocketCount];
|
||||
uint32 aug[EQEmu::invaug::SOCKET_COUNT];
|
||||
|
||||
aug[0] = (uint32)atoul(row[4]);
|
||||
aug[1] = (uint32)atoul(row[5]);
|
||||
@@ -632,8 +634,8 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQEmu::InventoryProfile *inv)
|
||||
inst->SetOrnamentHeroModel(item->HerosForgeModel);
|
||||
|
||||
if (instnodrop ||
|
||||
(((slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN && slot_id <= EQEmu::legacy::EQUIPMENT_END) ||
|
||||
slot_id == EQEmu::inventory::slotPowerSource) &&
|
||||
(((slot_id >= EQEmu::invslot::EQUIPMENT_BEGIN && slot_id <= EQEmu::invslot::EQUIPMENT_END) ||
|
||||
slot_id == EQEmu::invslot::SLOT_POWER_SOURCE) &&
|
||||
inst->GetItem()->Attuneable))
|
||||
inst->SetAttuned(true);
|
||||
|
||||
@@ -655,7 +657,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQEmu::InventoryProfile *inv)
|
||||
}
|
||||
|
||||
if (item->IsClassCommon()) {
|
||||
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
|
||||
for (int i = EQEmu::invaug::SOCKET_BEGIN; i <= EQEmu::invaug::SOCKET_END; i++) {
|
||||
if (aug[i])
|
||||
inst->PutAugment(this, i, aug[i]);
|
||||
}
|
||||
@@ -712,7 +714,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, EQEmu::Inventor
|
||||
int8 charges = atoi(row[2]);
|
||||
uint32 color = atoul(row[3]);
|
||||
|
||||
uint32 aug[EQEmu::inventory::SocketCount];
|
||||
uint32 aug[EQEmu::invaug::SOCKET_COUNT];
|
||||
aug[0] = (uint32)atoi(row[4]);
|
||||
aug[1] = (uint32)atoi(row[5]);
|
||||
aug[2] = (uint32)atoi(row[6]);
|
||||
@@ -773,7 +775,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, EQEmu::Inventor
|
||||
inst->SetCharges(charges);
|
||||
|
||||
if (item->IsClassCommon()) {
|
||||
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
|
||||
for (int i = EQEmu::invaug::SOCKET_BEGIN; i <= EQEmu::invaug::SOCKET_END; i++) {
|
||||
if (aug[i])
|
||||
inst->PutAugment(this, i, aug[i]);
|
||||
}
|
||||
|
||||
+1
-1
@@ -129,7 +129,7 @@ void Timer::SetTimer(uint32 set_timer_time) {
|
||||
}
|
||||
}
|
||||
|
||||
uint32 Timer::GetRemainingTime() {
|
||||
uint32 Timer::GetRemainingTime() const {
|
||||
if (enabled) {
|
||||
if (current_time - start_time > timer_time)
|
||||
return 0;
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ public:
|
||||
void Disable();
|
||||
void Start(uint32 set_timer_time=0, bool ChangeResetTimer = true);
|
||||
void SetTimer(uint32 set_timer_time=0);
|
||||
uint32 GetRemainingTime();
|
||||
uint32 GetRemainingTime() const;
|
||||
inline const uint32& GetTimerTime() { return timer_time; }
|
||||
inline const uint32& GetSetAtTrigger() { return set_at_trigger; }
|
||||
void Trigger();
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@
|
||||
Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
|
||||
*/
|
||||
|
||||
#define CURRENT_BINARY_DATABASE_VERSION 9122
|
||||
#define CURRENT_BINARY_DATABASE_VERSION 9125
|
||||
#ifdef BOTS
|
||||
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9019
|
||||
#else
|
||||
|
||||
@@ -1096,7 +1096,7 @@ dtStatus dtNavMeshQuery::findPath(dtPolyRef startRef, dtPolyRef endRef,
|
||||
// The API input has been cheked already, skip checking internal data.
|
||||
const dtMeshTile* neighbourTile = 0;
|
||||
const dtPoly* neighbourPoly = 0;
|
||||
if (m_nav->getTileAndPolyByRef(neighbourRef, &neighbourTile, &neighbourPoly) == DT_FAILURE) {
|
||||
if (dtStatusFailed(m_nav->getTileAndPolyByRef(neighbourRef, &neighbourTile, &neighbourPoly))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
+22014
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,366 @@
|
||||
// The MIT License (MIT)
|
||||
|
||||
// Copyright (c) 2013-2018 Rapptz, ThePhD and contributors
|
||||
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
// this software and associated documentation files (the "Software"), to deal in
|
||||
// the Software without restriction, including without limitation the rights to
|
||||
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
// the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// This file was generated with a script.
|
||||
// Generated 2018-06-16 11:58:58.882218 UTC
|
||||
// This header was generated with sol v2.20.3 (revision 968989b)
|
||||
// https://github.com/ThePhD/sol2
|
||||
|
||||
#ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP
|
||||
#define SOL_SINGLE_INCLUDE_FORWARD_HPP
|
||||
|
||||
// beginning of sol/forward.hpp
|
||||
|
||||
// beginning of sol/feature_test.hpp
|
||||
|
||||
#if (defined(__cplusplus) && __cplusplus == 201703L) || (defined(_MSC_VER) && _MSC_VER > 1900 && ((defined(_HAS_CXX17) && _HAS_CXX17 == 1) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201402L))))
|
||||
#ifndef SOL_CXX17_FEATURES
|
||||
#define SOL_CXX17_FEATURES 1
|
||||
#endif // C++17 features macro
|
||||
#endif // C++17 features check
|
||||
|
||||
#if defined(SOL_CXX17_FEATURES) && SOL_CXX17_FEATURES
|
||||
#if defined(__cpp_noexcept_function_type) || ((defined(_MSC_VER) && _MSC_VER > 1911) && (defined(_MSVC_LANG) && ((_MSVC_LANG >= 201403L))))
|
||||
#ifndef SOL_NOEXCEPT_FUNCTION_TYPE
|
||||
#define SOL_NOEXCEPT_FUNCTION_TYPE 1
|
||||
#endif // noexcept is part of a function's type
|
||||
#endif // compiler-specific checks
|
||||
#if defined(__clang__) && defined(__APPLE__)
|
||||
#if defined(__has_include)
|
||||
#if __has_include(<variant>)
|
||||
#define SOL_STD_VARIANT 1
|
||||
#endif // has include nonsense
|
||||
#endif // __has_include
|
||||
#else
|
||||
#define SOL_STD_VARIANT 1
|
||||
#endif // Clang screws up variant
|
||||
#endif // C++17 only
|
||||
|
||||
// beginning of sol/config.hpp
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#if defined(_DEBUG) && !defined(NDEBUG)
|
||||
|
||||
#ifndef SOL_IN_DEBUG_DETECTED
|
||||
#define SOL_IN_DEBUG_DETECTED 1
|
||||
#endif
|
||||
|
||||
#endif // VC++ Debug macros
|
||||
|
||||
#ifndef _CPPUNWIND
|
||||
#ifndef SOL_NO_EXCEPTIONS
|
||||
#define SOL_NO_EXCEPTIONS 1
|
||||
#endif
|
||||
#endif // Automatic Exceptions
|
||||
|
||||
#ifndef _CPPRTTI
|
||||
#ifndef SOL_NO_RTTI
|
||||
#define SOL_NO_RTTI 1
|
||||
#endif
|
||||
#endif // Automatic RTTI
|
||||
#elif defined(__GNUC__) || defined(__clang__)
|
||||
|
||||
#if !defined(NDEBUG) && !defined(__OPTIMIZE__)
|
||||
|
||||
#ifndef SOL_IN_DEBUG_DETECTED
|
||||
#define SOL_IN_DEBUG_DETECTED 1
|
||||
#endif
|
||||
|
||||
#endif // Not Debug && g++ optimizer flag
|
||||
|
||||
#ifndef __EXCEPTIONS
|
||||
#ifndef SOL_NO_EXCEPTIONS
|
||||
#define SOL_NO_EXCEPTIONS 1
|
||||
#endif
|
||||
#endif // No Exceptions
|
||||
|
||||
#ifndef __GXX_RTTI
|
||||
#ifndef SOL_NO_RTII
|
||||
#define SOL_NO_RTTI 1
|
||||
#endif
|
||||
#endif // No RTTI
|
||||
|
||||
#endif // vc++ || clang++/g++
|
||||
|
||||
#if defined(SOL_CHECK_ARGUMENTS) && SOL_CHECK_ARGUMENTS
|
||||
|
||||
// Checks low-level getter function
|
||||
// (and thusly, affects nearly entire framework)
|
||||
#if !defined(SOL_SAFE_GETTER)
|
||||
#define SOL_SAFE_GETTER 1
|
||||
#endif
|
||||
|
||||
// Checks access on usertype functions
|
||||
// local my_obj = my_type.new()
|
||||
// my_obj.my_member_function()
|
||||
// -- bad syntax and crash
|
||||
#if !defined(SOL_SAFE_USERTYPE)
|
||||
#define SOL_SAFE_USERTYPE 1
|
||||
#endif
|
||||
|
||||
// Checks sol::reference derived boundaries
|
||||
// sol::function ref(L, 1);
|
||||
// sol::userdata sref(L, 2);
|
||||
#if !defined(SOL_SAFE_REFERENCES)
|
||||
#define SOL_SAFE_REFERENCES 1
|
||||
#endif
|
||||
|
||||
// Changes all typedefs of sol::function to point to the
|
||||
// protected_function version, instead of unsafe_function
|
||||
#if !defined(SOL_SAFE_FUNCTION)
|
||||
#define SOL_SAFE_FUNCTION 1
|
||||
#endif
|
||||
|
||||
// Checks function parameters and
|
||||
// returns upon call into/from Lua
|
||||
// local a = 1
|
||||
// local b = "woof"
|
||||
// my_c_function(a, b)
|
||||
#if !defined(SOL_SAFE_FUNCTION_CALLS)
|
||||
#define SOL_SAFE_FUNCTION_CALLS 1
|
||||
#endif
|
||||
|
||||
// Checks conversions
|
||||
// int v = lua["bark"];
|
||||
// int v2 = my_sol_function();
|
||||
#if !defined(SOL_SAFE_PROXIES)
|
||||
#define SOL_SAFE_PROXIES 1
|
||||
#endif
|
||||
|
||||
// Check overflowing number conversions
|
||||
// for things like 64 bit integers that don't fit in a typical lua_Number
|
||||
// for Lua 5.1 and 5.2
|
||||
#if !defined(SOL_SAFE_NUMERICS)
|
||||
#define SOL_SAFE_NUMERICS 1
|
||||
#endif
|
||||
|
||||
// Turn off Number Precision Checks
|
||||
// if this is defined, we do not do range
|
||||
// checks on integers / unsigned integers that might
|
||||
// be bigger than what Lua can represent
|
||||
#if !defined(SOL_NO_CHECK_NUMBER_PRECISION)
|
||||
// off by default
|
||||
#define SOL_NO_CHECK_NUMBER_PRECISION 0
|
||||
#endif
|
||||
|
||||
#endif // Turn on Safety for all if top-level macro is defined
|
||||
|
||||
#if defined(SOL_IN_DEBUG_DETECTED) && SOL_IN_DEBUG_DETECTED
|
||||
|
||||
#if !defined(SOL_SAFE_REFERENCES)
|
||||
// Ensure that references are forcefully type-checked upon construction
|
||||
#define SOL_SAFE_REFERENCES 1
|
||||
#endif
|
||||
|
||||
// Safe usertypes checks for errors such as
|
||||
// obj = my_type.new()
|
||||
// obj.f() -- note the '.' instead of ':'
|
||||
// usertypes should be safe no matter what
|
||||
#if !defined(SOL_SAFE_USERTYPE)
|
||||
#define SOL_SAFE_USERTYPE 1
|
||||
#endif
|
||||
|
||||
#if !defined(SOL_SAFE_FUNCTION_CALLS)
|
||||
// Function calls from Lua should be automatically safe in debug mode
|
||||
#define SOL_SAFE_FUNCTION_CALLS 1
|
||||
#endif
|
||||
|
||||
// Print any exceptions / errors that occur
|
||||
// in debug mode to the default error stream / console
|
||||
#if !defined(SOL_PRINT_ERRORS)
|
||||
#define SOL_PRINT_ERRORS 1
|
||||
#endif
|
||||
|
||||
#endif // DEBUG: Turn on all debug safety features for VC++ / g++ / clang++ and similar
|
||||
|
||||
#if !defined(SOL_PRINT_ERRORS)
|
||||
#define SOL_PRINT_ERRORS 0
|
||||
#endif
|
||||
|
||||
#if !defined(SOL_DEFAULT_PASS_ON_ERROR)
|
||||
#define SOL_DEFAULT_PASS_ON_ERROR 0
|
||||
#endif
|
||||
|
||||
#if !defined(SOL_ENABLE_INTEROP)
|
||||
#define SOL_ENABLE_INTEROP 0
|
||||
#endif
|
||||
|
||||
#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) || defined(__OBJC__) || defined(nil)
|
||||
#if !defined(SOL_NO_NIL)
|
||||
#define SOL_NO_NIL 1
|
||||
#endif
|
||||
#endif // avoiding nil defines / keywords
|
||||
|
||||
#if defined(SOL_USE_BOOST) && SOL_USE_BOOST
|
||||
#ifndef SOL_UNORDERED_MAP_COMPATIBLE_HASH
|
||||
#define SOL_UNORDERED_MAP_COMPATIBLE_HASH 1
|
||||
#endif // SOL_UNORDERED_MAP_COMPATIBLE_HASH
|
||||
#endif
|
||||
|
||||
#ifndef SOL_STACK_STRING_OPTIMIZATION_SIZE
|
||||
#define SOL_STACK_STRING_OPTIMIZATION_SIZE 1024
|
||||
#endif // Optimized conversion routines using a KB or so off the stack
|
||||
|
||||
// end of sol/config.hpp
|
||||
|
||||
// beginning of sol/config_setup.hpp
|
||||
|
||||
// end of sol/config_setup.hpp
|
||||
|
||||
// end of sol/feature_test.hpp
|
||||
|
||||
namespace sol {
|
||||
|
||||
template <bool b>
|
||||
class basic_reference;
|
||||
using reference = basic_reference<false>;
|
||||
using main_reference = basic_reference<true>;
|
||||
class stack_reference;
|
||||
|
||||
struct proxy_base_tag;
|
||||
template <typename Super>
|
||||
struct proxy_base;
|
||||
template <typename Table, typename Key>
|
||||
struct proxy;
|
||||
|
||||
template <typename T>
|
||||
class usertype;
|
||||
template <typename T>
|
||||
class simple_usertype;
|
||||
template <bool, typename T>
|
||||
class basic_table_core;
|
||||
template <bool b>
|
||||
using table_core = basic_table_core<b, reference>;
|
||||
template <bool b>
|
||||
using main_table_core = basic_table_core<b, main_reference>;
|
||||
template <bool b>
|
||||
using stack_table_core = basic_table_core<b, stack_reference>;
|
||||
template <typename T>
|
||||
using basic_table = basic_table_core<false, T>;
|
||||
typedef table_core<false> table;
|
||||
typedef table_core<true> global_table;
|
||||
typedef main_table_core<false> main_table;
|
||||
typedef main_table_core<true> main_global_table;
|
||||
typedef stack_table_core<false> stack_table;
|
||||
typedef stack_table_core<true> stack_global_table;
|
||||
template <typename base_t>
|
||||
struct basic_environment;
|
||||
using environment = basic_environment<reference>;
|
||||
using main_environment = basic_environment<main_reference>;
|
||||
using stack_environment = basic_environment<stack_reference>;
|
||||
template <typename T, bool>
|
||||
class basic_function;
|
||||
template <typename T, bool, typename H>
|
||||
class basic_protected_function;
|
||||
using unsafe_function = basic_function<reference, false>;
|
||||
using safe_function = basic_protected_function<reference, false, reference>;
|
||||
using main_unsafe_function = basic_function<main_reference, false>;
|
||||
using main_safe_function = basic_protected_function<main_reference, false, reference>;
|
||||
using stack_unsafe_function = basic_function<stack_reference, false>;
|
||||
using stack_safe_function = basic_protected_function<stack_reference, false, reference>;
|
||||
using stack_aligned_unsafe_function = basic_function<stack_reference, true>;
|
||||
using stack_aligned_safe_function = basic_protected_function<stack_reference, true, reference>;
|
||||
using protected_function = safe_function;
|
||||
using main_protected_function = main_safe_function;
|
||||
using stack_protected_function = stack_safe_function;
|
||||
using stack_aligned_protected_function = stack_aligned_safe_function;
|
||||
#if defined(SOL_SAFE_FUNCTION) && SOL_SAFE_FUNCTION
|
||||
using function = protected_function;
|
||||
using main_function = main_protected_function;
|
||||
using stack_function = stack_protected_function;
|
||||
#else
|
||||
using function = unsafe_function;
|
||||
using main_function = main_unsafe_function;
|
||||
using stack_function = stack_unsafe_function;
|
||||
#endif
|
||||
using stack_aligned_function = stack_aligned_unsafe_function;
|
||||
using stack_aligned_stack_handler_function = basic_protected_function<stack_reference, true, stack_reference>;
|
||||
|
||||
struct unsafe_function_result;
|
||||
struct protected_function_result;
|
||||
using safe_function_result = protected_function_result;
|
||||
#if defined(SOL_SAFE_FUNCTION) && SOL_SAFE_FUNCTION
|
||||
using function_result = safe_function_result;
|
||||
#else
|
||||
using function_result = unsafe_function_result;
|
||||
#endif
|
||||
|
||||
template <typename base_t>
|
||||
class basic_object;
|
||||
template <typename base_t>
|
||||
class basic_userdata;
|
||||
template <typename base_t>
|
||||
class basic_lightuserdata;
|
||||
template <typename base_t>
|
||||
class basic_coroutine;
|
||||
template <typename base_t>
|
||||
class basic_thread;
|
||||
|
||||
using object = basic_object<reference>;
|
||||
using userdata = basic_userdata<reference>;
|
||||
using lightuserdata = basic_lightuserdata<reference>;
|
||||
using thread = basic_thread<reference>;
|
||||
using coroutine = basic_coroutine<reference>;
|
||||
using main_object = basic_object<main_reference>;
|
||||
using main_userdata = basic_userdata<main_reference>;
|
||||
using main_lightuserdata = basic_lightuserdata<main_reference>;
|
||||
using main_coroutine = basic_coroutine<main_reference>;
|
||||
using stack_object = basic_object<stack_reference>;
|
||||
using stack_userdata = basic_userdata<stack_reference>;
|
||||
using stack_lightuserdata = basic_lightuserdata<stack_reference>;
|
||||
using stack_thread = basic_thread<stack_reference>;
|
||||
using stack_coroutine = basic_coroutine<stack_reference>;
|
||||
|
||||
struct stack_proxy_base;
|
||||
struct stack_proxy;
|
||||
struct variadic_args;
|
||||
struct variadic_results;
|
||||
struct stack_count;
|
||||
struct this_state;
|
||||
struct this_main_state;
|
||||
struct this_environment;
|
||||
|
||||
template <typename T>
|
||||
struct as_table_t;
|
||||
template <typename T>
|
||||
struct as_container_t;
|
||||
template <typename T>
|
||||
struct nested;
|
||||
template <typename T>
|
||||
struct light;
|
||||
template <typename T>
|
||||
struct user;
|
||||
template <typename T>
|
||||
struct as_args_t;
|
||||
template <typename T>
|
||||
struct protect_t;
|
||||
template <typename F, typename... Filters>
|
||||
struct filter_wrapper;
|
||||
|
||||
template <typename T>
|
||||
struct usertype_traits;
|
||||
template <typename T>
|
||||
struct unique_usertype_traits;
|
||||
} // namespace sol
|
||||
|
||||
// end of sol/forward.hpp
|
||||
|
||||
#endif // SOL_SINGLE_INCLUDE_FORWARD_HPP
|
||||
@@ -127,7 +127,7 @@ void MainFrame::NewActivity(wxCommandEvent& event)
|
||||
|
||||
if(mMysql){
|
||||
char * mActQuery = 0;
|
||||
MakeAnyLenString(&mActQuery, "INSERT INTO `activities` (`taskid`,`activityid`,`step`,`activitytype`,`text1`,`text2`,`text3`,`goalid`,`goalmethod`,`goalcount`,`delivertonpc`,`zoneid`,`optional`) VALUES (%u,%u,%u,%u,'%s','%s','%s',%u,%u,%u,%u,%u,%u)",
|
||||
MakeAnyLenString(&mActQuery, "INSERT INTO `task_activities` (`taskid`,`activityid`,`step`,`activitytype`,`text1`,`text2`,`text3`,`goalid`,`goalmethod`,`goalcount`,`delivertonpc`,`zoneid`,`optional`) VALUES (%u,%u,%u,%u,'%s','%s','%s',%u,%u,%u,%u,%u,%u)",
|
||||
newAct.id, newAct.activityId, newAct.step, newAct.activityType, newAct.text1, newAct.text2, newAct.text3, newAct.goalid, newAct.goalmethod, newAct.goalcount, newAct.deliverToNpc, newAct.zoneid, newAct.optional );
|
||||
|
||||
mErrorLog->Log(eqEmuLogSQL, "%s", mActQuery);
|
||||
@@ -167,7 +167,7 @@ void MainFrame::DeleteActivity(wxCommandEvent& event)
|
||||
{
|
||||
if(mMysql){
|
||||
char * mActQuery = 0;
|
||||
MakeAnyLenString(&mActQuery, "DELETE FROM activities WHERE taskid=%u AND activityid=%u",selAct->id, selAct->activityid);
|
||||
MakeAnyLenString(&mActQuery, "DELETE FROM `task_activities` WHERE taskid=%u AND activityid=%u",selAct->id, selAct->activityid);
|
||||
mErrorLog->Log(eqEmuLogSQL, "%s", mActQuery);
|
||||
if (mysql_query(mMysql, mActQuery)) {
|
||||
mErrorLog->Log(eqEmuLogBoth, "MySQL Error: %s", mysql_error(mMysql));
|
||||
@@ -554,7 +554,7 @@ void MainFrame::SaveActivity(wxCommandEvent& event)
|
||||
if(canUpdate)
|
||||
{
|
||||
char * mQuery = 0;
|
||||
MakeAnyLenString(&mQuery, "UPDATE activities SET step=%u, activitytype=%u, text1='%s', text2='%s', text3='%s', goalid=%u, goalmethod=%u,goalcount=%u, delivertonpc=%u, zoneid=%u, optional=%u WHERE taskid=%u AND activityid =%u",
|
||||
MakeAnyLenString(&mQuery, "UPDATE `task_activities` SET step=%u, activitytype=%u, text1='%s', text2='%s', text3='%s', goalid=%u, goalmethod=%u,goalcount=%u, delivertonpc=%u, zoneid=%u, optional=%u WHERE taskid=%u AND activityid =%u",
|
||||
ourAct.step, ourAct.activityType, MakeStringSQLSafe(ourAct.text1).mb_str(), MakeStringSQLSafe(ourAct.text2).mb_str(), MakeStringSQLSafe(ourAct.text3).mb_str(), ourAct.goalid, ourAct.goalmethod, ourAct.goalcount, ourAct.deliverToNpc, ourAct.zoneid, ourAct.optional, ourAct.id, ourAct.activityId );
|
||||
mErrorLog->Log(eqEmuLogSQL, "%s", mQuery);
|
||||
if (mysql_query(mMysql, mQuery)) {
|
||||
@@ -565,14 +565,14 @@ void MainFrame::SaveActivity(wxCommandEvent& event)
|
||||
else
|
||||
{
|
||||
char * mQuery = 0;
|
||||
MakeAnyLenString(&mQuery, "DELETE FROM activities WHERE taskid=%u AND activityid=%u", ourAct.id, delid);
|
||||
MakeAnyLenString(&mQuery, "DELETE FROM `task_activities` WHERE taskid=%u AND activityid=%u", ourAct.id, delid);
|
||||
mErrorLog->Log(eqEmuLogSQL, "%s", mQuery);
|
||||
if (mysql_query(mMysql, mQuery)) {
|
||||
mErrorLog->Log(eqEmuLogBoth, "MySQL Error: %s", mysql_error(mMysql));
|
||||
return;
|
||||
}
|
||||
|
||||
MakeAnyLenString(&mQuery, "INSERT INTO `activities` (`taskid`,`activityid`,`step`,`activitytype`,`text1`,`text2`,`text3`,`goalid`,`goalmethod`,`goalcount`,`delivertonpc`,`zoneid`,`optional`) VALUES (%u,%u,%u,%u,'%s','%s','%s',%u,%u,%u,%u,%u,%u)",
|
||||
MakeAnyLenString(&mQuery, "INSERT INTO `task_activities` (`taskid`,`activityid`,`step`,`activitytype`,`text1`,`text2`,`text3`,`goalid`,`goalmethod`,`goalcount`,`delivertonpc`,`zoneid`,`optional`) VALUES (%u,%u,%u,%u,'%s','%s','%s',%u,%u,%u,%u,%u,%u)",
|
||||
ourAct.id, ourAct.activityId, ourAct.step, ourAct.activityType, MakeStringSQLSafe(ourAct.text1).mb_str(), MakeStringSQLSafe(ourAct.text2).mb_str(), MakeStringSQLSafe(ourAct.text3).mb_str(), ourAct.goalid, ourAct.goalmethod, ourAct.goalcount, ourAct.deliverToNpc, ourAct.zoneid, ourAct.optional);
|
||||
mErrorLog->Log(eqEmuLogSQL, "%s", mQuery);
|
||||
if (mysql_query(mMysql, mQuery)) {
|
||||
|
||||
@@ -241,44 +241,43 @@ bool MainFrame::LoadGoals()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MainFrame::LoadActivities()
|
||||
{
|
||||
if(mMysql){
|
||||
bool MainFrame::LoadActivities() {
|
||||
if (mMysql) {
|
||||
mErrorLog->Log(eqEmuLogBoth, "Loading Activities...");
|
||||
unsigned int activitiesLoaded = 0;
|
||||
MYSQL_RES *res;
|
||||
MYSQL_ROW row;
|
||||
MYSQL_RES *res;
|
||||
MYSQL_ROW row;
|
||||
|
||||
if (mysql_query(mMysql, "SELECT taskid, activityid, step, activitytype, text1, text2, text3, goalid, goalmethod, goalcount, delivertonpc, zoneid, optional FROM activities")) {
|
||||
if (mysql_query(mMysql,
|
||||
"SELECT taskid, activityid, step, activitytype, text1, text2, text3, goalid, goalmethod, goalcount, delivertonpc, zoneid, optional FROM `task_activities`")) {
|
||||
mErrorLog->Log(eqEmuLogBoth, "MySQL Connection Error: %s", mysql_error(mMysql));
|
||||
return false;
|
||||
}
|
||||
|
||||
res = mysql_use_result(mMysql);
|
||||
while ((row = mysql_fetch_row(res)) != NULL){
|
||||
res = mysql_use_result(mMysql);
|
||||
while ((row = mysql_fetch_row(res)) != NULL) {
|
||||
eqtask_activities newAL;
|
||||
|
||||
newAL.id = atoi(row[0]);
|
||||
newAL.activityId = atoi(row[1]);
|
||||
newAL.step = atoi(row[2]);
|
||||
newAL.id = atoi(row[0]);
|
||||
newAL.activityId = atoi(row[1]);
|
||||
newAL.step = atoi(row[2]);
|
||||
newAL.activityType = atoi(row[3]);
|
||||
strcpy(newAL.text1, row[4]);
|
||||
strcpy(newAL.text2, row[5]);
|
||||
strcpy(newAL.text3, row[6]);
|
||||
newAL.goalid = atoi(row[7]);
|
||||
newAL.goalmethod = atoi(row[8]);
|
||||
newAL.goalcount = atoi(row[9]);
|
||||
newAL.goalid = atoi(row[7]);
|
||||
newAL.goalmethod = atoi(row[8]);
|
||||
newAL.goalcount = atoi(row[9]);
|
||||
newAL.deliverToNpc = atoi(row[10]);
|
||||
newAL.zoneid = atoi(row[11]);
|
||||
newAL.optional = atoi(row[12]) ? true : false;
|
||||
newAL.zoneid = atoi(row[11]);
|
||||
newAL.optional = atoi(row[12]) ? true : false;
|
||||
|
||||
taskActivitiesList.push_back(newAL);
|
||||
activitiesLoaded++;
|
||||
}
|
||||
mErrorLog->Log(eqEmuLogBoth, "%u Successfully Loaded Activities", activitiesLoaded);
|
||||
mysql_free_result(res);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
mErrorLog->Log(eqEmuLogBoth, "Mysql connection did not exist for activity load.");
|
||||
return false;
|
||||
}
|
||||
|
||||
+1103
-418
File diff suppressed because it is too large
Load Diff
@@ -1,19 +1,26 @@
|
||||
adventure_stats
|
||||
char_recipe_list
|
||||
character_auras
|
||||
character_activities
|
||||
character_alt_currency
|
||||
character_alternate_abilities
|
||||
character_bandolier
|
||||
character_bind
|
||||
character_buffs
|
||||
character_corpse_items
|
||||
character_corpses
|
||||
character_currency
|
||||
character_data
|
||||
character_disciplines
|
||||
character_enabledtasks
|
||||
character_inspect_messages
|
||||
character_item_recast
|
||||
character_languages
|
||||
character_leadership_abilities
|
||||
character_material
|
||||
character_memmed_spells
|
||||
character_pet_buffs
|
||||
character_pet_inventory
|
||||
character_potionbelt
|
||||
character_skills
|
||||
character_spells
|
||||
|
||||
@@ -376,6 +376,9 @@
|
||||
9120|2018_02_13_Heading.sql|SELECT value FROM variables WHERE varname = 'fixed_heading'|empty|
|
||||
9121|2018_02_18_bug_reports.sql|SHOW TABLES LIKE 'bug_reports'|empty|
|
||||
9122|2018_03_07_ucs_command.sql|SELECT * FROM `command_settings` WHERE `command` LIKE 'ucs'|empty|
|
||||
9123|2018_07_07_data_buckets.sql|SHOW TABLES LIKE 'data_buckets'|empty|
|
||||
9124|2018_07_09_tasks.sql|SHOW COLUMNS FROM `tasks` LIKE 'type'|empty|
|
||||
9125|2018_07_20_task_emote.sql|SHOW COLUMNS FROM `tasks` LIKE 'completion_emote'|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 @@
|
||||
INSERT INTO `rule_values` (`ruleset_id`, `rule_name`, `rule_value`, `notes`) VALUES
|
||||
(1, 'Bots:AllowedClasses', '-1', 'Bitmask of allowed bot classes'),
|
||||
(1, 'Bots:AllowedRaces', '-1', 'Bitmask of allowed bot races'),
|
||||
(1, 'Bots:AllowedGenders', '3', 'Bitmask of allowed bot genders');
|
||||
@@ -0,0 +1,8 @@
|
||||
CREATE TABLE `data_buckets` (
|
||||
`id` bigint(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`key` varchar(100) DEFAULT NULL,
|
||||
`value` text,
|
||||
`expires` int(11) unsigned DEFAULT '0',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `key_index` (`key`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
|
||||
@@ -0,0 +1,22 @@
|
||||
ALTER TABLE `tasks` ADD `type` TINYINT NOT NULL DEFAULT '0' AFTER `id`;
|
||||
ALTER TABLE `tasks` ADD `duration_code` TINYINT NOT NULL DEFAULT '0' AFTER `duration`;
|
||||
UPDATE `tasks` SET `type` = '2'; -- we were treating them all as quests
|
||||
ALTER TABLE `character_tasks` ADD `type` TINYINT NOT NULL DEFAULT '0' AFTER `slot`;
|
||||
UPDATE `character_tasks` SET `type` = '2'; -- we were treating them all as quests
|
||||
ALTER TABLE `activities` ADD `target_name` VARCHAR(64) NOT NULL DEFAULT '' AFTER `activitytype`;
|
||||
ALTER TABLE `activities` ADD `item_list` VARCHAR(128) NOT NULL DEFAULT '' AFTER `target_name`;
|
||||
ALTER TABLE `activities` ADD `skill_list` VARCHAR(64) NOT NULL DEFAULT '-1' AFTER `item_list`;
|
||||
ALTER TABLE `activities` ADD `spell_list` VARCHAR(64) NOT NULL DEFAULT '0' AFTER `skill_list`;
|
||||
ALTER TABLE `activities` ADD `description_override` VARCHAR(128) NOT NULL DEFAULT '' AFTER `spell_list`;
|
||||
ALTER TABLE `activities` ADD `zones` VARCHAR(64) NOT NULL DEFAULT '' AFTER `zoneid`;
|
||||
UPDATE `activities` SET `description_override` = `text3`;
|
||||
UPDATE `activities` SET `target_name` = `text1`;
|
||||
UPDATE `activities` SET `item_list` = `text2`;
|
||||
UPDATE `activities` SET `zones` = `zoneid`; -- should be safe for us ...
|
||||
ALTER TABLE `activities` DROP COLUMN `text1`;
|
||||
ALTER TABLE `activities` DROP COLUMN `text2`;
|
||||
ALTER TABLE `activities` DROP COLUMN `text3`;
|
||||
ALTER TABLE `activities` DROP COLUMN `zoneid`;
|
||||
ALTER TABLE `tasks` DROP COLUMN `startzone`;
|
||||
ALTER TABLE `tasks` ADD `faction_reward` INT(10) NOT NULL DEFAULT '0';
|
||||
RENAME TABLE `activities` TO `task_activities`;
|
||||
@@ -0,0 +1 @@
|
||||
ALTER TABLE `tasks` ADD `completion_emote` VARCHAR(128) NOT NULL DEFAULT '';
|
||||
@@ -5,7 +5,7 @@ aa_required_level_cost
|
||||
aa_ranks
|
||||
aa_rank_effects
|
||||
aa_rank_prereqs
|
||||
activities
|
||||
task_activities
|
||||
adventure_template
|
||||
adventure_template_entry
|
||||
adventure_template_entry_flavor
|
||||
@@ -24,6 +24,7 @@ faction_list_mod
|
||||
fear_hints
|
||||
fishing
|
||||
forage
|
||||
global_loot
|
||||
goallists
|
||||
graveyard
|
||||
grid
|
||||
@@ -97,4 +98,4 @@ zone
|
||||
zone_points
|
||||
zone_server
|
||||
zone_state_dump
|
||||
zoneserver_auth
|
||||
zoneserver_auth
|
||||
|
||||
+4
-4
@@ -212,8 +212,8 @@ void Client::SendMaxCharCreate() {
|
||||
MaxCharacters_Struct* mc = (MaxCharacters_Struct*)outapp->pBuffer;
|
||||
|
||||
mc->max_chars = EQEmu::constants::Lookup(m_ClientVersion)->CharacterCreationLimit;
|
||||
if (mc->max_chars > EQEmu::constants::CharacterCreationMax)
|
||||
mc->max_chars = EQEmu::constants::CharacterCreationMax;
|
||||
if (mc->max_chars > EQEmu::constants::CHARACTER_CREATION_LIMIT)
|
||||
mc->max_chars = EQEmu::constants::CHARACTER_CREATION_LIMIT;
|
||||
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
@@ -766,8 +766,8 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
|
||||
// (This is a literal translation of the original process..I don't see why it can't be changed to a single-target query over account iteration)
|
||||
if (!is_player_zoning) {
|
||||
size_t character_limit = EQEmu::constants::Lookup(eqs->ClientVersion())->CharacterCreationLimit;
|
||||
if (character_limit > EQEmu::constants::CharacterCreationMax) { character_limit = EQEmu::constants::CharacterCreationMax; }
|
||||
if (eqs->ClientVersion() == EQEmu::versions::ClientVersion::Titanium) { character_limit = 8; }
|
||||
if (character_limit > EQEmu::constants::CHARACTER_CREATION_LIMIT) { character_limit = EQEmu::constants::CHARACTER_CREATION_LIMIT; }
|
||||
if (eqs->ClientVersion() == EQEmu::versions::ClientVersion::Titanium) { character_limit = Titanium::constants::CHARACTER_CREATION_LIMIT; }
|
||||
|
||||
std::string tgh_query = StringFormat(
|
||||
"SELECT "
|
||||
|
||||
+7
-2
@@ -85,6 +85,7 @@ union semun {
|
||||
#include "console.h"
|
||||
|
||||
#include "../common/net/servertalk_server.h"
|
||||
#include "../zone/data_bucket.h"
|
||||
|
||||
ClientList client_list;
|
||||
GroupLFPList LFPGroupList;
|
||||
@@ -309,6 +310,9 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
}
|
||||
|
||||
Log(Logs::General, Logs::World_Server, "Purging expired data buckets...");
|
||||
database.PurgeAllDeletedDataBuckets();
|
||||
|
||||
Log(Logs::General, Logs::World_Server, "Loading zones..");
|
||||
database.LoadZoneNames();
|
||||
Log(Logs::General, Logs::World_Server, "Clearing groups..");
|
||||
@@ -389,6 +393,7 @@ int main(int argc, char** argv) {
|
||||
|
||||
Log(Logs::General, Logs::World_Server, "Purging expired instances");
|
||||
database.PurgeExpiredInstances();
|
||||
|
||||
Timer PurgeInstanceTimer(450000);
|
||||
PurgeInstanceTimer.Start(450000);
|
||||
|
||||
@@ -545,9 +550,9 @@ int main(int argc, char** argv) {
|
||||
|
||||
client_list.Process();
|
||||
|
||||
if (PurgeInstanceTimer.Check())
|
||||
{
|
||||
if (PurgeInstanceTimer.Check()) {
|
||||
database.PurgeExpiredInstances();
|
||||
database.PurgeAllDeletedDataBuckets();
|
||||
}
|
||||
|
||||
if (EQTimeTimer.Check()) {
|
||||
|
||||
+2
-2
@@ -39,8 +39,8 @@ void WorldDatabase::GetCharSelectInfo(uint32 accountID, EQApplicationPacket **ou
|
||||
size_t character_limit = EQEmu::constants::Lookup(client_version)->CharacterCreationLimit;
|
||||
|
||||
// Validate against absolute server max
|
||||
if (character_limit > EQEmu::constants::CharacterCreationMax)
|
||||
character_limit = EQEmu::constants::CharacterCreationMax;
|
||||
if (character_limit > EQEmu::constants::CHARACTER_CREATION_LIMIT)
|
||||
character_limit = EQEmu::constants::CHARACTER_CREATION_LIMIT;
|
||||
|
||||
// Force Titanium clients to use '8'
|
||||
if (client_version == EQEmu::versions::ClientVersion::Titanium)
|
||||
|
||||
+9
-1
@@ -43,6 +43,7 @@ ZSList::ZSList()
|
||||
memset(pLockedZones, 0, sizeof(pLockedZones));
|
||||
|
||||
m_tick.reset(new EQ::Timer(5000, true, std::bind(&ZSList::OnTick, this, std::placeholders::_1)));
|
||||
m_keepalive.reset(new EQ::Timer(2500, true, std::bind(&ZSList::OnKeepAlive, this, std::placeholders::_1)));
|
||||
}
|
||||
|
||||
ZSList::~ZSList() {
|
||||
@@ -745,4 +746,11 @@ void ZSList::OnTick(EQ::Timer *t)
|
||||
}
|
||||
|
||||
web_interface.SendEvent(out);
|
||||
}
|
||||
}
|
||||
|
||||
void ZSList::OnKeepAlive(EQ::Timer *t)
|
||||
{
|
||||
for (auto &zone : list) {
|
||||
zone->SendKeepAlive();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,7 @@ public:
|
||||
|
||||
private:
|
||||
void OnTick(EQ::Timer *t);
|
||||
void OnKeepAlive(EQ::Timer *t);
|
||||
uint32 NextID;
|
||||
std::list<std::unique_ptr<ZoneServer>> list;
|
||||
uint16 pLockedZones[MaxLockedZones];
|
||||
@@ -70,6 +71,7 @@ private:
|
||||
uint16 LastAllocatedPort;
|
||||
|
||||
std::unique_ptr<EQ::Timer> m_tick;
|
||||
std::unique_ptr<EQ::Timer> m_keepalive;
|
||||
};
|
||||
|
||||
#endif /*ZONELIST_H_*/
|
||||
|
||||
@@ -1400,6 +1400,13 @@ void ZoneServer::SendGroupIDs() {
|
||||
delete pack;
|
||||
}
|
||||
|
||||
|
||||
void ZoneServer::SendKeepAlive()
|
||||
{
|
||||
ServerPacket pack(ServerOP_KeepAlive, 0);
|
||||
SendPacket(&pack);
|
||||
}
|
||||
|
||||
void ZoneServer::ChangeWID(uint32 iCharID, uint32 iWID) {
|
||||
auto pack = new ServerPacket(ServerOP_ChangeWID, sizeof(ServerChangeWID_Struct));
|
||||
ServerChangeWID_Struct* scw = (ServerChangeWID_Struct*)pack->pBuffer;
|
||||
|
||||
@@ -39,6 +39,7 @@ public:
|
||||
void SendPacket(ServerPacket* pack) { tcpc->SendPacket(pack); }
|
||||
void SendEmoteMessage(const char* to, uint32 to_guilddbid, int16 to_minstatus, uint32 type, const char* message, ...);
|
||||
void SendEmoteMessageRaw(const char* to, uint32 to_guilddbid, int16 to_minstatus, uint32 type, const char* message);
|
||||
void SendKeepAlive();
|
||||
bool SetZone(uint32 iZoneID, uint32 iInstanceID = 0, bool iStaticZone = false);
|
||||
void TriggerBootup(uint32 iZoneID = 0, uint32 iInstanceID = 0, const char* iAdminName = 0, bool iMakeStatic = false);
|
||||
void Disconnect() { auto handle = tcpc->Handle(); if (handle) { handle->Disconnect(); } }
|
||||
|
||||
+51
-49
@@ -19,6 +19,7 @@ SET(zone_sources
|
||||
client_process.cpp
|
||||
command.cpp
|
||||
corpse.cpp
|
||||
data_bucket.cpp
|
||||
doors.cpp
|
||||
effects.cpp
|
||||
embparser.cpp
|
||||
@@ -39,30 +40,6 @@ SET(zone_sources
|
||||
horse.cpp
|
||||
inventory.cpp
|
||||
loottables.cpp
|
||||
lua_bit.cpp
|
||||
lua_corpse.cpp
|
||||
lua_client.cpp
|
||||
lua_door.cpp
|
||||
lua_encounter.cpp
|
||||
lua_entity.cpp
|
||||
lua_entity_list.cpp
|
||||
lua_general.cpp
|
||||
lua_group.cpp
|
||||
lua_hate_list.cpp
|
||||
lua_inventory.cpp
|
||||
lua_item.cpp
|
||||
lua_iteminst.cpp
|
||||
lua_mob.cpp
|
||||
lua_mod.cpp
|
||||
lua_npc.cpp
|
||||
lua_object.cpp
|
||||
lua_packet.cpp
|
||||
lua_parser.cpp
|
||||
lua_parser_events.cpp
|
||||
lua_raid.cpp
|
||||
lua_spawn.cpp
|
||||
lua_spell.cpp
|
||||
lua_stat_bonuses.cpp
|
||||
embperl.cpp
|
||||
embxs.cpp
|
||||
entity.cpp
|
||||
@@ -155,6 +132,7 @@ SET(zone_headers
|
||||
command.h
|
||||
common.h
|
||||
corpse.h
|
||||
data_bucket.h
|
||||
doors.h
|
||||
embparser.h
|
||||
embperl.h
|
||||
@@ -171,31 +149,6 @@ SET(zone_headers
|
||||
hate_list.h
|
||||
heal_rotation.h
|
||||
horse.h
|
||||
lua_bit.h
|
||||
lua_client.h
|
||||
lua_corpse.h
|
||||
lua_door.h
|
||||
lua_encounter.h
|
||||
lua_entity.h
|
||||
lua_entity_list.h
|
||||
lua_general.h
|
||||
lua_group.h
|
||||
lua_hate_list.h
|
||||
lua_inventory.h
|
||||
lua_item.h
|
||||
lua_iteminst.h
|
||||
lua_mob.h
|
||||
lua_mod.h
|
||||
lua_npc.h
|
||||
lua_object.h
|
||||
lua_packet.h
|
||||
lua_parser.h
|
||||
lua_parser_events.h
|
||||
lua_ptr.h
|
||||
lua_raid.h
|
||||
lua_spawn.h
|
||||
lua_spell.h
|
||||
lua_stat_bonuses.h
|
||||
map.h
|
||||
masterentity.h
|
||||
maxskill.h
|
||||
@@ -243,6 +196,55 @@ SET(zone_headers
|
||||
zonedump.h
|
||||
)
|
||||
|
||||
IF(EQEMU_BUILD_LUA)
|
||||
|
||||
SET(zone_sources ${zone_sources}
|
||||
lua/lua_client.cpp
|
||||
lua/lua_corpse.cpp
|
||||
lua/lua_door.cpp
|
||||
lua/lua_entity.cpp
|
||||
lua/lua_extra_attack_options.cpp
|
||||
lua/lua_inventory_where.cpp
|
||||
lua/lua_npc.cpp
|
||||
lua/lua_mob.cpp
|
||||
lua/lua_mob_a.cpp
|
||||
lua/lua_mob_b.cpp
|
||||
lua/lua_mob_c.cpp
|
||||
lua/lua_object.cpp
|
||||
lua/lua_general.cpp
|
||||
lua/lua_parser.cpp
|
||||
)
|
||||
|
||||
SET(zone_headers ${zone_headers}
|
||||
lua/lua_events.h
|
||||
lua/lua_forward.h
|
||||
lua/lua_parser.h
|
||||
lua/lua_structs.h
|
||||
)
|
||||
|
||||
SOURCE_GROUP(lua FILES
|
||||
lua/lua_client.cpp
|
||||
lua/lua_corpse.cpp
|
||||
lua/lua_door.cpp
|
||||
lua/lua_entity.cpp
|
||||
lua/lua_extra_attack_options.cpp
|
||||
lua/lua_events.h
|
||||
lua/lua_forward.h
|
||||
lua/lua_inventory_where.cpp
|
||||
lua/lua_npc.cpp
|
||||
lua/lua_mob.cpp
|
||||
lua/lua_mob_a.cpp
|
||||
lua/lua_mob_b.cpp
|
||||
lua/lua_mob_c.cpp
|
||||
lua/lua_object.cpp
|
||||
lua/lua_general.cpp
|
||||
lua/lua_parser.cpp
|
||||
lua/lua_parser.h
|
||||
lua/lua_structs.h
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
IF(EQEMU_DEPOP_INVALIDATES_CACHE)
|
||||
ADD_DEFINITIONS(-DDEPOP_INVALIDATES_NPC_TYPES_CACHE)
|
||||
ENDIF(EQEMU_DEPOP_INVALIDATES_CACHE)
|
||||
|
||||
+1
-1
@@ -435,7 +435,7 @@ void Mob::WakeTheDead(uint16 spell_id, Mob *target, uint32 duration)
|
||||
|
||||
//gear stuff, need to make sure there's
|
||||
//no situation where this stuff can be duped
|
||||
for (int x = EQEmu::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::EQUIPMENT_END; x++) // (< 21) added MainAmmo
|
||||
for (int x = EQEmu::invslot::EQUIPMENT_BEGIN; x <= EQEmu::invslot::EQUIPMENT_END; x++)
|
||||
{
|
||||
uint32 sitem = 0;
|
||||
sitem = CorpseToUse->GetWornItem(x);
|
||||
|
||||
+64
-56
@@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "water_map.h"
|
||||
#include "worldserver.h"
|
||||
#include "zone.h"
|
||||
#include "lua_parser.h"
|
||||
#include "lua/lua_parser.h"
|
||||
#include "fastmath.h"
|
||||
|
||||
#include <assert.h>
|
||||
@@ -136,7 +136,7 @@ EQEmu::skills::SkillType Mob::AttackAnimation(int Hand, const EQEmu::ItemInstanc
|
||||
}
|
||||
|
||||
// If we're attacking with the secondary hand, play the dual wield anim
|
||||
if (Hand == EQEmu::inventory::slotSecondary) // DW anim
|
||||
if (Hand == EQEmu::invslot::slotSecondary) // DW anim
|
||||
type = animDualWield;
|
||||
|
||||
DoAnim(type, 0, false);
|
||||
@@ -386,7 +386,7 @@ bool Mob::AvoidDamage(Mob *other, DamageHitInfo &hit)
|
||||
// riposte -- it may seem crazy, but if the attacker has SPA 173 on them, they are immune to Ripo
|
||||
bool ImmuneRipo = attacker->aabonuses.RiposteChance || attacker->spellbonuses.RiposteChance || attacker->itembonuses.RiposteChance || attacker->IsEnraged();
|
||||
// Need to check if we have something in MainHand to actually attack with (or fists)
|
||||
if (hit.hand != EQEmu::inventory::slotRange && (CanThisClassRiposte() || IsEnraged()) && InFront && !ImmuneRipo) {
|
||||
if (hit.hand != EQEmu::invslot::slotRange && (CanThisClassRiposte() || IsEnraged()) && InFront && !ImmuneRipo) {
|
||||
if (IsEnraged()) {
|
||||
hit.damage_done = DMG_RIPOSTED;
|
||||
Log(Logs::Detail, Logs::Combat, "I am enraged, riposting frontal attack.");
|
||||
@@ -408,7 +408,7 @@ bool Mob::AvoidDamage(Mob *other, DamageHitInfo &hit)
|
||||
chance -= chance * counter;
|
||||
}
|
||||
// AA Slippery Attacks
|
||||
if (hit.hand == EQEmu::inventory::slotSecondary) {
|
||||
if (hit.hand == EQEmu::invslot::slotSecondary) {
|
||||
int slip = aabonuses.OffhandRiposteFail + itembonuses.OffhandRiposteFail + spellbonuses.OffhandRiposteFail;
|
||||
chance += chance * slip / 100;
|
||||
}
|
||||
@@ -453,7 +453,7 @@ bool Mob::AvoidDamage(Mob *other, DamageHitInfo &hit)
|
||||
}
|
||||
|
||||
// parry
|
||||
if (CanThisClassParry() && InFront && hit.hand != EQEmu::inventory::slotRange) {
|
||||
if (CanThisClassParry() && InFront && hit.hand != EQEmu::invslot::slotRange) {
|
||||
if (IsClient())
|
||||
CastToClient()->CheckIncreaseSkill(EQEmu::skills::SkillParry, other, -10);
|
||||
// check auto discs ... I guess aa/items too :P
|
||||
@@ -783,7 +783,7 @@ int Mob::ACSum()
|
||||
int shield_ac = 0;
|
||||
if (HasShieldEquiped() && IsClient()) {
|
||||
auto client = CastToClient();
|
||||
auto inst = client->GetInv().GetItem(EQEmu::inventory::slotSecondary);
|
||||
auto inst = client->GetInv().GetItem(EQEmu::invslot::slotSecondary);
|
||||
if (inst) {
|
||||
if (inst->GetItemRecommendedLevel(true) <= GetLevel())
|
||||
shield_ac = inst->GetItemArmorClass(true);
|
||||
@@ -1111,7 +1111,7 @@ int Mob::GetWeaponDamage(Mob *against, const EQEmu::ItemInstance *weapon_item, u
|
||||
else {
|
||||
bool MagicGloves = false;
|
||||
if (IsClient()) {
|
||||
const EQEmu::ItemInstance *gloves = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotHands);
|
||||
const EQEmu::ItemInstance *gloves = CastToClient()->GetInv().GetItem(EQEmu::invslot::slotHands);
|
||||
if (gloves)
|
||||
MagicGloves = gloves->GetItemMagical(true);
|
||||
}
|
||||
@@ -1397,12 +1397,12 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
||||
return false; // Rogean: How can you attack while feigned? Moved up from Aggro Code.
|
||||
|
||||
EQEmu::ItemInstance* weapon = nullptr;
|
||||
if (Hand == EQEmu::inventory::slotSecondary) { // Kaiyodo - Pick weapon from the attacking hand
|
||||
weapon = GetInv().GetItem(EQEmu::inventory::slotSecondary);
|
||||
if (Hand == EQEmu::invslot::slotSecondary) { // Kaiyodo - Pick weapon from the attacking hand
|
||||
weapon = GetInv().GetItem(EQEmu::invslot::slotSecondary);
|
||||
OffHandAtk(true);
|
||||
}
|
||||
else {
|
||||
weapon = GetInv().GetItem(EQEmu::inventory::slotPrimary);
|
||||
weapon = GetInv().GetItem(EQEmu::invslot::slotPrimary);
|
||||
OffHandAtk(false);
|
||||
}
|
||||
|
||||
@@ -1440,10 +1440,10 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
||||
if (my_hit.base_damage > 0) {
|
||||
// if we revamp this function be more general, we will have to make sure this isn't
|
||||
// executed for anything BUT normal melee damage weapons from auto attack
|
||||
if (Hand == EQEmu::inventory::slotPrimary || Hand == EQEmu::inventory::slotSecondary)
|
||||
if (Hand == EQEmu::invslot::slotPrimary || Hand == EQEmu::invslot::slotSecondary)
|
||||
my_hit.base_damage = DoDamageCaps(my_hit.base_damage);
|
||||
auto shield_inc = spellbonuses.ShieldEquipDmgMod + itembonuses.ShieldEquipDmgMod + aabonuses.ShieldEquipDmgMod;
|
||||
if (shield_inc > 0 && HasShieldEquiped() && Hand == EQEmu::inventory::slotPrimary) {
|
||||
if (shield_inc > 0 && HasShieldEquiped() && Hand == EQEmu::invslot::slotPrimary) {
|
||||
my_hit.base_damage = my_hit.base_damage * (100 + shield_inc) / 100;
|
||||
hate = hate * (100 + shield_inc) / 100;
|
||||
}
|
||||
@@ -1465,7 +1465,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
||||
|
||||
int ucDamageBonus = 0;
|
||||
|
||||
if (Hand == EQEmu::inventory::slotPrimary && GetLevel() >= 28 && IsWarriorClass())
|
||||
if (Hand == EQEmu::invslot::slotPrimary && GetLevel() >= 28 && IsWarriorClass())
|
||||
{
|
||||
// Damage bonuses apply only to hits from the main hand (Hand == MainPrimary) by characters level 28 and above
|
||||
// who belong to a melee class. If we're here, then all of these conditions apply.
|
||||
@@ -1477,7 +1477,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
||||
}
|
||||
#endif
|
||||
//Live AA - Sinister Strikes *Adds weapon damage bonus to offhand weapon.
|
||||
if (Hand == EQEmu::inventory::slotSecondary) {
|
||||
if (Hand == EQEmu::invslot::slotSecondary) {
|
||||
if (aabonuses.SecondaryDmgInc || itembonuses.SecondaryDmgInc || spellbonuses.SecondaryDmgInc) {
|
||||
|
||||
ucDamageBonus = GetWeaponDamageBonus(weapon ? weapon->GetItem() : (const EQEmu::ItemData*) nullptr, true);
|
||||
@@ -1927,28 +1927,28 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
|
||||
my_hit.skill = EQEmu::skills::SkillHandtoHand;
|
||||
my_hit.hand = Hand;
|
||||
my_hit.damage_done = 1;
|
||||
if (Hand == EQEmu::inventory::slotPrimary) {
|
||||
if (Hand == EQEmu::invslot::slotPrimary) {
|
||||
my_hit.skill = static_cast<EQEmu::skills::SkillType>(GetPrimSkill());
|
||||
OffHandAtk(false);
|
||||
}
|
||||
if (Hand == EQEmu::inventory::slotSecondary) {
|
||||
if (Hand == EQEmu::invslot::slotSecondary) {
|
||||
my_hit.skill = static_cast<EQEmu::skills::SkillType>(GetSecSkill());
|
||||
OffHandAtk(true);
|
||||
}
|
||||
|
||||
//figure out what weapon they are using, if any
|
||||
const EQEmu::ItemData* weapon = nullptr;
|
||||
if (Hand == EQEmu::inventory::slotPrimary && equipment[EQEmu::inventory::slotPrimary] > 0)
|
||||
weapon = database.GetItem(equipment[EQEmu::inventory::slotPrimary]);
|
||||
else if (equipment[EQEmu::inventory::slotSecondary])
|
||||
weapon = database.GetItem(equipment[EQEmu::inventory::slotSecondary]);
|
||||
if (Hand == EQEmu::invslot::slotPrimary && equipment[EQEmu::invslot::slotPrimary] > 0)
|
||||
weapon = database.GetItem(equipment[EQEmu::invslot::slotPrimary]);
|
||||
else if (equipment[EQEmu::invslot::slotSecondary])
|
||||
weapon = database.GetItem(equipment[EQEmu::invslot::slotSecondary]);
|
||||
|
||||
//We dont factor much from the weapon into the attack.
|
||||
//Just the skill type so it doesn't look silly using punching animations and stuff while wielding weapons
|
||||
if (weapon) {
|
||||
Log(Logs::Detail, Logs::Combat, "Attacking with weapon: %s (%d) (too bad im not using it for much)", weapon->Name, weapon->ID);
|
||||
|
||||
if (Hand == EQEmu::inventory::slotSecondary && weapon->ItemType == EQEmu::item::ItemTypeShield) {
|
||||
if (Hand == EQEmu::invslot::slotSecondary && weapon->ItemType == EQEmu::item::ItemTypeShield) {
|
||||
Log(Logs::Detail, Logs::Combat, "Attack with shield canceled.");
|
||||
return false;
|
||||
}
|
||||
@@ -3896,7 +3896,7 @@ void Mob::TryDefensiveProc(Mob *on, uint16 hand) {
|
||||
float ProcChance, ProcBonus;
|
||||
on->GetDefensiveProcChances(ProcBonus, ProcChance, hand, this);
|
||||
|
||||
if (hand != EQEmu::inventory::slotPrimary)
|
||||
if (hand != EQEmu::invslot::slotPrimary)
|
||||
ProcChance /= 2;
|
||||
|
||||
int level_penalty = 0;
|
||||
@@ -3969,7 +3969,7 @@ void Mob::TryWeaponProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *
|
||||
ProcBonus += static_cast<float>(itembonuses.ProcChance) / 10.0f; // Combat Effects
|
||||
float ProcChance = GetProcChances(ProcBonus, hand);
|
||||
|
||||
if (hand != EQEmu::inventory::slotPrimary) //Is Archery intened to proc at 50% rate?
|
||||
if (hand != EQEmu::invslot::slotPrimary) //Is Archery intened to proc at 50% rate?
|
||||
ProcChance /= 2;
|
||||
|
||||
// Try innate proc on weapon
|
||||
@@ -4008,7 +4008,7 @@ void Mob::TryWeaponProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *
|
||||
proced = false;
|
||||
|
||||
if (!proced && inst) {
|
||||
for (int r = EQEmu::inventory::socketBegin; r < EQEmu::inventory::SocketCount; r++) {
|
||||
for (int r = EQEmu::invaug::SOCKET_BEGIN; r <= EQEmu::invaug::SOCKET_END; r++) {
|
||||
const EQEmu::ItemInstance *aug_i = inst->GetAugment(r);
|
||||
if (!aug_i) // no aug, try next slot!
|
||||
continue;
|
||||
@@ -4051,11 +4051,11 @@ void Mob::TrySpellProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *w
|
||||
float ProcChance = 0.0f;
|
||||
ProcChance = GetProcChances(ProcBonus, hand);
|
||||
|
||||
if (hand != EQEmu::inventory::slotPrimary) //Is Archery intened to proc at 50% rate?
|
||||
if (hand != EQEmu::invslot::slotPrimary) //Is Archery intened to proc at 50% rate?
|
||||
ProcChance /= 2;
|
||||
|
||||
bool rangedattk = false;
|
||||
if (weapon && hand == EQEmu::inventory::slotRange) {
|
||||
if (weapon && hand == EQEmu::invslot::slotRange) {
|
||||
if (weapon->ItemType == EQEmu::item::ItemTypeArrow ||
|
||||
weapon->ItemType == EQEmu::item::ItemTypeLargeThrowing ||
|
||||
weapon->ItemType == EQEmu::item::ItemTypeSmallThrowing ||
|
||||
@@ -4064,11 +4064,11 @@ void Mob::TrySpellProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *w
|
||||
}
|
||||
}
|
||||
|
||||
if (!weapon && hand == EQEmu::inventory::slotRange && GetSpecialAbility(SPECATK_RANGED_ATK))
|
||||
if (!weapon && hand == EQEmu::invslot::slotRange && GetSpecialAbility(SPECATK_RANGED_ATK))
|
||||
rangedattk = true;
|
||||
|
||||
for (uint32 i = 0; i < MAX_PROCS; i++) {
|
||||
if (IsPet() && hand != EQEmu::inventory::slotPrimary) //Pets can only proc spell procs from their primay hand (ie; beastlord pets)
|
||||
if (IsPet() && hand != EQEmu::invslot::slotPrimary) //Pets can only proc spell procs from their primay hand (ie; beastlord pets)
|
||||
continue; // If pets ever can proc from off hand, this will need to change
|
||||
|
||||
// Not ranged
|
||||
@@ -4128,7 +4128,7 @@ void Mob::TrySpellProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *w
|
||||
}
|
||||
}
|
||||
|
||||
if (HasSkillProcs() && hand != EQEmu::inventory::slotRange) { //We check ranged skill procs within the attack functions.
|
||||
if (HasSkillProcs() && hand != EQEmu::invslot::slotRange) { //We check ranged skill procs within the attack functions.
|
||||
uint16 skillinuse = 28;
|
||||
if (weapon)
|
||||
skillinuse = GetSkillByItemType(weapon->ItemType);
|
||||
@@ -4451,7 +4451,7 @@ void Mob::DoRiposte(Mob *defender)
|
||||
return;
|
||||
}
|
||||
|
||||
defender->Attack(this, EQEmu::inventory::slotPrimary, true);
|
||||
defender->Attack(this, EQEmu::invslot::slotPrimary, true);
|
||||
if (HasDied())
|
||||
return;
|
||||
|
||||
@@ -4462,7 +4462,7 @@ void Mob::DoRiposte(Mob *defender)
|
||||
if (DoubleRipChance && zone->random.Roll(DoubleRipChance)) {
|
||||
Log(Logs::Detail, Logs::Combat,
|
||||
"Preforming a double riposted from SE_DoubleRiposte (%d percent chance)", DoubleRipChance);
|
||||
defender->Attack(this, EQEmu::inventory::slotPrimary, true);
|
||||
defender->Attack(this, EQEmu::invslot::slotPrimary, true);
|
||||
if (HasDied())
|
||||
return;
|
||||
}
|
||||
@@ -4475,7 +4475,7 @@ void Mob::DoRiposte(Mob *defender)
|
||||
Log(Logs::Detail, Logs::Combat,
|
||||
"Preforming a double riposted from SE_GiveDoubleRiposte base1 == 0 (%d percent chance)",
|
||||
DoubleRipChance);
|
||||
defender->Attack(this, EQEmu::inventory::slotPrimary, true);
|
||||
defender->Attack(this, EQEmu::invslot::slotPrimary, true);
|
||||
if (HasDied())
|
||||
return;
|
||||
}
|
||||
@@ -4888,7 +4888,7 @@ float Mob::GetSkillProcChances(uint16 ReuseTime, uint16 hand) {
|
||||
if (!ReuseTime && hand) {
|
||||
weapon_speed = GetWeaponSpeedbyHand(hand);
|
||||
ProcChance = static_cast<float>(weapon_speed) * (RuleR(Combat, AvgProcsPerMinute) / 60000.0f);
|
||||
if (hand != EQEmu::inventory::slotPrimary)
|
||||
if (hand != EQEmu::invslot::slotPrimary)
|
||||
ProcChance /= 2;
|
||||
}
|
||||
|
||||
@@ -5182,13 +5182,13 @@ void Client::SetAttackTimer()
|
||||
|
||||
Timer *TimerToUse = nullptr;
|
||||
|
||||
for (int i = EQEmu::inventory::slotRange; i <= EQEmu::inventory::slotSecondary; i++) {
|
||||
for (int i = EQEmu::invslot::slotRange; i <= EQEmu::invslot::slotSecondary; i++) {
|
||||
//pick a timer
|
||||
if (i == EQEmu::inventory::slotPrimary)
|
||||
if (i == EQEmu::invslot::slotPrimary)
|
||||
TimerToUse = &attack_timer;
|
||||
else if (i == EQEmu::inventory::slotRange)
|
||||
else if (i == EQEmu::invslot::slotRange)
|
||||
TimerToUse = &ranged_timer;
|
||||
else if (i == EQEmu::inventory::slotSecondary)
|
||||
else if (i == EQEmu::invslot::slotSecondary)
|
||||
TimerToUse = &attack_dw_timer;
|
||||
else //invalid slot (hands will always hit this)
|
||||
continue;
|
||||
@@ -5201,7 +5201,7 @@ void Client::SetAttackTimer()
|
||||
ItemToUse = ci->GetItem();
|
||||
|
||||
//special offhand stuff
|
||||
if (i == EQEmu::inventory::slotSecondary) {
|
||||
if (i == EQEmu::invslot::slotSecondary) {
|
||||
//if we cant dual wield, skip it
|
||||
if (!CanThisClassDualWield() || HasTwoHanderEquipped()) {
|
||||
attack_dw_timer.Disable();
|
||||
@@ -5276,19 +5276,19 @@ void NPC::SetAttackTimer()
|
||||
else
|
||||
speed = static_cast<int>((attack_delay / haste_mod) + ((hhe / 100.0f) * attack_delay));
|
||||
|
||||
for (int i = EQEmu::inventory::slotRange; i <= EQEmu::inventory::slotSecondary; i++) {
|
||||
for (int i = EQEmu::invslot::slotRange; i <= EQEmu::invslot::slotSecondary; i++) {
|
||||
//pick a timer
|
||||
if (i == EQEmu::inventory::slotPrimary)
|
||||
if (i == EQEmu::invslot::slotPrimary)
|
||||
TimerToUse = &attack_timer;
|
||||
else if (i == EQEmu::inventory::slotRange)
|
||||
else if (i == EQEmu::invslot::slotRange)
|
||||
TimerToUse = &ranged_timer;
|
||||
else if (i == EQEmu::inventory::slotSecondary)
|
||||
else if (i == EQEmu::invslot::slotSecondary)
|
||||
TimerToUse = &attack_dw_timer;
|
||||
else //invalid slot (hands will always hit this)
|
||||
continue;
|
||||
|
||||
//special offhand stuff
|
||||
if (i == EQEmu::inventory::slotSecondary) {
|
||||
if (i == EQEmu::invslot::slotSecondary) {
|
||||
// SPECATK_QUAD is uncheesable
|
||||
if (!CanThisClassDualWield() || (HasTwoHanderEquipped() && !GetSpecialAbility(SPECATK_QUAD))) {
|
||||
attack_dw_timer.Disable();
|
||||
@@ -5310,7 +5310,7 @@ void Client::DoAttackRounds(Mob *target, int hand, bool IsFromSpell)
|
||||
bool candouble = CanThisClassDoubleAttack();
|
||||
// extra off hand non-sense, can only double with skill of 150 or above
|
||||
// or you have any amount of GiveDoubleAttack
|
||||
if (candouble && hand == EQEmu::inventory::slotSecondary)
|
||||
if (candouble && hand == EQEmu::invslot::slotSecondary)
|
||||
candouble =
|
||||
GetSkill(EQEmu::skills::SkillDoubleAttack) > 149 ||
|
||||
(aabonuses.GiveDoubleAttack + spellbonuses.GiveDoubleAttack + itembonuses.GiveDoubleAttack) > 0;
|
||||
@@ -5321,7 +5321,7 @@ void Client::DoAttackRounds(Mob *target, int hand, bool IsFromSpell)
|
||||
Attack(target, hand, false, false, IsFromSpell);
|
||||
|
||||
// Modern AA description: Increases your chance of ... performing one additional hit with a 2-handed weapon when double attacking by 2%.
|
||||
if (hand == EQEmu::inventory::slotPrimary) {
|
||||
if (hand == EQEmu::invslot::slotPrimary) {
|
||||
auto extraattackchance = aabonuses.ExtraAttackChance + spellbonuses.ExtraAttackChance +
|
||||
itembonuses.ExtraAttackChance;
|
||||
if (extraattackchance && HasTwoHanderEquipped() && zone->random.Roll(extraattackchance))
|
||||
@@ -5329,7 +5329,7 @@ void Client::DoAttackRounds(Mob *target, int hand, bool IsFromSpell)
|
||||
}
|
||||
|
||||
// you can only triple from the main hand
|
||||
if (hand == EQEmu::inventory::slotPrimary && CanThisClassTripleAttack()) {
|
||||
if (hand == EQEmu::invslot::slotPrimary && CanThisClassTripleAttack()) {
|
||||
CheckIncreaseSkill(EQEmu::skills::SkillTripleAttack, target, -10);
|
||||
if (CheckTripleAttack()) {
|
||||
Attack(target, hand, false, false, IsFromSpell);
|
||||
@@ -5383,9 +5383,9 @@ void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts)
|
||||
if (RuleB(Combat, UseLiveCombatRounds)) {
|
||||
// A "quad" on live really is just a successful dual wield where both double attack
|
||||
// The mobs that could triple lost the ability to when the triple attack skill was added in
|
||||
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts);
|
||||
Attack(target, EQEmu::invslot::slotPrimary, false, false, false, opts);
|
||||
if (CanThisClassDoubleAttack() && CheckDoubleAttack()) {
|
||||
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts);
|
||||
Attack(target, EQEmu::invslot::slotPrimary, false, false, false, opts);
|
||||
if ((IsPet() || IsTempPet()) && IsPetOwnerClient()) {
|
||||
int chance = spellbonuses.PC_Pet_Flurry + itembonuses.PC_Pet_Flurry + aabonuses.PC_Pet_Flurry;
|
||||
if (chance && zone->random.Roll(chance))
|
||||
@@ -5398,16 +5398,16 @@ void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts)
|
||||
if (IsNPC()) {
|
||||
int16 n_atk = CastToNPC()->GetNumberOfAttacks();
|
||||
if (n_atk <= 1) {
|
||||
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts);
|
||||
Attack(target, EQEmu::invslot::slotPrimary, false, false, false, opts);
|
||||
}
|
||||
else {
|
||||
for (int i = 0; i < n_atk; ++i) {
|
||||
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts);
|
||||
Attack(target, EQEmu::invslot::slotPrimary, false, false, false, opts);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts);
|
||||
Attack(target, EQEmu::invslot::slotPrimary, false, false, false, opts);
|
||||
}
|
||||
|
||||
// we use this random value in three comparisons with different
|
||||
@@ -5418,15 +5418,15 @@ void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts)
|
||||
// check double attack, this is NOT the same rules that clients use...
|
||||
&&
|
||||
RandRoll < (GetLevel() + NPCDualAttackModifier)) {
|
||||
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts);
|
||||
Attack(target, EQEmu::invslot::slotPrimary, false, false, false, opts);
|
||||
// lets see if we can do a triple attack with the main hand
|
||||
// pets are excluded from triple and quads...
|
||||
if ((GetSpecialAbility(SPECATK_TRIPLE) || GetSpecialAbility(SPECATK_QUAD)) && !IsPet() &&
|
||||
RandRoll < (GetLevel() + NPCTripleAttackModifier)) {
|
||||
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts);
|
||||
Attack(target, EQEmu::invslot::slotPrimary, false, false, false, opts);
|
||||
// now lets check the quad attack
|
||||
if (GetSpecialAbility(SPECATK_QUAD) && RandRoll < (GetLevel() + NPCQuadAttackModifier)) {
|
||||
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts);
|
||||
Attack(target, EQEmu::invslot::slotPrimary, false, false, false, opts);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5442,9 +5442,9 @@ void Mob::DoOffHandAttackRounds(Mob *target, ExtraAttackOptions *opts)
|
||||
(RuleB(Combat, UseLiveCombatRounds) && GetSpecialAbility(SPECATK_QUAD))) ||
|
||||
GetEquipment(EQEmu::textures::weaponSecondary) != 0) {
|
||||
if (CheckDualWield()) {
|
||||
Attack(target, EQEmu::inventory::slotSecondary, false, false, false, opts);
|
||||
Attack(target, EQEmu::invslot::slotSecondary, false, false, false, opts);
|
||||
if (CanThisClassDoubleAttack() && GetLevel() > 35 && CheckDoubleAttack()) {
|
||||
Attack(target, EQEmu::inventory::slotSecondary, false, false, false, opts);
|
||||
Attack(target, EQEmu::invslot::slotSecondary, false, false, false, opts);
|
||||
|
||||
if ((IsPet() || IsTempPet()) && IsPetOwnerClient()) {
|
||||
int chance = spellbonuses.PC_Pet_Flurry + itembonuses.PC_Pet_Flurry + aabonuses.PC_Pet_Flurry;
|
||||
@@ -5455,3 +5455,11 @@ void Mob::DoOffHandAttackRounds(Mob *target, ExtraAttackOptions *opts)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool Mob::GetWasSpawnedInWater() const {
|
||||
return spawned_in_water;
|
||||
}
|
||||
|
||||
void Mob::SetSpawnedInWater(bool spawned_in_water) {
|
||||
Mob::spawned_in_water = spawned_in_water;
|
||||
}
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ public:
|
||||
//abstract virtual function implementations requird by base abstract class
|
||||
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill) { return true; }
|
||||
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None) { return; }
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::invslot::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
ExtraAttackOptions *opts = nullptr) { return false; }
|
||||
virtual bool HasRaid() { return false; }
|
||||
virtual bool HasGroup() { return false; }
|
||||
|
||||
+36
-36
@@ -161,35 +161,35 @@ void Client::CalcItemBonuses(StatBonuses* newbon) {
|
||||
|
||||
unsigned int i;
|
||||
// Update: MainAmmo should only calc skill mods (TODO: Check for other cases)
|
||||
for (i = EQEmu::inventory::slotCharm; i <= EQEmu::inventory::slotAmmo; i++) {
|
||||
for (i = EQEmu::invslot::BONUS_BEGIN; i <= EQEmu::invslot::BONUS_SKILL_END; i++) {
|
||||
const EQEmu::ItemInstance* inst = m_inv[i];
|
||||
if(inst == 0)
|
||||
continue;
|
||||
AddItemBonuses(inst, newbon, false, false, 0, (i == EQEmu::inventory::slotAmmo));
|
||||
AddItemBonuses(inst, newbon, false, false, 0, (i == EQEmu::invslot::slotAmmo));
|
||||
|
||||
//These are given special flags due to how often they are checked for various spell effects.
|
||||
const EQEmu::ItemData *item = inst->GetItem();
|
||||
if (i == EQEmu::inventory::slotSecondary && (item && item->ItemType == EQEmu::item::ItemTypeShield))
|
||||
if (i == EQEmu::invslot::slotSecondary && (item && item->ItemType == EQEmu::item::ItemTypeShield))
|
||||
SetShieldEquiped(true);
|
||||
else if (i == EQEmu::inventory::slotPrimary && (item && item->ItemType == EQEmu::item::ItemType2HBlunt)) {
|
||||
else if (i == EQEmu::invslot::slotPrimary && (item && item->ItemType == EQEmu::item::ItemType2HBlunt)) {
|
||||
SetTwoHandBluntEquiped(true);
|
||||
SetTwoHanderEquipped(true);
|
||||
}
|
||||
else if (i == EQEmu::inventory::slotPrimary && (item && (item->ItemType == EQEmu::item::ItemType2HSlash || item->ItemType == EQEmu::item::ItemType2HPiercing)))
|
||||
else if (i == EQEmu::invslot::slotPrimary && (item && (item->ItemType == EQEmu::item::ItemType2HSlash || item->ItemType == EQEmu::item::ItemType2HPiercing)))
|
||||
SetTwoHanderEquipped(true);
|
||||
}
|
||||
|
||||
//Power Source Slot
|
||||
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
|
||||
{
|
||||
const EQEmu::ItemInstance* inst = m_inv[EQEmu::inventory::slotPowerSource];
|
||||
const EQEmu::ItemInstance* inst = m_inv[EQEmu::invslot::SLOT_POWER_SOURCE];
|
||||
if(inst)
|
||||
AddItemBonuses(inst, newbon);
|
||||
}
|
||||
|
||||
//tribute items
|
||||
for (i = 0; i < EQEmu::legacy::TRIBUTE_SIZE; i++) {
|
||||
const EQEmu::ItemInstance* inst = m_inv[EQEmu::legacy::TRIBUTE_BEGIN + i];
|
||||
for (i = EQEmu::invslot::TRIBUTE_BEGIN; i <= EQEmu::invslot::TRIBUTE_END; i++) {
|
||||
const EQEmu::ItemInstance* inst = m_inv[i];
|
||||
if(inst == 0)
|
||||
continue;
|
||||
AddItemBonuses(inst, newbon, false, true);
|
||||
@@ -197,7 +197,7 @@ void Client::CalcItemBonuses(StatBonuses* newbon) {
|
||||
|
||||
//Optional ability to have worn effects calculate as an addititive bonus instead of highest value
|
||||
if (RuleI(Spells, AdditiveBonusWornType) && RuleI(Spells, AdditiveBonusWornType) != EQEmu::item::ItemEffectWorn){
|
||||
for (i = EQEmu::inventory::slotCharm; i < EQEmu::inventory::slotAmmo; i++) {
|
||||
for (i = EQEmu::invslot::BONUS_BEGIN; i <= EQEmu::invslot::BONUS_STAT_END; i++) {
|
||||
const EQEmu::ItemInstance* inst = m_inv[i];
|
||||
if(inst == 0)
|
||||
continue;
|
||||
@@ -543,7 +543,7 @@ void Client::AddItemBonuses(const EQEmu::ItemInstance *inst, StatBonuses *newbon
|
||||
}
|
||||
|
||||
if (!isAug) {
|
||||
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++)
|
||||
for (int i = EQEmu::invaug::SOCKET_BEGIN; i <= EQEmu::invaug::SOCKET_END; i++)
|
||||
AddItemBonuses(inst->GetAugment(i), newbon, true, false, rec_level, ammo_slot_item);
|
||||
}
|
||||
}
|
||||
@@ -581,7 +581,7 @@ void Client::AdditiveWornBonuses(const EQEmu::ItemInstance *inst, StatBonuses* n
|
||||
if (!isAug)
|
||||
{
|
||||
int i;
|
||||
for (i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
|
||||
for (i = EQEmu::invaug::SOCKET_BEGIN; i <= EQEmu::invaug::SOCKET_END; i++) {
|
||||
AdditiveWornBonuses(inst->GetAugment(i),newbon,true);
|
||||
}
|
||||
}
|
||||
@@ -592,32 +592,32 @@ void Client::CalcEdibleBonuses(StatBonuses* newbon) {
|
||||
|
||||
bool food = false;
|
||||
bool drink = false;
|
||||
for (i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_BAGS_BEGIN; i++)
|
||||
for (i = EQEmu::invslot::GENERAL_BEGIN; i <= EQEmu::invslot::GENERAL_END; i++)
|
||||
{
|
||||
if (food && drink)
|
||||
break;
|
||||
const EQEmu::ItemInstance* inst = GetInv().GetItem(i);
|
||||
if (inst && inst->GetItem() && inst->IsClassCommon()) {
|
||||
const EQEmu::ItemData *item = inst->GetItem();
|
||||
if (item->ItemType == EQEmu::item::ItemTypeFood && !food)
|
||||
if (!food && item->ItemType == EQEmu::item::ItemTypeFood)
|
||||
food = true;
|
||||
else if (item->ItemType == EQEmu::item::ItemTypeDrink && !drink)
|
||||
else if (!drink && item->ItemType == EQEmu::item::ItemTypeDrink)
|
||||
drink = true;
|
||||
else
|
||||
continue;
|
||||
AddItemBonuses(inst, newbon);
|
||||
}
|
||||
}
|
||||
for (i = EQEmu::legacy::GENERAL_BAGS_BEGIN; i <= EQEmu::legacy::GENERAL_BAGS_END; i++)
|
||||
for (i = EQEmu::invbag::GENERAL_BAGS_BEGIN; i <= EQEmu::invbag::GENERAL_BAGS_END; i++)
|
||||
{
|
||||
if (food && drink)
|
||||
break;
|
||||
const EQEmu::ItemInstance* inst = GetInv().GetItem(i);
|
||||
if (inst && inst->GetItem() && inst->IsClassCommon()) {
|
||||
const EQEmu::ItemData *item = inst->GetItem();
|
||||
if (item->ItemType == EQEmu::item::ItemTypeFood && !food)
|
||||
if (!food && item->ItemType == EQEmu::item::ItemTypeFood)
|
||||
food = true;
|
||||
else if (item->ItemType == EQEmu::item::ItemTypeDrink && !drink)
|
||||
else if (!drink && item->ItemType == EQEmu::item::ItemTypeDrink)
|
||||
drink = true;
|
||||
else
|
||||
continue;
|
||||
@@ -3261,7 +3261,7 @@ void NPC::CalcItemBonuses(StatBonuses *newbon)
|
||||
{
|
||||
if(newbon){
|
||||
|
||||
for (int i = 0; i < EQEmu::legacy::EQUIPMENT_SIZE; i++){
|
||||
for (int i = EQEmu::invslot::EQUIPMENT_BEGIN; i <= EQEmu::invslot::EQUIPMENT_END; i++){
|
||||
const EQEmu::ItemData *cur = database.GetItem(equipment[i]);
|
||||
if(cur){
|
||||
//basic stats
|
||||
@@ -3339,24 +3339,24 @@ void Client::CalcItemScale() {
|
||||
bool changed = false;
|
||||
|
||||
// MainAmmo excluded in helper function below
|
||||
if (CalcItemScale(EQEmu::legacy::EQUIPMENT_BEGIN, EQEmu::legacy::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21)
|
||||
if (CalcItemScale(EQEmu::invslot::EQUIPMENT_BEGIN, EQEmu::invslot::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21)
|
||||
changed = true;
|
||||
|
||||
if (CalcItemScale(EQEmu::legacy::GENERAL_BEGIN, EQEmu::legacy::GENERAL_END)) // original coding excluded MainCursor (< 30)
|
||||
if (CalcItemScale(EQEmu::invslot::GENERAL_BEGIN, EQEmu::invslot::GENERAL_END)) // original coding excluded MainCursor (< 30)
|
||||
changed = true;
|
||||
|
||||
// I excluded cursor bag slots here because cursor was excluded above..if this is incorrect, change 'slot_y' here to CURSOR_BAG_END
|
||||
// and 'slot_y' above to CURSOR from GENERAL_END above - or however it is supposed to be...
|
||||
if (CalcItemScale(EQEmu::legacy::GENERAL_BAGS_BEGIN, EQEmu::legacy::GENERAL_BAGS_END)) // (< 341)
|
||||
if (CalcItemScale(EQEmu::invbag::GENERAL_BAGS_BEGIN, EQEmu::invbag::GENERAL_BAGS_END)) // (< 341)
|
||||
changed = true;
|
||||
|
||||
if (CalcItemScale(EQEmu::legacy::TRIBUTE_BEGIN, EQEmu::legacy::TRIBUTE_END)) // (< 405)
|
||||
if (CalcItemScale(EQEmu::invslot::TRIBUTE_BEGIN, EQEmu::invslot::TRIBUTE_END)) // (< 405)
|
||||
changed = true;
|
||||
|
||||
//Power Source Slot
|
||||
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
|
||||
{
|
||||
if (CalcItemScale(EQEmu::inventory::slotPowerSource, EQEmu::inventory::slotPowerSource))
|
||||
if (CalcItemScale(EQEmu::invslot::SLOT_POWER_SOURCE, EQEmu::invslot::SLOT_POWER_SOURCE))
|
||||
changed = true;
|
||||
}
|
||||
|
||||
@@ -3371,7 +3371,7 @@ bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) {
|
||||
bool changed = false;
|
||||
uint32 i;
|
||||
for (i = slot_x; i <= slot_y; i++) {
|
||||
if (i == EQEmu::inventory::slotAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot
|
||||
if (i == EQEmu::invslot::slotAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot
|
||||
continue;
|
||||
|
||||
EQEmu::ItemInstance* inst = m_inv.GetItem(i);
|
||||
@@ -3381,7 +3381,7 @@ bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) {
|
||||
|
||||
// TEST CODE: test for bazaar trader crashing with charm items
|
||||
if (Trader)
|
||||
if (i >= EQEmu::legacy::GENERAL_BAGS_BEGIN && i <= EQEmu::legacy::GENERAL_BAGS_END) {
|
||||
if (i >= EQEmu::invbag::GENERAL_BAGS_BEGIN && i <= EQEmu::invbag::GENERAL_BAGS_END) {
|
||||
EQEmu::ItemInstance* parent_item = m_inv.GetItem(EQEmu::InventoryProfile::CalcSlotId(i));
|
||||
if (parent_item && parent_item->GetItem()->ID == 17899) // trader satchel
|
||||
continue;
|
||||
@@ -3401,7 +3401,7 @@ bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) {
|
||||
}
|
||||
|
||||
//iterate all augments
|
||||
for (int x = EQEmu::inventory::socketBegin; x < EQEmu::inventory::SocketCount; ++x)
|
||||
for (int x = EQEmu::invaug::SOCKET_BEGIN; x <= EQEmu::invaug::SOCKET_END; ++x)
|
||||
{
|
||||
EQEmu::ItemInstance * a_inst = inst->GetAugment(x);
|
||||
if(!a_inst)
|
||||
@@ -3433,24 +3433,24 @@ void Client::DoItemEnterZone() {
|
||||
bool changed = false;
|
||||
|
||||
// MainAmmo excluded in helper function below
|
||||
if (DoItemEnterZone(EQEmu::legacy::EQUIPMENT_BEGIN, EQEmu::legacy::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21)
|
||||
if (DoItemEnterZone(EQEmu::invslot::EQUIPMENT_BEGIN, EQEmu::invslot::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21)
|
||||
changed = true;
|
||||
|
||||
if (DoItemEnterZone(EQEmu::legacy::GENERAL_BEGIN, EQEmu::legacy::GENERAL_END)) // original coding excluded MainCursor (< 30)
|
||||
if (DoItemEnterZone(EQEmu::invslot::GENERAL_BEGIN, EQEmu::invslot::GENERAL_END)) // original coding excluded MainCursor (< 30)
|
||||
changed = true;
|
||||
|
||||
// I excluded cursor bag slots here because cursor was excluded above..if this is incorrect, change 'slot_y' here to CURSOR_BAG_END
|
||||
// and 'slot_y' above to CURSOR from GENERAL_END above - or however it is supposed to be...
|
||||
if (DoItemEnterZone(EQEmu::legacy::GENERAL_BAGS_BEGIN, EQEmu::legacy::GENERAL_BAGS_END)) // (< 341)
|
||||
if (DoItemEnterZone(EQEmu::invbag::GENERAL_BAGS_BEGIN, EQEmu::invbag::GENERAL_BAGS_END)) // (< 341)
|
||||
changed = true;
|
||||
|
||||
if (DoItemEnterZone(EQEmu::legacy::TRIBUTE_BEGIN, EQEmu::legacy::TRIBUTE_END)) // (< 405)
|
||||
if (DoItemEnterZone(EQEmu::invslot::TRIBUTE_BEGIN, EQEmu::invslot::TRIBUTE_END)) // (< 405)
|
||||
changed = true;
|
||||
|
||||
//Power Source Slot
|
||||
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
|
||||
{
|
||||
if (DoItemEnterZone(EQEmu::inventory::slotPowerSource, EQEmu::inventory::slotPowerSource))
|
||||
if (DoItemEnterZone(EQEmu::invslot::SLOT_POWER_SOURCE, EQEmu::invslot::SLOT_POWER_SOURCE))
|
||||
changed = true;
|
||||
}
|
||||
|
||||
@@ -3464,7 +3464,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
|
||||
// behavior change: 'slot_y' is now [RANGE]_END and not [RANGE]_END + 1
|
||||
bool changed = false;
|
||||
for(uint32 i = slot_x; i <= slot_y; i++) {
|
||||
if (i == EQEmu::inventory::slotAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot
|
||||
if (i == EQEmu::invslot::slotAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot
|
||||
continue;
|
||||
|
||||
EQEmu::ItemInstance* inst = m_inv.GetItem(i);
|
||||
@@ -3474,7 +3474,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
|
||||
|
||||
// TEST CODE: test for bazaar trader crashing with charm items
|
||||
if (Trader)
|
||||
if (i >= EQEmu::legacy::GENERAL_BAGS_BEGIN && i <= EQEmu::legacy::GENERAL_BAGS_END) {
|
||||
if (i >= EQEmu::invbag::GENERAL_BAGS_BEGIN && i <= EQEmu::invbag::GENERAL_BAGS_END) {
|
||||
EQEmu::ItemInstance* parent_item = m_inv.GetItem(EQEmu::InventoryProfile::CalcSlotId(i));
|
||||
if (parent_item && parent_item->GetItem()->ID == 17899) // trader satchel
|
||||
continue;
|
||||
@@ -3486,7 +3486,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
|
||||
uint16 oldexp = inst->GetExp();
|
||||
|
||||
parse->EventItem(EVENT_ITEM_ENTER_ZONE, this, inst, nullptr, "", 0);
|
||||
if (i <= EQEmu::inventory::slotAmmo || i == EQEmu::inventory::slotPowerSource) {
|
||||
if (i <= EQEmu::invslot::slotAmmo || i == EQEmu::invslot::SLOT_POWER_SOURCE) {
|
||||
parse->EventItem(EVENT_EQUIP_ITEM, this, inst, nullptr, "", i);
|
||||
}
|
||||
|
||||
@@ -3496,7 +3496,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
|
||||
update_slot = true;
|
||||
}
|
||||
} else {
|
||||
if (i <= EQEmu::inventory::slotAmmo || i == EQEmu::inventory::slotPowerSource) {
|
||||
if (i <= EQEmu::invslot::slotAmmo || i == EQEmu::invslot::SLOT_POWER_SOURCE) {
|
||||
parse->EventItem(EVENT_EQUIP_ITEM, this, inst, nullptr, "", i);
|
||||
}
|
||||
|
||||
@@ -3504,7 +3504,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
|
||||
}
|
||||
|
||||
//iterate all augments
|
||||
for (int x = EQEmu::inventory::socketBegin; x < EQEmu::inventory::SocketCount; ++x)
|
||||
for (int x = EQEmu::invaug::SOCKET_BEGIN; x <= EQEmu::invaug::SOCKET_END; ++x)
|
||||
{
|
||||
EQEmu::ItemInstance *a_inst = inst->GetAugment(x);
|
||||
if(!a_inst)
|
||||
|
||||
+140
-136
@@ -243,8 +243,8 @@ void Bot::SetBotSpellID(uint32 newSpellID) {
|
||||
}
|
||||
|
||||
uint32 Bot::GetBotArcheryRange() {
|
||||
const EQEmu::ItemInstance *range_inst = GetBotItem(EQEmu::inventory::slotRange);
|
||||
const EQEmu::ItemInstance *ammo_inst = GetBotItem(EQEmu::inventory::slotAmmo);
|
||||
const EQEmu::ItemInstance *range_inst = GetBotItem(EQEmu::invslot::slotRange);
|
||||
const EQEmu::ItemInstance *ammo_inst = GetBotItem(EQEmu::invslot::slotAmmo);
|
||||
if (!range_inst || !ammo_inst)
|
||||
return 0;
|
||||
|
||||
@@ -260,15 +260,15 @@ uint32 Bot::GetBotArcheryRange() {
|
||||
void Bot::ChangeBotArcherWeapons(bool isArcher) {
|
||||
if((GetClass()==WARRIOR) || (GetClass()==PALADIN) || (GetClass()==RANGER) || (GetClass()==SHADOWKNIGHT) || (GetClass()==ROGUE)) {
|
||||
if(!isArcher) {
|
||||
BotAddEquipItem(EQEmu::inventory::slotPrimary, GetBotItemBySlot(EQEmu::inventory::slotPrimary));
|
||||
BotAddEquipItem(EQEmu::inventory::slotSecondary, GetBotItemBySlot(EQEmu::inventory::slotSecondary));
|
||||
BotAddEquipItem(EQEmu::invslot::slotPrimary, GetBotItemBySlot(EQEmu::invslot::slotPrimary));
|
||||
BotAddEquipItem(EQEmu::invslot::slotSecondary, GetBotItemBySlot(EQEmu::invslot::slotSecondary));
|
||||
SetAttackTimer();
|
||||
BotGroupSay(this, "My blade is ready");
|
||||
} else {
|
||||
BotRemoveEquipItem(EQEmu::inventory::slotPrimary);
|
||||
BotRemoveEquipItem(EQEmu::inventory::slotSecondary);
|
||||
BotAddEquipItem(EQEmu::inventory::slotAmmo, GetBotItemBySlot(EQEmu::inventory::slotAmmo));
|
||||
BotAddEquipItem(EQEmu::inventory::slotSecondary, GetBotItemBySlot(EQEmu::inventory::slotRange));
|
||||
BotRemoveEquipItem(EQEmu::invslot::slotPrimary);
|
||||
BotRemoveEquipItem(EQEmu::invslot::slotSecondary);
|
||||
BotAddEquipItem(EQEmu::invslot::slotAmmo, GetBotItemBySlot(EQEmu::invslot::slotAmmo));
|
||||
BotAddEquipItem(EQEmu::invslot::slotSecondary, GetBotItemBySlot(EQEmu::invslot::slotRange));
|
||||
SetAttackTimer();
|
||||
BotGroupSay(this, "My bow is true and ready");
|
||||
}
|
||||
@@ -1166,11 +1166,11 @@ int32 Bot::acmod() {
|
||||
|
||||
uint16 Bot::GetPrimarySkillValue() {
|
||||
EQEmu::skills::SkillType skill = EQEmu::skills::HIGHEST_SKILL; //because nullptr == 0, which is 1H Slashing, & we want it to return 0 from GetSkill
|
||||
bool equiped = m_inv.GetItem(EQEmu::inventory::slotPrimary);
|
||||
bool equiped = m_inv.GetItem(EQEmu::invslot::slotPrimary);
|
||||
if(!equiped)
|
||||
skill = EQEmu::skills::SkillHandtoHand;
|
||||
else {
|
||||
uint8 type = m_inv.GetItem(EQEmu::inventory::slotPrimary)->GetItem()->ItemType; //is this the best way to do this?
|
||||
uint8 type = m_inv.GetItem(EQEmu::invslot::slotPrimary)->GetItem()->ItemType; //is this the best way to do this?
|
||||
switch(type) {
|
||||
case EQEmu::item::ItemType1HSlash:
|
||||
skill = EQEmu::skills::Skill1HSlashing;
|
||||
@@ -1718,8 +1718,8 @@ bool Bot::LoadPet()
|
||||
if (!botdb.LoadPetBuffs(GetBotID(), pet_buffs))
|
||||
bot_owner->Message(13, "%s for %s's pet", BotDatabase::fail::LoadPetBuffs(), GetCleanName());
|
||||
|
||||
uint32 pet_items[EQEmu::legacy::EQUIPMENT_SIZE];
|
||||
memset(pet_items, 0, (sizeof(uint32) * EQEmu::legacy::EQUIPMENT_SIZE));
|
||||
uint32 pet_items[EQEmu::invslot::EQUIPMENT_COUNT];
|
||||
memset(pet_items, 0, (sizeof(uint32) * EQEmu::invslot::EQUIPMENT_COUNT));
|
||||
if (!botdb.LoadPetItems(GetBotID(), pet_items))
|
||||
bot_owner->Message(13, "%s for %s's pet", BotDatabase::fail::LoadPetItems(), GetCleanName());
|
||||
|
||||
@@ -1746,11 +1746,11 @@ bool Bot::SavePet()
|
||||
|
||||
char* pet_name = new char[64];
|
||||
SpellBuff_Struct pet_buffs[PET_BUFF_COUNT];
|
||||
uint32 pet_items[EQEmu::legacy::EQUIPMENT_SIZE];
|
||||
uint32 pet_items[EQEmu::invslot::EQUIPMENT_COUNT];
|
||||
|
||||
memset(pet_name, 0, 64);
|
||||
memset(pet_buffs, 0, (sizeof(SpellBuff_Struct) * PET_BUFF_COUNT));
|
||||
memset(pet_items, 0, (sizeof(uint32) * EQEmu::legacy::EQUIPMENT_SIZE));
|
||||
memset(pet_items, 0, (sizeof(uint32) * EQEmu::invslot::EQUIPMENT_COUNT));
|
||||
|
||||
pet_inst->GetPetState(pet_buffs, pet_items, pet_name);
|
||||
|
||||
@@ -1846,7 +1846,7 @@ bool Bot::Process() {
|
||||
SetEndurance(GetEndurance() + CalcEnduranceRegen() + RestRegenEndurance);
|
||||
}
|
||||
|
||||
if (sendhpupdate_timer.Check(false)) {
|
||||
if (send_hp_update_timer.Check(false)) {
|
||||
SendHPUpdate();
|
||||
if(HasPet())
|
||||
GetPet()->SendHPUpdate();
|
||||
@@ -1904,12 +1904,12 @@ void Bot::BotRangedAttack(Mob* other) {
|
||||
return;
|
||||
}
|
||||
|
||||
EQEmu::ItemInstance* rangedItem = GetBotItem(EQEmu::inventory::slotRange);
|
||||
EQEmu::ItemInstance* rangedItem = GetBotItem(EQEmu::invslot::slotRange);
|
||||
const EQEmu::ItemData* RangeWeapon = nullptr;
|
||||
if(rangedItem)
|
||||
RangeWeapon = rangedItem->GetItem();
|
||||
|
||||
EQEmu::ItemInstance* ammoItem = GetBotItem(EQEmu::inventory::slotAmmo);
|
||||
EQEmu::ItemInstance* ammoItem = GetBotItem(EQEmu::invslot::slotAmmo);
|
||||
const EQEmu::ItemData* Ammo = nullptr;
|
||||
if(ammoItem)
|
||||
Ammo = ammoItem->GetItem();
|
||||
@@ -2003,19 +2003,19 @@ void Bot::ApplySpecialAttackMod(EQEmu::skills::SkillType skill, int32 &dmg, int3
|
||||
case EQEmu::skills::SkillFlyingKick:
|
||||
case EQEmu::skills::SkillRoundKick:
|
||||
case EQEmu::skills::SkillKick:
|
||||
item_slot = EQEmu::inventory::slotFeet;
|
||||
item_slot = EQEmu::invslot::slotFeet;
|
||||
break;
|
||||
case EQEmu::skills::SkillBash:
|
||||
item_slot = EQEmu::inventory::slotSecondary;
|
||||
item_slot = EQEmu::invslot::slotSecondary;
|
||||
break;
|
||||
case EQEmu::skills::SkillDragonPunch:
|
||||
case EQEmu::skills::SkillEagleStrike:
|
||||
case EQEmu::skills::SkillTigerClaw:
|
||||
item_slot = EQEmu::inventory::slotHands;
|
||||
item_slot = EQEmu::invslot::slotHands;
|
||||
break;
|
||||
}
|
||||
|
||||
if (item_slot >= EQEmu::legacy::EQUIPMENT_BEGIN){
|
||||
if (item_slot >= EQEmu::invslot::EQUIPMENT_BEGIN){
|
||||
const EQEmu::ItemInstance* inst = GetBotItem(item_slot);
|
||||
const EQEmu::ItemData* botweapon = nullptr;
|
||||
if(inst)
|
||||
@@ -2312,8 +2312,8 @@ void Bot::AI_Process() {
|
||||
|
||||
bool atCombatRange = false;
|
||||
|
||||
const auto* p_item = GetBotItem(EQEmu::inventory::slotPrimary);
|
||||
const auto* s_item = GetBotItem(EQEmu::inventory::slotSecondary);
|
||||
const auto* p_item = GetBotItem(EQEmu::invslot::slotPrimary);
|
||||
const auto* s_item = GetBotItem(EQEmu::invslot::slotSecondary);
|
||||
|
||||
bool behind_mob = false;
|
||||
bool backstab_weapon = false;
|
||||
@@ -2589,31 +2589,31 @@ void Bot::AI_Process() {
|
||||
|
||||
TEST_TARGET();
|
||||
if (attack_timer.Check()) { // Process primary weapon attacks
|
||||
Attack(tar, EQEmu::inventory::slotPrimary);
|
||||
Attack(tar, EQEmu::invslot::slotPrimary);
|
||||
|
||||
TEST_TARGET();
|
||||
TriggerDefensiveProcs(tar, EQEmu::inventory::slotPrimary, false);
|
||||
TriggerDefensiveProcs(tar, EQEmu::invslot::slotPrimary, false);
|
||||
|
||||
TEST_TARGET();
|
||||
TryWeaponProc(p_item, tar, EQEmu::inventory::slotPrimary);
|
||||
TryWeaponProc(p_item, tar, EQEmu::invslot::slotPrimary);
|
||||
|
||||
//bool tripleSuccess = false;
|
||||
|
||||
TEST_TARGET();
|
||||
if (CanThisClassDoubleAttack()) {
|
||||
if (CheckBotDoubleAttack())
|
||||
Attack(tar, EQEmu::inventory::slotPrimary, true);
|
||||
Attack(tar, EQEmu::invslot::slotPrimary, true);
|
||||
|
||||
TEST_TARGET();
|
||||
if (GetSpecialAbility(SPECATK_TRIPLE) && CheckBotDoubleAttack(true)) {
|
||||
//tripleSuccess = true;
|
||||
Attack(tar, EQEmu::inventory::slotPrimary, true);
|
||||
Attack(tar, EQEmu::invslot::slotPrimary, true);
|
||||
}
|
||||
|
||||
TEST_TARGET();
|
||||
//quad attack, does this belong here??
|
||||
if (GetSpecialAbility(SPECATK_QUAD) && CheckBotDoubleAttack(true))
|
||||
Attack(tar, EQEmu::inventory::slotPrimary, true);
|
||||
Attack(tar, EQEmu::invslot::slotPrimary, true);
|
||||
}
|
||||
|
||||
TEST_TARGET();
|
||||
@@ -2622,10 +2622,10 @@ void Bot::AI_Process() {
|
||||
if (flurrychance) {
|
||||
if (zone->random.Int(0, 100) < flurrychance) {
|
||||
Message_StringID(MT_NPCFlurry, YOU_FLURRY);
|
||||
Attack(tar, EQEmu::inventory::slotPrimary, false);
|
||||
Attack(tar, EQEmu::invslot::slotPrimary, false);
|
||||
|
||||
TEST_TARGET();
|
||||
Attack(tar, EQEmu::inventory::slotPrimary, false);
|
||||
Attack(tar, EQEmu::invslot::slotPrimary, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2634,7 +2634,7 @@ void Bot::AI_Process() {
|
||||
if (ExtraAttackChanceBonus) {
|
||||
if (p_item && p_item->GetItem()->IsType2HWeapon()) {
|
||||
if (zone->random.Int(0, 100) < ExtraAttackChanceBonus)
|
||||
Attack(tar, EQEmu::inventory::slotPrimary, false);
|
||||
Attack(tar, EQEmu::invslot::slotPrimary, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2666,15 +2666,15 @@ void Bot::AI_Process() {
|
||||
float random = zone->random.Real(0, 1);
|
||||
|
||||
if (random < DualWieldProbability){ // Max 78% of DW
|
||||
Attack(tar, EQEmu::inventory::slotSecondary); // Single attack with offhand
|
||||
Attack(tar, EQEmu::invslot::slotSecondary); // Single attack with offhand
|
||||
|
||||
TEST_TARGET();
|
||||
TryWeaponProc(s_item, tar, EQEmu::inventory::slotSecondary);
|
||||
TryWeaponProc(s_item, tar, EQEmu::invslot::slotSecondary);
|
||||
|
||||
TEST_TARGET();
|
||||
if (CanThisClassDoubleAttack() && CheckBotDoubleAttack()) {
|
||||
if (tar->GetHP() > -10)
|
||||
Attack(tar, EQEmu::inventory::slotSecondary); // Single attack with offhand
|
||||
Attack(tar, EQEmu::invslot::slotSecondary); // Single attack with offhand
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2945,12 +2945,12 @@ void Bot::PetAIProcess() {
|
||||
if(!botPet->BehindMob(botPet->GetTarget(), botPet->GetX(), botPet->GetY()) && botPet->GetTarget()->IsEnraged())
|
||||
return;
|
||||
|
||||
if (botPet->Attack(GetTarget(), EQEmu::inventory::slotPrimary)) // try the main hand
|
||||
if (botPet->Attack(GetTarget(), EQEmu::invslot::slotPrimary)) // try the main hand
|
||||
if (botPet->GetTarget()) {
|
||||
// We're a pet so we re able to dual attack
|
||||
int32 RandRoll = zone->random.Int(0, 99);
|
||||
if (botPet->CanThisClassDoubleAttack() && (RandRoll < (botPet->GetLevel() + NPCDualAttackModifier))) {
|
||||
if (botPet->Attack(botPet->GetTarget(), EQEmu::inventory::slotPrimary)) {}
|
||||
if (botPet->Attack(botPet->GetTarget(), EQEmu::invslot::slotPrimary)) {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2988,11 +2988,11 @@ void Bot::PetAIProcess() {
|
||||
float DualWieldProbability = ((botPet->GetSkill(EQEmu::skills::SkillDualWield) + botPet->GetLevel()) / 400.0f);
|
||||
DualWieldProbability -= zone->random.Real(0, 1);
|
||||
if(DualWieldProbability < 0) {
|
||||
botPet->Attack(botPet->GetTarget(), EQEmu::inventory::slotSecondary);
|
||||
botPet->Attack(botPet->GetTarget(), EQEmu::invslot::slotSecondary);
|
||||
if (botPet->CanThisClassDoubleAttack()) {
|
||||
int32 RandRoll = zone->random.Int(0, 99);
|
||||
if (RandRoll < (botPet->GetLevel() + 20))
|
||||
botPet->Attack(botPet->GetTarget(), EQEmu::inventory::slotSecondary);
|
||||
botPet->Attack(botPet->GetTarget(), EQEmu::invslot::slotSecondary);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3117,7 +3117,7 @@ bool Bot::Spawn(Client* botCharacterOwner) {
|
||||
// I re-enabled this until I can sort it out
|
||||
uint32 itemID = 0;
|
||||
uint8 materialFromSlot = 0xFF;
|
||||
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; ++i) {
|
||||
for (int i = EQEmu::invslot::EQUIPMENT_BEGIN; i <= EQEmu::invslot::EQUIPMENT_END; ++i) {
|
||||
itemID = GetBotItemBySlot(i);
|
||||
if(itemID != 0) {
|
||||
materialFromSlot = EQEmu::InventoryProfile::CalcMaterialFromSlot(i);
|
||||
@@ -3225,7 +3225,7 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
||||
}
|
||||
}
|
||||
|
||||
inst = GetBotItem(EQEmu::inventory::slotPrimary);
|
||||
inst = GetBotItem(EQEmu::invslot::slotPrimary);
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
@@ -3236,7 +3236,7 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
||||
}
|
||||
}
|
||||
|
||||
inst = GetBotItem(EQEmu::inventory::slotSecondary);
|
||||
inst = GetBotItem(EQEmu::invslot::slotSecondary);
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
@@ -3490,17 +3490,21 @@ EQEmu::ItemInstance* Bot::GetBotItem(uint32 slotID) {
|
||||
|
||||
// Adds the specified item it bot to the NPC equipment array and to the bot inventory collection.
|
||||
void Bot::BotAddEquipItem(int slot, uint32 id) {
|
||||
// this is being called before bot is assigned an entity id..
|
||||
// ..causing packets to be sent out to zone with an id of '0'
|
||||
if(slot > 0 && id > 0) {
|
||||
uint8 materialFromSlot = EQEmu::InventoryProfile::CalcMaterialFromSlot(slot);
|
||||
|
||||
if (materialFromSlot != EQEmu::textures::materialInvalid) {
|
||||
equipment[slot] = id; // npc has more than just material slots. Valid material should mean valid inventory index
|
||||
SendWearChange(materialFromSlot);
|
||||
if (GetID()) // temp hack fix
|
||||
SendWearChange(materialFromSlot);
|
||||
}
|
||||
|
||||
UpdateEquipmentLight();
|
||||
if (UpdateActiveLight())
|
||||
SendAppearancePacket(AT_Light, GetActiveLightType());
|
||||
if (GetID()) // temp hack fix
|
||||
SendAppearancePacket(AT_Light, GetActiveLightType());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3617,12 +3621,12 @@ void Bot::FinishTrade(Client* client, BotTradeType tradeType)
|
||||
if (tradeType == BotTradeClientNormal) {
|
||||
// Items being traded are found in the normal trade window used to trade between a Client and a Client or NPC
|
||||
// Items in this mode are found in slot ids 3000 thru 3003 - thought bots used the full 8-slot window..?
|
||||
PerformTradeWithClient(EQEmu::legacy::TRADE_BEGIN, EQEmu::legacy::TRADE_END, client); // {3000..3007}
|
||||
PerformTradeWithClient(EQEmu::invslot::TRADE_BEGIN, EQEmu::invslot::TRADE_END, client); // {3000..3007}
|
||||
}
|
||||
else if (tradeType == BotTradeClientNoDropNoTrade) {
|
||||
// Items being traded are found on the Client's cursor slot, slot id 30. This item can be either a single item or it can be a bag.
|
||||
// If it is a bag, then we have to search for items in slots 331 thru 340
|
||||
PerformTradeWithClient(EQEmu::inventory::slotCursor, EQEmu::inventory::slotCursor, client);
|
||||
PerformTradeWithClient(EQEmu::invslot::slotCursor, EQEmu::invslot::slotCursor, client);
|
||||
|
||||
// TODO: Add logic here to test if the item in SLOT_CURSOR is a container type, if it is then we need to call the following:
|
||||
// PerformTradeWithClient(331, 340, client);
|
||||
@@ -3641,7 +3645,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
int adjustStackSize;
|
||||
std::string acceptedItemName;
|
||||
|
||||
ClientTrade(const ItemInstance* item, int16 from, const char* name = "") : tradeItemInstance(item), fromClientSlot(from), toBotSlot(legacy::SLOT_INVALID), adjustStackSize(0), acceptedItemName(name) { }
|
||||
ClientTrade(const ItemInstance* item, int16 from, const char* name = "") : tradeItemInstance(item), fromClientSlot(from), toBotSlot(invslot::SLOT_INVALID), adjustStackSize(0), acceptedItemName(name) { }
|
||||
};
|
||||
|
||||
struct ClientReturn {
|
||||
@@ -3651,18 +3655,18 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
int adjustStackSize;
|
||||
std::string failedItemName;
|
||||
|
||||
ClientReturn(const ItemInstance* item, int16 from, const char* name = "") : returnItemInstance(item), fromBotSlot(from), toClientSlot(legacy::SLOT_INVALID), adjustStackSize(0), failedItemName(name) { }
|
||||
ClientReturn(const ItemInstance* item, int16 from, const char* name = "") : returnItemInstance(item), fromBotSlot(from), toClientSlot(invslot::SLOT_INVALID), adjustStackSize(0), failedItemName(name) { }
|
||||
};
|
||||
|
||||
static const int16 proxyPowerSource = 22;
|
||||
|
||||
static const int16 bot_equip_order[(legacy::EQUIPMENT_SIZE + 1)] = {
|
||||
inventory::slotCharm, inventory::slotEar1, inventory::slotHead, inventory::slotFace,
|
||||
inventory::slotEar2, inventory::slotNeck, inventory::slotShoulders, inventory::slotArms,
|
||||
inventory::slotBack, inventory::slotWrist1, inventory::slotWrist2, inventory::slotRange,
|
||||
inventory::slotHands, inventory::slotPrimary, inventory::slotSecondary, inventory::slotFinger1,
|
||||
inventory::slotFinger2, inventory::slotChest, inventory::slotLegs, inventory::slotFeet,
|
||||
inventory::slotWaist, inventory::slotAmmo, proxyPowerSource // inventory::slotPowerSource
|
||||
static const int16 bot_equip_order[(invslot::CORPSE_BEGIN + 1)] = {
|
||||
invslot::slotCharm, invslot::slotEar1, invslot::slotHead, invslot::slotFace,
|
||||
invslot::slotEar2, invslot::slotNeck, invslot::slotShoulders, invslot::slotArms,
|
||||
invslot::slotBack, invslot::slotWrist1, invslot::slotWrist2, invslot::slotRange,
|
||||
invslot::slotHands, invslot::slotPrimary, invslot::slotSecondary, invslot::slotFinger1,
|
||||
invslot::slotFinger2, invslot::slotChest, invslot::slotLegs, invslot::slotFeet,
|
||||
invslot::slotWaist, invslot::slotAmmo, proxyPowerSource // invslot::SLOT_POWER_SOURCE
|
||||
};
|
||||
|
||||
enum { stageStackable = 0, stageEmpty, stageReplaceable };
|
||||
@@ -3677,17 +3681,17 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
client->ResetTrade();
|
||||
return;
|
||||
}
|
||||
if ((beginSlotID != legacy::TRADE_BEGIN) && (beginSlotID != inventory::slotCursor)) {
|
||||
if ((beginSlotID != invslot::TRADE_BEGIN) && (beginSlotID != invslot::slotCursor)) {
|
||||
client->Message(CC_Red, "Trade request processing from illegal 'begin' slot - Trade Canceled.");
|
||||
client->ResetTrade();
|
||||
return;
|
||||
}
|
||||
if ((endSlotID != legacy::TRADE_END) && (endSlotID != inventory::slotCursor)) {
|
||||
if ((endSlotID != invslot::TRADE_END) && (endSlotID != invslot::slotCursor)) {
|
||||
client->Message(CC_Red, "Trade request processing from illegal 'end' slot - Trade Canceled.");
|
||||
client->ResetTrade();
|
||||
return;
|
||||
}
|
||||
if (((beginSlotID == inventory::slotCursor) && (endSlotID != inventory::slotCursor)) || ((beginSlotID != inventory::slotCursor) && (endSlotID == inventory::slotCursor))) {
|
||||
if (((beginSlotID == invslot::slotCursor) && (endSlotID != invslot::slotCursor)) || ((beginSlotID != invslot::slotCursor) && (endSlotID == invslot::slotCursor))) {
|
||||
client->Message(CC_Red, "Trade request processing illegal slot range - Trade Canceled.");
|
||||
client->ResetTrade();
|
||||
return;
|
||||
@@ -3718,7 +3722,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
client->ResetTrade();
|
||||
return;
|
||||
}
|
||||
if ((trade_index != inventory::slotCursor) && !trade_instance->IsDroppable()) {
|
||||
if ((trade_index != invslot::slotCursor) && !trade_instance->IsDroppable()) {
|
||||
// TODO: add logging
|
||||
client->Message(CC_Red, "Trade hack detected - Trade Canceled.");
|
||||
client->ResetTrade();
|
||||
@@ -3781,7 +3785,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
//for (unsigned stage_loop = stageStackable; stage_loop <= stageReplaceable; ++stage_loop) { // awaiting implementation
|
||||
for (unsigned stage_loop = stageEmpty; stage_loop <= stageReplaceable; ++stage_loop) {
|
||||
for (auto& trade_iterator : client_trade) {
|
||||
if (trade_iterator.toBotSlot != legacy::SLOT_INVALID)
|
||||
if (trade_iterator.toBotSlot != invslot::SLOT_INVALID)
|
||||
continue;
|
||||
|
||||
auto trade_instance = trade_iterator.tradeItemInstance;
|
||||
@@ -3798,7 +3802,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
//}
|
||||
|
||||
if (stage_loop != stageReplaceable) {
|
||||
if ((index == proxyPowerSource) && m_inv[inventory::slotPowerSource])
|
||||
if ((index == proxyPowerSource) && m_inv[invslot::SLOT_POWER_SOURCE])
|
||||
continue;
|
||||
else if (m_inv[index])
|
||||
continue;
|
||||
@@ -3817,28 +3821,28 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
if (slot_taken)
|
||||
continue;
|
||||
|
||||
if (index == inventory::slotPrimary) {
|
||||
if (index == invslot::slotPrimary) {
|
||||
if (trade_instance->GetItem()->IsType2HWeapon()) {
|
||||
if (!melee_secondary) {
|
||||
melee_2h_weapon = true;
|
||||
|
||||
auto equipped_secondary_weapon = m_inv[inventory::slotSecondary];
|
||||
auto equipped_secondary_weapon = m_inv[invslot::slotSecondary];
|
||||
if (equipped_secondary_weapon)
|
||||
client_return.push_back(ClientReturn(equipped_secondary_weapon, inventory::slotSecondary));
|
||||
client_return.push_back(ClientReturn(equipped_secondary_weapon, invslot::slotSecondary));
|
||||
}
|
||||
else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (index == inventory::slotSecondary) {
|
||||
if (index == invslot::slotSecondary) {
|
||||
if (!melee_2h_weapon) {
|
||||
if ((can_dual_wield && trade_instance->GetItem()->IsType1HWeapon()) || trade_instance->GetItem()->IsTypeShield() || !trade_instance->IsWeapon()) {
|
||||
melee_secondary = true;
|
||||
|
||||
auto equipped_primary_weapon = m_inv[inventory::slotPrimary];
|
||||
auto equipped_primary_weapon = m_inv[invslot::slotPrimary];
|
||||
if (equipped_primary_weapon && equipped_primary_weapon->GetItem()->IsType2HWeapon())
|
||||
client_return.push_back(ClientReturn(equipped_primary_weapon, inventory::slotPrimary));
|
||||
client_return.push_back(ClientReturn(equipped_primary_weapon, invslot::slotPrimary));
|
||||
}
|
||||
else {
|
||||
continue;
|
||||
@@ -3850,10 +3854,10 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
}
|
||||
|
||||
if (index == proxyPowerSource) {
|
||||
trade_iterator.toBotSlot = inventory::slotPowerSource;
|
||||
trade_iterator.toBotSlot = invslot::SLOT_POWER_SOURCE;
|
||||
|
||||
if (m_inv[inventory::slotPowerSource])
|
||||
client_return.push_back(ClientReturn(m_inv[inventory::slotPowerSource], inventory::slotPowerSource));
|
||||
if (m_inv[invslot::SLOT_POWER_SOURCE])
|
||||
client_return.push_back(ClientReturn(m_inv[invslot::SLOT_POWER_SOURCE], invslot::SLOT_POWER_SOURCE));
|
||||
}
|
||||
else {
|
||||
trade_iterator.toBotSlot = index;
|
||||
@@ -3869,7 +3873,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
|
||||
// move unassignable items from trade list to return list
|
||||
for (std::list<ClientTrade>::iterator trade_iterator = client_trade.begin(); trade_iterator != client_trade.end();) {
|
||||
if (trade_iterator->toBotSlot == legacy::SLOT_INVALID) {
|
||||
if (trade_iterator->toBotSlot == invslot::SLOT_INVALID) {
|
||||
client_return.push_back(ClientReturn(trade_iterator->tradeItemInstance, trade_iterator->fromClientSlot, trade_iterator->tradeItemInstance->GetItem()->Name));
|
||||
trade_iterator = client_trade.erase(trade_iterator);
|
||||
continue;
|
||||
@@ -3895,17 +3899,17 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
return;
|
||||
}
|
||||
|
||||
if (return_iterator.fromBotSlot == inventory::slotCursor) {
|
||||
return_iterator.toClientSlot = inventory::slotCursor;
|
||||
if (return_iterator.fromBotSlot == invslot::slotCursor) {
|
||||
return_iterator.toClientSlot = invslot::slotCursor;
|
||||
}
|
||||
else {
|
||||
int16 client_search_general = legacy::GENERAL_BEGIN;
|
||||
uint8 client_search_bag = inventory::containerBegin;
|
||||
int16 client_search_general = invslot::GENERAL_BEGIN;
|
||||
uint8 client_search_bag = invbag::SLOT_BEGIN;
|
||||
|
||||
bool run_search = true;
|
||||
while (run_search) {
|
||||
int16 client_test_slot = client->GetInv().FindFreeSlotForTradeItem(return_instance, client_search_general, client_search_bag);
|
||||
if (client_test_slot == legacy::SLOT_INVALID) {
|
||||
if (client_test_slot == invslot::SLOT_INVALID) {
|
||||
run_search = false;
|
||||
continue;
|
||||
}
|
||||
@@ -3915,26 +3919,26 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
if (check_iterator.fromBotSlot == return_iterator.fromBotSlot)
|
||||
continue;
|
||||
|
||||
if ((check_iterator.toClientSlot == client_test_slot) && (client_test_slot != inventory::slotCursor)) {
|
||||
if ((check_iterator.toClientSlot == client_test_slot) && (client_test_slot != invslot::slotCursor)) {
|
||||
slot_taken = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (slot_taken) {
|
||||
if ((client_test_slot >= legacy::GENERAL_BEGIN) && (client_test_slot <= legacy::GENERAL_END)) {
|
||||
if ((client_test_slot >= invslot::GENERAL_BEGIN) && (client_test_slot <= invslot::GENERAL_END)) {
|
||||
++client_search_general;
|
||||
client_search_bag = inventory::containerBegin;
|
||||
client_search_bag = invbag::SLOT_BEGIN;
|
||||
}
|
||||
else {
|
||||
client_search_general = InventoryProfile::CalcSlotId(client_test_slot);
|
||||
client_search_bag = InventoryProfile::CalcBagIdx(client_test_slot);
|
||||
|
||||
++client_search_bag;
|
||||
if (client_search_bag >= inventory::ContainerCount) {
|
||||
if (client_search_bag >= invbag::SLOT_COUNT) {
|
||||
// incrementing this past legacy::GENERAL_END triggers the (client_test_slot == legacy::SLOT_INVALID) at the beginning of the search loop
|
||||
// ideally, this will never occur because we always start fresh with each loop iteration and should receive SLOT_CURSOR as a return value
|
||||
++client_search_general;
|
||||
client_search_bag = inventory::containerBegin;
|
||||
client_search_bag = invbag::SLOT_BEGIN;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3946,7 +3950,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
}
|
||||
}
|
||||
|
||||
if (return_iterator.toClientSlot == legacy::SLOT_INVALID) {
|
||||
if (return_iterator.toClientSlot == invslot::SLOT_INVALID) {
|
||||
client->Message(CC_Yellow, "You do not have room to complete this trade - Trade Canceled!");
|
||||
client->ResetTrade();
|
||||
return;
|
||||
@@ -3958,10 +3962,10 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
for (auto& return_iterator : client_return) {
|
||||
// TODO: code for stackables
|
||||
|
||||
if (return_iterator.fromBotSlot == inventory::slotCursor) { // failed trade return
|
||||
if (return_iterator.fromBotSlot == invslot::slotCursor) { // failed trade return
|
||||
// no movement action required
|
||||
}
|
||||
else if ((return_iterator.fromBotSlot >= legacy::TRADE_BEGIN) && (return_iterator.fromBotSlot <= legacy::TRADE_END)) { // failed trade returns
|
||||
else if ((return_iterator.fromBotSlot >= invslot::TRADE_BEGIN) && (return_iterator.fromBotSlot <= invslot::TRADE_END)) { // failed trade returns
|
||||
client->PutItemInInventory(return_iterator.toClientSlot, *return_iterator.returnItemInstance);
|
||||
client->SendItemPacket(return_iterator.toClientSlot, return_iterator.returnItemInstance, ItemPacketTrade);
|
||||
client->DeleteItemInInventory(return_iterator.fromBotSlot);
|
||||
@@ -3992,7 +3996,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
|
||||
m_inv.PutItem(trade_iterator.toBotSlot, *trade_iterator.tradeItemInstance);
|
||||
this->BotAddEquipItem(trade_iterator.toBotSlot, (trade_iterator.tradeItemInstance ? trade_iterator.tradeItemInstance->GetID() : 0));
|
||||
client->DeleteItemInInventory(trade_iterator.fromClientSlot, 0, true);
|
||||
client->DeleteItemInInventory(trade_iterator.fromClientSlot, 0, (trade_iterator.fromClientSlot == EQEmu::invslot::slotCursor));
|
||||
trade_iterator.tradeItemInstance = nullptr;
|
||||
}
|
||||
|
||||
@@ -4174,13 +4178,13 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
||||
|
||||
FaceTarget(GetTarget());
|
||||
EQEmu::ItemInstance* weapon = nullptr;
|
||||
if (Hand == EQEmu::inventory::slotPrimary) {
|
||||
weapon = GetBotItem(EQEmu::inventory::slotPrimary);
|
||||
if (Hand == EQEmu::invslot::slotPrimary) {
|
||||
weapon = GetBotItem(EQEmu::invslot::slotPrimary);
|
||||
OffHandAtk(false);
|
||||
}
|
||||
|
||||
if (Hand == EQEmu::inventory::slotSecondary) {
|
||||
weapon = GetBotItem(EQEmu::inventory::slotSecondary);
|
||||
if (Hand == EQEmu::invslot::slotSecondary) {
|
||||
weapon = GetBotItem(EQEmu::invslot::slotSecondary);
|
||||
OffHandAtk(true);
|
||||
}
|
||||
|
||||
@@ -4229,7 +4233,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
||||
// This is not recommended for normal usage, as the damage bonus represents a non-trivial component of the DPS output
|
||||
// of weapons wielded by higher-level melee characters (especially for two-handed weapons).
|
||||
int ucDamageBonus = 0;
|
||||
if (Hand == EQEmu::inventory::slotPrimary && GetLevel() >= 28 && IsWarriorClass()) {
|
||||
if (Hand == EQEmu::invslot::slotPrimary && GetLevel() >= 28 && IsWarriorClass()) {
|
||||
// Damage bonuses apply only to hits from the main hand (Hand == MainPrimary) by characters level 28 and above
|
||||
// who belong to a melee class. If we're here, then all of these conditions apply.
|
||||
ucDamageBonus = GetWeaponDamageBonus(weapon ? weapon->GetItem() : (const EQEmu::ItemData*) nullptr);
|
||||
@@ -4238,7 +4242,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
||||
}
|
||||
#endif
|
||||
//Live AA - Sinister Strikes *Adds weapon damage bonus to offhand weapon.
|
||||
if (Hand == EQEmu::inventory::slotSecondary) {
|
||||
if (Hand == EQEmu::invslot::slotSecondary) {
|
||||
if (aabonuses.SecondaryDmgInc || itembonuses.SecondaryDmgInc || spellbonuses.SecondaryDmgInc){
|
||||
ucDamageBonus = GetWeaponDamageBonus(weapon ? weapon->GetItem() : (const EQEmu::ItemData*) nullptr);
|
||||
my_hit.min_damage = ucDamageBonus;
|
||||
@@ -4645,7 +4649,7 @@ int32 Bot::GetBotFocusEffect(BotfocusType bottype, uint16 spell_id) {
|
||||
int32 focus_max = 0;
|
||||
int32 focus_max_real = 0;
|
||||
//item focus
|
||||
for (int x = EQEmu::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::EQUIPMENT_END; x++) {
|
||||
for (int x = EQEmu::invslot::EQUIPMENT_BEGIN; x <= EQEmu::invslot::EQUIPMENT_END; x++) {
|
||||
TempItem = nullptr;
|
||||
EQEmu::ItemInstance* ins = GetBotItem(x);
|
||||
if (!ins)
|
||||
@@ -4670,7 +4674,7 @@ int32 Bot::GetBotFocusEffect(BotfocusType bottype, uint16 spell_id) {
|
||||
}
|
||||
}
|
||||
|
||||
for (int y = EQEmu::inventory::socketBegin; y < EQEmu::inventory::SocketCount; ++y) {
|
||||
for (int y = EQEmu::invaug::SOCKET_BEGIN; y <= EQEmu::invaug::SOCKET_END; ++y) {
|
||||
EQEmu::ItemInstance *aug = nullptr;
|
||||
aug = ins->GetAugment(y);
|
||||
if(aug) {
|
||||
@@ -5106,13 +5110,13 @@ float Bot::GetProcChances(float ProcBonus, uint16 hand) {
|
||||
float ProcChance = 0.0f;
|
||||
uint32 weapon_speed = 0;
|
||||
switch (hand) {
|
||||
case EQEmu::inventory::slotPrimary:
|
||||
case EQEmu::invslot::slotPrimary:
|
||||
weapon_speed = attack_timer.GetDuration();
|
||||
break;
|
||||
case EQEmu::inventory::slotSecondary:
|
||||
case EQEmu::invslot::slotSecondary:
|
||||
weapon_speed = attack_dw_timer.GetDuration();
|
||||
break;
|
||||
case EQEmu::inventory::slotRange:
|
||||
case EQEmu::invslot::slotRange:
|
||||
weapon_speed = ranged_timer.GetDuration();
|
||||
break;
|
||||
}
|
||||
@@ -5202,11 +5206,11 @@ void Bot::DoRiposte(Mob* defender) {
|
||||
if (!defender)
|
||||
return;
|
||||
|
||||
defender->Attack(this, EQEmu::inventory::slotPrimary, true);
|
||||
defender->Attack(this, EQEmu::invslot::slotPrimary, true);
|
||||
int32 DoubleRipChance = (defender->GetAABonuses().GiveDoubleRiposte[0] + defender->GetSpellBonuses().GiveDoubleRiposte[0] + defender->GetItemBonuses().GiveDoubleRiposte[0]);
|
||||
if(DoubleRipChance && (DoubleRipChance >= zone->random.Int(0, 100))) {
|
||||
Log(Logs::Detail, Logs::Combat, "Preforming a double riposte (%d percent chance)", DoubleRipChance);
|
||||
defender->Attack(this, EQEmu::inventory::slotPrimary, true);
|
||||
defender->Attack(this, EQEmu::invslot::slotPrimary, true);
|
||||
}
|
||||
|
||||
DoubleRipChance = defender->GetAABonuses().GiveDoubleRiposte[1];
|
||||
@@ -5236,7 +5240,7 @@ int Bot::GetBaseSkillDamage(EQEmu::skills::SkillType skill, Mob *target)
|
||||
base++;
|
||||
return base;
|
||||
case EQEmu::skills::SkillFrenzy:
|
||||
if (GetBotItem(EQEmu::inventory::slotPrimary)) {
|
||||
if (GetBotItem(EQEmu::invslot::slotPrimary)) {
|
||||
if (GetLevel() > 15)
|
||||
base += GetLevel() - 15;
|
||||
if (base > 23)
|
||||
@@ -5252,7 +5256,7 @@ int Bot::GetBaseSkillDamage(EQEmu::skills::SkillType skill, Mob *target)
|
||||
case EQEmu::skills::SkillFlyingKick: {
|
||||
float skill_bonus = skill_level / 9.0f;
|
||||
float ac_bonus = 0.0f;
|
||||
auto inst = GetBotItem(EQEmu::inventory::slotFeet);
|
||||
auto inst = GetBotItem(EQEmu::invslot::slotFeet);
|
||||
if (inst)
|
||||
ac_bonus = inst->GetItemArmorClass(true) / 25.0f;
|
||||
if (ac_bonus > skill_bonus)
|
||||
@@ -5262,7 +5266,7 @@ int Bot::GetBaseSkillDamage(EQEmu::skills::SkillType skill, Mob *target)
|
||||
case EQEmu::skills::SkillKick: {
|
||||
float skill_bonus = skill_level / 10.0f;
|
||||
float ac_bonus = 0.0f;
|
||||
auto inst = GetBotItem(EQEmu::inventory::slotFeet);
|
||||
auto inst = GetBotItem(EQEmu::invslot::slotFeet);
|
||||
if (inst)
|
||||
ac_bonus = inst->GetItemArmorClass(true) / 25.0f;
|
||||
if (ac_bonus > skill_bonus)
|
||||
@@ -5274,9 +5278,9 @@ int Bot::GetBaseSkillDamage(EQEmu::skills::SkillType skill, Mob *target)
|
||||
float ac_bonus = 0.0f;
|
||||
const EQEmu::ItemInstance *inst = nullptr;
|
||||
if (HasShieldEquiped())
|
||||
inst = GetBotItem(EQEmu::inventory::slotSecondary);
|
||||
inst = GetBotItem(EQEmu::invslot::slotSecondary);
|
||||
else if (HasTwoHanderEquipped())
|
||||
inst = GetBotItem(EQEmu::inventory::slotPrimary);
|
||||
inst = GetBotItem(EQEmu::invslot::slotPrimary);
|
||||
if (inst)
|
||||
ac_bonus = inst->GetItemArmorClass(true) / 25.0f;
|
||||
if (ac_bonus > skill_bonus)
|
||||
@@ -5285,7 +5289,7 @@ int Bot::GetBaseSkillDamage(EQEmu::skills::SkillType skill, Mob *target)
|
||||
}
|
||||
case EQEmu::skills::SkillBackstab: {
|
||||
float skill_bonus = static_cast<float>(skill_level) * 0.02f;
|
||||
auto inst = GetBotItem(EQEmu::inventory::slotPrimary);
|
||||
auto inst = GetBotItem(EQEmu::invslot::slotPrimary);
|
||||
if (inst && inst->GetItem() && inst->GetItem()->ItemType == EQEmu::item::ItemType1HPiercing) {
|
||||
base = inst->GetItemBackstabDamage(true);
|
||||
if (!inst->GetItemBackstabDamage())
|
||||
@@ -5310,7 +5314,7 @@ void Bot::DoSpecialAttackDamage(Mob *who, EQEmu::skills::SkillType skill, int32
|
||||
hate = hate_override;
|
||||
|
||||
if (skill == EQEmu::skills::SkillBash) {
|
||||
const EQEmu::ItemInstance* inst = GetBotItem(EQEmu::inventory::slotSecondary);
|
||||
const EQEmu::ItemInstance* inst = GetBotItem(EQEmu::invslot::slotSecondary);
|
||||
const EQEmu::ItemData* botweapon = nullptr;
|
||||
if(inst)
|
||||
botweapon = inst->GetItem();
|
||||
@@ -5331,10 +5335,10 @@ void Bot::DoSpecialAttackDamage(Mob *who, EQEmu::skills::SkillType skill, int32
|
||||
my_hit.skill = skill;
|
||||
my_hit.offense = offense(my_hit.skill);
|
||||
my_hit.tohit = GetTotalToHit(my_hit.skill, 0);
|
||||
my_hit.hand = EQEmu::inventory::slotPrimary;
|
||||
my_hit.hand = EQEmu::invslot::slotPrimary;
|
||||
|
||||
if (skill == EQEmu::skills::SkillThrowing || skill == EQEmu::skills::SkillArchery)
|
||||
my_hit.hand = EQEmu::inventory::slotRange;
|
||||
my_hit.hand = EQEmu::invslot::slotRange;
|
||||
|
||||
DoAttack(who, my_hit);
|
||||
|
||||
@@ -5371,7 +5375,7 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) {
|
||||
|
||||
bool bIsBehind = false;
|
||||
bool bCanFrontalBS = false;
|
||||
const EQEmu::ItemInstance* inst = GetBotItem(EQEmu::inventory::slotPrimary);
|
||||
const EQEmu::ItemInstance* inst = GetBotItem(EQEmu::invslot::slotPrimary);
|
||||
const EQEmu::ItemData* botpiercer = nullptr;
|
||||
if(inst)
|
||||
botpiercer = inst->GetItem();
|
||||
@@ -5414,7 +5418,7 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) {
|
||||
m_specialattacks = eSpecialAttacks::None;
|
||||
}
|
||||
else
|
||||
Attack(other, EQEmu::inventory::slotPrimary);
|
||||
Attack(other, EQEmu::invslot::slotPrimary);
|
||||
}
|
||||
|
||||
void Bot::RogueBackstab(Mob *other, bool min_damage, int ReuseTime)
|
||||
@@ -5422,7 +5426,7 @@ void Bot::RogueBackstab(Mob *other, bool min_damage, int ReuseTime)
|
||||
if (!other)
|
||||
return;
|
||||
|
||||
EQEmu::ItemInstance *botweaponInst = GetBotItem(EQEmu::inventory::slotPrimary);
|
||||
EQEmu::ItemInstance *botweaponInst = GetBotItem(EQEmu::invslot::slotPrimary);
|
||||
if (botweaponInst) {
|
||||
if (!GetWeaponDamage(other, botweaponInst))
|
||||
return;
|
||||
@@ -5440,7 +5444,7 @@ void Bot::RogueBackstab(Mob *other, bool min_damage, int ReuseTime)
|
||||
}
|
||||
|
||||
void Bot::RogueAssassinate(Mob* other) {
|
||||
EQEmu::ItemInstance* botweaponInst = GetBotItem(EQEmu::inventory::slotPrimary);
|
||||
EQEmu::ItemInstance* botweaponInst = GetBotItem(EQEmu::invslot::slotPrimary);
|
||||
if(botweaponInst) {
|
||||
if(GetWeaponDamage(other, botweaponInst))
|
||||
other->Damage(this, 32000, SPELL_UNKNOWN, EQEmu::skills::SkillBackstab);
|
||||
@@ -5505,7 +5509,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
|
||||
case WARRIOR:
|
||||
if(level >= RuleI(Combat, NPCBashKickLevel)){
|
||||
bool canBash = false;
|
||||
if ((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) || (m_inv.GetItem(EQEmu::inventory::slotSecondary) && m_inv.GetItem(EQEmu::inventory::slotSecondary)->GetItem()->ItemType == EQEmu::item::ItemTypeShield) || (m_inv.GetItem(EQEmu::inventory::slotPrimary) && m_inv.GetItem(EQEmu::inventory::slotPrimary)->GetItem()->IsType2HWeapon() && GetAA(aa2HandBash) >= 1))
|
||||
if ((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) || (m_inv.GetItem(EQEmu::invslot::slotSecondary) && m_inv.GetItem(EQEmu::invslot::slotSecondary)->GetItem()->ItemType == EQEmu::item::ItemTypeShield) || (m_inv.GetItem(EQEmu::invslot::slotPrimary) && m_inv.GetItem(EQEmu::invslot::slotPrimary)->GetItem()->IsType2HWeapon() && GetAA(aa2HandBash) >= 1))
|
||||
canBash = true;
|
||||
|
||||
if(!canBash || zone->random.Int(0, 100) > 25)
|
||||
@@ -5524,7 +5528,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
|
||||
case SHADOWKNIGHT:
|
||||
case PALADIN:
|
||||
if(level >= RuleI(Combat, NPCBashKickLevel)){
|
||||
if ((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) || (m_inv.GetItem(EQEmu::inventory::slotSecondary) && m_inv.GetItem(EQEmu::inventory::slotSecondary)->GetItem()->ItemType == EQEmu::item::ItemTypeShield) || (m_inv.GetItem(EQEmu::inventory::slotPrimary) && m_inv.GetItem(EQEmu::inventory::slotPrimary)->GetItem()->IsType2HWeapon() && GetAA(aa2HandBash) >= 1))
|
||||
if ((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) || (m_inv.GetItem(EQEmu::invslot::slotSecondary) && m_inv.GetItem(EQEmu::invslot::slotSecondary)->GetItem()->ItemType == EQEmu::item::ItemTypeShield) || (m_inv.GetItem(EQEmu::invslot::slotPrimary) && m_inv.GetItem(EQEmu::invslot::slotPrimary)->GetItem()->IsType2HWeapon() && GetAA(aa2HandBash) >= 1))
|
||||
skill_to_use = EQEmu::skills::SkillBash;
|
||||
}
|
||||
break;
|
||||
@@ -5555,7 +5559,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
|
||||
if (skill_to_use == EQEmu::skills::SkillBash) {
|
||||
if (target != this) {
|
||||
DoAnim(animTailRake);
|
||||
if (GetWeaponDamage(target, GetBotItem(EQEmu::inventory::slotSecondary)) <= 0 && GetWeaponDamage(target, GetBotItem(EQEmu::inventory::slotShoulders)) <= 0)
|
||||
if (GetWeaponDamage(target, GetBotItem(EQEmu::invslot::slotSecondary)) <= 0 && GetWeaponDamage(target, GetBotItem(EQEmu::invslot::slotShoulders)) <= 0)
|
||||
dmg = DMG_INVULNERABLE;
|
||||
|
||||
reuse = (BashReuseTime * 1000);
|
||||
@@ -5582,7 +5586,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
|
||||
if (skill_to_use == EQEmu::skills::SkillKick) {
|
||||
if(target != this) {
|
||||
DoAnim(animKick);
|
||||
if (GetWeaponDamage(target, GetBotItem(EQEmu::inventory::slotFeet)) <= 0)
|
||||
if (GetWeaponDamage(target, GetBotItem(EQEmu::invslot::slotFeet)) <= 0)
|
||||
dmg = DMG_INVULNERABLE;
|
||||
|
||||
reuse = (KickReuseTime * 1000);
|
||||
@@ -5720,7 +5724,7 @@ void Bot::EquipBot(std::string* errorMessage) {
|
||||
GetBotItems(m_inv, errorMessage);
|
||||
const EQEmu::ItemInstance* inst = nullptr;
|
||||
const EQEmu::ItemData* item = nullptr;
|
||||
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; ++i) {
|
||||
for (int i = EQEmu::invslot::EQUIPMENT_BEGIN; i <= EQEmu::invslot::EQUIPMENT_END; ++i) {
|
||||
inst = GetBotItem(i);
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
@@ -5847,12 +5851,12 @@ void Bot::SetAttackTimer() {
|
||||
attack_timer.SetAtTrigger(4000, true);
|
||||
Timer* TimerToUse = nullptr;
|
||||
const EQEmu::ItemData* PrimaryWeapon = nullptr;
|
||||
for (int i = EQEmu::inventory::slotRange; i <= EQEmu::inventory::slotSecondary; i++) {
|
||||
if (i == EQEmu::inventory::slotPrimary)
|
||||
for (int i = EQEmu::invslot::slotRange; i <= EQEmu::invslot::slotSecondary; i++) {
|
||||
if (i == EQEmu::invslot::slotPrimary)
|
||||
TimerToUse = &attack_timer;
|
||||
else if (i == EQEmu::inventory::slotRange)
|
||||
else if (i == EQEmu::invslot::slotRange)
|
||||
TimerToUse = &ranged_timer;
|
||||
else if (i == EQEmu::inventory::slotSecondary)
|
||||
else if (i == EQEmu::invslot::slotSecondary)
|
||||
TimerToUse = &attack_dw_timer;
|
||||
else
|
||||
continue;
|
||||
@@ -5862,7 +5866,7 @@ void Bot::SetAttackTimer() {
|
||||
if (ci)
|
||||
ItemToUse = ci->GetItem();
|
||||
|
||||
if (i == EQEmu::inventory::slotSecondary) {
|
||||
if (i == EQEmu::invslot::slotSecondary) {
|
||||
if (PrimaryWeapon != nullptr) {
|
||||
if (PrimaryWeapon->IsClassCommon() && PrimaryWeapon->IsType2HWeapon()) {
|
||||
attack_dw_timer.Disable();
|
||||
@@ -5893,7 +5897,7 @@ void Bot::SetAttackTimer() {
|
||||
speed = (RuleB(Spells, Jun182014HundredHandsRevamp) ? static_cast<int>(((delay / haste_mod) + ((hhe / 1000.0f) * (delay / haste_mod))) * 100) : static_cast<int>(((delay / haste_mod) + ((hhe / 100.0f) * delay)) * 100));
|
||||
TimerToUse->SetAtTrigger(std::max(RuleI(Combat, MinHastedDelay), speed), true, true);
|
||||
|
||||
if (i == EQEmu::inventory::slotPrimary)
|
||||
if (i == EQEmu::invslot::slotPrimary)
|
||||
PrimaryWeapon = ItemToUse;
|
||||
}
|
||||
}
|
||||
@@ -7603,7 +7607,7 @@ void Bot::ProcessBotInspectionRequest(Bot* inspectedBot, Client* client) {
|
||||
// Modded to display power source items (will only show up on SoF+ client inspect windows though.)
|
||||
// I don't think bots are currently coded to use them..but, you'll have to use '#bot inventory list'
|
||||
// to see them on a Titanium client when/if they are activated.
|
||||
for (int16 L = EQEmu::legacy::EQUIPMENT_BEGIN; L <= EQEmu::inventory::slotWaist; L++) {
|
||||
for (int16 L = EQEmu::invslot::EQUIPMENT_BEGIN; L <= EQEmu::invslot::slotWaist; L++) {
|
||||
inst = inspectedBot->GetBotItem(L);
|
||||
|
||||
if(inst) {
|
||||
@@ -7617,28 +7621,28 @@ void Bot::ProcessBotInspectionRequest(Bot* inspectedBot, Client* client) {
|
||||
}
|
||||
}
|
||||
|
||||
inst = inspectedBot->GetBotItem(EQEmu::inventory::slotPowerSource);
|
||||
inst = inspectedBot->GetBotItem(EQEmu::invslot::SLOT_POWER_SOURCE);
|
||||
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
strcpy(insr->itemnames[SoF::invslot::PossessionsPowerSource], item->Name);
|
||||
insr->itemicons[SoF::invslot::PossessionsPowerSource] = item->Icon;
|
||||
strcpy(insr->itemnames[SoF::invslot::slotPowerSource], item->Name);
|
||||
insr->itemicons[SoF::invslot::slotPowerSource] = item->Icon;
|
||||
}
|
||||
else
|
||||
insr->itemicons[SoF::invslot::PossessionsPowerSource] = 0xFFFFFFFF;
|
||||
insr->itemicons[SoF::invslot::slotPowerSource] = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
inst = inspectedBot->GetBotItem(EQEmu::inventory::slotAmmo);
|
||||
inst = inspectedBot->GetBotItem(EQEmu::invslot::slotAmmo);
|
||||
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
strcpy(insr->itemnames[SoF::invslot::PossessionsAmmo], item->Name);
|
||||
insr->itemicons[SoF::invslot::PossessionsAmmo] = item->Icon;
|
||||
strcpy(insr->itemnames[SoF::invslot::slotAmmo], item->Name);
|
||||
insr->itemicons[SoF::invslot::slotAmmo] = item->Icon;
|
||||
}
|
||||
else
|
||||
insr->itemicons[SoF::invslot::PossessionsAmmo] = 0xFFFFFFFF;
|
||||
insr->itemicons[SoF::invslot::slotAmmo] = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
strcpy(insr->text, inspectedBot->GetInspectMessage().text);
|
||||
@@ -7651,7 +7655,7 @@ void Bot::CalcItemBonuses(StatBonuses* newbon)
|
||||
{
|
||||
const EQEmu::ItemData* itemtmp = nullptr;
|
||||
|
||||
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= (EQEmu::legacy::EQUIPMENT_END + 1); ++i) {
|
||||
for (int i = EQEmu::invslot::EQUIPMENT_BEGIN; i <= (EQEmu::invslot::EQUIPMENT_END + 1); ++i) {
|
||||
const EQEmu::ItemInstance* item = GetBotItem((i == 22 ? 9999 : i));
|
||||
if(item) {
|
||||
AddItemBonuses(item, newbon);
|
||||
@@ -7964,7 +7968,7 @@ void Bot::AddItemBonuses(const EQEmu::ItemInstance *inst, StatBonuses* newbon, b
|
||||
|
||||
if (!isAug)
|
||||
{
|
||||
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++)
|
||||
for (int i = EQEmu::invaug::SOCKET_BEGIN; i <= EQEmu::invaug::SOCKET_END; i++)
|
||||
AddItemBonuses(inst->GetAugment(i),newbon,true, false, rec_level);
|
||||
}
|
||||
|
||||
@@ -8473,12 +8477,12 @@ uint8 Bot::GetNumberNeedingHealedInGroup(uint8 hpr, bool includePets) {
|
||||
int Bot::GetRawACNoShield(int &shield_ac) {
|
||||
int ac = itembonuses.AC + spellbonuses.AC;
|
||||
shield_ac = 0;
|
||||
EQEmu::ItemInstance* inst = GetBotItem(EQEmu::inventory::slotSecondary);
|
||||
EQEmu::ItemInstance* inst = GetBotItem(EQEmu::invslot::slotSecondary);
|
||||
if(inst) {
|
||||
if (inst->GetItem()->ItemType == EQEmu::item::ItemTypeShield) {
|
||||
ac -= inst->GetItem()->AC;
|
||||
shield_ac = inst->GetItem()->AC;
|
||||
for (uint8 i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
|
||||
for (uint8 i = EQEmu::invaug::SOCKET_BEGIN; i <= EQEmu::invaug::SOCKET_END; i++) {
|
||||
if(inst->GetAugment(i)) {
|
||||
ac -= inst->GetAugment(i)->GetItem()->AC;
|
||||
shield_ac += inst->GetAugment(i)->GetItem()->AC;
|
||||
@@ -8493,7 +8497,7 @@ uint32 Bot::CalcCurrentWeight() {
|
||||
const EQEmu::ItemData* TempItem = nullptr;
|
||||
EQEmu::ItemInstance* inst = nullptr;
|
||||
uint32 Total = 0;
|
||||
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; ++i) {
|
||||
for (int i = EQEmu::invslot::EQUIPMENT_BEGIN; i <= EQEmu::invslot::EQUIPMENT_END; ++i) {
|
||||
inst = GetBotItem(i);
|
||||
if(inst) {
|
||||
TempItem = inst->GetItem();
|
||||
|
||||
+3
-3
@@ -80,9 +80,9 @@ static const std::string bot_stance_name[BOT_STANCE_COUNT] = {
|
||||
|
||||
static const char* GetBotStanceName(int stance_id) { return bot_stance_name[VALIDBOTSTANCE(stance_id)].c_str(); }
|
||||
|
||||
#define VALIDBOTEQUIPSLOT(x) ((x >= EQEmu::legacy::EQUIPMENT_BEGIN && x <= EQEmu::legacy::EQUIPMENT_END) ? (x) : ((x == EQEmu::inventory::slotPowerSource) ? (22) : (23)))
|
||||
#define VALIDBOTEQUIPSLOT(x) ((x >= EQEmu::invslot::EQUIPMENT_BEGIN && x <= EQEmu::invslot::EQUIPMENT_END) ? (x) : ((x == EQEmu::invslot::SLOT_POWER_SOURCE) ? (22) : (23)))
|
||||
|
||||
static std::string bot_equip_slot_name[EQEmu::legacy::EQUIPMENT_SIZE + 2] =
|
||||
static std::string bot_equip_slot_name[EQEmu::invslot::EQUIPMENT_COUNT + 2] =
|
||||
{
|
||||
"Charm", // MainCharm
|
||||
"Left Ear", // MainEar1
|
||||
@@ -256,7 +256,7 @@ public:
|
||||
//abstract virtual function implementations requird by base abstract class
|
||||
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill);
|
||||
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None);
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::invslot::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
ExtraAttackOptions *opts = nullptr);
|
||||
virtual bool HasRaid() { return (GetRaid() ? true : false); }
|
||||
virtual bool HasGroup() { return (GetGroup() ? true : false); }
|
||||
|
||||
+120
-44
@@ -2403,7 +2403,7 @@ namespace ActionableBots
|
||||
continue;
|
||||
|
||||
mod_skill_value = base_skill_value;
|
||||
for (int16 index = EQEmu::legacy::EQUIPMENT_BEGIN; index <= EQEmu::legacy::EQUIPMENT_END; ++index) {
|
||||
for (int16 index = EQEmu::invslot::EQUIPMENT_BEGIN; index <= EQEmu::invslot::EQUIPMENT_END; ++index) {
|
||||
const EQEmu::ItemInstance* indexed_item = bot_iter->GetBotItem(index);
|
||||
if (indexed_item && indexed_item->GetItem()->SkillModType == skill_type)
|
||||
mod_skill_value += (base_skill_value * (((float)indexed_item->GetItem()->SkillModValue) / 100.0f));
|
||||
@@ -4243,12 +4243,69 @@ void bot_subcommand_bot_clone(Client *c, const Seperator *sep)
|
||||
|
||||
void bot_subcommand_bot_create(Client *c, const Seperator *sep)
|
||||
{
|
||||
const std::string msg_class = StringFormat("class: %u(WAR), %u(CLR), %u(PAL), %u(RNG), %u(SHD), %u(DRU), %u(MNK), %u(BRD), %u(ROG), %u(SHM), %u(NEC), %u(WIZ), %u(MAG), %u(ENC), %u(BST), %u(BER)",
|
||||
WARRIOR, CLERIC, PALADIN, RANGER, SHADOWKNIGHT, DRUID, MONK, BARD, ROGUE, SHAMAN, NECROMANCER, WIZARD, MAGICIAN, ENCHANTER, BEASTLORD, BERSERKER);
|
||||
const std::string msg_race = StringFormat("race: %u(HUM), %u(BAR), %u(ERU), %u(ELF), %u(HIE), %u(DEF), %u(HEF), %u(DWF), %u(TRL), %u(OGR), %u(HFL), %u(GNM), %u(IKS), %u(VAH), %u(FRG), %u(DRK)",
|
||||
HUMAN, BARBARIAN, ERUDITE, WOOD_ELF, HIGH_ELF, DARK_ELF, HALF_ELF, DWARF, TROLL, OGRE, HALFLING, GNOME, IKSAR, VAHSHIR, FROGLOK, DRAKKIN);
|
||||
const std::string msg_gender = StringFormat("gender: %u(M), %u(F)", MALE, FEMALE);
|
||||
|
||||
const std::string class_substrs[17] = { "",
|
||||
"%u(WAR)", "%u(CLR)", "%u(PAL)", "%u(RNG)",
|
||||
"%u(SHD)", "%u(DRU)", "%u(MNK)", "%u(BRD)",
|
||||
"%u(ROG)", "%u(SHM)", "%u(NEC)", "%u(WIZ)",
|
||||
"%u(MAG)", "%u(ENC)", "%u(BST)", "%u(BER)"
|
||||
};
|
||||
|
||||
const std::string race_substrs[17] = { "",
|
||||
"%u(HUM)", "%u(BAR)", "%u(ERU)", "%u(ELF)",
|
||||
"%u(HIE)", "%u(DEF)", "%u(HEF)", "%u(DWF)",
|
||||
"%u(TRL)", "%u(OGR)", "%u(HFL)", "%u(GNM)",
|
||||
"%u(IKS)", "%u(VAH)", "%u(FRG)", "%u(DRK)"
|
||||
};
|
||||
|
||||
const uint16 race_values[17] = { 0,
|
||||
HUMAN, BARBARIAN, ERUDITE, WOOD_ELF,
|
||||
HIGH_ELF, DARK_ELF, HALF_ELF, DWARF,
|
||||
TROLL, OGRE, HALFLING, GNOME,
|
||||
IKSAR, VAHSHIR, FROGLOK, DRAKKIN
|
||||
};
|
||||
|
||||
const std::string gender_substrs[2] = {
|
||||
"%u(M)", "%u(F)",
|
||||
};
|
||||
|
||||
std::string msg_class = "class:";
|
||||
std::string msg_race = "race:";
|
||||
std::string msg_gender = "gender:";
|
||||
std::string msg_separator;
|
||||
|
||||
msg_separator = " ";
|
||||
for (int i = 0; i <= 15; ++i) {
|
||||
if (((1 << i) & RuleI(Bots, AllowedClasses)) == 0)
|
||||
continue;
|
||||
|
||||
msg_class.append(const_cast<const std::string&>(msg_separator));
|
||||
msg_class.append(StringFormat(class_substrs[i + 1].c_str(), (i + 1)));
|
||||
|
||||
msg_separator = ", ";
|
||||
}
|
||||
|
||||
msg_separator = " ";
|
||||
for (int i = 0; i <= 15; ++i) {
|
||||
if (((1 << i) & RuleI(Bots, AllowedRaces)) == 0)
|
||||
continue;
|
||||
|
||||
msg_race.append(const_cast<const std::string&>(msg_separator));
|
||||
msg_race.append(StringFormat(race_substrs[i + 1].c_str(), race_values[i + 1]));
|
||||
|
||||
msg_separator = ", ";
|
||||
}
|
||||
|
||||
msg_separator = " ";
|
||||
for (int i = 0; i <= 1; ++i) {
|
||||
if (((1 << i) & RuleI(Bots, AllowedGenders)) == 0)
|
||||
continue;
|
||||
|
||||
msg_gender.append(const_cast<const std::string&>(msg_separator));
|
||||
msg_gender.append(StringFormat(gender_substrs[i].c_str(), i));
|
||||
|
||||
msg_separator = ", ";
|
||||
}
|
||||
|
||||
if (helper_command_alias_fail(c, "bot_subcommand_bot_create", sep->arg[0], "botcreate"))
|
||||
return;
|
||||
if (helper_is_help_or_usage(sep->arg[1])) {
|
||||
@@ -7137,23 +7194,23 @@ void bot_subcommand_inventory_list(Client *c, const Seperator *sep)
|
||||
linker.SetLinkType(EQEmu::saylink::SayLinkItemInst);
|
||||
|
||||
uint32 inventory_count = 0;
|
||||
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= (EQEmu::legacy::EQUIPMENT_END + 1); ++i) {
|
||||
if ((i == EQEmu::inventory::slotSecondary) && is2Hweapon)
|
||||
for (int i = EQEmu::invslot::EQUIPMENT_BEGIN; i <= (EQEmu::invslot::EQUIPMENT_END + 1); ++i) {
|
||||
if ((i == EQEmu::invslot::slotSecondary) && is2Hweapon)
|
||||
continue;
|
||||
|
||||
inst = my_bot->CastToBot()->GetBotItem(i == 22 ? EQEmu::inventory::slotPowerSource : i);
|
||||
inst = my_bot->CastToBot()->GetBotItem(i == 22 ? EQEmu::invslot::SLOT_POWER_SOURCE : i);
|
||||
if (!inst || !inst->GetItem()) {
|
||||
c->Message(m_message, "I need something for my %s (slot %i)", GetBotEquipSlotName(i), (i == 22 ? EQEmu::inventory::slotPowerSource : i));
|
||||
c->Message(m_message, "I need something for my %s (slot %i)", GetBotEquipSlotName(i), (i == 22 ? EQEmu::invslot::SLOT_POWER_SOURCE : i));
|
||||
continue;
|
||||
}
|
||||
|
||||
item = inst->GetItem();
|
||||
if ((i == EQEmu::inventory::slotPrimary) && item->IsType2HWeapon()) {
|
||||
if ((i == EQEmu::invslot::slotPrimary) && item->IsType2HWeapon()) {
|
||||
is2Hweapon = true;
|
||||
}
|
||||
|
||||
linker.SetItemInst(inst);
|
||||
c->Message(m_message, "Using %s in my %s (slot %i)", linker.GenerateLink().c_str(), GetBotEquipSlotName(i), (i == 22 ? EQEmu::inventory::slotPowerSource : i));
|
||||
c->Message(m_message, "Using %s in my %s (slot %i)", linker.GenerateLink().c_str(), GetBotEquipSlotName(i), (i == 22 ? EQEmu::invslot::SLOT_POWER_SOURCE : i));
|
||||
|
||||
++inventory_count;
|
||||
}
|
||||
@@ -7192,7 +7249,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
int slotId = atoi(sep->arg[1]);
|
||||
if (!sep->IsNumber(1) || ((slotId > EQEmu::legacy::EQUIPMENT_END || slotId < EQEmu::legacy::EQUIPMENT_BEGIN) && slotId != EQEmu::inventory::slotPowerSource)) {
|
||||
if (!sep->IsNumber(1) || ((slotId > EQEmu::invslot::EQUIPMENT_END || slotId < EQEmu::invslot::EQUIPMENT_BEGIN) && slotId != EQEmu::invslot::SLOT_POWER_SOURCE)) {
|
||||
c->Message(m_fail, "Valid slots are 0-21 or 9999");
|
||||
return;
|
||||
}
|
||||
@@ -7207,7 +7264,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
|
||||
return;
|
||||
}
|
||||
|
||||
for (int m = EQEmu::inventory::socketBegin; m < EQEmu::inventory::SocketCount; ++m) {
|
||||
for (int m = EQEmu::invaug::SOCKET_BEGIN; m <= EQEmu::invaug::SOCKET_END; ++m) {
|
||||
if (!itminst)
|
||||
break;
|
||||
|
||||
@@ -7224,7 +7281,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
|
||||
std::string error_message;
|
||||
if (itm) {
|
||||
c->PushItemOnCursor(*itminst, true);
|
||||
if ((slotId == EQEmu::inventory::slotRange) || (slotId == EQEmu::inventory::slotAmmo) || (slotId == EQEmu::inventory::slotPrimary) || (slotId == EQEmu::inventory::slotSecondary))
|
||||
if ((slotId == EQEmu::invslot::slotRange) || (slotId == EQEmu::invslot::slotAmmo) || (slotId == EQEmu::invslot::slotPrimary) || (slotId == EQEmu::invslot::slotSecondary))
|
||||
my_bot->SetBotArcher(false);
|
||||
|
||||
my_bot->RemoveBotItemBySlot(slotId, &error_message);
|
||||
@@ -7238,31 +7295,31 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
switch (slotId) {
|
||||
case EQEmu::inventory::slotCharm:
|
||||
case EQEmu::inventory::slotEar1:
|
||||
case EQEmu::inventory::slotHead:
|
||||
case EQEmu::inventory::slotFace:
|
||||
case EQEmu::inventory::slotEar2:
|
||||
case EQEmu::inventory::slotNeck:
|
||||
case EQEmu::inventory::slotBack:
|
||||
case EQEmu::inventory::slotWrist1:
|
||||
case EQEmu::inventory::slotWrist2:
|
||||
case EQEmu::inventory::slotRange:
|
||||
case EQEmu::inventory::slotPrimary:
|
||||
case EQEmu::inventory::slotSecondary:
|
||||
case EQEmu::inventory::slotFinger1:
|
||||
case EQEmu::inventory::slotFinger2:
|
||||
case EQEmu::inventory::slotChest:
|
||||
case EQEmu::inventory::slotWaist:
|
||||
case EQEmu::inventory::slotPowerSource:
|
||||
case EQEmu::inventory::slotAmmo:
|
||||
case EQEmu::invslot::slotCharm:
|
||||
case EQEmu::invslot::slotEar1:
|
||||
case EQEmu::invslot::slotHead:
|
||||
case EQEmu::invslot::slotFace:
|
||||
case EQEmu::invslot::slotEar2:
|
||||
case EQEmu::invslot::slotNeck:
|
||||
case EQEmu::invslot::slotBack:
|
||||
case EQEmu::invslot::slotWrist1:
|
||||
case EQEmu::invslot::slotWrist2:
|
||||
case EQEmu::invslot::slotRange:
|
||||
case EQEmu::invslot::slotPrimary:
|
||||
case EQEmu::invslot::slotSecondary:
|
||||
case EQEmu::invslot::slotFinger1:
|
||||
case EQEmu::invslot::slotFinger2:
|
||||
case EQEmu::invslot::slotChest:
|
||||
case EQEmu::invslot::slotWaist:
|
||||
case EQEmu::invslot::SLOT_POWER_SOURCE:
|
||||
case EQEmu::invslot::slotAmmo:
|
||||
c->Message(m_message, "My %s is %s unequipped", GetBotEquipSlotName(slotId), ((itm) ? ("now") : ("already")));
|
||||
break;
|
||||
case EQEmu::inventory::slotShoulders:
|
||||
case EQEmu::inventory::slotArms:
|
||||
case EQEmu::inventory::slotHands:
|
||||
case EQEmu::inventory::slotLegs:
|
||||
case EQEmu::inventory::slotFeet:
|
||||
case EQEmu::invslot::slotShoulders:
|
||||
case EQEmu::invslot::slotArms:
|
||||
case EQEmu::invslot::slotHands:
|
||||
case EQEmu::invslot::slotLegs:
|
||||
case EQEmu::invslot::slotFeet:
|
||||
c->Message(m_message, "My %s are %s unequipped", GetBotEquipSlotName(slotId), ((itm) ? ("now") : ("already")));
|
||||
break;
|
||||
default:
|
||||
@@ -7299,14 +7356,14 @@ void bot_subcommand_inventory_window(Client *c, const Seperator *sep)
|
||||
//EQEmu::SayLinkEngine linker;
|
||||
//linker.SetLinkType(EQEmu::saylink::SayLinkItemInst);
|
||||
|
||||
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= (EQEmu::legacy::EQUIPMENT_END + 1); ++i) {
|
||||
for (int i = EQEmu::invslot::EQUIPMENT_BEGIN; i <= (EQEmu::invslot::EQUIPMENT_END + 1); ++i) {
|
||||
const EQEmu::ItemData* item = nullptr;
|
||||
const EQEmu::ItemInstance* inst = my_bot->CastToBot()->GetBotItem(i == 22 ? EQEmu::inventory::slotPowerSource : i);
|
||||
const EQEmu::ItemInstance* inst = my_bot->CastToBot()->GetBotItem(i == 22 ? EQEmu::invslot::SLOT_POWER_SOURCE : i);
|
||||
if (inst)
|
||||
item = inst->GetItem();
|
||||
|
||||
window_text.append("<c \"#FFFFFF\">");
|
||||
window_text.append(GetBotEquipSlotName(i == 22 ? EQEmu::inventory::slotPowerSource : i));
|
||||
window_text.append(GetBotEquipSlotName(i == 22 ? EQEmu::invslot::SLOT_POWER_SOURCE : i));
|
||||
window_text.append(": ");
|
||||
if (item) {
|
||||
//window_text.append("</c>");
|
||||
@@ -7588,14 +7645,33 @@ uint32 helper_bot_create(Client *bot_owner, std::string bot_name, uint8 bot_clas
|
||||
return bot_id;
|
||||
}
|
||||
|
||||
auto class_bit = GetPlayerClassBit(bot_class);
|
||||
if ((class_bit & RuleI(Bots, AllowedClasses)) == PLAYER_CLASS_UNKNOWN_BIT) {
|
||||
bot_owner->Message(m_fail, "Class '%s' bots are not allowed on this server", GetPlayerClassName(bot_class));
|
||||
return bot_id;
|
||||
}
|
||||
|
||||
auto race_bit = GetPlayerRaceBit(bot_race);
|
||||
if ((race_bit & RuleI(Bots, AllowedRaces)) == PLAYER_RACE_UNKNOWN_BIT) {
|
||||
bot_owner->Message(m_fail, "Race '%s' bots are not allowed on this server", GetPlayerRaceName(bot_class));
|
||||
return bot_id;
|
||||
}
|
||||
|
||||
if (!Bot::IsValidRaceClassCombo(bot_race, bot_class)) {
|
||||
bot_owner->Message(m_fail, "'%s'(%u):'%s'(%u) is an invalid race-class combination",
|
||||
Bot::RaceIdToString(bot_race).c_str(), bot_race, Bot::ClassIdToString(bot_class).c_str(), bot_class);
|
||||
return bot_id;
|
||||
}
|
||||
|
||||
if (bot_gender > FEMALE) {
|
||||
bot_owner->Message(m_fail, "gender: %u(M), %u(F)", MALE, FEMALE);
|
||||
if (bot_gender > FEMALE || (((1 << bot_gender) & RuleI(Bots, AllowedGenders)) == 0)) {
|
||||
if (RuleI(Bots, AllowedGenders) == 3)
|
||||
bot_owner->Message(m_fail, "gender: %u(M), %u(F)", MALE, FEMALE);
|
||||
else if (RuleI(Bots, AllowedGenders) == 2)
|
||||
bot_owner->Message(m_fail, "gender: %u(F)", FEMALE);
|
||||
else if (RuleI(Bots, AllowedGenders) == 1)
|
||||
bot_owner->Message(m_fail, "gender: %u(M)", MALE);
|
||||
else
|
||||
bot_owner->Message(m_fail, "gender: ERROR - No valid genders exist");
|
||||
return bot_id;
|
||||
}
|
||||
|
||||
|
||||
+14
-14
@@ -1138,7 +1138,7 @@ bool BotDatabase::LoadItems(const uint32 bot_id, EQEmu::InventoryProfile& invent
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
int16 slot_id = atoi(row[0]);
|
||||
if ((slot_id < EQEmu::legacy::EQUIPMENT_BEGIN || slot_id > EQEmu::legacy::EQUIPMENT_END) && slot_id != EQEmu::inventory::slotPowerSource)
|
||||
if ((slot_id < EQEmu::invslot::EQUIPMENT_BEGIN || slot_id > EQEmu::invslot::EQUIPMENT_END) && slot_id != EQEmu::invslot::SLOT_POWER_SOURCE)
|
||||
continue;
|
||||
|
||||
uint32 item_id = atoi(row[1]);
|
||||
@@ -1173,7 +1173,7 @@ bool BotDatabase::LoadItems(const uint32 bot_id, EQEmu::InventoryProfile& invent
|
||||
if (item_inst->GetItem()->Attuneable) {
|
||||
if (atoi(row[4]))
|
||||
item_inst->SetAttuned(true);
|
||||
else if (((slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::legacy::EQUIPMENT_END) || slot_id == EQEmu::inventory::slotPowerSource))
|
||||
else if (((slot_id >= EQEmu::invslot::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::invslot::EQUIPMENT_END) || slot_id == EQEmu::invslot::SLOT_POWER_SOURCE))
|
||||
item_inst->SetAttuned(true);
|
||||
}
|
||||
|
||||
@@ -1241,7 +1241,7 @@ bool BotDatabase::LoadItemBySlot(Bot* bot_inst)
|
||||
|
||||
bool BotDatabase::LoadItemBySlot(const uint32 bot_id, const uint32 slot_id, uint32& item_id)
|
||||
{
|
||||
if (!bot_id || (slot_id > EQEmu::legacy::EQUIPMENT_END && slot_id != EQEmu::inventory::slotPowerSource))
|
||||
if (!bot_id || (slot_id > EQEmu::invslot::EQUIPMENT_END && slot_id != EQEmu::invslot::SLOT_POWER_SOURCE))
|
||||
return false;
|
||||
|
||||
query = StringFormat("SELECT `item_id` FROM `bot_inventories` WHERE `bot_id` = '%i' AND `slot_id` = '%i' LIMIT 1", bot_id, slot_id);
|
||||
@@ -1259,7 +1259,7 @@ bool BotDatabase::LoadItemBySlot(const uint32 bot_id, const uint32 slot_id, uint
|
||||
|
||||
bool BotDatabase::SaveItemBySlot(Bot* bot_inst, const uint32 slot_id, const EQEmu::ItemInstance* item_inst)
|
||||
{
|
||||
if (!bot_inst || !bot_inst->GetBotID() || (slot_id > EQEmu::legacy::EQUIPMENT_END && slot_id != EQEmu::inventory::slotPowerSource))
|
||||
if (!bot_inst || !bot_inst->GetBotID() || (slot_id > EQEmu::invslot::EQUIPMENT_END && slot_id != EQEmu::invslot::SLOT_POWER_SOURCE))
|
||||
return false;
|
||||
|
||||
if (!DeleteItemBySlot(bot_inst->GetBotID(), slot_id))
|
||||
@@ -1268,8 +1268,8 @@ bool BotDatabase::SaveItemBySlot(Bot* bot_inst, const uint32 slot_id, const EQEm
|
||||
if (!item_inst || !item_inst->GetID())
|
||||
return true;
|
||||
|
||||
uint32 augment_id[EQEmu::inventory::SocketCount] = { 0, 0, 0, 0, 0, 0 };
|
||||
for (int augment_iter = EQEmu::inventory::socketBegin; augment_iter < EQEmu::inventory::SocketCount; ++augment_iter)
|
||||
uint32 augment_id[EQEmu::invaug::SOCKET_COUNT] = { 0, 0, 0, 0, 0, 0 };
|
||||
for (int augment_iter = EQEmu::invaug::SOCKET_BEGIN; augment_iter <= EQEmu::invaug::SOCKET_END; ++augment_iter)
|
||||
augment_id[augment_iter] = item_inst->GetAugmentItemID(augment_iter);
|
||||
|
||||
uint16 item_charges = 0;
|
||||
@@ -1343,7 +1343,7 @@ bool BotDatabase::SaveItemBySlot(Bot* bot_inst, const uint32 slot_id, const EQEm
|
||||
|
||||
bool BotDatabase::DeleteItemBySlot(const uint32 bot_id, const uint32 slot_id)
|
||||
{
|
||||
if (!bot_id || (slot_id > EQEmu::legacy::EQUIPMENT_END && slot_id != EQEmu::inventory::slotPowerSource))
|
||||
if (!bot_id || (slot_id > EQEmu::invslot::EQUIPMENT_END && slot_id != EQEmu::invslot::SLOT_POWER_SOURCE))
|
||||
return false;
|
||||
|
||||
query = StringFormat("DELETE FROM `bot_inventories` WHERE `bot_id` = '%u' AND `slot_id` = '%u'", bot_id, slot_id);
|
||||
@@ -1382,12 +1382,12 @@ bool BotDatabase::SaveEquipmentColor(const uint32 bot_id, const int16 slot_id, c
|
||||
return false;
|
||||
|
||||
bool all_flag = (slot_id == -2);
|
||||
if ((slot_id < EQEmu::legacy::EQUIPMENT_BEGIN || slot_id > EQEmu::legacy::EQUIPMENT_END) && slot_id != EQEmu::inventory::slotPowerSource && !all_flag)
|
||||
if ((slot_id < EQEmu::invslot::EQUIPMENT_BEGIN || slot_id > EQEmu::invslot::EQUIPMENT_END) && slot_id != EQEmu::invslot::SLOT_POWER_SOURCE && !all_flag)
|
||||
return false;
|
||||
|
||||
std::string where_clause;
|
||||
if (all_flag)
|
||||
where_clause = StringFormat(" AND `slot_id` IN ('%u', '%u', '%u', '%u', '%u', '%u', '%u')", EQEmu::inventory::slotHead, EQEmu::inventory::slotArms, EQEmu::inventory::slotWrist1, EQEmu::inventory::slotHands, EQEmu::inventory::slotChest, EQEmu::inventory::slotLegs, EQEmu::inventory::slotFeet);
|
||||
where_clause = StringFormat(" AND `slot_id` IN ('%u', '%u', '%u', '%u', '%u', '%u', '%u')", EQEmu::invslot::slotHead, EQEmu::invslot::slotArms, EQEmu::invslot::slotWrist1, EQEmu::invslot::slotHands, EQEmu::invslot::slotChest, EQEmu::invslot::slotLegs, EQEmu::invslot::slotFeet);
|
||||
else
|
||||
where_clause = StringFormat(" AND `slot_id` = '%u'", slot_id);
|
||||
|
||||
@@ -1658,8 +1658,8 @@ bool BotDatabase::LoadPetItems(const uint32 bot_id, uint32* pet_items)
|
||||
if (!results.RowCount())
|
||||
return true;
|
||||
|
||||
int item_index = 0;
|
||||
for (auto row = results.begin(); row != results.end() && item_index < EQEmu::legacy::EQUIPMENT_SIZE; ++row) {
|
||||
int item_index = EQEmu::invslot::EQUIPMENT_BEGIN;
|
||||
for (auto row = results.begin(); row != results.end() && item_index <= EQEmu::invslot::EQUIPMENT_END; ++row) {
|
||||
pet_items[item_index] = atoi(row[0]);
|
||||
++item_index;
|
||||
}
|
||||
@@ -1683,7 +1683,7 @@ bool BotDatabase::SavePetItems(const uint32 bot_id, const uint32* pet_items, boo
|
||||
if (!saved_pet_index)
|
||||
return true;
|
||||
|
||||
for (int item_index = 0; item_index < EQEmu::legacy::EQUIPMENT_SIZE; ++item_index) {
|
||||
for (int item_index = EQEmu::invslot::SLOT_BEGIN; item_index <= EQEmu::invslot::EQUIPMENT_END; ++item_index) {
|
||||
if (!pet_items[item_index])
|
||||
continue;
|
||||
|
||||
@@ -1832,7 +1832,7 @@ bool BotDatabase::SaveAllArmorColorBySlot(const uint32 owner_id, const int16 slo
|
||||
" AND bi.`slot_id` = '%i'",
|
||||
owner_id,
|
||||
rgb_value,
|
||||
EQEmu::inventory::slotHead, EQEmu::inventory::slotChest, EQEmu::inventory::slotArms, EQEmu::inventory::slotWrist1, EQEmu::inventory::slotWrist2, EQEmu::inventory::slotHands, EQEmu::inventory::slotLegs, EQEmu::inventory::slotFeet,
|
||||
EQEmu::invslot::slotHead, EQEmu::invslot::slotChest, EQEmu::invslot::slotArms, EQEmu::invslot::slotWrist1, EQEmu::invslot::slotWrist2, EQEmu::invslot::slotHands, EQEmu::invslot::slotLegs, EQEmu::invslot::slotFeet,
|
||||
slot_id
|
||||
);
|
||||
auto results = QueryDatabase(query);
|
||||
@@ -1856,7 +1856,7 @@ bool BotDatabase::SaveAllArmorColors(const uint32 owner_id, const uint32 rgb_val
|
||||
" AND bi.`slot_id` IN ('%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u')",
|
||||
owner_id,
|
||||
rgb_value,
|
||||
EQEmu::inventory::slotHead, EQEmu::inventory::slotChest, EQEmu::inventory::slotArms, EQEmu::inventory::slotWrist1, EQEmu::inventory::slotWrist2, EQEmu::inventory::slotHands, EQEmu::inventory::slotLegs, EQEmu::inventory::slotFeet
|
||||
EQEmu::invslot::slotHead, EQEmu::invslot::slotChest, EQEmu::invslot::slotArms, EQEmu::invslot::slotWrist1, EQEmu::invslot::slotWrist2, EQEmu::invslot::slotHands, EQEmu::invslot::slotLegs, EQEmu::invslot::slotFeet
|
||||
);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
|
||||
+154
-80
@@ -33,7 +33,6 @@ extern volatile bool RunLoops;
|
||||
|
||||
#include "../common/eqemu_logsys.h"
|
||||
#include "../common/features.h"
|
||||
#include "../common/emu_legacy.h"
|
||||
#include "../common/spdat.h"
|
||||
#include "../common/guilds.h"
|
||||
#include "../common/rulesys.h"
|
||||
@@ -326,9 +325,6 @@ Client::Client(EQStreamInterface* ieqs)
|
||||
initial_respawn_selection = 0;
|
||||
alternate_currency_loaded = false;
|
||||
|
||||
EngagedRaidTarget = false;
|
||||
SavedRaidRestTimer = 0;
|
||||
|
||||
interrogateinv_flag = false;
|
||||
|
||||
trapid = 0;
|
||||
@@ -631,7 +627,7 @@ bool Client::Save(uint8 iCommitNow) {
|
||||
/* Total Time Played */
|
||||
TotalSecondsPlayed += (time(nullptr) - m_pp.lastlogin);
|
||||
m_pp.timePlayedMin = (TotalSecondsPlayed / 60);
|
||||
m_pp.RestTimer = rest_timer.GetRemainingTime() / 1000;
|
||||
m_pp.RestTimer = GetRestTimer();
|
||||
|
||||
/* Save Mercs */
|
||||
if (GetMercInfo().MercTimerRemaining > RuleI(Mercs, UpkeepIntervalMS)) {
|
||||
@@ -1866,6 +1862,9 @@ void Client::CheckManaEndUpdate() {
|
||||
mana_change->stamina = current_endurance;
|
||||
mana_change->spell_id = casting_spell_id;
|
||||
mana_change->keepcasting = 1;
|
||||
mana_change->padding[0] = 0;
|
||||
mana_change->padding[1] = 0;
|
||||
mana_change->padding[2] = 0;
|
||||
outapp->priority = 6;
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
@@ -1887,8 +1886,9 @@ void Client::CheckManaEndUpdate() {
|
||||
mana_update->cur_mana = GetMana();
|
||||
mana_update->max_mana = GetMaxMana();
|
||||
mana_update->spawn_id = GetID();
|
||||
QueuePacket(mana_packet);
|
||||
entity_list.QueueClientsByXTarget(this, mana_packet, false);
|
||||
if ((ClientVersionBit() & EQEmu::versions::ClientVersionBit::bit_SoDAndLater) != 0)
|
||||
QueuePacket(mana_packet); // do we need this with the OP_ManaChange packet above?
|
||||
entity_list.QueueClientsByXTarget(this, mana_packet, false, EQEmu::versions::ClientVersionBit::bit_SoDAndLater);
|
||||
safe_delete(mana_packet);
|
||||
|
||||
last_reported_mana_percent = this->GetManaPercent();
|
||||
@@ -1911,8 +1911,9 @@ void Client::CheckManaEndUpdate() {
|
||||
endurance_update->cur_end = GetEndurance();
|
||||
endurance_update->max_end = GetMaxEndurance();
|
||||
endurance_update->spawn_id = GetID();
|
||||
QueuePacket(endurance_packet);
|
||||
entity_list.QueueClientsByXTarget(this, endurance_packet, false);
|
||||
if ((ClientVersionBit() & EQEmu::versions::ClientVersionBit::bit_SoDAndLater) != 0)
|
||||
QueuePacket(endurance_packet); // do we need this with the OP_ManaChange packet above?
|
||||
entity_list.QueueClientsByXTarget(this, endurance_packet, false, EQEmu::versions::ClientVersionBit::bit_SoDAndLater);
|
||||
safe_delete(endurance_packet);
|
||||
|
||||
last_reported_endurance_percent = this->GetEndurancePercent();
|
||||
@@ -2108,7 +2109,7 @@ void Client::ReadBook(BookRequest_Struct *book) {
|
||||
|
||||
const EQEmu::ItemInstance *inst = nullptr;
|
||||
|
||||
if (read_from_slot <= EQEmu::legacy::SLOT_PERSONAL_BAGS_END)
|
||||
if (read_from_slot <= EQEmu::invbag::GENERAL_BAGS_END)
|
||||
{
|
||||
inst = m_inv[read_from_slot];
|
||||
}
|
||||
@@ -2681,6 +2682,60 @@ void Client::LogMerchant(Client* player, Mob* merchant, uint32 quantity, uint32
|
||||
}
|
||||
}
|
||||
|
||||
void Client::Disarm(Client* disarmer, int chance) {
|
||||
int16 slot = EQEmu::invslot::SLOT_INVALID;
|
||||
const EQEmu::ItemInstance *inst = this->GetInv().GetItem(EQEmu::invslot::slotPrimary);
|
||||
if (inst && inst->IsWeapon()) {
|
||||
slot = EQEmu::invslot::slotPrimary;
|
||||
}
|
||||
else {
|
||||
inst = this->GetInv().GetItem(EQEmu::invslot::slotSecondary);
|
||||
if (inst && inst->IsWeapon())
|
||||
slot = EQEmu::invslot::slotSecondary;
|
||||
}
|
||||
if (slot != EQEmu::invslot::SLOT_INVALID && inst->IsClassCommon()) {
|
||||
// We have an item that can be disarmed.
|
||||
if (zone->random.Int(0, 1000) <= chance) {
|
||||
// Find a free inventory slot
|
||||
int16 slot_id = EQEmu::invslot::SLOT_INVALID;
|
||||
slot_id = m_inv.FindFreeSlot(false, true, inst->GetItem()->Size, (inst->GetItem()->ItemType == EQEmu::item::ItemTypeArrow));
|
||||
if (slot_id != EQEmu::invslot::SLOT_INVALID)
|
||||
{
|
||||
EQEmu::ItemInstance *InvItem = m_inv.PopItem(slot);
|
||||
if (InvItem) { // there should be no way it is not there, but check anyway
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_MoveItem, sizeof(MoveItem_Struct));
|
||||
MoveItem_Struct* mi = (MoveItem_Struct*)outapp->pBuffer;
|
||||
mi->from_slot = slot;
|
||||
mi->to_slot = 0xFFFFFFFF;
|
||||
if (inst->IsStackable()) // it should not be stackable
|
||||
mi->number_in_stack = inst->GetCharges();
|
||||
else
|
||||
mi->number_in_stack = 0;
|
||||
FastQueuePacket(&outapp); // this deletes item from the weapon slot on the client
|
||||
if (PutItemInInventory(slot_id, *InvItem, true))
|
||||
database.SaveInventory(this->CharacterID(), NULL, slot);
|
||||
auto matslot = (slot == EQEmu::invslot::slotPrimary ? EQEmu::textures::weaponPrimary : EQEmu::textures::weaponSecondary);
|
||||
if (matslot != EQEmu::textures::materialInvalid)
|
||||
SendWearChange(matslot);
|
||||
}
|
||||
Message_StringID(MT_Skills, DISARMED);
|
||||
if (disarmer != this)
|
||||
disarmer->Message_StringID(MT_Skills, DISARM_SUCCESS, this->GetCleanName());
|
||||
if (chance != 1000)
|
||||
disarmer->CheckIncreaseSkill(EQEmu::skills::SkillDisarm, nullptr, 4);
|
||||
CalcBonuses();
|
||||
// CalcEnduranceWeightFactor();
|
||||
return;
|
||||
}
|
||||
disarmer->Message_StringID(MT_Skills, DISARM_FAILED);
|
||||
if (chance != 1000)
|
||||
disarmer->CheckIncreaseSkill(EQEmu::skills::SkillDisarm, nullptr, 2);
|
||||
return;
|
||||
}
|
||||
}
|
||||
disarmer->Message_StringID(MT_Skills, DISARM_FAILED);
|
||||
}
|
||||
|
||||
bool Client::BindWound(Mob *bindmob, bool start, bool fail)
|
||||
{
|
||||
EQApplicationPacket *outapp = nullptr;
|
||||
@@ -3322,28 +3377,28 @@ void Client::LinkDead()
|
||||
uint8 Client::SlotConvert(uint8 slot,bool bracer){
|
||||
uint8 slot2 = 0; // why are we returning MainCharm instead of INVALID_INDEX? (must be a pre-charm segment...)
|
||||
if(bracer)
|
||||
return EQEmu::inventory::slotWrist2;
|
||||
return EQEmu::invslot::slotWrist2;
|
||||
switch(slot) {
|
||||
case EQEmu::textures::armorHead:
|
||||
slot2 = EQEmu::inventory::slotHead;
|
||||
slot2 = EQEmu::invslot::slotHead;
|
||||
break;
|
||||
case EQEmu::textures::armorChest:
|
||||
slot2 = EQEmu::inventory::slotChest;
|
||||
slot2 = EQEmu::invslot::slotChest;
|
||||
break;
|
||||
case EQEmu::textures::armorArms:
|
||||
slot2 = EQEmu::inventory::slotArms;
|
||||
slot2 = EQEmu::invslot::slotArms;
|
||||
break;
|
||||
case EQEmu::textures::armorWrist:
|
||||
slot2 = EQEmu::inventory::slotWrist1;
|
||||
slot2 = EQEmu::invslot::slotWrist1;
|
||||
break;
|
||||
case EQEmu::textures::armorHands:
|
||||
slot2 = EQEmu::inventory::slotHands;
|
||||
slot2 = EQEmu::invslot::slotHands;
|
||||
break;
|
||||
case EQEmu::textures::armorLegs:
|
||||
slot2 = EQEmu::inventory::slotLegs;
|
||||
slot2 = EQEmu::invslot::slotLegs;
|
||||
break;
|
||||
case EQEmu::textures::armorFeet:
|
||||
slot2 = EQEmu::inventory::slotFeet;
|
||||
slot2 = EQEmu::invslot::slotFeet;
|
||||
break;
|
||||
}
|
||||
return slot2;
|
||||
@@ -3352,25 +3407,25 @@ uint8 Client::SlotConvert(uint8 slot,bool bracer){
|
||||
uint8 Client::SlotConvert2(uint8 slot){
|
||||
uint8 slot2 = 0; // same as above...
|
||||
switch(slot){
|
||||
case EQEmu::inventory::slotHead:
|
||||
case EQEmu::invslot::slotHead:
|
||||
slot2 = EQEmu::textures::armorHead;
|
||||
break;
|
||||
case EQEmu::inventory::slotChest:
|
||||
case EQEmu::invslot::slotChest:
|
||||
slot2 = EQEmu::textures::armorChest;
|
||||
break;
|
||||
case EQEmu::inventory::slotArms:
|
||||
case EQEmu::invslot::slotArms:
|
||||
slot2 = EQEmu::textures::armorArms;
|
||||
break;
|
||||
case EQEmu::inventory::slotWrist1:
|
||||
case EQEmu::invslot::slotWrist1:
|
||||
slot2 = EQEmu::textures::armorWrist;
|
||||
break;
|
||||
case EQEmu::inventory::slotHands:
|
||||
case EQEmu::invslot::slotHands:
|
||||
slot2 = EQEmu::textures::armorHands;
|
||||
break;
|
||||
case EQEmu::inventory::slotLegs:
|
||||
case EQEmu::invslot::slotLegs:
|
||||
slot2 = EQEmu::textures::armorLegs;
|
||||
break;
|
||||
case EQEmu::inventory::slotFeet:
|
||||
case EQEmu::invslot::slotFeet:
|
||||
slot2 = EQEmu::textures::armorFeet;
|
||||
break;
|
||||
}
|
||||
@@ -4425,14 +4480,14 @@ bool Client::GroupFollow(Client* inviter) {
|
||||
uint16 Client::GetPrimarySkillValue()
|
||||
{
|
||||
EQEmu::skills::SkillType skill = EQEmu::skills::HIGHEST_SKILL; //because nullptr == 0, which is 1H Slashing, & we want it to return 0 from GetSkill
|
||||
bool equiped = m_inv.GetItem(EQEmu::inventory::slotPrimary);
|
||||
bool equiped = m_inv.GetItem(EQEmu::invslot::slotPrimary);
|
||||
|
||||
if (!equiped)
|
||||
skill = EQEmu::skills::SkillHandtoHand;
|
||||
|
||||
else {
|
||||
|
||||
uint8 type = m_inv.GetItem(EQEmu::inventory::slotPrimary)->GetItem()->ItemType; //is this the best way to do this?
|
||||
uint8 type = m_inv.GetItem(EQEmu::invslot::slotPrimary)->GetItem()->ItemType; //is this the best way to do this?
|
||||
|
||||
switch (type) {
|
||||
case EQEmu::item::ItemType1HSlash: // 1H Slashing
|
||||
@@ -4595,29 +4650,32 @@ int Client::GetAggroCount() {
|
||||
return AggroCount;
|
||||
}
|
||||
|
||||
void Client::IncrementAggroCount() {
|
||||
|
||||
// we pass in for book keeping if RestRegen is enabled
|
||||
void Client::IncrementAggroCount(bool raid_target)
|
||||
{
|
||||
// This method is called when a client is added to a mob's hate list. It turns the clients aggro flag on so
|
||||
// rest state regen is stopped, and for SoF, it sends the opcode to show the crossed swords in-combat indicator.
|
||||
//
|
||||
//
|
||||
AggroCount++;
|
||||
|
||||
if(!RuleB(Character, RestRegenEnabled))
|
||||
return;
|
||||
|
||||
uint32 newtimer = raid_target ? RuleI(Character, RestRegenRaidTimeToActivate) : RuleI(Character, RestRegenTimeToActivate);
|
||||
|
||||
// save the new timer if it's higher
|
||||
m_pp.RestTimer = std::max(m_pp.RestTimer, newtimer);
|
||||
|
||||
// If we already had aggro before this method was called, the combat indicator should already be up for SoF clients,
|
||||
// so we don't need to send it again.
|
||||
//
|
||||
if(AggroCount > 1)
|
||||
return;
|
||||
|
||||
// Pause the rest timer
|
||||
// Pause the rest timer, it's possible the new timer is a non-raid timer we're currently ticking down on a raid timer
|
||||
if (AggroCount == 1)
|
||||
SavedRaidRestTimer = rest_timer.GetRemainingTime();
|
||||
m_pp.RestTimer = std::max(m_pp.RestTimer, rest_timer.GetRemainingTime() / 1000);
|
||||
|
||||
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
|
||||
|
||||
auto outapp = new EQApplicationPacket(OP_RestState, 1);
|
||||
char *Buffer = (char *)outapp->pBuffer;
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 0x01);
|
||||
@@ -4627,12 +4685,11 @@ void Client::IncrementAggroCount() {
|
||||
|
||||
}
|
||||
|
||||
void Client::DecrementAggroCount() {
|
||||
|
||||
void Client::DecrementAggroCount()
|
||||
{
|
||||
// This should be called when a client is removed from a mob's hate list (it dies or is memblurred).
|
||||
// It checks whether any other mob is aggro on the player, and if not, starts the rest timer.
|
||||
// For SoF, the opcode to start the rest state countdown timer in the UI is sent.
|
||||
//
|
||||
|
||||
// If we didn't have aggro before, this method should not have been called.
|
||||
if(!AggroCount)
|
||||
@@ -4644,34 +4701,51 @@ void Client::DecrementAggroCount() {
|
||||
return;
|
||||
|
||||
// Something else is still aggro on us, can't rest yet.
|
||||
if(AggroCount) return;
|
||||
if (AggroCount)
|
||||
return;
|
||||
|
||||
uint32 time_until_rest;
|
||||
if (GetEngagedRaidTarget()) {
|
||||
time_until_rest = RuleI(Character, RestRegenRaidTimeToActivate) * 1000;
|
||||
SetEngagedRaidTarget(false);
|
||||
} else {
|
||||
if (SavedRaidRestTimer > (RuleI(Character, RestRegenTimeToActivate) * 1000)) {
|
||||
time_until_rest = SavedRaidRestTimer;
|
||||
SavedRaidRestTimer = 0;
|
||||
} else {
|
||||
time_until_rest = RuleI(Character, RestRegenTimeToActivate) * 1000;
|
||||
}
|
||||
}
|
||||
|
||||
rest_timer.Start(time_until_rest);
|
||||
rest_timer.Start(m_pp.RestTimer * 1000);
|
||||
|
||||
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
|
||||
|
||||
auto outapp = new EQApplicationPacket(OP_RestState, 5);
|
||||
char *Buffer = (char *)outapp->pBuffer;
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 0x00);
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, (uint32)(time_until_rest / 1000));
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, m_pp.RestTimer);
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
}
|
||||
}
|
||||
|
||||
// when we cast a beneficial spell we need to steal our targets current timer
|
||||
// That's what we use this for
|
||||
void Client::UpdateRestTimer(uint32 new_timer)
|
||||
{
|
||||
// their timer was 0, so we don't do anything
|
||||
if (new_timer == 0)
|
||||
return;
|
||||
|
||||
if (!RuleB(Character, RestRegenEnabled))
|
||||
return;
|
||||
|
||||
// so if we're currently on aggro, we check our saved timer
|
||||
if (AggroCount) {
|
||||
if (m_pp.RestTimer < new_timer) // our timer needs to be updated, don't need to update client here
|
||||
m_pp.RestTimer = new_timer;
|
||||
} else { // if we're not aggro, we need to check if current timer needs updating
|
||||
if (rest_timer.GetRemainingTime() / 1000 < new_timer) {
|
||||
rest_timer.Start(new_timer * 1000);
|
||||
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
|
||||
auto outapp = new EQApplicationPacket(OP_RestState, 5);
|
||||
char *Buffer = (char *)outapp->pBuffer;
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 0x00);
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, new_timer);
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Client::SendPVPStats()
|
||||
{
|
||||
// This sends the data to the client to populate the PVP Stats Window.
|
||||
@@ -5376,7 +5450,7 @@ void Client::SetPortExemption(bool v)
|
||||
m_PortExemption = v;
|
||||
}
|
||||
|
||||
void Client::Signal(uint32 data)
|
||||
void Client::Signal(int data)
|
||||
{
|
||||
char buf[32];
|
||||
snprintf(buf, 31, "%d", data);
|
||||
@@ -5596,7 +5670,7 @@ bool Client::TryReward(uint32 claim_id)
|
||||
// save
|
||||
uint32 free_slot = 0xFFFFFFFF;
|
||||
|
||||
for (int i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; ++i) {
|
||||
for (int i = EQEmu::invslot::GENERAL_BEGIN; i <= EQEmu::invslot::GENERAL_END; ++i) {
|
||||
EQEmu::ItemInstance *item = GetInv().GetItem(i);
|
||||
if (!item) {
|
||||
free_slot = i;
|
||||
@@ -5956,30 +6030,30 @@ void Client::ProcessInspectRequest(Client* requestee, Client* requester) {
|
||||
}
|
||||
}
|
||||
|
||||
inst = requestee->GetInv().GetItem(EQEmu::inventory::slotPowerSource);
|
||||
inst = requestee->GetInv().GetItem(EQEmu::invslot::SLOT_POWER_SOURCE);
|
||||
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
// we shouldn't do this..but, that's the way it's coded atm...
|
||||
// (this type of action should be handled exclusively in the client translator)
|
||||
strcpy(insr->itemnames[SoF::invslot::PossessionsPowerSource], item->Name);
|
||||
insr->itemicons[SoF::invslot::PossessionsPowerSource] = item->Icon;
|
||||
strcpy(insr->itemnames[SoF::invslot::slotPowerSource], item->Name);
|
||||
insr->itemicons[SoF::invslot::slotPowerSource] = item->Icon;
|
||||
}
|
||||
else
|
||||
insr->itemicons[SoF::invslot::PossessionsPowerSource] = 0xFFFFFFFF;
|
||||
insr->itemicons[SoF::invslot::slotPowerSource] = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
inst = requestee->GetInv().GetItem(EQEmu::inventory::slotAmmo);
|
||||
inst = requestee->GetInv().GetItem(EQEmu::invslot::slotAmmo);
|
||||
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
strcpy(insr->itemnames[SoF::invslot::PossessionsAmmo], item->Name);
|
||||
insr->itemicons[SoF::invslot::PossessionsAmmo] = item->Icon;
|
||||
strcpy(insr->itemnames[SoF::invslot::slotAmmo], item->Name);
|
||||
insr->itemicons[SoF::invslot::slotAmmo] = item->Icon;
|
||||
}
|
||||
else
|
||||
insr->itemicons[SoF::invslot::PossessionsAmmo] = 0xFFFFFFFF;
|
||||
insr->itemicons[SoF::invslot::slotAmmo] = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
strcpy(insr->text, requestee->GetInspectMessage().text);
|
||||
@@ -7035,7 +7109,7 @@ void Client::SendStatsWindow(Client* client, bool use_window)
|
||||
}
|
||||
|
||||
EQEmu::skills::SkillType skill = EQEmu::skills::SkillHandtoHand;
|
||||
auto *inst = GetInv().GetItem(EQEmu::inventory::slotPrimary);
|
||||
auto *inst = GetInv().GetItem(EQEmu::invslot::slotPrimary);
|
||||
if (inst && inst->IsClassCommon()) {
|
||||
switch (inst->GetItem()->ItemType) {
|
||||
case EQEmu::item::ItemType1HSlash:
|
||||
@@ -7908,7 +7982,7 @@ void Client::GarbleMessage(char *message, uint8 variance)
|
||||
for (size_t i = 0; i < strlen(message); i++) {
|
||||
// Client expects hex values inside of a text link body
|
||||
if (message[i] == delimiter) {
|
||||
if (!(delimiter_count & 1)) { i += EQEmu::constants::SayLinkBodySize; }
|
||||
if (!(delimiter_count & 1)) { i += EQEmu::constants::SAY_LINK_BODY_SIZE; }
|
||||
++delimiter_count;
|
||||
continue;
|
||||
}
|
||||
@@ -8333,17 +8407,17 @@ void Client::TickItemCheck()
|
||||
if(zone->tick_items.empty()) { return; }
|
||||
|
||||
//Scan equip slots for items
|
||||
for (i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; i++)
|
||||
for (i = EQEmu::invslot::EQUIPMENT_BEGIN; i <= EQEmu::invslot::EQUIPMENT_END; i++)
|
||||
{
|
||||
TryItemTick(i);
|
||||
}
|
||||
//Scan main inventory + cursor
|
||||
for (i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::inventory::slotCursor; i++)
|
||||
for (i = EQEmu::invslot::GENERAL_BEGIN; i <= EQEmu::invslot::slotCursor; i++)
|
||||
{
|
||||
TryItemTick(i);
|
||||
}
|
||||
//Scan bags
|
||||
for (i = EQEmu::legacy::GENERAL_BAGS_BEGIN; i <= EQEmu::legacy::CURSOR_BAG_END; i++)
|
||||
for (i = EQEmu::invbag::GENERAL_BAGS_BEGIN; i <= EQEmu::invbag::CURSOR_BAG_END; i++)
|
||||
{
|
||||
TryItemTick(i);
|
||||
}
|
||||
@@ -8359,7 +8433,7 @@ void Client::TryItemTick(int slot)
|
||||
|
||||
if(zone->tick_items.count(iid) > 0)
|
||||
{
|
||||
if (GetLevel() >= zone->tick_items[iid].level && zone->random.Int(0, 100) >= (100 - zone->tick_items[iid].chance) && (zone->tick_items[iid].bagslot || slot <= EQEmu::legacy::EQUIPMENT_END))
|
||||
if (GetLevel() >= zone->tick_items[iid].level && zone->random.Int(0, 100) >= (100 - zone->tick_items[iid].chance) && (zone->tick_items[iid].bagslot || slot <= EQEmu::invslot::EQUIPMENT_END))
|
||||
{
|
||||
EQEmu::ItemInstance* e_inst = (EQEmu::ItemInstance*)inst;
|
||||
parse->EventItem(EVENT_ITEM_TICK, this, e_inst, nullptr, "", slot);
|
||||
@@ -8367,9 +8441,9 @@ void Client::TryItemTick(int slot)
|
||||
}
|
||||
|
||||
//Only look at augs in main inventory
|
||||
if (slot > EQEmu::legacy::EQUIPMENT_END) { return; }
|
||||
if (slot > EQEmu::invslot::EQUIPMENT_END) { return; }
|
||||
|
||||
for (int x = EQEmu::inventory::socketBegin; x < EQEmu::inventory::SocketCount; ++x)
|
||||
for (int x = EQEmu::invaug::SOCKET_BEGIN; x <= EQEmu::invaug::SOCKET_END; ++x)
|
||||
{
|
||||
EQEmu::ItemInstance * a_inst = inst->GetAugment(x);
|
||||
if(!a_inst) { continue; }
|
||||
@@ -8390,17 +8464,17 @@ void Client::TryItemTick(int slot)
|
||||
void Client::ItemTimerCheck()
|
||||
{
|
||||
int i;
|
||||
for (i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; i++)
|
||||
for (i = EQEmu::invslot::EQUIPMENT_BEGIN; i <= EQEmu::invslot::EQUIPMENT_END; i++)
|
||||
{
|
||||
TryItemTimer(i);
|
||||
}
|
||||
|
||||
for (i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::inventory::slotCursor; i++)
|
||||
for (i = EQEmu::invslot::GENERAL_BEGIN; i <= EQEmu::invslot::slotCursor; i++)
|
||||
{
|
||||
TryItemTimer(i);
|
||||
}
|
||||
|
||||
for (i = EQEmu::legacy::GENERAL_BAGS_BEGIN; i <= EQEmu::legacy::CURSOR_BAG_END; i++)
|
||||
for (i = EQEmu::invbag::GENERAL_BAGS_BEGIN; i <= EQEmu::invbag::CURSOR_BAG_END; i++)
|
||||
{
|
||||
TryItemTimer(i);
|
||||
}
|
||||
@@ -8422,11 +8496,11 @@ void Client::TryItemTimer(int slot)
|
||||
++it_iter;
|
||||
}
|
||||
|
||||
if (slot > EQEmu::legacy::EQUIPMENT_END) {
|
||||
if (slot > EQEmu::invslot::EQUIPMENT_END) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int x = EQEmu::inventory::socketBegin; x < EQEmu::inventory::SocketCount; ++x)
|
||||
for (int x = EQEmu::invaug::SOCKET_BEGIN; x <= EQEmu::invaug::SOCKET_END; ++x)
|
||||
{
|
||||
EQEmu::ItemInstance * a_inst = inst->GetAugment(x);
|
||||
if(!a_inst) {
|
||||
@@ -8715,12 +8789,12 @@ void Client::ShowNumHits()
|
||||
int Client::GetQuiverHaste(int delay)
|
||||
{
|
||||
const EQEmu::ItemInstance *pi = nullptr;
|
||||
for (int r = EQEmu::legacy::GENERAL_BEGIN; r <= EQEmu::legacy::GENERAL_END; r++) {
|
||||
for (int r = EQEmu::invslot::GENERAL_BEGIN; r <= EQEmu::invslot::GENERAL_END; r++) {
|
||||
pi = GetInv().GetItem(r);
|
||||
if (pi && pi->IsClassBag() && pi->GetItem()->BagType == EQEmu::item::BagTypeQuiver &&
|
||||
pi->GetItem()->BagWR > 0)
|
||||
break;
|
||||
if (r == EQEmu::legacy::GENERAL_END)
|
||||
if (r == EQEmu::invslot::GENERAL_END)
|
||||
// we will get here if we don't find a valid quiver
|
||||
return 0;
|
||||
}
|
||||
@@ -8760,7 +8834,7 @@ void Client::QuestReward(Mob* target, uint32 copper, uint32 silver, uint32 gold,
|
||||
AddMoneyToPP(copper, silver, gold, platinum, false);
|
||||
|
||||
if (itemid > 0)
|
||||
SummonItem(itemid, 0, 0, 0, 0, 0, 0, false, EQEmu::inventory::slotPowerSource);
|
||||
SummonItem(itemid, 0, 0, 0, 0, 0, 0, false, EQEmu::invslot::slotCursor);
|
||||
|
||||
if (faction)
|
||||
{
|
||||
|
||||
+17
-17
@@ -249,7 +249,7 @@ public:
|
||||
//abstract virtual function implementations required by base abstract class
|
||||
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill);
|
||||
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None);
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::invslot::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
ExtraAttackOptions *opts = nullptr);
|
||||
virtual bool HasRaid() { return (GetRaid() ? true : false); }
|
||||
virtual bool HasGroup() { return (GetGroup() ? true : false); }
|
||||
@@ -803,6 +803,7 @@ public:
|
||||
|
||||
void NPCSpawn(NPC *target_npc, const char *identifier, uint32 extra = 0);
|
||||
|
||||
void Disarm(Client* disarmer, int chance);
|
||||
bool BindWound(Mob* bindmob, bool start, bool fail = false);
|
||||
void SetTradeskillObject(Object* object) { m_tradeskill_object = object; }
|
||||
Object* GetTradeskillObject() { return m_tradeskill_object; }
|
||||
@@ -871,7 +872,7 @@ public:
|
||||
void QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call = false);
|
||||
void PutLootInInventory(int16 slot_id, const EQEmu::ItemInstance &inst, ServerLootItem_Struct** bag_item_data = 0);
|
||||
bool AutoPutLootInInventory(EQEmu::ItemInstance& inst, bool try_worn = false, bool try_cursor = true, ServerLootItem_Struct** bag_item_data = 0);
|
||||
bool SummonItem(uint32 item_id, int16 charges = -1, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, bool attuned = false, uint16 to_slot = EQEmu::inventory::slotCursor, uint32 ornament_icon = 0, uint32 ornament_idfile = 0, uint32 ornament_hero_model = 0);
|
||||
bool SummonItem(uint32 item_id, int16 charges = -1, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, bool attuned = false, uint16 to_slot = EQEmu::invslot::slotCursor, uint32 ornament_icon = 0, uint32 ornament_idfile = 0, uint32 ornament_hero_model = 0);
|
||||
void SetStats(uint8 type,int16 set_val);
|
||||
void IncStats(uint8 type,int16 increase_val);
|
||||
void DropItem(int16 slot_id, bool recurse = true);
|
||||
@@ -1001,16 +1002,17 @@ public:
|
||||
// Task System Methods
|
||||
void LoadClientTaskState();
|
||||
void RemoveClientTaskState();
|
||||
void SendTaskActivityComplete(int TaskID, int ActivityID, int TaskIndex, int TaskIncomplete=1);
|
||||
void SendTaskFailed(int TaskID, int TaskIndex);
|
||||
void SendTaskActivityComplete(int TaskID, int ActivityID, int TaskIndex, TaskType type, int TaskIncomplete=1);
|
||||
void SendTaskFailed(int TaskID, int TaskIndex, TaskType type);
|
||||
void SendTaskComplete(int TaskIndex);
|
||||
inline ClientTaskState *GetTaskState() const { return taskstate; }
|
||||
|
||||
inline void CancelTask(int TaskIndex) { if(taskstate) taskstate->CancelTask(this, TaskIndex); }
|
||||
inline void CancelTask(int TaskIndex, TaskType type) { if(taskstate) taskstate->CancelTask(this, TaskIndex, type); }
|
||||
inline bool SaveTaskState() { return (taskmanager ? taskmanager->SaveClientState(this, taskstate) : false); }
|
||||
inline bool IsTaskStateLoaded() { return taskstate != nullptr; }
|
||||
inline bool IsTaskActive(int TaskID) { return (taskstate ? taskstate->IsTaskActive(TaskID) : false); }
|
||||
inline bool IsTaskActivityActive(int TaskID, int ActivityID) { return (taskstate ? taskstate->IsTaskActivityActive(TaskID, ActivityID) : false); }
|
||||
inline ActivityState GetTaskActivityState(int index, int ActivityID) { return (taskstate ? taskstate->GetTaskActivityState(index, ActivityID) : ActivityHidden); }
|
||||
inline ActivityState GetTaskActivityState(TaskType type, int index, int ActivityID) { return (taskstate ? taskstate->GetTaskActivityState(type, index, ActivityID) : ActivityHidden); }
|
||||
inline void UpdateTaskActivity(int TaskID, int ActivityID, int Count, bool ignore_quest_update = false) { if (taskstate) taskstate->UpdateTaskActivity(this, TaskID, ActivityID, Count, ignore_quest_update); }
|
||||
inline void ResetTaskActivity(int TaskID, int ActivityID) { if(taskstate) taskstate->ResetTaskActivity(this, TaskID, ActivityID); }
|
||||
inline void UpdateTasksOnKill(int NPCTypeID) { if(taskstate) taskstate->UpdateTasksOnKill(this, NPCTypeID); }
|
||||
@@ -1019,6 +1021,7 @@ public:
|
||||
inline bool UpdateTasksOnSpeakWith(int NPCTypeID) { if(taskstate) return taskstate->UpdateTasksOnSpeakWith(this, NPCTypeID); else return false; }
|
||||
inline bool UpdateTasksOnDeliver(std::list<EQEmu::ItemInstance*>& Items, int Cash, int NPCTypeID) { if (taskstate) return taskstate->UpdateTasksOnDeliver(this, Items, Cash, NPCTypeID); else return false; }
|
||||
inline void TaskSetSelector(Mob *mob, int TaskSetID) { if(taskmanager) taskmanager->TaskSetSelector(this, taskstate, mob, TaskSetID); }
|
||||
inline void TaskQuestSetSelector(Mob *mob, int count, int *tasks) { if(taskmanager) taskmanager->TaskQuestSetSelector(this, taskstate, mob, count, tasks); }
|
||||
inline void EnableTask(int TaskCount, int *TaskList) { if(taskstate) taskstate->EnableTask(CharacterID(), TaskCount, TaskList); }
|
||||
inline void DisableTask(int TaskCount, int *TaskList) { if(taskstate) taskstate->DisableTask(CharacterID(), TaskCount, TaskList); }
|
||||
inline bool IsTaskEnabled(int TaskID) { return (taskstate ? taskstate->IsTaskEnabled(TaskID) : false); }
|
||||
@@ -1034,9 +1037,9 @@ public:
|
||||
inline void CancelAllTasks() { if(taskstate) taskstate->CancelAllTasks(this); }
|
||||
inline int GetActiveTaskCount() { return (taskstate ? taskstate->GetActiveTaskCount() : 0); }
|
||||
inline int GetActiveTaskID(int index) { return (taskstate ? taskstate->GetActiveTaskID(index) : -1); }
|
||||
inline int GetTaskStartTime(int index) { return (taskstate ? taskstate->GetTaskStartTime(index) : -1); }
|
||||
inline bool IsTaskActivityCompleted(int index, int ActivityID) { return (taskstate ? taskstate->IsTaskActivityCompleted(index, ActivityID) : false); }
|
||||
inline int GetTaskActivityDoneCount(int ClientTaskIndex, int ActivityID) { return (taskstate ? taskstate->GetTaskActivityDoneCount(ClientTaskIndex, ActivityID) :0); }
|
||||
inline int GetTaskStartTime(TaskType type, int index) { return (taskstate ? taskstate->GetTaskStartTime(type, index) : -1); }
|
||||
inline bool IsTaskActivityCompleted(TaskType type, int index, int ActivityID) { return (taskstate ? taskstate->IsTaskActivityCompleted(type, index, ActivityID) : false); }
|
||||
inline int GetTaskActivityDoneCount(TaskType type, int ClientTaskIndex, int ActivityID) { return (taskstate ? taskstate->GetTaskActivityDoneCount(type, ClientTaskIndex, ActivityID) :0); }
|
||||
inline int GetTaskActivityDoneCountFromTaskID(int TaskID, int ActivityID) { return (taskstate ? taskstate->GetTaskActivityDoneCountFromTaskID(TaskID, ActivityID) :0); }
|
||||
inline int ActiveTasksInSet(int TaskSet) { return (taskstate ? taskstate->ActiveTasksInSet(TaskSet) :0); }
|
||||
inline int CompletedTasksInSet(int TaskSet) { return (taskstate ? taskstate->CompletedTasksInSet(TaskSet) :0); }
|
||||
@@ -1072,7 +1075,7 @@ public:
|
||||
void ClearPendingAdventureData();
|
||||
|
||||
int GetAggroCount();
|
||||
void IncrementAggroCount();
|
||||
void IncrementAggroCount(bool raid_target = false);
|
||||
void DecrementAggroCount();
|
||||
void SendPVPStats();
|
||||
void SendDisciplineTimers();
|
||||
@@ -1096,6 +1099,7 @@ public:
|
||||
|
||||
void MarkSingleCompassLoc(float in_x, float in_y, float in_z, uint8 count=1);
|
||||
|
||||
virtual void Signal(int signal);
|
||||
void CalcItemScale();
|
||||
bool CalcItemScale(uint32 slot_x, uint32 slot_y); // behavior change: 'slot_y' is now [RANGE]_END and not [RANGE]_END + 1
|
||||
void DoItemEnterZone();
|
||||
@@ -1111,7 +1115,6 @@ public:
|
||||
void SuspendMinion();
|
||||
void Doppelganger(uint16 spell_id, Mob *target, const char *name_override, int pet_count, int pet_duration);
|
||||
void NotifyNewTitlesAvailable();
|
||||
void Signal(uint32 data);
|
||||
Mob *GetBindSightTarget() { return bind_sight_target; }
|
||||
void SetBindSightTarget(Mob *n) { bind_sight_target = n; }
|
||||
const uint16 GetBoatID() const { return controlling_boat_id; }
|
||||
@@ -1276,9 +1279,6 @@ public:
|
||||
int mod_food_value(const EQEmu::ItemData *item, int change);
|
||||
int mod_drink_value(const EQEmu::ItemData *item, int change);
|
||||
|
||||
void SetEngagedRaidTarget(bool value) { EngagedRaidTarget = value; }
|
||||
bool GetEngagedRaidTarget() const { return EngagedRaidTarget; }
|
||||
|
||||
void ShowNumHits(); // work around function for numhits not showing on buffs
|
||||
|
||||
void TripInterrogateInvState() { interrogateinv_flag = true; }
|
||||
@@ -1396,6 +1396,9 @@ private:
|
||||
void DoManaRegen();
|
||||
void DoStaminaHungerUpdate();
|
||||
void CalcRestState();
|
||||
// if they have aggro (AggroCount != 0) their timer is saved in m_pp.RestTimer, else we need to get current timer
|
||||
inline uint32 GetRestTimer() const { return AggroCount ? m_pp.RestTimer : rest_timer.GetRemainingTime() / 1000; }
|
||||
void UpdateRestTimer(uint32 new_timer);
|
||||
|
||||
uint32 pLastUpdate;
|
||||
uint32 pLastUpdateWZ;
|
||||
@@ -1563,9 +1566,6 @@ private:
|
||||
float AreaManaRegen;
|
||||
float AreaEndRegen;
|
||||
|
||||
bool EngagedRaidTarget;
|
||||
uint32 SavedRaidRestTimer;
|
||||
|
||||
std::set<uint32> zone_flags;
|
||||
|
||||
ClientTaskState *taskstate;
|
||||
|
||||
@@ -552,7 +552,7 @@ int32 Client::GetRawItemAC()
|
||||
{
|
||||
int32 Total = 0;
|
||||
// this skips MainAmmo..add an '=' conditional if that slot is required (original behavior)
|
||||
for (int16 slot_id = EQEmu::legacy::EQUIPMENT_BEGIN; slot_id < EQEmu::legacy::EQUIPMENT_END; slot_id++) {
|
||||
for (int16 slot_id = EQEmu::invslot::BONUS_BEGIN; slot_id <= EQEmu::invslot::BONUS_STAT_END; slot_id++) {
|
||||
const EQEmu::ItemInstance* inst = m_inv[slot_id];
|
||||
if (inst && inst->IsClassCommon()) {
|
||||
Total += inst->GetItem()->AC;
|
||||
@@ -1319,7 +1319,7 @@ uint32 Client::CalcCurrentWeight()
|
||||
EQEmu::ItemInstance* ins = nullptr;
|
||||
uint32 Total = 0;
|
||||
int x;
|
||||
for (x = EQEmu::legacy::EQUIPMENT_BEGIN; x <= EQEmu::inventory::slotCursor; x++) { // include cursor or not?
|
||||
for (x = EQEmu::invslot::POSSESSIONS_BEGIN; x <= EQEmu::invslot::POSSESSIONS_END; x++) {
|
||||
TempItem = 0;
|
||||
ins = GetInv().GetItem(x);
|
||||
if (ins) {
|
||||
@@ -1329,7 +1329,7 @@ uint32 Client::CalcCurrentWeight()
|
||||
Total += TempItem->Weight;
|
||||
}
|
||||
}
|
||||
for (x = EQEmu::legacy::GENERAL_BAGS_BEGIN; x <= EQEmu::legacy::GENERAL_BAGS_END; x++) { // include cursor bags or not?
|
||||
for (x = EQEmu::invbag::GENERAL_BAGS_BEGIN; x <= EQEmu::invbag::CURSOR_BAG_END; x++) {
|
||||
int TmpWeight = 0;
|
||||
TempItem = 0;
|
||||
ins = GetInv().GetItem(x);
|
||||
@@ -1342,9 +1342,9 @@ uint32 Client::CalcCurrentWeight()
|
||||
if (TmpWeight > 0) {
|
||||
// this code indicates that weight redux bags can only be in the first general inventory slot to be effective...
|
||||
// is this correct? or can we scan for the highest weight redux and use that? (need client verifications)
|
||||
int bagslot = EQEmu::inventory::slotGeneral1;
|
||||
int bagslot = EQEmu::invslot::slotGeneral1;
|
||||
int reduction = 0;
|
||||
for (int m = EQEmu::legacy::GENERAL_BAGS_BEGIN + 10; m <= EQEmu::legacy::GENERAL_BAGS_END; m += 10) { // include cursor bags or not?
|
||||
for (int m = EQEmu::invbag::GENERAL_BAGS_BEGIN + EQEmu::invbag::SLOT_COUNT; m <= EQEmu::invbag::CURSOR_BAG_END; m += EQEmu::invbag::SLOT_COUNT) {
|
||||
if (x >= m) {
|
||||
bagslot += 1;
|
||||
}
|
||||
@@ -2293,12 +2293,12 @@ int Client::GetRawACNoShield(int &shield_ac) const
|
||||
{
|
||||
int ac = itembonuses.AC + spellbonuses.AC + aabonuses.AC;
|
||||
shield_ac = 0;
|
||||
const EQEmu::ItemInstance *inst = m_inv.GetItem(EQEmu::inventory::slotSecondary);
|
||||
const EQEmu::ItemInstance *inst = m_inv.GetItem(EQEmu::invslot::slotSecondary);
|
||||
if (inst) {
|
||||
if (inst->GetItem()->ItemType == EQEmu::item::ItemTypeShield) {
|
||||
ac -= inst->GetItem()->AC;
|
||||
shield_ac = inst->GetItem()->AC;
|
||||
for (uint8 i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
|
||||
for (uint8 i = EQEmu::invaug::SOCKET_BEGIN; i <= EQEmu::invaug::SOCKET_END; i++) {
|
||||
if (inst->GetAugment(i)) {
|
||||
ac -= inst->GetAugment(i)->GetItem()->AC;
|
||||
shield_ac += inst->GetAugment(i)->GetItem()->AC;
|
||||
|
||||
+181
-89
@@ -181,6 +181,7 @@ void MapOpcodes()
|
||||
ConnectedOpcodes[OP_DeleteItem] = &Client::Handle_OP_DeleteItem;
|
||||
ConnectedOpcodes[OP_DeleteSpawn] = &Client::Handle_OP_DeleteSpawn;
|
||||
ConnectedOpcodes[OP_DeleteSpell] = &Client::Handle_OP_DeleteSpell;
|
||||
ConnectedOpcodes[OP_Disarm] = &Client::Handle_OP_Disarm;
|
||||
ConnectedOpcodes[OP_DisarmTraps] = &Client::Handle_OP_DisarmTraps;
|
||||
ConnectedOpcodes[OP_DoGroupLeadershipAbility] = &Client::Handle_OP_DoGroupLeadershipAbility;
|
||||
ConnectedOpcodes[OP_DuelResponse] = &Client::Handle_OP_DuelResponse;
|
||||
@@ -1731,7 +1732,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
|
||||
if (iter == m_inv.cursor_cbegin())
|
||||
continue;
|
||||
const EQEmu::ItemInstance *inst = *iter;
|
||||
SendItemPacket(EQEmu::inventory::slotCursor, inst, ItemPacketLimbo);
|
||||
SendItemPacket(EQEmu::invslot::slotCursor, inst, ItemPacketLimbo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2069,7 +2070,7 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app)
|
||||
EQEmu::ItemInstance *inst = database.CreateItem(item, charges);
|
||||
if (!AutoPutLootInInventory(*inst, true, true))
|
||||
{
|
||||
PutLootInInventory(EQEmu::inventory::slotCursor, *inst);
|
||||
PutLootInInventory(EQEmu::invslot::slotCursor, *inst);
|
||||
}
|
||||
Save(1);
|
||||
}
|
||||
@@ -2603,7 +2604,7 @@ void Client::Handle_OP_AltCurrencyPurchase(const EQApplicationPacket *app)
|
||||
EQEmu::ItemInstance *inst = database.CreateItem(item, charges);
|
||||
if (!AutoPutLootInInventory(*inst, true, true))
|
||||
{
|
||||
PutLootInInventory(EQEmu::inventory::slotCursor, *inst);
|
||||
PutLootInInventory(EQEmu::invslot::slotCursor, *inst);
|
||||
}
|
||||
|
||||
Save(1);
|
||||
@@ -2653,7 +2654,7 @@ void Client::Handle_OP_AltCurrencyReclaim(const EQApplicationPacket *app)
|
||||
SetAlternateCurrencyValue(reclaim->currency_id, 0);
|
||||
}
|
||||
else {
|
||||
SummonItem(item_id, reclaim->count, 0, 0, 0, 0, 0, 0, false, EQEmu::inventory::slotCursor);
|
||||
SummonItem(item_id, reclaim->count, 0, 0, 0, 0, 0, 0, false, EQEmu::invslot::slotCursor);
|
||||
AddAlternateCurrencyValue(reclaim->currency_id, -((int32)reclaim->count));
|
||||
}
|
||||
/* QS: PlayerLogAlternateCurrencyTransactions :: Cursor to Item Storage */
|
||||
@@ -2866,8 +2867,8 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app)
|
||||
|
||||
uint32 ApplyPoisonSuccessResult = 0;
|
||||
ApplyPoison_Struct* ApplyPoisonData = (ApplyPoison_Struct*)app->pBuffer;
|
||||
const EQEmu::ItemInstance* PrimaryWeapon = GetInv().GetItem(EQEmu::inventory::slotPrimary);
|
||||
const EQEmu::ItemInstance* SecondaryWeapon = GetInv().GetItem(EQEmu::inventory::slotSecondary);
|
||||
const EQEmu::ItemInstance* PrimaryWeapon = GetInv().GetItem(EQEmu::invslot::slotPrimary);
|
||||
const EQEmu::ItemInstance* SecondaryWeapon = GetInv().GetItem(EQEmu::invslot::slotSecondary);
|
||||
const EQEmu::ItemInstance* PoisonItemInstance = GetInv()[ApplyPoisonData->inventorySlot];
|
||||
const EQEmu::ItemData* poison=PoisonItemInstance->GetItem();
|
||||
const EQEmu::ItemData* primary=nullptr;
|
||||
@@ -3001,14 +3002,14 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
|
||||
bool deleteItems = false;
|
||||
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
|
||||
{
|
||||
if ((in_augment->container_slot < 0 || in_augment->container_slot >= EQEmu::legacy::SLOT_CURSOR) &&
|
||||
in_augment->container_slot != EQEmu::legacy::SLOT_POWER_SOURCE &&
|
||||
(in_augment->container_slot < EQEmu::legacy::SLOT_PERSONAL_BAGS_BEGIN || in_augment->container_slot > EQEmu::legacy::SLOT_PERSONAL_BAGS_END))
|
||||
if ((in_augment->container_slot < 0 || in_augment->container_slot >= EQEmu::invslot::slotCursor) &&
|
||||
in_augment->container_slot != EQEmu::invslot::SLOT_POWER_SOURCE &&
|
||||
(in_augment->container_slot < EQEmu::invbag::GENERAL_BAGS_BEGIN || in_augment->container_slot > EQEmu::invbag::GENERAL_BAGS_END))
|
||||
{
|
||||
Message(13, "The server does not allow augmentation actions from this slot.");
|
||||
auto cursor_item = m_inv[EQEmu::legacy::SLOT_CURSOR];
|
||||
auto cursor_item = m_inv[EQEmu::invslot::slotCursor];
|
||||
auto augmented_item = m_inv[in_augment->container_slot];
|
||||
SendItemPacket(EQEmu::legacy::SLOT_CURSOR, cursor_item, ItemPacketCharInventory);
|
||||
SendItemPacket(EQEmu::invslot::slotCursor, cursor_item, ItemPacketCharInventory);
|
||||
// this may crash clients on certain slots
|
||||
SendItemPacket(in_augment->container_slot, augmented_item, ItemPacketCharInventory);
|
||||
return;
|
||||
@@ -3083,7 +3084,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
|
||||
{
|
||||
case 0: // Adding an augment
|
||||
case 2: // Swapping augment
|
||||
new_aug = user_inv.GetItem(EQEmu::inventory::slotCursor);
|
||||
new_aug = user_inv.GetItem(EQEmu::invslot::slotCursor);
|
||||
|
||||
if (!new_aug) // Shouldn't get the OP code without the augment on the user's cursor, but maybe it's h4x.
|
||||
{
|
||||
@@ -3141,7 +3142,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
|
||||
if (itemOneToPush)
|
||||
{
|
||||
DeleteItemInInventory(item_slot, 0, true);
|
||||
DeleteItemInInventory(EQEmu::inventory::slotCursor, new_aug->IsStackable() ? 1 : 0, true);
|
||||
DeleteItemInInventory(EQEmu::invslot::slotCursor, new_aug->IsStackable() ? 1 : 0, true);
|
||||
|
||||
if (solvent)
|
||||
{
|
||||
@@ -3152,7 +3153,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
|
||||
if (itemTwoToPush)
|
||||
{
|
||||
// This is a swap. Return the old aug to the player's cursor.
|
||||
if (!PutItemInInventory(EQEmu::inventory::slotCursor, *itemTwoToPush, true))
|
||||
if (!PutItemInInventory(EQEmu::invslot::slotCursor, *itemTwoToPush, true))
|
||||
{
|
||||
Log(Logs::General, Logs::Error, "Problem returning old augment to player's cursor after augmentation swap.");
|
||||
Message(15, "Error: Failed to retrieve old augment after augmentation swap!");
|
||||
@@ -3237,7 +3238,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
|
||||
}
|
||||
|
||||
// Drop the removed augment on the player's cursor
|
||||
if (!PutItemInInventory(EQEmu::inventory::slotCursor, *itemTwoToPush, true))
|
||||
if (!PutItemInInventory(EQEmu::invslot::slotCursor, *itemTwoToPush, true))
|
||||
{
|
||||
Log(Logs::General, Logs::Error, "Problem returning augment to player's cursor after safe removal.");
|
||||
Message(15, "Error: Failed to return augment after removal from item!");
|
||||
@@ -4031,7 +4032,7 @@ void Client::Handle_OP_CancelTask(const EQApplicationPacket *app)
|
||||
CancelTask_Struct *cts = (CancelTask_Struct*)app->pBuffer;
|
||||
|
||||
if (RuleB(TaskSystem, EnableTaskSystem) && taskstate)
|
||||
taskstate->CancelTask(this, cts->SequenceNumber);
|
||||
taskstate->CancelTask(this, cts->SequenceNumber, static_cast<TaskType>(cts->type));
|
||||
}
|
||||
|
||||
void Client::Handle_OP_CancelTrade(const EQApplicationPacket *app)
|
||||
@@ -4175,7 +4176,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app)
|
||||
}
|
||||
else
|
||||
{
|
||||
Message(0, "Error: castspell->inventoryslot >= %i (0x%04x)", EQEmu::inventory::slotCursor, castspell->inventoryslot);
|
||||
Message(0, "Error: castspell->inventoryslot >= %i (0x%04x)", EQEmu::invslot::slotCursor, castspell->inventoryslot);
|
||||
InterruptSpell(castspell->spell_id);
|
||||
}
|
||||
}
|
||||
@@ -4407,8 +4408,7 @@ void Client::Handle_OP_ClientTimeStamp(const EQApplicationPacket *app)
|
||||
return;
|
||||
}
|
||||
|
||||
void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
||||
{
|
||||
void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) {
|
||||
if (IsAIControlled())
|
||||
return;
|
||||
|
||||
@@ -4418,18 +4418,19 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
||||
/* Invalid size check */
|
||||
if (app->size != sizeof(PlayerPositionUpdateClient_Struct)
|
||||
&& app->size != (sizeof(PlayerPositionUpdateClient_Struct) + 1)
|
||||
) {
|
||||
Log(Logs::General, Logs::Error, "OP size error: OP_ClientUpdate expected:%i got:%i", sizeof(PlayerPositionUpdateClient_Struct), app->size);
|
||||
) {
|
||||
Log(Logs::General, Logs::Error, "OP size error: OP_ClientUpdate expected:%i got:%i",
|
||||
sizeof(PlayerPositionUpdateClient_Struct), app->size);
|
||||
return;
|
||||
}
|
||||
|
||||
PlayerPositionUpdateClient_Struct* ppu = (PlayerPositionUpdateClient_Struct*)app->pBuffer;
|
||||
PlayerPositionUpdateClient_Struct *ppu = (PlayerPositionUpdateClient_Struct *) app->pBuffer;
|
||||
|
||||
/* Boat handling */
|
||||
if (ppu->spawn_id != GetID()) {
|
||||
/* If player is controlling boat */
|
||||
if (ppu->spawn_id == controlling_boat_id) {
|
||||
Mob* boat = entity_list.GetMob(controlling_boat_id);
|
||||
Mob *boat = entity_list.GetMob(controlling_boat_id);
|
||||
if (boat == 0) {
|
||||
controlling_boat_id = 0;
|
||||
return;
|
||||
@@ -4437,9 +4438,9 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
||||
|
||||
auto boat_delta = glm::vec4(ppu->delta_x, ppu->delta_y, ppu->delta_z, EQ10toFloat(ppu->delta_heading));
|
||||
boat->SetDelta(boat_delta);
|
||||
|
||||
|
||||
auto outapp = new EQApplicationPacket(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
|
||||
PlayerPositionUpdateServer_Struct* ppus = (PlayerPositionUpdateServer_Struct*)outapp->pBuffer;
|
||||
PlayerPositionUpdateServer_Struct *ppus = (PlayerPositionUpdateServer_Struct *) outapp->pBuffer;
|
||||
boat->MakeSpawnUpdate(ppus);
|
||||
entity_list.QueueCloseClients(boat, outapp, true, 300, this, false);
|
||||
safe_delete(outapp);
|
||||
@@ -4447,16 +4448,15 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
||||
/* Update the boat's position on the server, without sending an update */
|
||||
boat->GMMove(ppu->x_pos, ppu->y_pos, ppu->z_pos, EQ12toFloat(ppu->heading), false);
|
||||
return;
|
||||
}
|
||||
else return;
|
||||
} else return;
|
||||
}
|
||||
|
||||
float dist = 0;
|
||||
float tmp;
|
||||
tmp = m_Position.x - ppu->x_pos;
|
||||
dist += tmp*tmp;
|
||||
dist += tmp * tmp;
|
||||
tmp = m_Position.y - ppu->y_pos;
|
||||
dist += tmp*tmp;
|
||||
dist += tmp * tmp;
|
||||
dist = sqrt(dist);
|
||||
|
||||
/* Hack checks */
|
||||
@@ -4464,29 +4464,28 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
||||
if (m_DistanceSinceLastPositionCheck > 0.0) {
|
||||
uint32 cur_time = Timer::GetCurrentTime();
|
||||
if ((cur_time - m_TimeSinceLastPositionCheck) > 0) {
|
||||
float speed = (m_DistanceSinceLastPositionCheck * 100) / (float)(cur_time - m_TimeSinceLastPositionCheck);
|
||||
float speed =
|
||||
(m_DistanceSinceLastPositionCheck * 100) / (float) (cur_time - m_TimeSinceLastPositionCheck);
|
||||
int runs = GetRunspeed();
|
||||
if (speed > (runs * RuleR(Zone, MQWarpDetectionDistanceFactor))) {
|
||||
if (!GetGMSpeed() && (runs >= GetBaseRunspeed() || (speed > (GetBaseRunspeed() * RuleR(Zone, MQWarpDetectionDistanceFactor))))) {
|
||||
if (!GetGMSpeed() && (runs >= GetBaseRunspeed() ||
|
||||
(speed > (GetBaseRunspeed() * RuleR(Zone, MQWarpDetectionDistanceFactor))))) {
|
||||
if (IsShadowStepExempted()) {
|
||||
if (m_DistanceSinceLastPositionCheck > 800) {
|
||||
CheatDetected(MQWarpShadowStep, ppu->x_pos, ppu->y_pos, ppu->z_pos);
|
||||
}
|
||||
}
|
||||
else if (IsKnockBackExempted()) {
|
||||
} else if (IsKnockBackExempted()) {
|
||||
if (speed > 30.0f) {
|
||||
CheatDetected(MQWarpKnockBack, ppu->x_pos, ppu->y_pos, ppu->z_pos);
|
||||
}
|
||||
}
|
||||
else if (!IsPortExempted()) {
|
||||
} else if (!IsPortExempted()) {
|
||||
if (!IsMQExemptedArea(zone->GetZoneID(), ppu->x_pos, ppu->y_pos, ppu->z_pos)) {
|
||||
if (speed > (runs * 2 * RuleR(Zone, MQWarpDetectionDistanceFactor))) {
|
||||
m_TimeSinceLastPositionCheck = cur_time;
|
||||
m_DistanceSinceLastPositionCheck = 0.0f;
|
||||
CheatDetected(MQWarp, ppu->x_pos, ppu->y_pos, ppu->z_pos);
|
||||
//Death(this, 10000000, SPELL_UNKNOWN, _1H_BLUNT);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
CheatDetected(MQWarpLight, ppu->x_pos, ppu->y_pos, ppu->z_pos);
|
||||
}
|
||||
}
|
||||
@@ -4500,43 +4499,39 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
||||
m_DistanceSinceLastPositionCheck = 0.0f;
|
||||
m_CheatDetectMoved = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
m_TimeSinceLastPositionCheck = Timer::GetCurrentTime();
|
||||
m_CheatDetectMoved = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
m_DistanceSinceLastPositionCheck += dist;
|
||||
m_CheatDetectMoved = true;
|
||||
if (m_TimeSinceLastPositionCheck == 0) {
|
||||
m_TimeSinceLastPositionCheck = Timer::GetCurrentTime();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
uint32 cur_time = Timer::GetCurrentTime();
|
||||
if ((cur_time - m_TimeSinceLastPositionCheck) > 2500) {
|
||||
float speed = (m_DistanceSinceLastPositionCheck * 100) / (float)(cur_time - m_TimeSinceLastPositionCheck);
|
||||
float speed =
|
||||
(m_DistanceSinceLastPositionCheck * 100) / (float) (cur_time - m_TimeSinceLastPositionCheck);
|
||||
int runs = GetRunspeed();
|
||||
if (speed > (runs * RuleR(Zone, MQWarpDetectionDistanceFactor))) {
|
||||
if (!GetGMSpeed() && (runs >= GetBaseRunspeed() || (speed > (GetBaseRunspeed() * RuleR(Zone, MQWarpDetectionDistanceFactor))))) {
|
||||
if (!GetGMSpeed() && (runs >= GetBaseRunspeed() ||
|
||||
(speed > (GetBaseRunspeed() * RuleR(Zone, MQWarpDetectionDistanceFactor))))) {
|
||||
if (IsShadowStepExempted()) {
|
||||
if (m_DistanceSinceLastPositionCheck > 800) {
|
||||
CheatDetected(MQWarpShadowStep, ppu->x_pos, ppu->y_pos, ppu->z_pos);
|
||||
}
|
||||
}
|
||||
else if (IsKnockBackExempted()) {
|
||||
} else if (IsKnockBackExempted()) {
|
||||
if (speed > 30.0f) {
|
||||
CheatDetected(MQWarpKnockBack, ppu->x_pos, ppu->y_pos, ppu->z_pos);
|
||||
}
|
||||
}
|
||||
else if (!IsPortExempted()) {
|
||||
} else if (!IsPortExempted()) {
|
||||
if (!IsMQExemptedArea(zone->GetZoneID(), ppu->x_pos, ppu->y_pos, ppu->z_pos)) {
|
||||
if (speed > (runs * 2 * RuleR(Zone, MQWarpDetectionDistanceFactor))) {
|
||||
m_TimeSinceLastPositionCheck = cur_time;
|
||||
m_DistanceSinceLastPositionCheck = 0.0f;
|
||||
CheatDetected(MQWarp, ppu->x_pos, ppu->y_pos, ppu->z_pos);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
CheatDetected(MQWarpLight, ppu->x_pos, ppu->y_pos, ppu->z_pos);
|
||||
}
|
||||
}
|
||||
@@ -4604,8 +4599,8 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
||||
improved_hidden = false;
|
||||
if (!invisible) {
|
||||
auto outapp =
|
||||
new EQApplicationPacket(OP_SpawnAppearance, sizeof(SpawnAppearance_Struct));
|
||||
SpawnAppearance_Struct* sa_out = (SpawnAppearance_Struct*)outapp->pBuffer;
|
||||
new EQApplicationPacket(OP_SpawnAppearance, sizeof(SpawnAppearance_Struct));
|
||||
SpawnAppearance_Struct *sa_out = (SpawnAppearance_Struct *) outapp->pBuffer;
|
||||
sa_out->spawn_id = GetID();
|
||||
sa_out->type = 0x03;
|
||||
sa_out->parameter = 0;
|
||||
@@ -4620,7 +4615,8 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
||||
is_client_moving = (ppu->y_pos == m_Position.y && ppu->x_pos == m_Position.x) ? false : true;
|
||||
|
||||
if (is_client_moving) {
|
||||
Log(Logs::Detail, Logs::Normal, "ClientUpdate: Client is moving - scan timer is: %u", client_scan_npc_aggro_timer.GetDuration());
|
||||
Log(Logs::Detail, Logs::Normal, "ClientUpdate: Client is moving - scan timer is: %u",
|
||||
client_scan_npc_aggro_timer.GetDuration());
|
||||
if (client_scan_npc_aggro_timer.GetDuration() > 1000) {
|
||||
|
||||
npc_close_scan_timer.Disable();
|
||||
@@ -4630,9 +4626,9 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
||||
client_scan_npc_aggro_timer.Start(500);
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
Log(Logs::Detail, Logs::Normal, "ClientUpdate: Client is NOT moving - scan timer is: %u", client_scan_npc_aggro_timer.GetDuration());
|
||||
} else {
|
||||
Log(Logs::Detail, Logs::Normal, "ClientUpdate: Client is NOT moving - scan timer is: %u",
|
||||
client_scan_npc_aggro_timer.GetDuration());
|
||||
if (client_scan_npc_aggro_timer.GetDuration() < 1000) {
|
||||
|
||||
npc_close_scan_timer.Disable();
|
||||
@@ -4642,7 +4638,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
||||
client_scan_npc_aggro_timer.Start(3000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
float new_heading = EQ12toFloat(ppu->heading);
|
||||
int32 new_animation = ppu->animation;
|
||||
|
||||
@@ -4650,10 +4646,11 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
||||
m_Position.x = ppu->x_pos;
|
||||
m_Position.y = ppu->y_pos;
|
||||
m_Position.z = ppu->z_pos;
|
||||
|
||||
|
||||
/* Visual Debugging */
|
||||
if (RuleB(Character, OPClientUpdateVisualDebug)) {
|
||||
Log(Logs::General, Logs::Debug, "ClientUpdate: ppu x: %f y: %f z: %f h: %u", ppu->x_pos, ppu->y_pos, ppu->z_pos, ppu->heading);
|
||||
Log(Logs::General, Logs::Debug, "ClientUpdate: ppu x: %f y: %f z: %f h: %u", ppu->x_pos, ppu->y_pos, ppu->z_pos,
|
||||
ppu->heading);
|
||||
this->SendAppearanceEffect(78, 0, 0, 0, 0);
|
||||
this->SendAppearanceEffect(41, 0, 0, 0, 0);
|
||||
}
|
||||
@@ -4666,14 +4663,13 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
||||
|
||||
/* Broadcast update to other clients */
|
||||
auto outapp = new EQApplicationPacket(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
|
||||
PlayerPositionUpdateServer_Struct* position_update = (PlayerPositionUpdateServer_Struct*)outapp->pBuffer;
|
||||
PlayerPositionUpdateServer_Struct *position_update = (PlayerPositionUpdateServer_Struct *) outapp->pBuffer;
|
||||
|
||||
MakeSpawnUpdate(position_update);
|
||||
|
||||
if (gm_hide_me) {
|
||||
entity_list.QueueClientsStatus(this, outapp, true, Admin(), 250);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
entity_list.QueueCloseClients(this, outapp, true, RuleI(Range, ClientPositionUpdates), nullptr, true);
|
||||
}
|
||||
|
||||
@@ -4684,8 +4680,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
||||
|
||||
if (raid) {
|
||||
raid->QueueClients(this, outapp, true, true, (RuleI(Range, ClientPositionUpdates) * -1));
|
||||
}
|
||||
else if (group) {
|
||||
} else if (group) {
|
||||
group->QueueClients(this, outapp, true, true, (RuleI(Range, ClientPositionUpdates) * -1));
|
||||
}
|
||||
|
||||
@@ -4693,11 +4688,17 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
||||
}
|
||||
|
||||
if (zone->watermap) {
|
||||
if (zone->watermap->InLiquid(glm::vec3(m_Position)))
|
||||
if (zone->watermap->InLiquid(glm::vec3(m_Position))) {
|
||||
CheckIncreaseSkill(EQEmu::skills::SkillSwimming, nullptr, -17);
|
||||
|
||||
// Dismount horses when entering water
|
||||
if (GetHorseId() && RuleB(Character, DismountWater)) {
|
||||
SetHorseId(0);
|
||||
BuffFadeByEffect(SE_SummonHorse);
|
||||
}
|
||||
}
|
||||
CheckRegionTypeChanges();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5053,7 +5054,7 @@ void Client::Handle_OP_ControlBoat(const EQApplicationPacket *app)
|
||||
FastQueuePacket(&outapp);
|
||||
safe_delete(outapp);
|
||||
// have the boat signal itself, so quests can be triggered by boat use
|
||||
boat->CastToNPC()->SignalNPC(0);
|
||||
boat->Signal(0);
|
||||
}
|
||||
|
||||
void Client::Handle_OP_CorpseDrag(const EQApplicationPacket *app)
|
||||
@@ -5123,7 +5124,7 @@ void Client::Handle_OP_CreateObject(const EQApplicationPacket *app)
|
||||
if (LogSys.log_settings[Logs::Inventory].is_category_enabled)
|
||||
Log(Logs::Detail, Logs::Inventory, "Handle_OP_CreateObject() [psize: %u] %s", app->size, DumpPacketToString(app).c_str());
|
||||
|
||||
DropItem(EQEmu::inventory::slotCursor);
|
||||
DropItem(EQEmu::invslot::slotCursor);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5324,6 +5325,97 @@ void Client::Handle_OP_DeleteSpawn(const EQApplicationPacket *app)
|
||||
return;
|
||||
}
|
||||
|
||||
void Client::Handle_OP_Disarm(const EQApplicationPacket *app) {
|
||||
if (dead || bZoning) return;
|
||||
if (!HasSkill(EQEmu::skills::SkillDisarm))
|
||||
return;
|
||||
|
||||
if (app->size != sizeof(Disarm_Struct)) {
|
||||
Log(Logs::General, Logs::Skills, "Size mismatch for Disarm_Struct packet");
|
||||
return;
|
||||
}
|
||||
|
||||
Disarm_Struct *disarm = (Disarm_Struct *)app->pBuffer;
|
||||
|
||||
if (!p_timers.Expired(&database, pTimerCombatAbility2, false)) {
|
||||
Message(13, "Ability recovery time not yet met.");
|
||||
return;
|
||||
}
|
||||
|
||||
p_timers.Start(pTimerCombatAbility2, 8);
|
||||
|
||||
BreakInvis();
|
||||
Mob* pmob = entity_list.GetMob(disarm->source);
|
||||
Mob* tmob = entity_list.GetMob(disarm->target);
|
||||
if (!pmob || !tmob)
|
||||
return;
|
||||
if (pmob->GetID() != GetID()) {
|
||||
// Client sent a disarm request with an originator ID not matching their own ID.
|
||||
char *hack_str = NULL;
|
||||
MakeAnyLenString(&hack_str, "Player %s (%d) sent OP_Disarm with source ID of: %d", GetCleanName(), GetID(), pmob->GetID());
|
||||
database.SetMQDetectionFlag(this->account_name, this->name, hack_str, zone->GetShortName());
|
||||
safe_delete_array(hack_str);
|
||||
return;
|
||||
}
|
||||
// No disarm on corpses
|
||||
if (tmob->IsCorpse())
|
||||
return;
|
||||
// No target
|
||||
if (!GetTarget())
|
||||
return;
|
||||
// Targets don't match (possible hack, but not flagging)
|
||||
if (GetTarget() != tmob) {
|
||||
return;
|
||||
}
|
||||
// Too far away
|
||||
if (pmob->CalculateDistance(GetTarget()->GetX(), GetTarget()->GetY(), GetTarget()->GetZ()) > 400)
|
||||
return;
|
||||
|
||||
// Can't see mob
|
||||
//if (tmob->BehindMob(pmob))
|
||||
// return;
|
||||
// How can we disarm someone if we are feigned.
|
||||
if (GetFeigned())
|
||||
return;
|
||||
// We can't disarm someone who is feigned.
|
||||
if (tmob->IsClient() && tmob->CastToClient()->GetFeigned())
|
||||
return;
|
||||
if (GetTarget() == tmob && pmob == this->CastToMob() &&
|
||||
disarm->skill == GetSkill(EQEmu::skills::SkillDisarm) && IsAttackAllowed(tmob)) {
|
||||
int p_level = pmob->GetLevel() ? pmob->GetLevel() : 1;
|
||||
int t_level = tmob->GetLevel() ? tmob->GetLevel() : 1;
|
||||
// We have a disarmable target - sucess or fail, we always aggro the mob
|
||||
if (tmob->IsNPC()) {
|
||||
if (!tmob->CheckAggro(pmob)) {
|
||||
zone->AddAggroMob();
|
||||
tmob->AddToHateList(pmob, p_level);
|
||||
}
|
||||
else {
|
||||
tmob->AddToHateList(pmob, p_level / 3);
|
||||
}
|
||||
}
|
||||
int chance = GetSkill(EQEmu::skills::SkillDisarm); // (1% @ 0 skill) (11% @ 200 skill) - against even con
|
||||
chance /= 2;
|
||||
chance += 10;
|
||||
// Modify chance based on level difference
|
||||
float lvl_mod = p_level / t_level;
|
||||
chance *= lvl_mod;
|
||||
if (chance > 300)
|
||||
chance = 300; // max chance of 30%
|
||||
if (tmob->IsNPC()) {
|
||||
tmob->CastToNPC()->Disarm(this, chance);
|
||||
}
|
||||
else if (tmob->IsClient()) {
|
||||
tmob->CastToClient()->Disarm(this, chance);
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Trying to disarm something we can't disarm
|
||||
Message_StringID(MT_Skills, DISARM_NO_TARGET);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void Client::Handle_OP_DeleteSpell(const EQApplicationPacket *app)
|
||||
{
|
||||
if (app->size != sizeof(DeleteSpell_Struct))
|
||||
@@ -7049,7 +7141,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
|
||||
return;
|
||||
}
|
||||
|
||||
EQEmu::ItemInstance *CursorItemInst = GetInv().GetItem(EQEmu::inventory::slotCursor);
|
||||
EQEmu::ItemInstance *CursorItemInst = GetInv().GetItem(EQEmu::invslot::slotCursor);
|
||||
|
||||
bool Allowed = true;
|
||||
|
||||
@@ -7097,7 +7189,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
|
||||
{
|
||||
GuildBankDepositAck(false, sentAction);
|
||||
|
||||
DeleteItemInInventory(EQEmu::inventory::slotCursor, 0, false);
|
||||
DeleteItemInInventory(EQEmu::invslot::slotCursor, 0, false);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -7118,7 +7210,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
|
||||
|
||||
case GuildBankWithdraw:
|
||||
{
|
||||
if (GetInv()[EQEmu::inventory::slotCursor])
|
||||
if (GetInv()[EQEmu::invslot::slotCursor])
|
||||
{
|
||||
Message_StringID(13, GUILD_BANK_EMPTY_HANDS);
|
||||
|
||||
@@ -7164,7 +7256,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
|
||||
{
|
||||
PushItemOnCursor(*inst);
|
||||
|
||||
SendItemPacket(EQEmu::inventory::slotCursor, inst, ItemPacketLimbo);
|
||||
SendItemPacket(EQEmu::invslot::slotCursor, inst, ItemPacketLimbo);
|
||||
|
||||
GuildBanks->DeleteItem(GuildID(), gbwis->Area, gbwis->SlotID, gbwis->Quantity);
|
||||
}
|
||||
@@ -8147,7 +8239,7 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app)
|
||||
const EQEmu::ItemData* item = nullptr;
|
||||
|
||||
int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
|
||||
for (int16 L = EQEmu::legacy::EQUIPMENT_BEGIN; L <= EQEmu::inventory::slotWaist; L++) {
|
||||
for (int16 L = EQEmu::invslot::EQUIPMENT_BEGIN; L <= EQEmu::invslot::slotWaist; L++) {
|
||||
const EQEmu::ItemInstance* inst = GetInv().GetItem(L);
|
||||
item = inst ? inst->GetItem() : nullptr;
|
||||
|
||||
@@ -8167,15 +8259,15 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app)
|
||||
else { insr->itemicons[L] = 0xFFFFFFFF; }
|
||||
}
|
||||
|
||||
const EQEmu::ItemInstance* inst = GetInv().GetItem(EQEmu::inventory::slotAmmo);
|
||||
const EQEmu::ItemInstance* inst = GetInv().GetItem(EQEmu::invslot::slotAmmo);
|
||||
item = inst ? inst->GetItem() : nullptr;
|
||||
|
||||
if (item) {
|
||||
// another one..I did these, didn't I!!?
|
||||
strcpy(insr->itemnames[SoF::invslot::PossessionsAmmo], item->Name);
|
||||
insr->itemicons[SoF::invslot::PossessionsAmmo] = item->Icon;
|
||||
strcpy(insr->itemnames[SoF::invslot::slotAmmo], item->Name);
|
||||
insr->itemicons[SoF::invslot::slotAmmo] = item->Icon;
|
||||
}
|
||||
else { insr->itemicons[SoF::invslot::PossessionsAmmo] = 0xFFFFFFFF; }
|
||||
else { insr->itemicons[SoF::invslot::slotAmmo] = 0xFFFFFFFF; }
|
||||
|
||||
InspectMessage_Struct* newmessage = (InspectMessage_Struct*)insr->text;
|
||||
InspectMessage_Struct& playermessage = this->GetInspectMessage();
|
||||
@@ -8637,7 +8729,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
|
||||
EQEmu::ItemInstance* clickaug = nullptr;
|
||||
EQEmu::ItemData* augitem = nullptr;
|
||||
|
||||
for (r = EQEmu::inventory::socketBegin; r < EQEmu::inventory::SocketCount; r++) {
|
||||
for (r = EQEmu::invaug::SOCKET_BEGIN; r <= EQEmu::invaug::SOCKET_END; r++) {
|
||||
const EQEmu::ItemInstance* aug_i = inst->GetAugment(r);
|
||||
if (!aug_i)
|
||||
continue;
|
||||
@@ -9817,7 +9909,7 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app)
|
||||
MoveItem_Struct* mi = (MoveItem_Struct*)app->pBuffer;
|
||||
if (spellend_timer.Enabled() && casting_spell_id && !IsBardSong(casting_spell_id))
|
||||
{
|
||||
if (mi->from_slot != mi->to_slot && (mi->from_slot <= EQEmu::legacy::GENERAL_END || mi->from_slot > 39) && IsValidSlot(mi->from_slot) && IsValidSlot(mi->to_slot))
|
||||
if (mi->from_slot != mi->to_slot && (mi->from_slot <= EQEmu::invslot::GENERAL_END || mi->from_slot > 39) && IsValidSlot(mi->from_slot) && IsValidSlot(mi->to_slot))
|
||||
{
|
||||
char *detect = nullptr;
|
||||
const EQEmu::ItemInstance *itm_from = GetInv().GetItem(mi->from_slot);
|
||||
@@ -9838,8 +9930,8 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app)
|
||||
// Illegal bagslot usage checks. Currently, user only receives a message if this check is triggered.
|
||||
bool mi_hack = false;
|
||||
|
||||
if (mi->from_slot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && mi->from_slot <= EQEmu::legacy::CURSOR_BAG_END) {
|
||||
if (mi->from_slot >= EQEmu::legacy::CURSOR_BAG_BEGIN) { mi_hack = true; }
|
||||
if (mi->from_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN && mi->from_slot <= EQEmu::invbag::CURSOR_BAG_END) {
|
||||
if (mi->from_slot >= EQEmu::invbag::CURSOR_BAG_BEGIN) { mi_hack = true; }
|
||||
else {
|
||||
int16 from_parent = m_inv.CalcSlotId(mi->from_slot);
|
||||
if (!m_inv[from_parent]) { mi_hack = true; }
|
||||
@@ -9848,8 +9940,8 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app)
|
||||
}
|
||||
}
|
||||
|
||||
if (mi->to_slot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && mi->to_slot <= EQEmu::legacy::CURSOR_BAG_END) {
|
||||
if (mi->to_slot >= EQEmu::legacy::CURSOR_BAG_BEGIN) { mi_hack = true; }
|
||||
if (mi->to_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN && mi->to_slot <= EQEmu::invbag::CURSOR_BAG_END) {
|
||||
if (mi->to_slot >= EQEmu::invbag::CURSOR_BAG_BEGIN) { mi_hack = true; }
|
||||
else {
|
||||
int16 to_parent = m_inv.CalcSlotId(mi->to_slot);
|
||||
if (!m_inv[to_parent]) { mi_hack = true; }
|
||||
@@ -12475,7 +12567,7 @@ void Client::Handle_OP_Shielding(const EQApplicationPacket *app)
|
||||
Shielding_Struct* shield = (Shielding_Struct*)app->pBuffer;
|
||||
shield_target = entity_list.GetMob(shield->target_id);
|
||||
bool ack = false;
|
||||
EQEmu::ItemInstance* inst = GetInv().GetItem(EQEmu::inventory::slotSecondary);
|
||||
EQEmu::ItemInstance* inst = GetInv().GetItem(EQEmu::invslot::slotSecondary);
|
||||
if (!shield_target)
|
||||
return;
|
||||
if (inst)
|
||||
@@ -12687,8 +12779,8 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app)
|
||||
// shouldn't we be reimbursing if these two fail?
|
||||
|
||||
//make sure we are not completely full...
|
||||
if (freeslotid == EQEmu::inventory::slotCursor) {
|
||||
if (m_inv.GetItem(EQEmu::inventory::slotCursor) != nullptr) {
|
||||
if (freeslotid == EQEmu::invslot::slotCursor) {
|
||||
if (m_inv.GetItem(EQEmu::invslot::slotCursor) != nullptr) {
|
||||
Message(13, "You do not have room for any more items.");
|
||||
safe_delete(outapp);
|
||||
safe_delete(inst);
|
||||
@@ -13311,13 +13403,13 @@ void Client::Handle_OP_Split(const EQApplicationPacket *app)
|
||||
//Per the note above, Im not exactly sure what to do on error
|
||||
//to notify the client of the error...
|
||||
if (!isgrouped) {
|
||||
Message(13, "You can not split money if your not in a group.");
|
||||
Message(13, "You can not split money if you're not in a group.");
|
||||
return;
|
||||
}
|
||||
Group *cgroup = GetGroup();
|
||||
if (cgroup == nullptr) {
|
||||
//invalid group, not sure if we should say more...
|
||||
Message(13, "You can not split money if your not in a group.");
|
||||
Message(13, "You can not split money if you're not in a group.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user