mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-06 12:12:25 +00:00
Merge branch 'master' into web_interface
This commit is contained in:
commit
ee8b950df1
@ -1,5 +1,11 @@
|
|||||||
EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
|
== 12/04/2014 ==
|
||||||
|
Kayen: Ranged attacks will now more accurately check MAX firing range, fixing the issue where you would
|
||||||
|
hit ranged attack and nothing would happpen due to incorrect server side range checks.
|
||||||
|
Trevius: Initial addition of the RoF2 client from May 10th 2013 (currently available on Steam as the F2P client).
|
||||||
|
Trevius: RoF2 is disabled by default, but you can enable by editing /common/patches/patches.cpp (see comments)
|
||||||
|
|
||||||
== 12/01/2014 ==
|
== 12/01/2014 ==
|
||||||
Trevius: Mercenaries now spawn as the same Gender and Size of the Merchant they are purchased from.
|
Trevius: Mercenaries now spawn as the same Gender and Size of the Merchant they are purchased from.
|
||||||
Trevius: Mercenaries now spawn with randomized facial features when purchased.
|
Trevius: Mercenaries now spawn with randomized facial features when purchased.
|
||||||
|
|||||||
@ -74,6 +74,7 @@ SET(common_sources
|
|||||||
patches/sod.cpp
|
patches/sod.cpp
|
||||||
patches/sof.cpp
|
patches/sof.cpp
|
||||||
patches/rof.cpp
|
patches/rof.cpp
|
||||||
|
patches/rof2.cpp
|
||||||
patches/titanium.cpp
|
patches/titanium.cpp
|
||||||
patches/underfoot.cpp
|
patches/underfoot.cpp
|
||||||
SocketLib/Base64.cpp
|
SocketLib/Base64.cpp
|
||||||
@ -170,6 +171,7 @@ SET(common_headers
|
|||||||
ptimer.h
|
ptimer.h
|
||||||
queue.h
|
queue.h
|
||||||
races.h
|
races.h
|
||||||
|
random.h
|
||||||
rdtsc.h
|
rdtsc.h
|
||||||
rulesys.h
|
rulesys.h
|
||||||
ruletypes.h
|
ruletypes.h
|
||||||
@ -221,6 +223,11 @@ SET(common_headers
|
|||||||
patches/rof_itemfields.h
|
patches/rof_itemfields.h
|
||||||
patches/rof_ops.h
|
patches/rof_ops.h
|
||||||
patches/rof_structs.h
|
patches/rof_structs.h
|
||||||
|
patches/rof2.h
|
||||||
|
patches/rof2_constants.h
|
||||||
|
patches/rof2_itemfields.h
|
||||||
|
patches/rof2_ops.h
|
||||||
|
patches/rof2_structs.h
|
||||||
patches/titanium.h
|
patches/titanium.h
|
||||||
patches/titanium_constants.h
|
patches/titanium_constants.h
|
||||||
patches/titanium_itemfields.h
|
patches/titanium_itemfields.h
|
||||||
@ -274,6 +281,11 @@ SOURCE_GROUP(Patches FILES
|
|||||||
patches/rof_ops.h
|
patches/rof_ops.h
|
||||||
patches/rof_constants.h
|
patches/rof_constants.h
|
||||||
patches/rof_structs.h
|
patches/rof_structs.h
|
||||||
|
patches/rof2.h
|
||||||
|
patches/rof2_itemfields.h
|
||||||
|
patches/rof2_ops.h
|
||||||
|
patches/rof2_constants.h
|
||||||
|
patches/rof2_structs.h
|
||||||
patches/titanium.h
|
patches/titanium.h
|
||||||
patches/titanium_itemfields.h
|
patches/titanium_itemfields.h
|
||||||
patches/titanium_ops.h
|
patches/titanium_ops.h
|
||||||
@ -289,6 +301,7 @@ SOURCE_GROUP(Patches FILES
|
|||||||
patches/sod.cpp
|
patches/sod.cpp
|
||||||
patches/sof.cpp
|
patches/sof.cpp
|
||||||
patches/rof.cpp
|
patches/rof.cpp
|
||||||
|
patches/rof2.cpp
|
||||||
patches/titanium.cpp
|
patches/titanium.cpp
|
||||||
patches/underfoot.cpp
|
patches/underfoot.cpp
|
||||||
)
|
)
|
||||||
@ -340,7 +353,7 @@ ADD_LIBRARY(common ${common_sources} ${common_headers})
|
|||||||
IF(UNIX)
|
IF(UNIX)
|
||||||
ADD_DEFINITIONS(-fPIC)
|
ADD_DEFINITIONS(-fPIC)
|
||||||
SET_SOURCE_FILES_PROPERTIES("SocketLib/Mime.cpp" PROPERTY COMPILE_FLAGS -Wno-unused-result)
|
SET_SOURCE_FILES_PROPERTIES("SocketLib/Mime.cpp" PROPERTY COMPILE_FLAGS -Wno-unused-result)
|
||||||
SET_SOURCE_FILES_PROPERTIES("patches/sod.cpp" "patches/sof.cpp" "patches/rof.cpp" "patches/underfoot.cpp" PROPERTIES COMPILE_FLAGS -O0)
|
SET_SOURCE_FILES_PROPERTIES("patches/sod.cpp" "patches/sof.cpp" "patches/rof.cpp" "patches/rof2.cpp" "patches/underfoot.cpp" PROPERTIES COMPILE_FLAGS -O0)
|
||||||
ENDIF(UNIX)
|
ENDIF(UNIX)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
179
common/debug.cpp
179
common/debug.cpp
@ -1,7 +1,5 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <cstdarg>
|
|
||||||
#include <time.h>
|
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
@ -19,7 +17,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "string_util.h"
|
|
||||||
#include "misc_functions.h"
|
#include "misc_functions.h"
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
||||||
@ -34,34 +31,37 @@ EQEMuLog *LogFile = &realLogFile;
|
|||||||
static const char* FileNames[EQEMuLog::MaxLogID] = { "logs/eqemu", "logs/eqemu", "logs/eqemu_error", "logs/eqemu_debug", "logs/eqemu_quest", "logs/eqemu_commands", "logs/crash" };
|
static const char* FileNames[EQEMuLog::MaxLogID] = { "logs/eqemu", "logs/eqemu", "logs/eqemu_error", "logs/eqemu_debug", "logs/eqemu_quest", "logs/eqemu_commands", "logs/crash" };
|
||||||
static const char* LogNames[EQEMuLog::MaxLogID] = { "Status", "Normal", "Error", "Debug", "Quest", "Command", "Crash" };
|
static const char* LogNames[EQEMuLog::MaxLogID] = { "Status", "Normal", "Error", "Debug", "Quest", "Command", "Crash" };
|
||||||
|
|
||||||
EQEMuLog::EQEMuLog() {
|
EQEMuLog::EQEMuLog()
|
||||||
|
{
|
||||||
for (int i = 0; i < MaxLogID; i++) {
|
for (int i = 0; i < MaxLogID; i++) {
|
||||||
fp[i] = 0;
|
fp[i] = 0;
|
||||||
logCallbackFmt[i] = nullptr;
|
logCallbackFmt[i] = nullptr;
|
||||||
logCallbackBuf[i] = nullptr;
|
logCallbackBuf[i] = nullptr;
|
||||||
logCallbackPva[i] = nullptr;
|
logCallbackPva[i] = nullptr;
|
||||||
}
|
}
|
||||||
|
pLogStatus[EQEMuLog::LogIDs::Status] = LOG_LEVEL_STATUS;
|
||||||
pLogStatus[Status] = LOG_LEVEL_STATUS;
|
pLogStatus[EQEMuLog::LogIDs::Normal] = LOG_LEVEL_NORMAL;
|
||||||
pLogStatus[Normal] = LOG_LEVEL_NORMAL;
|
pLogStatus[EQEMuLog::LogIDs::Error] = LOG_LEVEL_ERROR;
|
||||||
pLogStatus[Error] = LOG_LEVEL_ERROR;
|
pLogStatus[EQEMuLog::LogIDs::Debug] = LOG_LEVEL_DEBUG;
|
||||||
pLogStatus[Debug] = LOG_LEVEL_DEBUG;
|
pLogStatus[EQEMuLog::LogIDs::Quest] = LOG_LEVEL_QUEST;
|
||||||
pLogStatus[Quest] = LOG_LEVEL_QUEST;
|
pLogStatus[EQEMuLog::LogIDs::Commands] = LOG_LEVEL_COMMANDS;
|
||||||
pLogStatus[Commands] = LOG_LEVEL_COMMANDS;
|
pLogStatus[EQEMuLog::LogIDs::Crash] = LOG_LEVEL_CRASH;
|
||||||
pLogStatus[Crash] = LOG_LEVEL_CRASH;
|
|
||||||
logFileValid = true;
|
logFileValid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEMuLog::~EQEMuLog() {
|
EQEMuLog::~EQEMuLog()
|
||||||
|
{
|
||||||
logFileValid = false;
|
logFileValid = false;
|
||||||
for (int i = 0; i < MaxLogID; i++) {
|
for (int i = 0; i < MaxLogID; i++) {
|
||||||
LockMutex lock(&MLog[i]); //to prevent termination race
|
LockMutex lock(&MLog[i]); //to prevent termination race
|
||||||
if (fp[i])
|
if (fp[i]) {
|
||||||
fclose(fp[i]);
|
fclose(fp[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool EQEMuLog::open(LogIDs id) {
|
bool EQEMuLog::open(LogIDs id)
|
||||||
|
{
|
||||||
if (!logFileValid) {
|
if (!logFileValid) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -76,7 +76,6 @@ bool EQEMuLog::open(LogIDs id) {
|
|||||||
//cerr<<"Warning: LogFile already open"<<endl;
|
//cerr<<"Warning: LogFile already open"<<endl;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
char exename[200] = "";
|
char exename[200] = "";
|
||||||
const EQEmuExePlatform &platform = GetExecutablePlatform();
|
const EQEmuExePlatform &platform = GetExecutablePlatform();
|
||||||
if (platform == ExePlatformWorld) {
|
if (platform == ExePlatformWorld) {
|
||||||
@ -96,7 +95,6 @@ bool EQEMuLog::open(LogIDs id) {
|
|||||||
} else if (platform == ExePlatformClientExport) {
|
} else if (platform == ExePlatformClientExport) {
|
||||||
snprintf(exename, sizeof(exename), "_export");
|
snprintf(exename, sizeof(exename), "_export");
|
||||||
}
|
}
|
||||||
|
|
||||||
char filename[200];
|
char filename[200];
|
||||||
#ifndef NO_PIDLOG
|
#ifndef NO_PIDLOG
|
||||||
snprintf(filename, sizeof(filename), "%s%s_%04i.log", FileNames[id], exename, getpid());
|
snprintf(filename, sizeof(filename), "%s%s_%04i.log", FileNames[id], exename, getpid());
|
||||||
@ -114,7 +112,8 @@ bool EQEMuLog::open(LogIDs id) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEMuLog::write(LogIDs id, const char *fmt, ...) {
|
bool EQEMuLog::write(LogIDs id, const char *fmt, ...)
|
||||||
|
{
|
||||||
if (!logFileValid) {
|
if (!logFileValid) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -125,25 +124,23 @@ bool EQEMuLog::write(LogIDs id, const char *fmt, ...) {
|
|||||||
if (pLogStatus[id] & 1) {
|
if (pLogStatus[id] & 1) {
|
||||||
dofile = open(id);
|
dofile = open(id);
|
||||||
}
|
}
|
||||||
if (!(dofile || pLogStatus[id] & 2))
|
if (!(dofile || pLogStatus[id] & 2)) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
LockMutex lock(&MLog[id]);
|
LockMutex lock(&MLog[id]);
|
||||||
if (!logFileValid)
|
if (!logFileValid) {
|
||||||
return false; //check again for threading race reasons (to avoid two mutexes)
|
return false; //check again for threading race reasons (to avoid two mutexes)
|
||||||
|
}
|
||||||
time_t aclock;
|
time_t aclock;
|
||||||
struct tm *newtime;
|
struct tm *newtime;
|
||||||
|
|
||||||
time( &aclock ); /* Get time in seconds */
|
time( &aclock ); /* Get time in seconds */
|
||||||
newtime = localtime( &aclock ); /* Convert time to struct */
|
newtime = localtime( &aclock ); /* Convert time to struct */
|
||||||
|
|
||||||
if (dofile)
|
if (dofile)
|
||||||
#ifndef NO_PIDLOG
|
#ifndef NO_PIDLOG
|
||||||
fprintf(fp[id], "[%02d.%02d. - %02d:%02d:%02d] ", newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec);
|
fprintf(fp[id], "[%02d.%02d. - %02d:%02d:%02d] ", newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec);
|
||||||
#else
|
#else
|
||||||
fprintf(fp[id], "%04i [%02d.%02d. - %02d:%02d:%02d] ", getpid(), newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec);
|
fprintf(fp[id], "%04i [%02d.%02d. - %02d:%02d:%02d] ", getpid(), newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
va_list argptr, tmpargptr;
|
va_list argptr, tmpargptr;
|
||||||
va_start(argptr, fmt);
|
va_start(argptr, fmt);
|
||||||
if (dofile) {
|
if (dofile) {
|
||||||
@ -159,15 +156,15 @@ bool EQEMuLog::write(LogIDs id, const char *fmt, ...) {
|
|||||||
if (pLogStatus[id] & 8) {
|
if (pLogStatus[id] & 8) {
|
||||||
fprintf(stderr, "[%s] ", LogNames[id]);
|
fprintf(stderr, "[%s] ", LogNames[id]);
|
||||||
vfprintf( stderr, fmt, argptr );
|
vfprintf( stderr, fmt, argptr );
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
fprintf(stdout, "[%s] ", LogNames[id]);
|
fprintf(stdout, "[%s] ", LogNames[id]);
|
||||||
vfprintf( stdout, fmt, argptr );
|
vfprintf( stdout, fmt, argptr );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
if (dofile)
|
if (dofile) {
|
||||||
fprintf(fp[id], "\n");
|
fprintf(fp[id], "\n");
|
||||||
|
}
|
||||||
if (pLogStatus[id] & 2) {
|
if (pLogStatus[id] & 2) {
|
||||||
if (pLogStatus[id] & 8) {
|
if (pLogStatus[id] & 8) {
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
@ -177,13 +174,15 @@ bool EQEMuLog::write(LogIDs id, const char *fmt, ...) {
|
|||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(dofile)
|
if (dofile) {
|
||||||
fflush(fp[id]);
|
fflush(fp[id]);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//write with Prefix and a VA_list
|
//write with Prefix and a VA_list
|
||||||
bool EQEMuLog::writePVA(LogIDs id, const char *prefix, const char *fmt, va_list argptr) {
|
bool EQEMuLog::writePVA(LogIDs id, const char *prefix, const char *fmt, va_list argptr)
|
||||||
|
{
|
||||||
if (!logFileValid) {
|
if (!logFileValid) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -198,17 +197,14 @@ bool EQEMuLog::writePVA(LogIDs id, const char *prefix, const char *fmt, va_list
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
LockMutex lock(&MLog[id]);
|
LockMutex lock(&MLog[id]);
|
||||||
if (!logFileValid)
|
if (!logFileValid) {
|
||||||
return false; //check again for threading race reasons (to avoid two mutexes)
|
return false; //check again for threading race reasons (to avoid two mutexes)
|
||||||
|
}
|
||||||
time_t aclock;
|
time_t aclock;
|
||||||
struct tm *newtime;
|
struct tm *newtime;
|
||||||
|
|
||||||
time( &aclock ); /* Get time in seconds */
|
time( &aclock ); /* Get time in seconds */
|
||||||
newtime = localtime( &aclock ); /* Convert time to struct */
|
newtime = localtime( &aclock ); /* Convert time to struct */
|
||||||
|
|
||||||
va_list tmpargptr;
|
va_list tmpargptr;
|
||||||
|
|
||||||
if (dofile) {
|
if (dofile) {
|
||||||
#ifndef NO_PIDLOG
|
#ifndef NO_PIDLOG
|
||||||
fprintf(fp[id], "[%02d.%02d. - %02d:%02d:%02d] %s", newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec, prefix);
|
fprintf(fp[id], "[%02d.%02d. - %02d:%02d:%02d] %s", newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec, prefix);
|
||||||
@ -227,27 +223,30 @@ bool EQEMuLog::writePVA(LogIDs id, const char *prefix, const char *fmt, va_list
|
|||||||
if (pLogStatus[id] & 8) {
|
if (pLogStatus[id] & 8) {
|
||||||
fprintf(stderr, "[%s] %s", LogNames[id], prefix);
|
fprintf(stderr, "[%s] %s", LogNames[id], prefix);
|
||||||
vfprintf( stderr, fmt, argptr );
|
vfprintf( stderr, fmt, argptr );
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
fprintf(stdout, "[%s] %s", LogNames[id], prefix);
|
fprintf(stdout, "[%s] %s", LogNames[id], prefix);
|
||||||
vfprintf( stdout, fmt, argptr );
|
vfprintf( stdout, fmt, argptr );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
if (dofile)
|
if (dofile) {
|
||||||
fprintf(fp[id], "\n");
|
fprintf(fp[id], "\n");
|
||||||
|
}
|
||||||
if (pLogStatus[id] & 2) {
|
if (pLogStatus[id] & 2) {
|
||||||
if (pLogStatus[id] & 8)
|
if (pLogStatus[id] & 8) {
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
else
|
} else {
|
||||||
fprintf(stdout, "\n");
|
fprintf(stdout, "\n");
|
||||||
}
|
}
|
||||||
if(dofile)
|
}
|
||||||
|
if (dofile) {
|
||||||
fflush(fp[id]);
|
fflush(fp[id]);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEMuLog::writebuf(LogIDs id, const char *buf, uint8 size, uint32 count) {
|
bool EQEMuLog::writebuf(LogIDs id, const char *buf, uint8 size, uint32 count)
|
||||||
|
{
|
||||||
if (!logFileValid) {
|
if (!logFileValid) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -258,25 +257,23 @@ bool EQEMuLog::writebuf(LogIDs id, const char *buf, uint8 size, uint32 count) {
|
|||||||
if (pLogStatus[id] & 1) {
|
if (pLogStatus[id] & 1) {
|
||||||
dofile = open(id);
|
dofile = open(id);
|
||||||
}
|
}
|
||||||
if (!(dofile || pLogStatus[id] & 2))
|
if (!(dofile || pLogStatus[id] & 2)) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
LockMutex lock(&MLog[id]);
|
LockMutex lock(&MLog[id]);
|
||||||
if (!logFileValid)
|
if (!logFileValid) {
|
||||||
return false; //check again for threading race reasons (to avoid two mutexes)
|
return false; //check again for threading race reasons (to avoid two mutexes)
|
||||||
|
}
|
||||||
time_t aclock;
|
time_t aclock;
|
||||||
struct tm *newtime;
|
struct tm *newtime;
|
||||||
|
|
||||||
time( &aclock ); /* Get time in seconds */
|
time( &aclock ); /* Get time in seconds */
|
||||||
newtime = localtime( &aclock ); /* Convert time to struct */
|
newtime = localtime( &aclock ); /* Convert time to struct */
|
||||||
|
|
||||||
if (dofile)
|
if (dofile)
|
||||||
#ifndef NO_PIDLOG
|
#ifndef NO_PIDLOG
|
||||||
fprintf(fp[id], "[%02d.%02d. - %02d:%02d:%02d] ", newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec);
|
fprintf(fp[id], "[%02d.%02d. - %02d:%02d:%02d] ", newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec);
|
||||||
#else
|
#else
|
||||||
fprintf(fp[id], "%04i [%02d.%02d. - %02d:%02d:%02d] ", getpid(), newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec);
|
fprintf(fp[id], "%04i [%02d.%02d. - %02d:%02d:%02d] ", getpid(), newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (dofile) {
|
if (dofile) {
|
||||||
fwrite(buf, size, count, fp[id]);
|
fwrite(buf, size, count, fp[id]);
|
||||||
fprintf(fp[id], "\n");
|
fprintf(fp[id], "\n");
|
||||||
@ -296,12 +293,14 @@ bool EQEMuLog::writebuf(LogIDs id, const char *buf, uint8 size, uint32 count) {
|
|||||||
fprintf(stdout, "\n");
|
fprintf(stdout, "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(dofile)
|
if (dofile) {
|
||||||
fflush(fp[id]);
|
fflush(fp[id]);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEMuLog::writeNTS(LogIDs id, bool dofile, const char *fmt, ...) {
|
bool EQEMuLog::writeNTS(LogIDs id, bool dofile, const char *fmt, ...)
|
||||||
|
{
|
||||||
va_list argptr, tmpargptr;
|
va_list argptr, tmpargptr;
|
||||||
va_start(argptr, fmt);
|
va_start(argptr, fmt);
|
||||||
if (dofile) {
|
if (dofile) {
|
||||||
@ -309,130 +308,144 @@ bool EQEMuLog::writeNTS(LogIDs id, bool dofile, const char *fmt, ...) {
|
|||||||
vfprintf( fp[id], fmt, tmpargptr );
|
vfprintf( fp[id], fmt, tmpargptr );
|
||||||
}
|
}
|
||||||
if (pLogStatus[id] & 2) {
|
if (pLogStatus[id] & 2) {
|
||||||
if (pLogStatus[id] & 8)
|
if (pLogStatus[id] & 8) {
|
||||||
vfprintf( stderr, fmt, argptr );
|
vfprintf( stderr, fmt, argptr );
|
||||||
else
|
} else {
|
||||||
vfprintf( stdout, fmt, argptr );
|
vfprintf( stdout, fmt, argptr );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool EQEMuLog::Dump(LogIDs id, uint8* data, uint32 size, uint32 cols, uint32 skip) {
|
bool EQEMuLog::Dump(LogIDs id, uint8* data, uint32 size, uint32 cols, uint32 skip)
|
||||||
|
{
|
||||||
if (!logFileValid) {
|
if (!logFileValid) {
|
||||||
#if EQDEBUG >= 10
|
#if EQDEBUG >= 10
|
||||||
std::cerr << "Error: Dump() from null pointer" << std::endl;
|
std::cerr << "Error: Dump() from null pointer" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (size == 0)
|
if (size == 0) {
|
||||||
return true;
|
return true;
|
||||||
if (!LogFile)
|
}
|
||||||
|
if (!LogFile) {
|
||||||
return false;
|
return false;
|
||||||
if (id >= MaxLogID)
|
}
|
||||||
|
if (id >= MaxLogID) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
bool dofile = false;
|
bool dofile = false;
|
||||||
if (pLogStatus[id] & 1) {
|
if (pLogStatus[id] & 1) {
|
||||||
dofile = open(id);
|
dofile = open(id);
|
||||||
}
|
}
|
||||||
if (!(dofile || pLogStatus[id] & 2))
|
if (!(dofile || pLogStatus[id] & 2)) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
LockMutex lock(&MLog[id]);
|
LockMutex lock(&MLog[id]);
|
||||||
if (!logFileValid)
|
if (!logFileValid) {
|
||||||
return false; //check again for threading race reasons (to avoid two mutexes)
|
return false; //check again for threading race reasons (to avoid two mutexes)
|
||||||
|
}
|
||||||
write(id, "Dumping Packet: %i", size);
|
write(id, "Dumping Packet: %i", size);
|
||||||
// Output as HEX
|
// Output as HEX
|
||||||
|
|
||||||
int beginningOfLineOffset = 0;
|
int beginningOfLineOffset = 0;
|
||||||
uint32 indexInData;
|
uint32 indexInData;
|
||||||
std::string asciiOutput;
|
std::string asciiOutput;
|
||||||
|
|
||||||
for (indexInData = skip; indexInData < size; indexInData++) {
|
for (indexInData = skip; indexInData < size; indexInData++) {
|
||||||
if ((indexInData - skip) % cols == 0) {
|
if ((indexInData - skip) % cols == 0) {
|
||||||
if (indexInData != skip)
|
if (indexInData != skip) {
|
||||||
writeNTS(id, dofile, " | %s\n", asciiOutput.c_str());
|
writeNTS(id, dofile, " | %s\n", asciiOutput.c_str());
|
||||||
|
}
|
||||||
writeNTS(id, dofile, "%4i: ", indexInData - skip);
|
writeNTS(id, dofile, "%4i: ", indexInData - skip);
|
||||||
asciiOutput.clear();
|
asciiOutput.clear();
|
||||||
beginningOfLineOffset = 0;
|
beginningOfLineOffset = 0;
|
||||||
}
|
} else if ((indexInData - skip) % (cols / 2) == 0) {
|
||||||
else if ((indexInData-skip)%(cols/2) == 0) {
|
|
||||||
writeNTS(id, dofile, "- ");
|
writeNTS(id, dofile, "- ");
|
||||||
}
|
}
|
||||||
writeNTS(id, dofile, "%02X ", (unsigned char)data[indexInData]);
|
writeNTS(id, dofile, "%02X ", (unsigned char)data[indexInData]);
|
||||||
|
if (data[indexInData] >= 32 && data[indexInData] < 127) {
|
||||||
if (data[indexInData] >= 32 && data[indexInData] < 127)
|
|
||||||
{
|
|
||||||
// According to http://msdn.microsoft.com/en-us/library/vstudio/ee404875(v=vs.100).aspx
|
// According to http://msdn.microsoft.com/en-us/library/vstudio/ee404875(v=vs.100).aspx
|
||||||
// Visual Studio 2010 doesn't have std::to_string(int) but it does have the long long
|
// Visual Studio 2010 doesn't have std::to_string(int) but it does have the long long
|
||||||
// version.
|
// version.
|
||||||
asciiOutput.append(std::to_string((long long)data[indexInData]));
|
asciiOutput.append(std::to_string((long long)data[indexInData]));
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
asciiOutput.append(".");
|
asciiOutput.append(".");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
uint32 k = ((indexInData - skip) - 1) % cols;
|
uint32 k = ((indexInData - skip) - 1) % cols;
|
||||||
if (k < 8)
|
if (k < 8) {
|
||||||
writeNTS(id, dofile, " ");
|
writeNTS(id, dofile, " ");
|
||||||
|
}
|
||||||
for (uint32 h = k + 1; h < cols; h++) {
|
for (uint32 h = k + 1; h < cols; h++) {
|
||||||
writeNTS(id, dofile, " ");
|
writeNTS(id, dofile, " ");
|
||||||
}
|
}
|
||||||
writeNTS(id, dofile, " | %s\n", asciiOutput.c_str());
|
writeNTS(id, dofile, " | %s\n", asciiOutput.c_str());
|
||||||
if (dofile)
|
if (dofile) {
|
||||||
fflush(fp[id]);
|
fflush(fp[id]);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEMuLog::SetCallback(LogIDs id, msgCallbackFmt proc) {
|
void EQEMuLog::SetCallback(LogIDs id, msgCallbackFmt proc)
|
||||||
if (!logFileValid)
|
{
|
||||||
|
if (!logFileValid) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
if (id >= MaxLogID) {
|
if (id >= MaxLogID) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
logCallbackFmt[id] = proc;
|
logCallbackFmt[id] = proc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEMuLog::SetCallback(LogIDs id, msgCallbackBuf proc) {
|
void EQEMuLog::SetCallback(LogIDs id, msgCallbackBuf proc)
|
||||||
if (!logFileValid)
|
{
|
||||||
|
if (!logFileValid) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
if (id >= MaxLogID) {
|
if (id >= MaxLogID) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
logCallbackBuf[id] = proc;
|
logCallbackBuf[id] = proc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEMuLog::SetCallback(LogIDs id, msgCallbackPva proc) {
|
void EQEMuLog::SetCallback(LogIDs id, msgCallbackPva proc)
|
||||||
if (!logFileValid)
|
{
|
||||||
|
if (!logFileValid) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
if (id >= MaxLogID) {
|
if (id >= MaxLogID) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
logCallbackPva[id] = proc;
|
logCallbackPva[id] = proc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEMuLog::SetAllCallbacks(msgCallbackFmt proc) {
|
void EQEMuLog::SetAllCallbacks(msgCallbackFmt proc)
|
||||||
if (!logFileValid)
|
{
|
||||||
|
if (!logFileValid) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
int r;
|
int r;
|
||||||
for (r = Status; r < MaxLogID; r++) {
|
for (r = Status; r < MaxLogID; r++) {
|
||||||
SetCallback((LogIDs)r, proc);
|
SetCallback((LogIDs)r, proc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEMuLog::SetAllCallbacks(msgCallbackBuf proc) {
|
void EQEMuLog::SetAllCallbacks(msgCallbackBuf proc)
|
||||||
if (!logFileValid)
|
{
|
||||||
|
if (!logFileValid) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
int r;
|
int r;
|
||||||
for (r = Status; r < MaxLogID; r++) {
|
for (r = Status; r < MaxLogID; r++) {
|
||||||
SetCallback((LogIDs)r, proc);
|
SetCallback((LogIDs)r, proc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQEMuLog::SetAllCallbacks(msgCallbackPva proc) {
|
void EQEMuLog::SetAllCallbacks(msgCallbackPva proc)
|
||||||
if (!logFileValid)
|
{
|
||||||
|
if (!logFileValid) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
int r;
|
int r;
|
||||||
for (r = Status; r < MaxLogID; r++) {
|
for (r = Status; r < MaxLogID; r++) {
|
||||||
SetCallback((LogIDs)r, proc);
|
SetCallback((LogIDs)r, proc);
|
||||||
|
|||||||
@ -74,7 +74,9 @@ N(OP_CharacterCreateRequest),
|
|||||||
N(OP_CharInventory),
|
N(OP_CharInventory),
|
||||||
N(OP_Charm),
|
N(OP_Charm),
|
||||||
N(OP_ChatMessage),
|
N(OP_ChatMessage),
|
||||||
|
N(OP_ClearAA),
|
||||||
N(OP_ClearBlockedBuffs),
|
N(OP_ClearBlockedBuffs),
|
||||||
|
N(OP_ClearLeadershipAbilities),
|
||||||
N(OP_ClearNPCMarks),
|
N(OP_ClearNPCMarks),
|
||||||
N(OP_ClearObject),
|
N(OP_ClearObject),
|
||||||
N(OP_ClearSurname),
|
N(OP_ClearSurname),
|
||||||
|
|||||||
@ -539,7 +539,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
|
|||||||
/*SoD*/ EmuConstants::MAP_POSSESSIONS_SIZE,
|
/*SoD*/ EmuConstants::MAP_POSSESSIONS_SIZE,
|
||||||
/*Underfoot*/ EmuConstants::MAP_POSSESSIONS_SIZE,
|
/*Underfoot*/ EmuConstants::MAP_POSSESSIONS_SIZE,
|
||||||
/*RoF*/ EmuConstants::MAP_POSSESSIONS_SIZE,
|
/*RoF*/ EmuConstants::MAP_POSSESSIONS_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::MAP_POSSESSIONS_SIZE,
|
||||||
|
|
||||||
/*NPC*/ EmuConstants::MAP_POSSESSIONS_SIZE,
|
/*NPC*/ EmuConstants::MAP_POSSESSIONS_SIZE,
|
||||||
/*Merc*/ EmuConstants::MAP_POSSESSIONS_SIZE,
|
/*Merc*/ EmuConstants::MAP_POSSESSIONS_SIZE,
|
||||||
@ -554,7 +554,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
|
|||||||
/*SoD*/ EmuConstants::MAP_BANK_SIZE,
|
/*SoD*/ EmuConstants::MAP_BANK_SIZE,
|
||||||
/*Underfoot*/ EmuConstants::MAP_BANK_SIZE,
|
/*Underfoot*/ EmuConstants::MAP_BANK_SIZE,
|
||||||
/*RoF*/ EmuConstants::MAP_BANK_SIZE,
|
/*RoF*/ EmuConstants::MAP_BANK_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::MAP_BANK_SIZE,
|
||||||
|
|
||||||
/*NPC*/ NOT_USED,
|
/*NPC*/ NOT_USED,
|
||||||
/*Merc*/ NOT_USED,
|
/*Merc*/ NOT_USED,
|
||||||
@ -569,7 +569,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
|
|||||||
/*SoD*/ EmuConstants::MAP_SHARED_BANK_SIZE,
|
/*SoD*/ EmuConstants::MAP_SHARED_BANK_SIZE,
|
||||||
/*Underfoot*/ EmuConstants::MAP_SHARED_BANK_SIZE,
|
/*Underfoot*/ EmuConstants::MAP_SHARED_BANK_SIZE,
|
||||||
/*RoF*/ EmuConstants::MAP_SHARED_BANK_SIZE,
|
/*RoF*/ EmuConstants::MAP_SHARED_BANK_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::MAP_SHARED_BANK_SIZE,
|
||||||
|
|
||||||
/*NPC*/ NOT_USED,
|
/*NPC*/ NOT_USED,
|
||||||
/*Merc*/ NOT_USED,
|
/*Merc*/ NOT_USED,
|
||||||
@ -584,7 +584,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
|
|||||||
/*SoD*/ EmuConstants::MAP_TRADE_SIZE,
|
/*SoD*/ EmuConstants::MAP_TRADE_SIZE,
|
||||||
/*Underfoot*/ EmuConstants::MAP_TRADE_SIZE,
|
/*Underfoot*/ EmuConstants::MAP_TRADE_SIZE,
|
||||||
/*RoF*/ EmuConstants::MAP_TRADE_SIZE,
|
/*RoF*/ EmuConstants::MAP_TRADE_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::MAP_TRADE_SIZE,
|
||||||
|
|
||||||
/*NPC*/ 4,
|
/*NPC*/ 4,
|
||||||
/*Merc*/ 4,
|
/*Merc*/ 4,
|
||||||
@ -599,7 +599,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
|
|||||||
/*SoD*/ EmuConstants::MAP_WORLD_SIZE,
|
/*SoD*/ EmuConstants::MAP_WORLD_SIZE,
|
||||||
/*Underfoot*/ EmuConstants::MAP_WORLD_SIZE,
|
/*Underfoot*/ EmuConstants::MAP_WORLD_SIZE,
|
||||||
/*RoF*/ EmuConstants::MAP_WORLD_SIZE,
|
/*RoF*/ EmuConstants::MAP_WORLD_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::MAP_WORLD_SIZE,
|
||||||
|
|
||||||
/*NPC*/ NOT_USED,
|
/*NPC*/ NOT_USED,
|
||||||
/*Merc*/ NOT_USED,
|
/*Merc*/ NOT_USED,
|
||||||
@ -614,7 +614,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
|
|||||||
/*SoD*/ EmuConstants::MAP_LIMBO_SIZE,
|
/*SoD*/ EmuConstants::MAP_LIMBO_SIZE,
|
||||||
/*Underfoot*/ EmuConstants::MAP_LIMBO_SIZE,
|
/*Underfoot*/ EmuConstants::MAP_LIMBO_SIZE,
|
||||||
/*RoF*/ EmuConstants::MAP_LIMBO_SIZE,
|
/*RoF*/ EmuConstants::MAP_LIMBO_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::MAP_LIMBO_SIZE,
|
||||||
|
|
||||||
/*NPC*/ NOT_USED,
|
/*NPC*/ NOT_USED,
|
||||||
/*Merc*/ NOT_USED,
|
/*Merc*/ NOT_USED,
|
||||||
@ -629,7 +629,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
|
|||||||
/*SoD*/ EmuConstants::MAP_TRIBUTE_SIZE,
|
/*SoD*/ EmuConstants::MAP_TRIBUTE_SIZE,
|
||||||
/*Underfoot*/ EmuConstants::MAP_TRIBUTE_SIZE,
|
/*Underfoot*/ EmuConstants::MAP_TRIBUTE_SIZE,
|
||||||
/*RoF*/ EmuConstants::MAP_TRIBUTE_SIZE,
|
/*RoF*/ EmuConstants::MAP_TRIBUTE_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::MAP_TRIBUTE_SIZE,
|
||||||
|
|
||||||
/*NPC*/ 0,
|
/*NPC*/ 0,
|
||||||
/*Merc*/ 0,
|
/*Merc*/ 0,
|
||||||
@ -644,7 +644,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
|
|||||||
/*SoD*/ 0,
|
/*SoD*/ 0,
|
||||||
/*Underfoot*/ 0,
|
/*Underfoot*/ 0,
|
||||||
/*RoF*/ EmuConstants::MAP_TROPHY_TRIBUTE_SIZE,
|
/*RoF*/ EmuConstants::MAP_TROPHY_TRIBUTE_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::MAP_TROPHY_TRIBUTE_SIZE,
|
||||||
|
|
||||||
/*NPC*/ 0,
|
/*NPC*/ 0,
|
||||||
/*Merc*/ 0,
|
/*Merc*/ 0,
|
||||||
@ -659,7 +659,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
|
|||||||
/*SoD*/ 0,
|
/*SoD*/ 0,
|
||||||
/*Underfoot*/ 0,
|
/*Underfoot*/ 0,
|
||||||
/*RoF*/ EmuConstants::MAP_GUILD_TRIBUTE_SIZE,
|
/*RoF*/ EmuConstants::MAP_GUILD_TRIBUTE_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::MAP_GUILD_TRIBUTE_SIZE,
|
||||||
|
|
||||||
/*NPC*/ 0,
|
/*NPC*/ 0,
|
||||||
/*Merc*/ 0,
|
/*Merc*/ 0,
|
||||||
@ -674,7 +674,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
|
|||||||
/*SoD*/ 0,
|
/*SoD*/ 0,
|
||||||
/*Underfoot*/ 0,
|
/*Underfoot*/ 0,
|
||||||
/*RoF*/ EmuConstants::MAP_MERCHANT_SIZE,
|
/*RoF*/ EmuConstants::MAP_MERCHANT_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::MAP_MERCHANT_SIZE,
|
||||||
|
|
||||||
/*NPC*/ 0,
|
/*NPC*/ 0,
|
||||||
/*Merc*/ 0,
|
/*Merc*/ 0,
|
||||||
@ -689,7 +689,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
|
|||||||
/*SoD*/ 0,
|
/*SoD*/ 0,
|
||||||
/*Underfoot*/ 0,
|
/*Underfoot*/ 0,
|
||||||
/*RoF*/ EmuConstants::MAP_DELETED_SIZE,
|
/*RoF*/ EmuConstants::MAP_DELETED_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::MAP_DELETED_SIZE,
|
||||||
|
|
||||||
/*NPC*/ 0,
|
/*NPC*/ 0,
|
||||||
/*Merc*/ 0,
|
/*Merc*/ 0,
|
||||||
@ -704,7 +704,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
|
|||||||
/*SoD*/ SoD::consts::MAP_CORPSE_SIZE,
|
/*SoD*/ SoD::consts::MAP_CORPSE_SIZE,
|
||||||
/*Underfoot*/ Underfoot::consts::MAP_CORPSE_SIZE,
|
/*Underfoot*/ Underfoot::consts::MAP_CORPSE_SIZE,
|
||||||
/*RoF*/ RoF::consts::MAP_CORPSE_SIZE,
|
/*RoF*/ RoF::consts::MAP_CORPSE_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ RoF2::consts::MAP_CORPSE_SIZE,
|
||||||
|
|
||||||
/*NPC*/ 0,
|
/*NPC*/ 0,
|
||||||
/*Merc*/ 0,
|
/*Merc*/ 0,
|
||||||
@ -719,7 +719,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
|
|||||||
/*SoD*/ EmuConstants::MAP_BAZAAR_SIZE,
|
/*SoD*/ EmuConstants::MAP_BAZAAR_SIZE,
|
||||||
/*Underfoot*/ EmuConstants::MAP_BAZAAR_SIZE,
|
/*Underfoot*/ EmuConstants::MAP_BAZAAR_SIZE,
|
||||||
/*RoF*/ EmuConstants::MAP_BAZAAR_SIZE,
|
/*RoF*/ EmuConstants::MAP_BAZAAR_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::MAP_BAZAAR_SIZE,
|
||||||
|
|
||||||
/*NPC*/ 0, // this may need to be 'EmuConstants::MAP_BAZAAR_SIZE' if offline client traders respawn as an npc
|
/*NPC*/ 0, // this may need to be 'EmuConstants::MAP_BAZAAR_SIZE' if offline client traders respawn as an npc
|
||||||
/*Merc*/ 0,
|
/*Merc*/ 0,
|
||||||
@ -734,7 +734,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
|
|||||||
/*SoD*/ SoD::consts::MAP_INSPECT_SIZE,
|
/*SoD*/ SoD::consts::MAP_INSPECT_SIZE,
|
||||||
/*Underfoot*/ Underfoot::consts::MAP_INSPECT_SIZE,
|
/*Underfoot*/ Underfoot::consts::MAP_INSPECT_SIZE,
|
||||||
/*RoF*/ RoF::consts::MAP_INSPECT_SIZE,
|
/*RoF*/ RoF::consts::MAP_INSPECT_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ RoF2::consts::MAP_INSPECT_SIZE,
|
||||||
|
|
||||||
/*NPC*/ NOT_USED,
|
/*NPC*/ NOT_USED,
|
||||||
/*Merc*/ NOT_USED,
|
/*Merc*/ NOT_USED,
|
||||||
@ -749,7 +749,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
|
|||||||
/*SoD*/ 0,
|
/*SoD*/ 0,
|
||||||
/*Underfoot*/ 0,
|
/*Underfoot*/ 0,
|
||||||
/*RoF*/ EmuConstants::MAP_REAL_ESTATE_SIZE,
|
/*RoF*/ EmuConstants::MAP_REAL_ESTATE_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::MAP_REAL_ESTATE_SIZE,
|
||||||
|
|
||||||
/*NPC*/ 0,
|
/*NPC*/ 0,
|
||||||
/*Merc*/ 0,
|
/*Merc*/ 0,
|
||||||
@ -764,7 +764,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
|
|||||||
/*SoD*/ 0,
|
/*SoD*/ 0,
|
||||||
/*Underfoot*/ 0,
|
/*Underfoot*/ 0,
|
||||||
/*RoF*/ EmuConstants::MAP_VIEW_MOD_PC_SIZE,
|
/*RoF*/ EmuConstants::MAP_VIEW_MOD_PC_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::MAP_VIEW_MOD_PC_SIZE,
|
||||||
|
|
||||||
/*NPC*/ 0,
|
/*NPC*/ 0,
|
||||||
/*Merc*/ 0,
|
/*Merc*/ 0,
|
||||||
@ -779,7 +779,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
|
|||||||
/*SoD*/ 0,
|
/*SoD*/ 0,
|
||||||
/*Underfoot*/ 0,
|
/*Underfoot*/ 0,
|
||||||
/*RoF*/ EmuConstants::MAP_VIEW_MOD_BANK_SIZE,
|
/*RoF*/ EmuConstants::MAP_VIEW_MOD_BANK_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::MAP_VIEW_MOD_BANK_SIZE,
|
||||||
|
|
||||||
/*NPC*/ 0,
|
/*NPC*/ 0,
|
||||||
/*Merc*/ 0,
|
/*Merc*/ 0,
|
||||||
@ -794,7 +794,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
|
|||||||
/*SoD*/ 0,
|
/*SoD*/ 0,
|
||||||
/*Underfoot*/ 0,
|
/*Underfoot*/ 0,
|
||||||
/*RoF*/ EmuConstants::MAP_VIEW_MOD_SHARED_BANK_SIZE,
|
/*RoF*/ EmuConstants::MAP_VIEW_MOD_SHARED_BANK_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::MAP_VIEW_MOD_SHARED_BANK_SIZE,
|
||||||
|
|
||||||
/*NPC*/ 0,
|
/*NPC*/ 0,
|
||||||
/*Merc*/ 0,
|
/*Merc*/ 0,
|
||||||
@ -809,7 +809,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
|
|||||||
/*SoD*/ 0,
|
/*SoD*/ 0,
|
||||||
/*Underfoot*/ 0,
|
/*Underfoot*/ 0,
|
||||||
/*RoF*/ EmuConstants::MAP_VIEW_MOD_LIMBO_SIZE,
|
/*RoF*/ EmuConstants::MAP_VIEW_MOD_LIMBO_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::MAP_VIEW_MOD_LIMBO_SIZE,
|
||||||
|
|
||||||
/*NPC*/ 0,
|
/*NPC*/ 0,
|
||||||
/*Merc*/ 0,
|
/*Merc*/ 0,
|
||||||
@ -824,7 +824,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
|
|||||||
/*SoD*/ 0,
|
/*SoD*/ 0,
|
||||||
/*Underfoot*/ 0,
|
/*Underfoot*/ 0,
|
||||||
/*RoF*/ EmuConstants::MAP_ALT_STORAGE_SIZE,
|
/*RoF*/ EmuConstants::MAP_ALT_STORAGE_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::MAP_ALT_STORAGE_SIZE,
|
||||||
|
|
||||||
/*NPC*/ 0,
|
/*NPC*/ 0,
|
||||||
/*Merc*/ 0,
|
/*Merc*/ 0,
|
||||||
@ -839,7 +839,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
|
|||||||
/*SoD*/ 0,
|
/*SoD*/ 0,
|
||||||
/*Underfoot*/ 0,
|
/*Underfoot*/ 0,
|
||||||
/*RoF*/ EmuConstants::MAP_ARCHIVED_SIZE,
|
/*RoF*/ EmuConstants::MAP_ARCHIVED_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::MAP_ARCHIVED_SIZE,
|
||||||
|
|
||||||
/*NPC*/ 0,
|
/*NPC*/ 0,
|
||||||
/*Merc*/ 0,
|
/*Merc*/ 0,
|
||||||
@ -854,7 +854,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
|
|||||||
/*SoD*/ 0,
|
/*SoD*/ 0,
|
||||||
/*Underfoot*/ 0,
|
/*Underfoot*/ 0,
|
||||||
/*RoF*/ EmuConstants::MAP_MAIL_SIZE,
|
/*RoF*/ EmuConstants::MAP_MAIL_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::MAP_MAIL_SIZE,
|
||||||
|
|
||||||
/*NPC*/ 0,
|
/*NPC*/ 0,
|
||||||
/*Merc*/ 0,
|
/*Merc*/ 0,
|
||||||
@ -869,7 +869,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
|
|||||||
/*SoD*/ 0,
|
/*SoD*/ 0,
|
||||||
/*Underfoot*/ 0,
|
/*Underfoot*/ 0,
|
||||||
/*RoF*/ EmuConstants::MAP_GUILD_TROPHY_TRIBUTE_SIZE,
|
/*RoF*/ EmuConstants::MAP_GUILD_TROPHY_TRIBUTE_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::MAP_GUILD_TROPHY_TRIBUTE_SIZE,
|
||||||
|
|
||||||
/*NPC*/ 0,
|
/*NPC*/ 0,
|
||||||
/*Merc*/ 0,
|
/*Merc*/ 0,
|
||||||
@ -884,7 +884,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
|
|||||||
/*SoD*/ NOT_USED,
|
/*SoD*/ NOT_USED,
|
||||||
/*Underfoot*/ NOT_USED,
|
/*Underfoot*/ NOT_USED,
|
||||||
/*RoF*/ EmuConstants::MAP_KRONO_SIZE,
|
/*RoF*/ EmuConstants::MAP_KRONO_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::MAP_KRONO_SIZE,
|
||||||
|
|
||||||
/*NPC*/ 0,
|
/*NPC*/ 0,
|
||||||
/*Merc*/ 0,
|
/*Merc*/ 0,
|
||||||
@ -899,7 +899,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
|
|||||||
/*SoD*/ 0,
|
/*SoD*/ 0,
|
||||||
/*Underfoot*/ 0,
|
/*Underfoot*/ 0,
|
||||||
/*RoF*/ EmuConstants::MAP_OTHER_SIZE,
|
/*RoF*/ EmuConstants::MAP_OTHER_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::MAP_OTHER_SIZE,
|
||||||
|
|
||||||
/*NPC*/ 0,
|
/*NPC*/ 0,
|
||||||
/*Merc*/ 0,
|
/*Merc*/ 0,
|
||||||
@ -1012,7 +1012,7 @@ bool EQLimits::AllowsEmptyBagInBag(uint32 version) {
|
|||||||
/*SoD*/ SoD::limits::ALLOWS_EMPTY_BAG_IN_BAG,
|
/*SoD*/ SoD::limits::ALLOWS_EMPTY_BAG_IN_BAG,
|
||||||
/*Underfoot*/ Underfoot::limits::ALLOWS_EMPTY_BAG_IN_BAG,
|
/*Underfoot*/ Underfoot::limits::ALLOWS_EMPTY_BAG_IN_BAG,
|
||||||
/*RoF*/ RoF::limits::ALLOWS_EMPTY_BAG_IN_BAG,
|
/*RoF*/ RoF::limits::ALLOWS_EMPTY_BAG_IN_BAG,
|
||||||
/*RoF2*/ false,
|
/*RoF2*/ RoF2::limits::ALLOWS_EMPTY_BAG_IN_BAG,
|
||||||
|
|
||||||
/*NPC*/ false,
|
/*NPC*/ false,
|
||||||
/*Merc*/ false,
|
/*Merc*/ false,
|
||||||
@ -1033,7 +1033,7 @@ bool EQLimits::AllowsClickCastFromBag(uint32 version) {
|
|||||||
/*SoD*/ SoD::limits::ALLOWS_CLICK_CAST_FROM_BAG,
|
/*SoD*/ SoD::limits::ALLOWS_CLICK_CAST_FROM_BAG,
|
||||||
/*Underfoot*/ Underfoot::limits::ALLOWS_CLICK_CAST_FROM_BAG,
|
/*Underfoot*/ Underfoot::limits::ALLOWS_CLICK_CAST_FROM_BAG,
|
||||||
/*RoF*/ RoF::limits::ALLOWS_CLICK_CAST_FROM_BAG,
|
/*RoF*/ RoF::limits::ALLOWS_CLICK_CAST_FROM_BAG,
|
||||||
/*RoF2*/ false,
|
/*RoF2*/ RoF2::limits::ALLOWS_CLICK_CAST_FROM_BAG,
|
||||||
|
|
||||||
/*NPC*/ false,
|
/*NPC*/ false,
|
||||||
/*Merc*/ false,
|
/*Merc*/ false,
|
||||||
@ -1054,7 +1054,7 @@ uint16 EQLimits::ItemCommonSize(uint32 version) {
|
|||||||
/*SoD*/ EmuConstants::ITEM_COMMON_SIZE,
|
/*SoD*/ EmuConstants::ITEM_COMMON_SIZE,
|
||||||
/*Underfoot*/ EmuConstants::ITEM_COMMON_SIZE,
|
/*Underfoot*/ EmuConstants::ITEM_COMMON_SIZE,
|
||||||
/*RoF*/ EmuConstants::ITEM_COMMON_SIZE,
|
/*RoF*/ EmuConstants::ITEM_COMMON_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::ITEM_COMMON_SIZE,
|
||||||
|
|
||||||
/*NPC*/ EmuConstants::ITEM_COMMON_SIZE,
|
/*NPC*/ EmuConstants::ITEM_COMMON_SIZE,
|
||||||
/*Merc*/ EmuConstants::ITEM_COMMON_SIZE,
|
/*Merc*/ EmuConstants::ITEM_COMMON_SIZE,
|
||||||
@ -1074,7 +1074,7 @@ uint16 EQLimits::ItemContainerSize(uint32 version) {
|
|||||||
/*SoD*/ EmuConstants::ITEM_CONTAINER_SIZE,
|
/*SoD*/ EmuConstants::ITEM_CONTAINER_SIZE,
|
||||||
/*Underfoot*/ EmuConstants::ITEM_CONTAINER_SIZE,
|
/*Underfoot*/ EmuConstants::ITEM_CONTAINER_SIZE,
|
||||||
/*RoF*/ EmuConstants::ITEM_CONTAINER_SIZE,
|
/*RoF*/ EmuConstants::ITEM_CONTAINER_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::ITEM_CONTAINER_SIZE,
|
||||||
|
|
||||||
/*NPC*/ EmuConstants::ITEM_CONTAINER_SIZE,
|
/*NPC*/ EmuConstants::ITEM_CONTAINER_SIZE,
|
||||||
/*Merc*/ EmuConstants::ITEM_CONTAINER_SIZE,
|
/*Merc*/ EmuConstants::ITEM_CONTAINER_SIZE,
|
||||||
@ -1094,7 +1094,7 @@ bool EQLimits::CoinHasWeight(uint32 version) {
|
|||||||
/*SoD*/ SoD::limits::COIN_HAS_WEIGHT,
|
/*SoD*/ SoD::limits::COIN_HAS_WEIGHT,
|
||||||
/*Underfoot*/ Underfoot::limits::COIN_HAS_WEIGHT,
|
/*Underfoot*/ Underfoot::limits::COIN_HAS_WEIGHT,
|
||||||
/*RoF*/ RoF::limits::COIN_HAS_WEIGHT,
|
/*RoF*/ RoF::limits::COIN_HAS_WEIGHT,
|
||||||
/*RoF2*/ true,
|
/*RoF2*/ RoF::limits::COIN_HAS_WEIGHT,
|
||||||
|
|
||||||
/*NPC*/ true,
|
/*NPC*/ true,
|
||||||
/*Merc*/ true,
|
/*Merc*/ true,
|
||||||
@ -1114,7 +1114,7 @@ uint32 EQLimits::BandoliersCount(uint32 version) {
|
|||||||
/*SoD*/ EmuConstants::BANDOLIERS_COUNT,
|
/*SoD*/ EmuConstants::BANDOLIERS_COUNT,
|
||||||
/*Underfoot*/ EmuConstants::BANDOLIERS_COUNT,
|
/*Underfoot*/ EmuConstants::BANDOLIERS_COUNT,
|
||||||
/*RoF*/ EmuConstants::BANDOLIERS_COUNT,
|
/*RoF*/ EmuConstants::BANDOLIERS_COUNT,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::BANDOLIERS_COUNT,
|
||||||
|
|
||||||
/*NPC*/ NOT_USED,
|
/*NPC*/ NOT_USED,
|
||||||
/*Merc*/ NOT_USED,
|
/*Merc*/ NOT_USED,
|
||||||
@ -1134,7 +1134,7 @@ uint32 EQLimits::BandolierSize(uint32 version) {
|
|||||||
/*SoD*/ EmuConstants::BANDOLIER_SIZE,
|
/*SoD*/ EmuConstants::BANDOLIER_SIZE,
|
||||||
/*Underfoot*/ EmuConstants::BANDOLIER_SIZE,
|
/*Underfoot*/ EmuConstants::BANDOLIER_SIZE,
|
||||||
/*RoF*/ EmuConstants::BANDOLIER_SIZE,
|
/*RoF*/ EmuConstants::BANDOLIER_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::BANDOLIER_SIZE,
|
||||||
|
|
||||||
/*NPC*/ NOT_USED,
|
/*NPC*/ NOT_USED,
|
||||||
/*Merc*/ NOT_USED,
|
/*Merc*/ NOT_USED,
|
||||||
@ -1154,7 +1154,7 @@ uint32 EQLimits::PotionBeltSize(uint32 version) {
|
|||||||
/*SoD*/ EmuConstants::POTION_BELT_SIZE,
|
/*SoD*/ EmuConstants::POTION_BELT_SIZE,
|
||||||
/*Underfoot*/ EmuConstants::POTION_BELT_SIZE,
|
/*Underfoot*/ EmuConstants::POTION_BELT_SIZE,
|
||||||
/*RoF*/ EmuConstants::POTION_BELT_SIZE,
|
/*RoF*/ EmuConstants::POTION_BELT_SIZE,
|
||||||
/*RoF2*/ 0,
|
/*RoF2*/ EmuConstants::POTION_BELT_SIZE,
|
||||||
|
|
||||||
/*NPC*/ NOT_USED,
|
/*NPC*/ NOT_USED,
|
||||||
/*Merc*/ NOT_USED,
|
/*Merc*/ NOT_USED,
|
||||||
|
|||||||
@ -32,7 +32,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
#include "../common/patches/sod_constants.h"
|
#include "../common/patches/sod_constants.h"
|
||||||
#include "../common/patches/underfoot_constants.h"
|
#include "../common/patches/underfoot_constants.h"
|
||||||
#include "../common/patches/rof_constants.h"
|
#include "../common/patches/rof_constants.h"
|
||||||
//#include "../common/patches/rof2_constants.h"
|
#include "../common/patches/rof2_constants.h"
|
||||||
|
|
||||||
// *** DO NOT CHANGE without a full understanding of the consequences..the server is set up to use these settings explicitly!! ***
|
// *** DO NOT CHANGE without a full understanding of the consequences..the server is set up to use these settings explicitly!! ***
|
||||||
// *** You will cause compilation failures and corrupt your database if partial or incorrect attempts to change them are made!! ***
|
// *** You will cause compilation failures and corrupt your database if partial or incorrect attempts to change them are made!! ***
|
||||||
|
|||||||
@ -54,20 +54,6 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static bool WELLRNG_init = false;
|
|
||||||
static int state_i = 0;
|
|
||||||
static unsigned int STATE[R];
|
|
||||||
static unsigned int z0, z1, z2;
|
|
||||||
unsigned int (*WELLRNG19937)(void);
|
|
||||||
static unsigned int case_1 (void);
|
|
||||||
static unsigned int case_2 (void);
|
|
||||||
static unsigned int case_3 (void);
|
|
||||||
static unsigned int case_4 (void);
|
|
||||||
static unsigned int case_5 (void);
|
|
||||||
static unsigned int case_6 (void);
|
|
||||||
uint32 rnd_hash(time_t t, clock_t c);
|
|
||||||
void oneseed(const uint32 seed);
|
|
||||||
|
|
||||||
void CoutTimestamp(bool ms) {
|
void CoutTimestamp(bool ms) {
|
||||||
time_t rawtime;
|
time_t rawtime;
|
||||||
struct tm* gmt_t;
|
struct tm* gmt_t;
|
||||||
@ -179,41 +165,6 @@ const char * itoa(int num, char* a,int b) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
* generate a random integer in the range low-high this
|
|
||||||
* should be used instead of the rand()%limit method
|
|
||||||
*/
|
|
||||||
int MakeRandomInt(int low, int high)
|
|
||||||
{
|
|
||||||
if(low >= high)
|
|
||||||
return(low);
|
|
||||||
|
|
||||||
//return (rand()%(high-low+1) + (low));
|
|
||||||
if(!WELLRNG_init) {
|
|
||||||
WELLRNG_init = true;
|
|
||||||
oneseed( rnd_hash( time(nullptr), clock() ) );
|
|
||||||
WELLRNG19937 = case_1;
|
|
||||||
}
|
|
||||||
unsigned int randomnum = ((WELLRNG19937)());
|
|
||||||
if(randomnum == 0xffffffffUL)
|
|
||||||
return high;
|
|
||||||
return int ((randomnum / (double)0xffffffffUL) * (high - low + 1) + low);
|
|
||||||
}
|
|
||||||
|
|
||||||
double MakeRandomFloat(double low, double high)
|
|
||||||
{
|
|
||||||
if(low >= high)
|
|
||||||
return(low);
|
|
||||||
|
|
||||||
//return (rand() / (double)RAND_MAX * (high - low) + low);
|
|
||||||
if(!WELLRNG_init) {
|
|
||||||
WELLRNG_init = true;
|
|
||||||
oneseed( rnd_hash( time(nullptr), clock() ) );
|
|
||||||
WELLRNG19937 = case_1;
|
|
||||||
}
|
|
||||||
return ((WELLRNG19937)() / (double)0xffffffffUL * (high - low) + low);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32 rnd_hash( time_t t, clock_t c )
|
uint32 rnd_hash( time_t t, clock_t c )
|
||||||
{
|
{
|
||||||
// Get a uint32 from t and c
|
// Get a uint32 from t and c
|
||||||
@ -239,111 +190,6 @@ uint32 rnd_hash( time_t t, clock_t c )
|
|||||||
return ( h1 + differ++ ) ^ h2;
|
return ( h1 + differ++ ) ^ h2;
|
||||||
}
|
}
|
||||||
|
|
||||||
void oneseed( const uint32 seed )
|
|
||||||
{
|
|
||||||
// Initialize generator state with seed
|
|
||||||
// See Knuth TAOCP Vol 2, 3rd Ed, p.106 for multiplier.
|
|
||||||
// In previous versions, most significant bits (MSBs) of the seed affect
|
|
||||||
// only MSBs of the state array. Modified 9 Jan 2002 by Makoto Matsumoto.
|
|
||||||
register int j = 0;
|
|
||||||
STATE[j] = seed & 0xffffffffUL;
|
|
||||||
for (j = 1; j < R; j++)
|
|
||||||
{
|
|
||||||
STATE[j] = ( 1812433253UL * ( STATE[j-1] ^ (STATE[j-1] >> 30) ) + j ) & 0xffffffffUL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// WELL RNG code
|
|
||||||
|
|
||||||
/* ***************************************************************************** */
|
|
||||||
/* Copyright: Francois Panneton and Pierre L'Ecuyer, University of Montreal */
|
|
||||||
/* Makoto Matsumoto, Hiroshima University */
|
|
||||||
/* Notice: This code can be used freely for personal, academic, */
|
|
||||||
/* or non-commercial purposes. For commercial purposes, */
|
|
||||||
/* please contact P. L'Ecuyer at: lecuyer@iro.UMontreal.ca */
|
|
||||||
/* A modified "maximally equidistributed" implementation */
|
|
||||||
/* by Shin Harase, Hiroshima University. */
|
|
||||||
/* ***************************************************************************** */
|
|
||||||
|
|
||||||
unsigned int case_1 (void){
|
|
||||||
// state_i == 0
|
|
||||||
z0 = (VRm1Under & MASKL) | (VRm2Under & MASKU);
|
|
||||||
z1 = MAT0NEG (-25, V0) ^ MAT0POS (27, VM1);
|
|
||||||
z2 = MAT3POS (9, VM2) ^ MAT0POS (1, VM3);
|
|
||||||
newV1 = z1 ^ z2;
|
|
||||||
newV0Under = MAT1 (z0) ^ MAT0NEG (-9, z1) ^ MAT0NEG (-21, z2) ^ MAT0POS (21, newV1);
|
|
||||||
state_i = R - 1;
|
|
||||||
WELLRNG19937 = case_3;
|
|
||||||
return (STATE[state_i] ^ (newVM2Over & BITMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned int case_2 (void){
|
|
||||||
// state_i == 1
|
|
||||||
z0 = (VRm1 & MASKL) | (VRm2Under & MASKU);
|
|
||||||
z1 = MAT0NEG (-25, V0) ^ MAT0POS (27, VM1);
|
|
||||||
z2 = MAT3POS (9, VM2) ^ MAT0POS (1, VM3);
|
|
||||||
newV1 = z1 ^ z2;
|
|
||||||
newV0 = MAT1 (z0) ^ MAT0NEG (-9, z1) ^ MAT0NEG (-21, z2) ^ MAT0POS (21, newV1);
|
|
||||||
state_i = 0;
|
|
||||||
WELLRNG19937 = case_1;
|
|
||||||
return (STATE[state_i] ^ (newVM2 & BITMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned int case_3 (void){
|
|
||||||
// state_i+M1 >= R
|
|
||||||
z0 = (VRm1 & MASKL) | (VRm2 & MASKU);
|
|
||||||
z1 = MAT0NEG (-25, V0) ^ MAT0POS (27, VM1Over);
|
|
||||||
z2 = MAT3POS (9, VM2Over) ^ MAT0POS (1, VM3Over);
|
|
||||||
newV1 = z1 ^ z2;
|
|
||||||
newV0 = MAT1 (z0) ^ MAT0NEG (-9, z1) ^ MAT0NEG (-21, z2) ^ MAT0POS (21, newV1);
|
|
||||||
state_i--;
|
|
||||||
if (state_i + M1 < R)
|
|
||||||
WELLRNG19937 = case_5;
|
|
||||||
return (STATE[state_i] ^ (newVM2Over & BITMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned int case_4 (void){
|
|
||||||
// state_i+M3 >= R
|
|
||||||
z0 = (VRm1 & MASKL) | (VRm2 & MASKU);
|
|
||||||
z1 = MAT0NEG (-25, V0) ^ MAT0POS (27, VM1);
|
|
||||||
z2 = MAT3POS (9, VM2) ^ MAT0POS (1, VM3Over);
|
|
||||||
newV1 = z1 ^ z2;
|
|
||||||
newV0 = MAT1 (z0) ^ MAT0NEG (-9, z1) ^ MAT0NEG (-21, z2) ^ MAT0POS (21, newV1);
|
|
||||||
state_i--;
|
|
||||||
if (state_i + M3 < R)
|
|
||||||
WELLRNG19937 = case_6;
|
|
||||||
return (STATE[state_i] ^ (newVM2 & BITMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned int case_5 (void){
|
|
||||||
// state_i+M2 >= R
|
|
||||||
z0 = (VRm1 & MASKL) | (VRm2 & MASKU);
|
|
||||||
z1 = MAT0NEG (-25, V0) ^ MAT0POS (27, VM1);
|
|
||||||
z2 = MAT3POS (9, VM2Over) ^ MAT0POS (1, VM3Over);
|
|
||||||
newV1 = z1 ^ z2;
|
|
||||||
newV0 = MAT1 (z0) ^ MAT0NEG (-9, z1) ^ MAT0NEG (-21, z2) ^ MAT0POS (21, newV1);
|
|
||||||
state_i--;
|
|
||||||
if (state_i + M2 < R)
|
|
||||||
WELLRNG19937 = case_4;
|
|
||||||
return (STATE[state_i] ^ (newVM2Over & BITMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned int case_6 (void){
|
|
||||||
// 2 <= state_i <= (R - M3 - 1)
|
|
||||||
z0 = (VRm1 & MASKL) | (VRm2 & MASKU);
|
|
||||||
z1 = MAT0NEG (-25, V0) ^ MAT0POS (27, VM1);
|
|
||||||
z2 = MAT3POS (9, VM2) ^ MAT0POS (1, VM3);
|
|
||||||
newV1 = z1 ^ z2;
|
|
||||||
newV0 = MAT1 (z0) ^ MAT0NEG (-9, z1) ^ MAT0NEG (-21, z2) ^ MAT0POS (21, newV1);
|
|
||||||
state_i--;
|
|
||||||
if (state_i == 1)
|
|
||||||
WELLRNG19937 = case_2;
|
|
||||||
return (STATE[state_i] ^ (newVM2 & BITMASK));
|
|
||||||
}
|
|
||||||
|
|
||||||
// end WELL RNG code
|
|
||||||
|
|
||||||
|
|
||||||
float EQ13toFloat(int d)
|
float EQ13toFloat(int d)
|
||||||
{
|
{
|
||||||
return ( float(d)/float(1<<2));
|
return ( float(d)/float(1<<2));
|
||||||
|
|||||||
@ -92,8 +92,6 @@ int32 filesize(FILE* fp);
|
|||||||
uint32 ResolveIP(const char* hostname, char* errbuf = 0);
|
uint32 ResolveIP(const char* hostname, char* errbuf = 0);
|
||||||
bool ParseAddress(const char* iAddress, uint32* oIP, uint16* oPort, char* errbuf = 0);
|
bool ParseAddress(const char* iAddress, uint32* oIP, uint16* oPort, char* errbuf = 0);
|
||||||
void CoutTimestamp(bool ms = true);
|
void CoutTimestamp(bool ms = true);
|
||||||
int MakeRandomInt(int low, int high);
|
|
||||||
double MakeRandomFloat(double low, double high);
|
|
||||||
float EQ13toFloat(int d);
|
float EQ13toFloat(int d);
|
||||||
float NewEQ13toFloat(int d);
|
float NewEQ13toFloat(int d);
|
||||||
float EQ19toFloat(int d);
|
float EQ19toFloat(int d);
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
#include "sof.h"
|
#include "sof.h"
|
||||||
#include "sod.h"
|
#include "sod.h"
|
||||||
#include "rof.h"
|
#include "rof.h"
|
||||||
//#include "rof2.h"
|
#include "rof2.h"
|
||||||
|
|
||||||
void RegisterAllPatches(EQStreamIdentifier &into) {
|
void RegisterAllPatches(EQStreamIdentifier &into) {
|
||||||
Client62::Register(into);
|
Client62::Register(into);
|
||||||
@ -17,7 +17,7 @@ void RegisterAllPatches(EQStreamIdentifier &into) {
|
|||||||
SoD::Register(into);
|
SoD::Register(into);
|
||||||
Underfoot::Register(into);
|
Underfoot::Register(into);
|
||||||
RoF::Register(into);
|
RoF::Register(into);
|
||||||
//RoF2::Register(into);
|
RoF2::Register(into);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReloadAllPatches() {
|
void ReloadAllPatches() {
|
||||||
@ -27,5 +27,5 @@ void ReloadAllPatches() {
|
|||||||
SoD::Reload();
|
SoD::Reload();
|
||||||
Underfoot::Reload();
|
Underfoot::Reload();
|
||||||
RoF::Reload();
|
RoF::Reload();
|
||||||
//RoF2::Reload();
|
RoF2::Reload();
|
||||||
}
|
}
|
||||||
|
|||||||
5677
common/patches/rof2.cpp
Normal file
5677
common/patches/rof2.cpp
Normal file
File diff suppressed because it is too large
Load Diff
37
common/patches/rof2.h
Normal file
37
common/patches/rof2.h
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
#ifndef RoF2_H_
|
||||||
|
#define RoF2_H_
|
||||||
|
|
||||||
|
#include "../struct_strategy.h"
|
||||||
|
|
||||||
|
class EQStreamIdentifier;
|
||||||
|
|
||||||
|
namespace RoF2 {
|
||||||
|
|
||||||
|
//these are the only public member of this namespace.
|
||||||
|
extern void Register(EQStreamIdentifier &into);
|
||||||
|
extern void Reload();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//you should not directly access anything below..
|
||||||
|
//I just dont feel like making a seperate header for it.
|
||||||
|
|
||||||
|
class Strategy : public StructStrategy {
|
||||||
|
public:
|
||||||
|
Strategy();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
virtual std::string Describe() const;
|
||||||
|
virtual const EQClientVersion ClientVersion() const;
|
||||||
|
|
||||||
|
//magic macro to declare our opcode processors
|
||||||
|
#include "ss_declare.h"
|
||||||
|
#include "rof2_ops.h"
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /*RoF2_H_*/
|
||||||
217
common/patches/rof2_constants.h
Normal file
217
common/patches/rof2_constants.h
Normal file
@ -0,0 +1,217 @@
|
|||||||
|
/*
|
||||||
|
EQEMu: Everquest Server Emulator
|
||||||
|
|
||||||
|
Copyright (C) 2001-2014 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 RoF2_CONSTANTS_H_
|
||||||
|
#define RoF2_CONSTANTS_H_
|
||||||
|
|
||||||
|
#include "../types.h"
|
||||||
|
|
||||||
|
namespace RoF2 {
|
||||||
|
namespace maps {
|
||||||
|
typedef enum : int16 {
|
||||||
|
MapPossessions = 0,
|
||||||
|
MapBank,
|
||||||
|
MapSharedBank,
|
||||||
|
MapTrade,
|
||||||
|
MapWorld,
|
||||||
|
MapLimbo,
|
||||||
|
MapTribute,
|
||||||
|
MapTrophyTribute,
|
||||||
|
MapGuildTribute,
|
||||||
|
MapMerchant,
|
||||||
|
MapDeleted,
|
||||||
|
MapCorpse,
|
||||||
|
MapBazaar,
|
||||||
|
MapInspect,
|
||||||
|
MapRealEstate,
|
||||||
|
MapViewMODPC,
|
||||||
|
MapViewMODBank,
|
||||||
|
MapViewMODSharedBank,
|
||||||
|
MapViewMODLimbo,
|
||||||
|
MapAltStorage,
|
||||||
|
MapArchived,
|
||||||
|
MapMail,
|
||||||
|
MapGuildTrophyTribute,
|
||||||
|
MapKrono,
|
||||||
|
MapOther,
|
||||||
|
_MapCount
|
||||||
|
} InventoryMaps;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace slots {
|
||||||
|
typedef enum : int16 {
|
||||||
|
MainCharm = 0,
|
||||||
|
MainEar1,
|
||||||
|
MainHead,
|
||||||
|
MainFace,
|
||||||
|
MainEar2,
|
||||||
|
MainNeck,
|
||||||
|
MainShoulders,
|
||||||
|
MainArms,
|
||||||
|
MainBack,
|
||||||
|
MainWrist1,
|
||||||
|
MainWrist2,
|
||||||
|
MainRange,
|
||||||
|
MainHands,
|
||||||
|
MainPrimary,
|
||||||
|
MainSecondary,
|
||||||
|
MainFinger1,
|
||||||
|
MainFinger2,
|
||||||
|
MainChest,
|
||||||
|
MainLegs,
|
||||||
|
MainFeet,
|
||||||
|
MainWaist,
|
||||||
|
MainPowerSource,
|
||||||
|
MainAmmo,
|
||||||
|
MainGeneral1,
|
||||||
|
MainGeneral2,
|
||||||
|
MainGeneral3,
|
||||||
|
MainGeneral4,
|
||||||
|
MainGeneral5,
|
||||||
|
MainGeneral6,
|
||||||
|
MainGeneral7,
|
||||||
|
MainGeneral8,
|
||||||
|
MainGeneral9,
|
||||||
|
MainGeneral10,
|
||||||
|
MainCursor,
|
||||||
|
_MainCount,
|
||||||
|
_MainEquipmentBegin = MainCharm,
|
||||||
|
_MainEquipmentEnd = MainAmmo,
|
||||||
|
_MainEquipmentCount = (_MainEquipmentEnd - _MainEquipmentBegin + 1),
|
||||||
|
_MainGeneralBegin = MainGeneral1,
|
||||||
|
_MainGeneralEnd = MainGeneral10,
|
||||||
|
_MainGeneralCount = (_MainGeneralEnd - _MainGeneralBegin + 1)
|
||||||
|
} EquipmentSlots;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace consts {
|
||||||
|
static const uint16 MAP_POSSESSIONS_SIZE = slots::_MainCount;
|
||||||
|
static const uint16 MAP_BANK_SIZE = 24;
|
||||||
|
static const uint16 MAP_SHARED_BANK_SIZE = 2;
|
||||||
|
static const uint16 MAP_TRADE_SIZE = 8;
|
||||||
|
static const uint16 MAP_WORLD_SIZE = 10;
|
||||||
|
static const uint16 MAP_LIMBO_SIZE = 36;
|
||||||
|
static const uint16 MAP_TRIBUTE_SIZE = 0; //?
|
||||||
|
static const uint16 MAP_TROPHY_TRIBUTE_SIZE = 0;
|
||||||
|
static const uint16 MAP_GUILD_TRIBUTE_SIZE = 0;
|
||||||
|
static const uint16 MAP_MERCHANT_SIZE = 0;
|
||||||
|
static const uint16 MAP_DELETED_SIZE = 0;
|
||||||
|
static const uint16 MAP_CORPSE_SIZE = slots::_MainCount;
|
||||||
|
static const uint16 MAP_BAZAAR_SIZE = 200;
|
||||||
|
static const uint16 MAP_INSPECT_SIZE = slots::_MainEquipmentCount;
|
||||||
|
static const uint16 MAP_REAL_ESTATE_SIZE = 0;
|
||||||
|
static const uint16 MAP_VIEW_MOD_PC_SIZE = MAP_POSSESSIONS_SIZE;
|
||||||
|
static const uint16 MAP_VIEW_MOD_BANK_SIZE = MAP_BANK_SIZE;
|
||||||
|
static const uint16 MAP_VIEW_MOD_SHARED_BANK_SIZE = MAP_SHARED_BANK_SIZE;
|
||||||
|
static const uint16 MAP_VIEW_MOD_LIMBO_SIZE = MAP_LIMBO_SIZE;
|
||||||
|
static const uint16 MAP_ALT_STORAGE_SIZE = 0;
|
||||||
|
static const uint16 MAP_ARCHIVED_SIZE = 0;
|
||||||
|
static const uint16 MAP_MAIL_SIZE = 0;
|
||||||
|
static const uint16 MAP_GUILD_TROPHY_TRIBUTE_SIZE = 0;
|
||||||
|
static const uint16 MAP_KRONO_SIZE = NOT_USED;
|
||||||
|
static const uint16 MAP_OTHER_SIZE = 0;
|
||||||
|
|
||||||
|
// most of these definitions will go away with the structure-based system..this maintains compatibility for now
|
||||||
|
// (bag slots and main slots beyond Possessions are assigned for compatibility with current server coding)
|
||||||
|
static const int16 EQUIPMENT_BEGIN = slots::MainCharm;
|
||||||
|
static const int16 EQUIPMENT_END = slots::MainAmmo;
|
||||||
|
static const uint16 EQUIPMENT_SIZE = slots::_MainEquipmentCount;
|
||||||
|
|
||||||
|
static const int16 GENERAL_BEGIN = slots::MainGeneral1;
|
||||||
|
static const int16 GENERAL_END = slots::MainGeneral10;
|
||||||
|
static const uint16 GENERAL_SIZE = slots::_MainGeneralCount;
|
||||||
|
static const int16 GENERAL_BAGS_BEGIN = 251;
|
||||||
|
static const int16 GENERAL_BAGS_END_OFFSET = 99;
|
||||||
|
static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET;
|
||||||
|
|
||||||
|
static const int16 CURSOR = slots::MainCursor;
|
||||||
|
static const int16 CURSOR_BAG_BEGIN = 351;
|
||||||
|
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 TRIBUTE_BEGIN = 400;
|
||||||
|
static const int16 TRIBUTE_END = 404;
|
||||||
|
|
||||||
|
static const int16 CORPSE_BEGIN = slots::MainGeneral1;
|
||||||
|
static const int16 CORPSE_END = slots::MainGeneral1 + slots::MainCursor;
|
||||||
|
|
||||||
|
static const uint16 ITEM_COMMON_SIZE = 6;
|
||||||
|
static const uint16 ITEM_CONTAINER_SIZE = 255; // 255; (server max will be 255..unsure what actual client is - test)
|
||||||
|
|
||||||
|
static const uint32 BANDOLIERS_COUNT = 20; // count = number of bandolier instances
|
||||||
|
static const uint32 BANDOLIER_SIZE = 4; // size = number of equipment slots in bandolier instance
|
||||||
|
static const uint32 POTION_BELT_SIZE = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace limits {
|
||||||
|
static const bool ALLOWS_EMPTY_BAG_IN_BAG = true;
|
||||||
|
static const bool ALLOWS_CLICK_CAST_FROM_BAG = true;
|
||||||
|
static const bool COIN_HAS_WEIGHT = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}; //end namespace RoF2
|
||||||
|
|
||||||
|
#endif /*RoF2_CONSTANTS_H_*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
RoF2 Notes:
|
||||||
|
** Structure-based inventory **
|
||||||
|
ok Possessions: ( 0, { 0 .. 33 }, -1, -1 ) (Corpse: { 23 .. 56 } [Offset 23])
|
||||||
|
ok [Equipment: ( 0, { 0 .. 22 }, -1, -1 )]
|
||||||
|
ok [General: ( 0, { 23 .. 32 }, -1, -1 )]
|
||||||
|
ok [Cursor: ( 0, 33, -1, -1 )]
|
||||||
|
General Bags: ( 0, { 23 .. 32 }, { 0 .. (maxsize - 1) }, -1 )
|
||||||
|
Cursor Bags: ( 0, 33, { 0 .. (maxsize - 1) }, -1 )
|
||||||
|
|
||||||
|
Bank: ( 1, { 0 .. 23 }, -1, -1 )
|
||||||
|
Bank Bags: ( 1, { 0 .. 23 }, { 0 .. (maxsize - 1)}, -1 )
|
||||||
|
|
||||||
|
Shared Bank: ( 2, { 0 .. 1 }, -1, -1 )
|
||||||
|
Shared Bank Bags: ( 2, { 0 .. 1 }, { 0 .. (maxsize - 1) }, -1 )
|
||||||
|
|
||||||
|
Trade: ( 3, { 0 .. 8 }, -1, -1 )
|
||||||
|
(Trade Bags: 3031 - 3110 -- server values)
|
||||||
|
|
||||||
|
World: ( 4, { 0 .. 10 }, -1, -1 )
|
||||||
|
|
||||||
|
*/
|
||||||
439
common/patches/rof2_itemfields.h
Normal file
439
common/patches/rof2_itemfields.h
Normal file
@ -0,0 +1,439 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
|
||||||
|
These fields must be in the order of how they are serialized!
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
#define NEW_TRY
|
||||||
|
#ifdef NEW_TRY
|
||||||
|
//* 000 */ I(ItemClass) // Leave this one off on purpose
|
||||||
|
/* 001 */ S(Name)
|
||||||
|
/* 002 */ S(Lore)
|
||||||
|
//* 003 */ C("")//lorefile - Newly Added - Field is Null
|
||||||
|
/* 004 */ S(IDFile)
|
||||||
|
/* 005 */ I(ID)
|
||||||
|
/* 006 */ I(Weight)
|
||||||
|
/* 007 */ I(NoRent)
|
||||||
|
/* 008 */ I(NoDrop)
|
||||||
|
/* 009 */ I(Size)
|
||||||
|
/* 010 */ I(Slots)
|
||||||
|
/* 011 */ I(Price)
|
||||||
|
/* 012 */ I(Icon)
|
||||||
|
/* 013 */ C("0")//UNK013
|
||||||
|
/* 014 */ C("0")//UNK014
|
||||||
|
/* 015 */ I(BenefitFlag)
|
||||||
|
/* 016 */ I(Tradeskills)
|
||||||
|
/* 017 */ I(CR)
|
||||||
|
/* 018 */ I(DR)
|
||||||
|
/* 019 */ I(PR)
|
||||||
|
/* 020 */ I(MR)
|
||||||
|
/* 021 */ I(FR)
|
||||||
|
/* 022 */ C("0")//svcorruption - Newly Added
|
||||||
|
/* 023 */ I(AStr)
|
||||||
|
/* 024 */ I(ASta)
|
||||||
|
/* 025 */ I(AAgi)
|
||||||
|
/* 026 */ I(ADex)
|
||||||
|
/* 027 */ I(ACha)
|
||||||
|
/* 028 */ I(AInt)
|
||||||
|
/* 029 */ I(AWis)
|
||||||
|
/* 030 */ I(HP)
|
||||||
|
/* 031 */ I(Mana)
|
||||||
|
/* 032 */ I(Endur) //endur - Relocated
|
||||||
|
/* 033 */ I(AC)
|
||||||
|
/* 034 */ I(Classes)//classes - Relocated
|
||||||
|
/* 035 */ I(Races)//races - Relocated
|
||||||
|
/* 036 */ I(Deity)
|
||||||
|
/* 037 */ I(SkillModValue)
|
||||||
|
/* 038 */ C("0")//UNK038 - Default is 0
|
||||||
|
/* 039 */ I(SkillModType)
|
||||||
|
/* 040 */ I(BaneDmgRace)
|
||||||
|
/* 041 */ I(BaneDmgBody)//banedmgbody - Relocated
|
||||||
|
/* 042 */ I(BaneDmgRaceAmt)//banedmgraceamt - Relocated
|
||||||
|
/* 043 */ I(BaneDmgAmt)//banedmgamt - Relocated
|
||||||
|
/* 044 */ I(Magic)
|
||||||
|
/* 045 */ I(CastTime_)
|
||||||
|
/* 046 */ I(ReqLevel)
|
||||||
|
/* 047 */ I(RecLevel)//reclevel - Relocated
|
||||||
|
/* 048 */ I(RecSkill)//recskill - Relocated
|
||||||
|
/* 049 */ I(BardType)
|
||||||
|
/* 050 */ I(BardValue)
|
||||||
|
/* 051 */ I(Light)
|
||||||
|
/* 052 */ I(Delay)
|
||||||
|
/* 053 */ I(ElemDmgType)
|
||||||
|
/* 054 */ I(ElemDmgAmt)
|
||||||
|
/* 055 */ I(Range)
|
||||||
|
/* 056 */ I(Damage)
|
||||||
|
/* 057 */ I(Color)
|
||||||
|
/* 058 */ I(ItemType)
|
||||||
|
/* 059 */ I(Material)
|
||||||
|
/* 060 */ C("0")//UNK060 - Default is 0
|
||||||
|
/* 061 */ C("0")//UNK061 - Default is 0
|
||||||
|
/* 062 */ F(SellRate)
|
||||||
|
/* 063 */ I(CombatEffects)
|
||||||
|
/* 064 */ I(Shielding)
|
||||||
|
/* 065 */ I(StunResist)
|
||||||
|
/* 066 */ I(StrikeThrough)
|
||||||
|
/* 067 */ I(ExtraDmgSkill)
|
||||||
|
/* 068 */ I(ExtraDmgAmt)
|
||||||
|
/* 069 */ I(SpellShield)
|
||||||
|
/* 070 */ I(Avoidance)
|
||||||
|
/* 071 */ I(Accuracy)
|
||||||
|
/* 072 */ I(CharmFileID)
|
||||||
|
/* 073 */ I(FactionMod1)//Swapped these so Faction Amt comes after each Faction Mod
|
||||||
|
/* 074 */ I(FactionAmt1)//Swapped these so Faction Amt comes after each Faction Mod
|
||||||
|
/* 075 */ I(FactionMod2)//Swapped these so Faction Amt comes after each Faction Mod
|
||||||
|
/* 076 */ I(FactionAmt2)//Swapped these so Faction Amt comes after each Faction Mod
|
||||||
|
/* 077 */ I(FactionMod3)//Swapped these so Faction Amt comes after each Faction Mod
|
||||||
|
/* 078 */ I(FactionAmt3)//Swapped these so Faction Amt comes after each Faction Mod
|
||||||
|
/* 079 */ I(FactionMod4)//Swapped these so Faction Amt comes after each Faction Mod
|
||||||
|
/* 080 */ I(FactionAmt4)//Swapped these so Faction Amt comes after each Faction Mod
|
||||||
|
/* 081 */ S(CharmFile)
|
||||||
|
/* 082 */ I(AugType)
|
||||||
|
/* 083 */ I(AugRestrict)//augrestrict - Relocated
|
||||||
|
/* 084 */ I(AugDistiller)//augdistiller - Relocated
|
||||||
|
/* 085 */ I(AugSlotType[0])
|
||||||
|
/* 086 */ I(AugSlotVisible[0])//augslot1visible - Default 1
|
||||||
|
/* 087 */ C("0")//augslot1unk2 - Newly Added - Default 0
|
||||||
|
/* 088 */ I(AugSlotType[1])
|
||||||
|
/* 089 */ I(AugSlotVisible[1])
|
||||||
|
/* 090 */ C("0")//augslot2unk2 - Newly Added
|
||||||
|
/* 091 */ I(AugSlotType[2])
|
||||||
|
/* 092 */ I(AugSlotVisible[2])
|
||||||
|
/* 093 */ C("0")//augslot3unk2 - Newly Added
|
||||||
|
/* 094 */ I(AugSlotType[3])
|
||||||
|
/* 095 */ I(AugSlotVisible[3])
|
||||||
|
/* 096 */ C("0")//augslot4unk2 - Newly Added
|
||||||
|
/* 097 */ I(AugSlotType[4])
|
||||||
|
/* 098 */ I(AugSlotVisible[4])
|
||||||
|
/* 099 */ C("0")//augslot5unk2 - Newly Added
|
||||||
|
/* 100 */ I(PointType)//pointtype - Relocated
|
||||||
|
/* 101 */ I(LDoNTheme)
|
||||||
|
/* 102 */ I(LDoNPrice)
|
||||||
|
/* 103 */ C("70")//UNK098 - Newly Added - Default 70, but some are set to 0
|
||||||
|
/* 104 */ I(LDoNSold)
|
||||||
|
/* 105 */ I(BagType)
|
||||||
|
/* 106 */ I(BagSlots)
|
||||||
|
/* 107 */ I(BagSize)
|
||||||
|
/* 108 */ I(BagWR)
|
||||||
|
/* 109 */ I(Book)
|
||||||
|
/* 110 */ I(BookType)
|
||||||
|
/* 111 */ S(Filename)
|
||||||
|
/* 112 */ I(LoreGroup)
|
||||||
|
/* 113 */ I(ArtifactFlag)
|
||||||
|
/* 114 */ C("0")//I(PendingLoreFlag)?//UNK109 - Default 0, but a few are 1
|
||||||
|
/* 115 */ I(Favor)
|
||||||
|
/* 116 */ I(GuildFavor)//guildfavor - Relocated
|
||||||
|
/* 117 */ I(FVNoDrop)
|
||||||
|
/* 118 */ I(DotShielding)
|
||||||
|
/* 119 */ I(Attack)
|
||||||
|
/* 120 */ I(Regen)
|
||||||
|
/* 121 */ I(ManaRegen)
|
||||||
|
/* 122 */ I(EnduranceRegen)
|
||||||
|
/* 123 */ I(Haste)
|
||||||
|
/* 124 */ I(DamageShield)
|
||||||
|
/* 125 */ C("-1") //UNK120 - Default is -1
|
||||||
|
/* 126 */ C("0") //UNK121 - Default is 0
|
||||||
|
/* 127 */ I(Attuneable)
|
||||||
|
/* 128 */ I(NoPet)
|
||||||
|
/* 129 */ C("0") //UNK124 - Default 0, but a few are 1
|
||||||
|
/* 130 */ I(PotionBelt)
|
||||||
|
/* 131 */ C("0") //potionbeltslots - Default 0, but a few are 1
|
||||||
|
/* 132 */ I(StackSize)
|
||||||
|
/* 133 */ I(NoTransfer)
|
||||||
|
/* 134 */ I(Stackable)//UNK129 - Default is 0, but some are much higher
|
||||||
|
/* 135 */ I(QuestItemFlag)//questitemflag - Default is 0 (off), flag on = 1
|
||||||
|
/* 136 */ C("0")//UNK131 - Default is 0, but there is an item set to 1
|
||||||
|
/* 137 */ C("0")//UNK132 - Default is 0? 0000000000000000000?
|
||||||
|
/* 138 */ I(Click.Effect)
|
||||||
|
/* 139 */ I(Click.Type)
|
||||||
|
/* 140 */ I(Click.Level2)
|
||||||
|
/* 141 */ I(Click.Level)
|
||||||
|
/* 142 */ I(MaxCharges)//maxcharges - Relocated
|
||||||
|
/* 143 */ I(CastTime_)//casttime - Relocated - Note Duplicate Entries for CastTime_ and none for CastTime
|
||||||
|
/* 144 */ I(RecastDelay)//recastdelay - Relocated
|
||||||
|
/* 145 */ I(RecastType)//recasttype - Relocated
|
||||||
|
/* 146 */ C("0")//clickunk5 - Newly Added - Default is 0
|
||||||
|
/* 147 */ C("")//clickname - Newly Added - Default is Null
|
||||||
|
/* 148 */ C("-1")//clickunk7 - Newly Added - Default is -1, but some set to 0 and some much higher
|
||||||
|
/* 149 */ I(Proc.Effect)
|
||||||
|
/* 150 */ I(Proc.Type)
|
||||||
|
/* 151 */ I(Proc.Level2)
|
||||||
|
/* 152 */ I(Proc.Level)
|
||||||
|
/* 153 */ C("0")//procunk1 - Newly Added - Default is 0, but some set to -1 and 1
|
||||||
|
/* 154 */ C("0")//procunk2 - Newly Added - Default is 0
|
||||||
|
/* 155 */ C("0")//procunk3 - Newly Added - Default is 0
|
||||||
|
/* 156 */ C("0")//procunk4 - Newly Added - Default is 0
|
||||||
|
/* 157 */ I(ProcRate)//procrate - Relocated
|
||||||
|
/* 158 */ C("")//procname - Newly Added - Default is Null
|
||||||
|
/* 159 */ C("-1")//procunk7 - Newly Added - Default is -1, but some set to 0
|
||||||
|
/* 160 */ I(Worn.Effect)
|
||||||
|
/* 161 */ I(Worn.Type)
|
||||||
|
/* 162 */ I(Worn.Level2)
|
||||||
|
/* 163 */ I(Worn.Level)
|
||||||
|
/* 164 */ C("0")//wornunk1 - Newly Added - Default is 0
|
||||||
|
/* 165 */ C("0")//wornunk2 - Newly Added - Default is 0
|
||||||
|
/* 166 */ C("0")//wornunk3 - Newly Added - Default is 0
|
||||||
|
/* 167 */ C("0")//wornunk4 - Newly Added - Default is 0
|
||||||
|
/* 168 */ C("0")//wornunk5 - Newly Added - Default is 0
|
||||||
|
/* 169 */ C("")//wornname - Newly Added - Default is Null
|
||||||
|
/* 170 */ C("-1")//wornunk7 - Newly Added - Default is -1, but some set to 0
|
||||||
|
/* 171 */ I(Focus.Effect)
|
||||||
|
/* 172 */ I(Focus.Type)
|
||||||
|
/* 173 */ I(Focus.Level2)
|
||||||
|
/* 174 */ I(Focus.Level)
|
||||||
|
/* 175 */ C("0")//focusunk1 - Newly Added - Default is 0
|
||||||
|
/* 176 */ C("0")//focusunk2 - Newly Added - Default is 0
|
||||||
|
/* 177 */ C("0")//focusunk3 - Newly Added - Default is 0
|
||||||
|
/* 178 */ C("0")//focusunk4 - Newly Added - Default is 0
|
||||||
|
/* 179 */ C("0")//focusunk5 - Newly Added - Default is 0
|
||||||
|
/* 180 */ C("")//focusname - Newly Added - Default is Null
|
||||||
|
/* 181 */ C("-1")//focusunk7 - Newly Added - Default is -1, but some set to 0
|
||||||
|
/* 182 */ I(Scroll.Effect)
|
||||||
|
/* 183 */ I(Scroll.Type)
|
||||||
|
/* 184 */ I(Scroll.Level2)
|
||||||
|
/* 185 */ I(Scroll.Level)
|
||||||
|
/* 186 */ C("0")//scrollunk1 - Renumber this***
|
||||||
|
/* 187 */ C("0")//scrollunk2 - Newly Added - Default is 0
|
||||||
|
/* 188 */ C("0")//scrollunk3 - Newly Added - Default is 0
|
||||||
|
/* 189 */ C("0")//scrollunk4 - Newly Added - Default is 0
|
||||||
|
/* 190 */ C("0")//scrollunk5 - Newly Added - Default is 0
|
||||||
|
/* 191 */ C("")//scrollname - Newly Added - Default is Null
|
||||||
|
/* 192 */ C("-1")//scrollunk7 - Newly Added - Default is -1, but some set to 0
|
||||||
|
/* 193 */ C("0")//UNK193 - Default is 0
|
||||||
|
/* 194 */ C("0")//purity - Newly Added - Default is 0, but some go up to 75
|
||||||
|
/* 195 */ C("0")//dsmitigation - Newly Added - Default is 0, but some are up to 2
|
||||||
|
/* 196 */ C("0")//heroic_str - Newly Added - Default is 0
|
||||||
|
/* 197 */ C("0")//heroic_int - Newly Added - Default is 0
|
||||||
|
/* 198 */ C("0")//heroic_wis - Newly Added - Default is 0
|
||||||
|
/* 199 */ C("0")//heroic_agi - Newly Added - Default is 0
|
||||||
|
/* 200 */ C("0")//heroic_dex - Newly Added - Default is 0
|
||||||
|
/* 201 */ C("0")//heroic_sta - Newly Added - Default is 0
|
||||||
|
/* 202 */ C("0")//heroic_cha - Newly Added - Default is 0
|
||||||
|
/* 203 */ C("0")//HeroicSvPoison - Newly Added - Default is 0
|
||||||
|
/* 204 */ C("0")//HeroicSvMagic - Newly Added - Default is 0
|
||||||
|
/* 205 */ C("0")//HeroicSvFire - Newly Added - Default is 0
|
||||||
|
/* 206 */ C("0")//HeroicSvDisease - Newly Added - Default is 0
|
||||||
|
/* 207 */ C("0")//HeroicSvCold - Newly Added - Default is 0
|
||||||
|
/* 208 */ C("0")//HeroicSvCorruption - Newly Added - Default is 0
|
||||||
|
/* 209 */ C("0")//healamt - Newly Added - Default is 0, but some are up to 9
|
||||||
|
/* 210 */ C("0")//spelldmg - Newly Added - Default is 0, but some are up to 9
|
||||||
|
/* 211 */ C("0")//clairvoyance - Newly Added - Default is 0, but some are up to 10
|
||||||
|
/* 212 */ C("0")//backstabdmg - Newly Added - Default is 0, but some are up to 65
|
||||||
|
//* 213 */ C("0")//evolvinglevel - Newly Added - Default is 0, but some are up to 7
|
||||||
|
//* 214 */ C("0")//MaxPower - Newly Added
|
||||||
|
//* 215 */ C("0")//Power - Newly Added
|
||||||
|
|
||||||
|
//This doesn't appear to be used /* 102 */ S(verified)//verified
|
||||||
|
//This doesn't appear to be used /* 102 */ S(serialized)//created
|
||||||
|
//Unsure where this goes right now (or if it is even used) /* 108 */ I(SummonedFlag)
|
||||||
|
|
||||||
|
#else
|
||||||
|
/* 000 */ //I(ItemClass) Leave this one off on purpose
|
||||||
|
/* 001 */ S(Name)
|
||||||
|
/* 002 */ S(Lore)
|
||||||
|
/* 003 */ C("") //LoreFile?
|
||||||
|
/* 003 */ S(IDFile)
|
||||||
|
/* 004 */ I(ID)
|
||||||
|
/* 005 */ I(Weight)
|
||||||
|
/* 006 */ I(NoRent)
|
||||||
|
/* 007 */ I(NoDrop)
|
||||||
|
/* 008 */ I(Size)
|
||||||
|
/* 009 */ I(Slots)
|
||||||
|
/* 010 */ I(Price)
|
||||||
|
/* 011 */ I(Icon)
|
||||||
|
/* 013 */ C("0")
|
||||||
|
/* 014 */ C("0")
|
||||||
|
/* 014 */ I(BenefitFlag)
|
||||||
|
/* 015 */ I(Tradeskills)
|
||||||
|
/* 016 */ I(CR)
|
||||||
|
/* 017 */ I(DR)
|
||||||
|
/* 018 */ I(PR)
|
||||||
|
/* 019 */ I(MR)
|
||||||
|
/* 020 */ I(FR)
|
||||||
|
C("0") //svcorruption
|
||||||
|
/* 021 */ I(AStr)
|
||||||
|
/* 022 */ I(ASta)
|
||||||
|
/* 023 */ I(AAgi)
|
||||||
|
/* 024 */ I(ADex)
|
||||||
|
/* 025 */ I(ACha)
|
||||||
|
/* 026 */ I(AInt)
|
||||||
|
/* 027 */ I(AWis)
|
||||||
|
/* 028 */ I(HP)
|
||||||
|
/* 029 */ I(Mana)
|
||||||
|
I(Endur)
|
||||||
|
/* 030 */ I(AC)
|
||||||
|
/* 052 */ I(Classes)
|
||||||
|
/* 053 */ I(Races)
|
||||||
|
/* 031 */ I(Deity)
|
||||||
|
/* 032 */ I(SkillModValue)
|
||||||
|
/* 033 */ C("0")
|
||||||
|
/* 034 */ I(SkillModType)
|
||||||
|
/* 035 */ I(BaneDmgRace)
|
||||||
|
/* 037 */ I(BaneDmgBody)
|
||||||
|
/* 036 */ I(BaneDmgRaceAmt)
|
||||||
|
/* 036 */ I(BaneDmgAmt)
|
||||||
|
/* 038 */ I(Magic)
|
||||||
|
/* 039 */ I(CastTime_)
|
||||||
|
/* 040 */ I(ReqLevel)
|
||||||
|
/* 045 */ I(RecLevel)
|
||||||
|
/* 046 */ I(RecSkill)
|
||||||
|
/* 041 */ I(BardType)
|
||||||
|
/* 042 */ I(BardValue)
|
||||||
|
/* 043 */ I(Light)
|
||||||
|
/* 044 */ I(Delay)
|
||||||
|
/* 047 */ I(ElemDmgType)
|
||||||
|
/* 048 */ I(ElemDmgAmt)
|
||||||
|
/* 049 */ I(Range)
|
||||||
|
/* 050 */ I(Damage)
|
||||||
|
/* 051 */ I(Color)
|
||||||
|
/* 056 */ I(ItemType)
|
||||||
|
/* 057 */ I(Material)
|
||||||
|
/* 060 */ C("0")
|
||||||
|
/* 061 */ C("0")
|
||||||
|
/* 058 */ F(SellRate)
|
||||||
|
/* 063 */ I(CombatEffects)
|
||||||
|
/* 064 */ I(Shielding)
|
||||||
|
/* 065 */ I(StunResist)
|
||||||
|
/* 059 */ //C("0")
|
||||||
|
/* 061 */ //C("0")
|
||||||
|
/* 066 */ I(StrikeThrough)
|
||||||
|
/* 067 */ I(ExtraDmgSkill)
|
||||||
|
/* 068 */ I(ExtraDmgAmt)
|
||||||
|
/* 069 */ I(SpellShield)
|
||||||
|
/* 070 */ I(Avoidance)
|
||||||
|
/* 071 */ I(Accuracy)
|
||||||
|
/* 072 */ I(CharmFileID)
|
||||||
|
/* 073 */ I(FactionMod1)
|
||||||
|
/* 077 */ I(FactionAmt1)
|
||||||
|
/* 074 */ I(FactionMod2)
|
||||||
|
/* 078 */ I(FactionAmt2)
|
||||||
|
/* 075 */ I(FactionMod3)
|
||||||
|
/* 079 */ I(FactionAmt3)
|
||||||
|
/* 076 */ I(FactionMod4)
|
||||||
|
/* 080 */ I(FactionAmt4)
|
||||||
|
/* 081 */ S(CharmFile)
|
||||||
|
/* 082 */ I(AugType)
|
||||||
|
/* 082 */ I(AugRestrict)
|
||||||
|
/* 082 */ I(AugDistiller)
|
||||||
|
/* 083 */ I(AugSlotType[0])
|
||||||
|
/* 084 */ I(AugSlotVisible[0])
|
||||||
|
/* 084 */ I(AugSlotUnk2[0])
|
||||||
|
/* 085 */ I(AugSlotType[1])
|
||||||
|
/* 086 */ I(AugSlotVisible[1])
|
||||||
|
/* 086 */ I(AugSlotUnk2[1])
|
||||||
|
/* 087 */ I(AugSlotType[2])
|
||||||
|
/* 088 */ I(AugSlotVisible[2])
|
||||||
|
/* 088 */ I(AugSlotUnk2[2])
|
||||||
|
/* 089 */ I(AugSlotType[3])
|
||||||
|
/* 090 */ I(AugSlotVisible[3])
|
||||||
|
/* 090 */ I(AugSlotUnk2[3])
|
||||||
|
/* 091 */ I(AugSlotType[4])
|
||||||
|
/* 092 */ I(AugSlotVisible[4])
|
||||||
|
/* 092 */ I(AugSlotUnk2[4])
|
||||||
|
/* 093 */ I(PointType)
|
||||||
|
/* 093 */ I(LDoNTheme)
|
||||||
|
/* 094 */ I(LDoNPrice)
|
||||||
|
/* 094 */ C("0")
|
||||||
|
/* 095 */ I(LDoNSold)
|
||||||
|
/* 096 */ I(BagType)
|
||||||
|
/* 097 */ I(BagSlots)
|
||||||
|
/* 098 */ I(BagSize)
|
||||||
|
/* 099 */ I(BagWR)
|
||||||
|
/* 100 */ I(Book)
|
||||||
|
/* 101 */ I(BookType)
|
||||||
|
/* 102 */ S(Filename)
|
||||||
|
/* 105 */ I(LoreGroup)
|
||||||
|
/* 106 */ //I(PendingLoreFlag)
|
||||||
|
/* 107 */ I(ArtifactFlag)
|
||||||
|
/* 094 */ C("0")
|
||||||
|
/* 108 */ //I(SummonedFlag)
|
||||||
|
/* 109 */ I(Favor)
|
||||||
|
/* 121 */ I(GuildFavor)
|
||||||
|
/* 110 */ I(FVNoDrop)
|
||||||
|
/* 112 */ I(DotShielding)
|
||||||
|
/* 113 */ I(Attack)
|
||||||
|
/* 114 */ I(Regen)
|
||||||
|
/* 115 */ I(ManaRegen)
|
||||||
|
/* 116 */ I(EnduranceRegen)
|
||||||
|
/* 117 */ I(Haste)
|
||||||
|
/* 118 */ I(DamageShield)
|
||||||
|
/* 120 */ C("0")
|
||||||
|
/* 121 */ C("0")
|
||||||
|
/* 125 */ I(Attuneable)
|
||||||
|
/* 126 */ I(NoPet)
|
||||||
|
/* 124 */ C("0")
|
||||||
|
/* 129 */ I(PotionBelt)
|
||||||
|
/* 130 */ I(PotionBeltSlots)
|
||||||
|
/* 131 */ I(StackSize)
|
||||||
|
/* 132 */ I(NoTransfer)
|
||||||
|
/* 129 */ C("0")
|
||||||
|
/* 132 */ I(QuestItemFlag)
|
||||||
|
/* 131 */ C("0")
|
||||||
|
/* 132 */ C("00000000000000000000000000000000000000")
|
||||||
|
/* 134 */ I(Click.Effect)
|
||||||
|
/* 135 */ I(Click.Type)
|
||||||
|
/* 136 */ I(Click.Level2)
|
||||||
|
/* 137 */ I(Click.Level)
|
||||||
|
/* 055 */ I(MaxCharges)
|
||||||
|
/* 060 */ I(CastTime)
|
||||||
|
/* 119 */ I(RecastDelay)
|
||||||
|
/* 120 */ I(RecastType)
|
||||||
|
/* 138 */ C("0") //clickunk5 (prolly ProcRate)
|
||||||
|
/* 138 */ C("") //clickunk6
|
||||||
|
/* 138 */ C("-1") //clickunk7
|
||||||
|
/* 139 */ I(Proc.Effect)
|
||||||
|
/* 140 */ I(Proc.Type)
|
||||||
|
/* 141 */ I(Proc.Level2)
|
||||||
|
/* 142 */ I(Proc.Level)
|
||||||
|
/* 143 */ C("0") //procunk1 (prolly MaxCharges)
|
||||||
|
/* 143 */ C("0") //procunk2 (prolly CastTime)
|
||||||
|
/* 143 */ C("0") //procunk3 (prolly RecastDelay)
|
||||||
|
/* 143 */ C("0") //procunk4 (prolly RecastType)
|
||||||
|
/* 062 */ I(ProcRate)
|
||||||
|
/* 143 */ C("") //procunk6
|
||||||
|
/* 143 */ C("-1") //procunk7
|
||||||
|
/* 144 */ I(Worn.Effect)
|
||||||
|
/* 145 */ I(Worn.Type)
|
||||||
|
/* 146 */ I(Worn.Level2)
|
||||||
|
/* 147 */ I(Worn.Level)
|
||||||
|
/* 143 */ C("0") //wornunk1 (prolly MaxCharges)
|
||||||
|
/* 143 */ C("0") //wornunk2 (prolly CastTime)
|
||||||
|
/* 143 */ C("0") //wornunk3 (prolly RecastDelay)
|
||||||
|
/* 143 */ C("0") //wornunk4 (prolly RecastType)
|
||||||
|
/* 143 */ C("0") //wornunk5 (prolly ProcRate)
|
||||||
|
/* 143 */ C("") //wornunk6
|
||||||
|
/* 143 */ C("-1") //wornunk7
|
||||||
|
/* 149 */ I(Focus.Effect)
|
||||||
|
/* 150 */ I(Focus.Type)
|
||||||
|
/* 151 */ I(Focus.Level2)
|
||||||
|
/* 152 */ I(Focus.Level)
|
||||||
|
/* 143 */ C("0") //focusunk1 (prolly MaxCharges)
|
||||||
|
/* 143 */ C("0") //focusunk2 (prolly CastTime)
|
||||||
|
/* 143 */ C("0") //focusunk3 (prolly RecastDelay)
|
||||||
|
/* 143 */ C("0") //focusunk4 (prolly RecastType)
|
||||||
|
/* 143 */ C("0") //focusunk5 (prolly ProcRate)
|
||||||
|
/* 143 */ C("") //focusunk6
|
||||||
|
/* 143 */ C("-1") //focusunk7
|
||||||
|
/* 154 */ I(Scroll.Effect)
|
||||||
|
/* 155 */ I(Scroll.Type)
|
||||||
|
/* 156 */ I(Scroll.Level2)
|
||||||
|
/* 157 */ I(Scroll.Level)
|
||||||
|
/* 143 */ C("0") //scrollunk1 (prolly MaxCharges)
|
||||||
|
/* 143 */ C("0") //scrollunk2 (prolly CastTime)
|
||||||
|
/* 143 */ C("0") //scrollunk3 (prolly RecastDelay)
|
||||||
|
/* 143 */ C("0") //scrollunk4 (prolly RecastType)
|
||||||
|
/* 143 */ C("0") //scrollunk5 (prolly ProcRate)
|
||||||
|
/* 143 */ C("") //scrollunk6
|
||||||
|
/* 143 */ C("-1") //scrollunk7
|
||||||
|
/* 193 */ C("0") //Power Source Capacity
|
||||||
|
/* 194 */ C("0") //purity
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#undef I
|
||||||
|
#undef C
|
||||||
|
#undef S
|
||||||
|
#undef F
|
||||||
|
|
||||||
173
common/patches/rof2_ops.h
Normal file
173
common/patches/rof2_ops.h
Normal file
@ -0,0 +1,173 @@
|
|||||||
|
// out-going packets that require an ENCODE translation:
|
||||||
|
// Begin RoF2 Encodes
|
||||||
|
|
||||||
|
// incoming packets that require a DECODE translation:
|
||||||
|
// Begin RoF2 Decodes
|
||||||
|
|
||||||
|
|
||||||
|
// End RoF2 Encodes/Decodes
|
||||||
|
|
||||||
|
// These require Encodes/Decodes for RoF, so they do for RoF2 as well
|
||||||
|
// Begin RoF Encodes
|
||||||
|
E(OP_Action)
|
||||||
|
E(OP_AdventureMerchantSell)
|
||||||
|
E(OP_AltCurrency)
|
||||||
|
E(OP_AltCurrencySell)
|
||||||
|
E(OP_Animation)
|
||||||
|
E(OP_ApplyPoison)
|
||||||
|
E(OP_AugmentInfo)
|
||||||
|
E(OP_Barter)
|
||||||
|
E(OP_BazaarSearch)
|
||||||
|
E(OP_BeginCast)
|
||||||
|
E(OP_BlockedBuffs)
|
||||||
|
E(OP_Buff)
|
||||||
|
E(OP_BuffCreate)
|
||||||
|
E(OP_CancelTrade)
|
||||||
|
E(OP_CastSpell)
|
||||||
|
E(OP_ChannelMessage)
|
||||||
|
E(OP_CharInventory)
|
||||||
|
E(OP_ClickObjectAction)
|
||||||
|
E(OP_ClientUpdate)
|
||||||
|
E(OP_Consider)
|
||||||
|
E(OP_Damage)
|
||||||
|
E(OP_DeleteCharge)
|
||||||
|
E(OP_DeleteItem)
|
||||||
|
E(OP_DeleteSpawn)
|
||||||
|
E(OP_DisciplineUpdate)
|
||||||
|
E(OP_DzCompass)
|
||||||
|
E(OP_DzExpeditionEndsWarning)
|
||||||
|
E(OP_DzExpeditionInfo)
|
||||||
|
E(OP_DzExpeditionList)
|
||||||
|
E(OP_DzJoinExpeditionConfirm)
|
||||||
|
E(OP_DzLeaderStatus)
|
||||||
|
E(OP_DzMemberList)
|
||||||
|
E(OP_ExpansionInfo)
|
||||||
|
E(OP_GMLastName)
|
||||||
|
E(OP_GMTrainSkillConfirm)
|
||||||
|
E(OP_GroundSpawn)
|
||||||
|
E(OP_GroupCancelInvite)
|
||||||
|
E(OP_GroupFollow)
|
||||||
|
E(OP_GroupFollow2)
|
||||||
|
E(OP_GroupInvite)
|
||||||
|
E(OP_GroupUpdate)
|
||||||
|
E(OP_GuildMemberList)
|
||||||
|
E(OP_GuildMemberUpdate)
|
||||||
|
E(OP_GuildsList)
|
||||||
|
E(OP_HPUpdate)
|
||||||
|
E(OP_Illusion)
|
||||||
|
E(OP_InspectBuffs)
|
||||||
|
E(OP_InspectRequest)
|
||||||
|
E(OP_InterruptCast)
|
||||||
|
E(OP_ItemLinkResponse)
|
||||||
|
E(OP_ItemPacket)
|
||||||
|
E(OP_ItemVerifyReply)
|
||||||
|
E(OP_LeadershipExpUpdate)
|
||||||
|
E(OP_LogServer)
|
||||||
|
E(OP_LootItem)
|
||||||
|
E(OP_ManaChange)
|
||||||
|
E(OP_MercenaryDataResponse)
|
||||||
|
E(OP_MercenaryDataUpdate)
|
||||||
|
E(OP_MoveItem)
|
||||||
|
E(OP_NewSpawn)
|
||||||
|
E(OP_NewZone)
|
||||||
|
E(OP_OnLevelMessage)
|
||||||
|
//E(OP_OpenNewTasksWindow)
|
||||||
|
E(OP_PetBuffWindow)
|
||||||
|
E(OP_PlayerProfile)
|
||||||
|
E(OP_RaidJoin)
|
||||||
|
E(OP_RaidUpdate)
|
||||||
|
E(OP_ReadBook)
|
||||||
|
E(OP_RecipeAutoCombine)
|
||||||
|
E(OP_RemoveBlockedBuffs)
|
||||||
|
E(OP_RequestClientZoneChange)
|
||||||
|
E(OP_RespondAA)
|
||||||
|
E(OP_RezzRequest)
|
||||||
|
E(OP_SendAATable)
|
||||||
|
E(OP_SendCharInfo)
|
||||||
|
E(OP_SendMembership)
|
||||||
|
E(OP_SendZonepoints)
|
||||||
|
E(OP_SetGuildRank)
|
||||||
|
E(OP_ShopPlayerBuy)
|
||||||
|
E(OP_ShopPlayerSell)
|
||||||
|
E(OP_ShopRequest)
|
||||||
|
E(OP_SkillUpdate)
|
||||||
|
E(OP_SomeItemPacketMaybe)
|
||||||
|
E(OP_SpawnAppearance)
|
||||||
|
E(OP_SpawnDoor)
|
||||||
|
E(OP_Stun)
|
||||||
|
E(OP_TargetBuffs)
|
||||||
|
E(OP_TaskDescription)
|
||||||
|
E(OP_TaskHistoryReply)
|
||||||
|
E(OP_Track)
|
||||||
|
E(OP_Trader)
|
||||||
|
E(OP_TraderBuy)
|
||||||
|
E(OP_TributeInfo)
|
||||||
|
E(OP_TributeItem)
|
||||||
|
E(OP_VetRewardsAvaliable)
|
||||||
|
E(OP_WearChange)
|
||||||
|
E(OP_WhoAllResponse)
|
||||||
|
E(OP_ZoneChange)
|
||||||
|
E(OP_ZoneEntry)
|
||||||
|
E(OP_ZonePlayerToBind)
|
||||||
|
E(OP_ZoneServerInfo)
|
||||||
|
E(OP_ZoneSpawns)
|
||||||
|
// Begin RoF Decodes
|
||||||
|
D(OP_AdventureMerchantSell)
|
||||||
|
D(OP_AltCurrencySell)
|
||||||
|
D(OP_AltCurrencySellSelection)
|
||||||
|
D(OP_ApplyPoison)
|
||||||
|
D(OP_AugmentInfo)
|
||||||
|
D(OP_AugmentItem)
|
||||||
|
D(OP_BazaarSearch)
|
||||||
|
D(OP_BlockedBuffs)
|
||||||
|
D(OP_Buff)
|
||||||
|
D(OP_BuffRemoveRequest)
|
||||||
|
D(OP_CastSpell)
|
||||||
|
D(OP_ChannelMessage)
|
||||||
|
D(OP_CharacterCreate)
|
||||||
|
D(OP_ClientUpdate)
|
||||||
|
D(OP_Consider)
|
||||||
|
D(OP_ConsiderCorpse)
|
||||||
|
D(OP_Consume)
|
||||||
|
D(OP_Damage)
|
||||||
|
D(OP_DeleteItem)
|
||||||
|
D(OP_EnvDamage)
|
||||||
|
D(OP_FaceChange)
|
||||||
|
D(OP_FindPersonRequest)
|
||||||
|
D(OP_GMLastName)
|
||||||
|
D(OP_GroupCancelInvite)
|
||||||
|
D(OP_GroupDisband)
|
||||||
|
D(OP_GroupFollow)
|
||||||
|
D(OP_GroupFollow2)
|
||||||
|
D(OP_GroupInvite)
|
||||||
|
D(OP_GroupInvite2)
|
||||||
|
D(OP_GuildDemote)
|
||||||
|
D(OP_GuildRemove)
|
||||||
|
D(OP_GuildStatus)
|
||||||
|
D(OP_InspectRequest)
|
||||||
|
D(OP_ItemLinkClick)
|
||||||
|
D(OP_ItemVerifyRequest)
|
||||||
|
D(OP_LoadSpellSet)
|
||||||
|
D(OP_LootItem)
|
||||||
|
D(OP_MoveItem)
|
||||||
|
D(OP_PetCommands)
|
||||||
|
D(OP_RaidInvite)
|
||||||
|
D(OP_ReadBook)
|
||||||
|
D(OP_RecipeAutoCombine)
|
||||||
|
D(OP_RemoveBlockedBuffs)
|
||||||
|
D(OP_RezzAnswer)
|
||||||
|
D(OP_Save)
|
||||||
|
D(OP_SetServerFilter)
|
||||||
|
D(OP_ShopPlayerBuy)
|
||||||
|
D(OP_ShopPlayerSell)
|
||||||
|
D(OP_ShopRequest)
|
||||||
|
D(OP_Trader)
|
||||||
|
D(OP_TraderBuy)
|
||||||
|
D(OP_TradeSkillCombine)
|
||||||
|
D(OP_TributeItem)
|
||||||
|
D(OP_WhoAllRequest)
|
||||||
|
D(OP_ZoneChange)
|
||||||
|
D(OP_ZoneEntry)
|
||||||
|
// End RoF Encodes/Decodes
|
||||||
|
#undef E
|
||||||
|
#undef D
|
||||||
4922
common/patches/rof2_structs.h
Normal file
4922
common/patches/rof2_structs.h
Normal file
File diff suppressed because it is too large
Load Diff
84
common/random.h
Normal file
84
common/random.h
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
/* EQEMu: Everquest Server Emulator
|
||||||
|
Copyright (C) 2001-2014 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 __random_h__
|
||||||
|
#define __random_h__
|
||||||
|
|
||||||
|
#include <random>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
|
/* This uses mt19937 seeded with the std::random_device
|
||||||
|
* The idea is to have this be included as a member of another class
|
||||||
|
* so mocking out for testing is easier
|
||||||
|
* If you need to reseed random.Reseed()
|
||||||
|
* Eventually this should be derived from an abstract base class
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace EQEmu {
|
||||||
|
class Random {
|
||||||
|
public:
|
||||||
|
// AKA old MakeRandomInt
|
||||||
|
const int Int(int low, int high)
|
||||||
|
{
|
||||||
|
if (low > high)
|
||||||
|
std::swap(low, high);
|
||||||
|
return std::uniform_int_distribution<int>(low, high)(m_gen); // [low, high]
|
||||||
|
}
|
||||||
|
|
||||||
|
// AKA old MakeRandomFloat
|
||||||
|
const double Real(double low, double high)
|
||||||
|
{
|
||||||
|
if (low > high)
|
||||||
|
std::swap(low, high);
|
||||||
|
return std::uniform_real_distribution<double>(low, high)(m_gen); // [low, high)
|
||||||
|
}
|
||||||
|
|
||||||
|
// example Roll(50) would have a 50% success rate
|
||||||
|
// Roll(100) 100%, etc
|
||||||
|
// valid values 0-100 (well, higher works too but ...)
|
||||||
|
const bool Roll(const int required)
|
||||||
|
{
|
||||||
|
return Int(0, 99) < required;
|
||||||
|
}
|
||||||
|
|
||||||
|
// valid values 0.0 - 1.0
|
||||||
|
const bool Roll(const double required)
|
||||||
|
{
|
||||||
|
return Real(0.0, 1.0) <= required;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Reseed()
|
||||||
|
{
|
||||||
|
// We could do the seed_seq thing here too if we need better seeding
|
||||||
|
// but that is mostly overkill for us, so just seed once
|
||||||
|
std::random_device rd;
|
||||||
|
m_gen.seed(rd());
|
||||||
|
}
|
||||||
|
|
||||||
|
Random()
|
||||||
|
{
|
||||||
|
Reseed();
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::mt19937 m_gen;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* !__random_h__ */
|
||||||
|
|
||||||
@ -389,7 +389,7 @@ void Client::GenerateKey()
|
|||||||
'6', '7', '8', '9'
|
'6', '7', '8', '9'
|
||||||
};
|
};
|
||||||
|
|
||||||
key.append((const char*)&key_selection[MakeRandomInt(0, 35)], 1);
|
key.append((const char*)&key_selection[random.Int(0, 35)], 1);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,6 +22,7 @@
|
|||||||
#include "../common/opcodemgr.h"
|
#include "../common/opcodemgr.h"
|
||||||
#include "../common/eq_stream_type.h"
|
#include "../common/eq_stream_type.h"
|
||||||
#include "../common/eq_stream_factory.h"
|
#include "../common/eq_stream_factory.h"
|
||||||
|
#include "../common/random.h"
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#include "eq_crypto_api.h"
|
#include "eq_crypto_api.h"
|
||||||
#endif
|
#endif
|
||||||
@ -129,6 +130,8 @@ public:
|
|||||||
* Gets the connection for this client.
|
* Gets the connection for this client.
|
||||||
*/
|
*/
|
||||||
EQStream *GetConnection() { return connection; }
|
EQStream *GetConnection() { return connection; }
|
||||||
|
|
||||||
|
EQEmu::Random random;
|
||||||
private:
|
private:
|
||||||
EQStream *connection;
|
EQStream *connection;
|
||||||
ClientVersion version;
|
ClientVersion version;
|
||||||
|
|||||||
@ -94,6 +94,8 @@ OP_ClearBlockedBuffs=0x5d3c
|
|||||||
OP_WorldObjectsSent=0x7fa8
|
OP_WorldObjectsSent=0x7fa8
|
||||||
OP_SendExpZonein=0x25ab
|
OP_SendExpZonein=0x25ab
|
||||||
OP_SendAATable=0x7791
|
OP_SendAATable=0x7791
|
||||||
|
OP_ClearAA=0x422e
|
||||||
|
OP_ClearLeadershipAbilities=0xb978
|
||||||
OP_RespondAA=0x379d
|
OP_RespondAA=0x379d
|
||||||
OP_UpdateAA=0x504f
|
OP_UpdateAA=0x504f
|
||||||
OP_SendAAStats=0x3d1c
|
OP_SendAAStats=0x3d1c
|
||||||
@ -367,7 +369,7 @@ OP_DzLeaderStatus=0x4021
|
|||||||
OP_DzExpeditionEndsWarning=0x32eb
|
OP_DzExpeditionEndsWarning=0x32eb
|
||||||
OP_DzMemberList=0x348f
|
OP_DzMemberList=0x348f
|
||||||
OP_DzCompass=0x0e01 # Was 0x4f09
|
OP_DzCompass=0x0e01 # Was 0x4f09
|
||||||
OP_DzChooseZone=0x0000 # Maybe 0x29d6
|
OP_DzChooseZone=0x6e5e # Maybe 0x29d6
|
||||||
|
|
||||||
# New Opcodes
|
# New Opcodes
|
||||||
OP_SpawnPositionUpdate=0x0000 # Actually OP_MobUpdate ?
|
OP_SpawnPositionUpdate=0x0000 # Actually OP_MobUpdate ?
|
||||||
|
|||||||
662
utils/patches/patch_RoF2.conf
Normal file
662
utils/patches/patch_RoF2.conf
Normal file
@ -0,0 +1,662 @@
|
|||||||
|
# ShowEQ Import Notes:
|
||||||
|
# ZERO THE FILE first
|
||||||
|
# perl -pi -e 's/0x[0-9a-fA-F]{4}/0x0000/g' opcodes.conf
|
||||||
|
# Unknown Mapping:
|
||||||
|
# OP_Action2 -> OP_Damage
|
||||||
|
# OP_EnvDamage -> OP_Damage ---> might have been a one time mistake
|
||||||
|
# Name Differences:
|
||||||
|
# OP_CancelInvite -> OP_GroupCancelInvite
|
||||||
|
# OP_GMFind -> OP_FindPersonRequest
|
||||||
|
# OP_CommonMessage -> OP_ChannelMessage
|
||||||
|
|
||||||
|
OP_Unknown=0x0000
|
||||||
|
OP_ExploreUnknown=0x0000 # used for unknown explorer
|
||||||
|
|
||||||
|
# world packets
|
||||||
|
# Required to reach Char Select:
|
||||||
|
OP_SendLoginInfo=0x7a09
|
||||||
|
OP_ApproveWorld=0x7499
|
||||||
|
OP_LogServer=0x7ceb
|
||||||
|
OP_SendCharInfo=0x00d2
|
||||||
|
OP_ExpansionInfo=0x590d
|
||||||
|
OP_GuildsList=0x507a
|
||||||
|
OP_EnterWorld=0x578f
|
||||||
|
OP_PostEnterWorld=0x6259
|
||||||
|
OP_World_Client_CRC1=0x12cc
|
||||||
|
OP_World_Client_CRC2=0x0f13
|
||||||
|
OP_SendSpellChecksum=0x0000
|
||||||
|
OP_SendSkillCapsChecksum=0x0000
|
||||||
|
|
||||||
|
# Character Select Related:
|
||||||
|
OP_SendMaxCharacters=0x5475
|
||||||
|
OP_SendMembership=0x7acc
|
||||||
|
OP_SendMembershipDetails=0x057b
|
||||||
|
OP_CharacterCreateRequest=0x6773
|
||||||
|
OP_CharacterCreate=0x6bbf
|
||||||
|
OP_DeleteCharacter=0x1808
|
||||||
|
OP_RandomNameGenerator=0x5954
|
||||||
|
OP_ApproveName=0x56a2
|
||||||
|
OP_MOTD=0x0c22
|
||||||
|
OP_SetChatServer=0x1bc5
|
||||||
|
OP_SetChatServer2=0x7eec
|
||||||
|
OP_ZoneServerInfo=0x4c44
|
||||||
|
OP_WorldComplete=0x4493
|
||||||
|
OP_WorldUnknown001=0x2301
|
||||||
|
OP_FloatListThing=0x46c6
|
||||||
|
|
||||||
|
# Reasons for Disconnect:
|
||||||
|
OP_ZoneUnavail=0x4cb4
|
||||||
|
OP_WorldClientReady=0x23c1
|
||||||
|
OP_CharacterStillInZone=0x0000
|
||||||
|
OP_WorldChecksumFailure=0x0000
|
||||||
|
OP_WorldLoginFailed=0x0000
|
||||||
|
OP_WorldLogout=0x0000
|
||||||
|
OP_WorldLevelTooHigh=0x0000
|
||||||
|
OP_CharInacessable=0x0000
|
||||||
|
OP_UserCompInfo=0x0000
|
||||||
|
OP_SendExeChecksum=0x0000
|
||||||
|
OP_SendBaseDataChecksum=0x0000
|
||||||
|
|
||||||
|
# Zone in opcodes
|
||||||
|
OP_AckPacket=0x471d
|
||||||
|
OP_ZoneEntry=0x5089
|
||||||
|
OP_ReqNewZone=0x7887
|
||||||
|
OP_NewZone=0x1795
|
||||||
|
OP_ZoneSpawns=0x5237
|
||||||
|
OP_PlayerProfile=0x6506
|
||||||
|
OP_TimeOfDay=0x5070
|
||||||
|
OP_LevelUpdate=0x1eec
|
||||||
|
OP_Stamina=0x2a79
|
||||||
|
OP_RequestClientZoneChange=0x3fcf
|
||||||
|
OP_ZoneChange=0x2d18
|
||||||
|
OP_LockoutTimerInfo=0x0000
|
||||||
|
OP_ZoneServerReady=0x0000
|
||||||
|
OP_ZoneInUnknown=0x0000
|
||||||
|
OP_LogoutReply=0x0000
|
||||||
|
OP_PreLogoutReply=0x0000
|
||||||
|
|
||||||
|
# Required to fully log in
|
||||||
|
OP_SpawnAppearance=0x0971
|
||||||
|
OP_ChangeSize=0x4707
|
||||||
|
OP_TributeUpdate=0x5961
|
||||||
|
OP_TributeTimer=0x073d
|
||||||
|
OP_SendTributes=0x729b
|
||||||
|
OP_SendGuildTributes=0x1877
|
||||||
|
OP_TributeInfo=0x4254
|
||||||
|
OP_Weather=0x661e
|
||||||
|
OP_ReqClientSpawn=0x35fa
|
||||||
|
OP_SpawnDoor=0x7291
|
||||||
|
OP_GroundSpawn=0x6fca
|
||||||
|
OP_SendZonepoints=0x69a4
|
||||||
|
OP_BlockedBuffs=0x3033
|
||||||
|
OP_RemoveBlockedBuffs=0x0de7
|
||||||
|
OP_ClearBlockedBuffs=0x34cb
|
||||||
|
OP_WorldObjectsSent=0x5ae2
|
||||||
|
OP_SendExpZonein=0x5f8e
|
||||||
|
OP_SendAATable=0x66b5
|
||||||
|
OP_ClearAA=0x0f50
|
||||||
|
OP_ClearLeadershipAbilities=0x6da5
|
||||||
|
OP_RespondAA=0x7a27
|
||||||
|
OP_UpdateAA=0x66f0
|
||||||
|
OP_SendAAStats=0x43c8
|
||||||
|
OP_AAExpUpdate=0x7d14
|
||||||
|
OP_ExpUpdate=0x20ed
|
||||||
|
OP_HPUpdate=0x2828
|
||||||
|
OP_ManaChange=0x5467
|
||||||
|
OP_TGB=0x0876
|
||||||
|
OP_SpecialMesg=0x0083
|
||||||
|
OP_GuildMemberList=0x12a6
|
||||||
|
OP_GuildMOTD=0x3e13
|
||||||
|
OP_CharInventory=0x5ca6
|
||||||
|
OP_WearChange=0x7994
|
||||||
|
OP_ClientUpdate=0x7dfc
|
||||||
|
OP_ClientReady=0x345d
|
||||||
|
OP_SetServerFilter=0x444d
|
||||||
|
|
||||||
|
# Guild Opcodes - Disabled until crashes are resolved in RoF
|
||||||
|
OP_GetGuildMOTD=0x36e0
|
||||||
|
OP_GetGuildMOTDReply=0x4f1f
|
||||||
|
OP_GuildMemberUpdate=0x69b9
|
||||||
|
OP_GuildInvite=0x7099
|
||||||
|
OP_GuildRemove=0x1444
|
||||||
|
OP_GuildPeace=0x67e3
|
||||||
|
OP_SetGuildMOTD=0x0b0b
|
||||||
|
OP_GuildList=0x6279
|
||||||
|
OP_GuildWar=0x1ffb
|
||||||
|
OP_GuildLeader=0x7e09
|
||||||
|
OP_GuildDelete=0x3708
|
||||||
|
OP_GuildInviteAccept=0x7053
|
||||||
|
OP_GuildDemote=0x2d4e
|
||||||
|
OP_GuildPromote=0x0000
|
||||||
|
OP_GuildPublicNote=0x5053
|
||||||
|
OP_GuildManageBanker=0x748f
|
||||||
|
OP_GuildBank=0x5134
|
||||||
|
OP_SetGuildRank=0x0b9c
|
||||||
|
OP_GuildUpdateURLAndChannel=0x2958
|
||||||
|
OP_GuildStatus=0x7326
|
||||||
|
OP_GuildCreate=0x76d9
|
||||||
|
OP_GuildMemberLevelUpdate=0x0000 # Unused?
|
||||||
|
OP_ZoneGuildList=0x0000 # Unused?
|
||||||
|
OP_GetGuildsList=0x0000 # Unused?
|
||||||
|
OP_LFGuild=0x0000
|
||||||
|
OP_GuildManageRemove=0x0000
|
||||||
|
OP_GuildManageAdd=0x0000
|
||||||
|
OP_GuildManageStatus=0x0000
|
||||||
|
|
||||||
|
# GM/Guide Opcodes
|
||||||
|
OP_GMServers=0x08c1
|
||||||
|
OP_GMBecomeNPC=0x3ae1
|
||||||
|
OP_GMZoneRequest=0x62ac
|
||||||
|
OP_GMZoneRequest2=0x7e1a
|
||||||
|
OP_GMGoto=0x7d8e
|
||||||
|
OP_GMSearchCorpse=0x357c
|
||||||
|
OP_GMHideMe=0x79c5
|
||||||
|
OP_GMDelCorpse=0x607e
|
||||||
|
OP_GMApproval=0x6db5
|
||||||
|
OP_GMToggle=0x2097
|
||||||
|
OP_GMSummon=0x486f
|
||||||
|
OP_GMEmoteZone=0x1cfd
|
||||||
|
OP_GMEmoteWorld=0x458e
|
||||||
|
OP_GMFind=0x4a8f
|
||||||
|
OP_GMKick=0x26a7
|
||||||
|
OP_GMKill=0x51d3
|
||||||
|
OP_GMNameChange=0x035f
|
||||||
|
OP_GMLastName=0x46ce
|
||||||
|
|
||||||
|
# Misc Opcodes
|
||||||
|
OP_InspectRequest=0x57bc
|
||||||
|
OP_InspectAnswer=0x71ac
|
||||||
|
OP_InspectMessageUpdate=0x4d25
|
||||||
|
OP_BeginCast=0x318f
|
||||||
|
OP_ColoredText=0x43af
|
||||||
|
OP_ConsentResponse=0x384a
|
||||||
|
OP_MemorizeSpell=0x217c
|
||||||
|
OP_SwapSpell=0x0efa
|
||||||
|
OP_CastSpell=0x1287
|
||||||
|
OP_Consider=0x742b
|
||||||
|
OP_FormattedMessage=0x1024
|
||||||
|
OP_SimpleMessage=0x213f
|
||||||
|
OP_Buff=0x659c
|
||||||
|
OP_Illusion=0x312a
|
||||||
|
OP_MoneyOnCorpse=0x5f44
|
||||||
|
OP_RandomReply=0x106b
|
||||||
|
OP_DenyResponse=0x2382
|
||||||
|
OP_SkillUpdate=0x04c
|
||||||
|
OP_GMTrainSkillConfirm=0x4b64
|
||||||
|
OP_RandomReq=0x7b10
|
||||||
|
OP_Death=0x6517
|
||||||
|
OP_GMTraining=0x1966
|
||||||
|
OP_GMEndTraining=0x4d6b
|
||||||
|
OP_GMTrainSkill=0x2a85
|
||||||
|
OP_Animation=0x7177
|
||||||
|
OP_Begging=0x6703
|
||||||
|
OP_Consent=0x1fd1
|
||||||
|
OP_ConsentDeny=0x7a45
|
||||||
|
OP_AutoFire=0x241e
|
||||||
|
OP_PetCommands=0x0159
|
||||||
|
OP_DeleteSpell=0x52e5
|
||||||
|
OP_Surname=0x0423
|
||||||
|
OP_ClearSurname=0x3fb0
|
||||||
|
OP_FaceChange=0x5578
|
||||||
|
OP_SenseHeading=0x260a
|
||||||
|
OP_Action=0x744c
|
||||||
|
OP_ConsiderCorpse=0x5204
|
||||||
|
OP_HideCorpse=0x49e1
|
||||||
|
OP_CorpseDrag=0x0904
|
||||||
|
OP_CorpseDrop=0x7037
|
||||||
|
OP_Bug=0x73f4
|
||||||
|
OP_Feedback=0x5602
|
||||||
|
OP_Report=0x1414
|
||||||
|
OP_Damage=0x6f15
|
||||||
|
OP_ChannelMessage=0x2b2d
|
||||||
|
OP_Assist=0x4478
|
||||||
|
OP_AssistGroup=0x27f8
|
||||||
|
OP_MoveCoin=0x0bcf
|
||||||
|
OP_ZonePlayerToBind=0x0ecb
|
||||||
|
OP_KeyRing=0x6857
|
||||||
|
OP_WhoAllRequest=0x674b
|
||||||
|
OP_WhoAllResponse=0x578c
|
||||||
|
OP_FriendsWho=0x3956
|
||||||
|
OP_ConfirmDelete=0x43a3
|
||||||
|
OP_Logout=0x4ac6
|
||||||
|
OP_Rewind=0x1745
|
||||||
|
OP_TargetCommand=0x58e2
|
||||||
|
OP_Hide=0x67fe
|
||||||
|
OP_Jump=0x31f4
|
||||||
|
OP_Camp=0x28ec
|
||||||
|
OP_Emote=0x373b
|
||||||
|
OP_SetRunMode=0x009f
|
||||||
|
OP_BankerChange=0x791e
|
||||||
|
OP_TargetMouse=0x075d
|
||||||
|
OP_MobHealth=0x37b1
|
||||||
|
OP_InitialMobHealth=0x0000 # Unused?
|
||||||
|
OP_TargetHoTT=0x0272
|
||||||
|
OP_XTargetResponse=0x672f
|
||||||
|
OP_XTargetRequest=0x45be
|
||||||
|
OP_XTargetAutoAddHaters=0x792c
|
||||||
|
OP_TargetBuffs=0x4f4b
|
||||||
|
OP_BuffCreate=0x3377
|
||||||
|
OP_BuffRemoveRequest=0x64f2
|
||||||
|
OP_DeleteSpawn=0x7280
|
||||||
|
OP_AutoAttack=0x109d
|
||||||
|
OP_AutoAttack2=0x3526
|
||||||
|
OP_Consume=0x4b70
|
||||||
|
OP_MoveItem=0x32ee
|
||||||
|
OP_DeleteItem=0x18ad
|
||||||
|
OP_DeleteCharge=0x01b8
|
||||||
|
OP_ItemPacket=0x368e
|
||||||
|
OP_ItemLinkResponse=0x70c0
|
||||||
|
OP_ItemLinkClick=0x4cef
|
||||||
|
OP_ItemPreview=0x6b5c
|
||||||
|
OP_NewSpawn=0x6097
|
||||||
|
OP_Track=0x17e5
|
||||||
|
OP_TrackTarget=0x0029
|
||||||
|
OP_TrackUnknown=0x4577
|
||||||
|
OP_ClickDoor=0x3a8f
|
||||||
|
OP_MoveDoor=0x08e8
|
||||||
|
OP_RemoveAllDoors=0x700c
|
||||||
|
OP_EnvDamage=0x51fd
|
||||||
|
OP_BoardBoat=0x4211
|
||||||
|
OP_Forage=0x5306
|
||||||
|
OP_LeaveBoat=0x7617
|
||||||
|
OP_ControlBoat=0x0ae7
|
||||||
|
OP_SafeFallSuccess=0x2219
|
||||||
|
OP_RezzComplete=0x760d
|
||||||
|
OP_RezzRequest=0x3c21
|
||||||
|
OP_RezzAnswer=0x701c
|
||||||
|
OP_Shielding=0x48c1
|
||||||
|
OP_RequestDuel=0x3af1
|
||||||
|
OP_MobRename=0x2c57
|
||||||
|
OP_AugmentItem=0x661b
|
||||||
|
OP_WeaponEquip1=0x34a7
|
||||||
|
OP_WeaponEquip2=0x559a
|
||||||
|
OP_WeaponUnequip2=0x2d25
|
||||||
|
OP_ApplyPoison=0x31e6
|
||||||
|
OP_Save=0x4a39
|
||||||
|
OP_TestBuff=0x7cb8
|
||||||
|
OP_CustomTitles=0x100e
|
||||||
|
OP_Split=0x3a54
|
||||||
|
OP_YellForHelp=0x4e56
|
||||||
|
OP_LoadSpellSet=0x261d
|
||||||
|
OP_Bandolier=0x7677
|
||||||
|
OP_PotionBelt=0x1a3e
|
||||||
|
OP_DuelResponse=0x6a46
|
||||||
|
OP_DuelResponse2=0x68d3
|
||||||
|
OP_SaveOnZoneReq=0x600d
|
||||||
|
OP_ReadBook=0x72df
|
||||||
|
OP_Dye=0x23b9
|
||||||
|
OP_InterruptCast=0x048c
|
||||||
|
OP_AAAction=0x424e
|
||||||
|
OP_LeadershipExpToggle=0x6c55
|
||||||
|
OP_LeadershipExpUpdate=0x2797
|
||||||
|
OP_PurchaseLeadershipAA=0x0026
|
||||||
|
OP_UpdateLeadershipAA=0x026
|
||||||
|
OP_MarkNPC=0x5a58
|
||||||
|
OP_MarkRaidNPC=0x74bd #unimplemented
|
||||||
|
OP_ClearNPCMarks=0x2003
|
||||||
|
OP_ClearRaidNPCMarks=0x20d3 #unimplemented
|
||||||
|
OP_DelegateAbility=0x76b8
|
||||||
|
OP_SetGroupTarget=0x2814
|
||||||
|
OP_Charm=0x5d92
|
||||||
|
OP_Stun=0x36a4
|
||||||
|
OP_SendFindableNPCs=0x4613
|
||||||
|
OP_FindPersonRequest=0x5cea
|
||||||
|
OP_FindPersonReply=0x7e58
|
||||||
|
OP_Sound=0x1a30
|
||||||
|
OP_PetBuffWindow=0x5882
|
||||||
|
OP_LevelAppearance=0x3bc9
|
||||||
|
OP_Translocate=0x6580
|
||||||
|
OP_Sacrifice=0x1821
|
||||||
|
OP_PopupResponse=0x08a6
|
||||||
|
OP_OnLevelMessage=0x575b
|
||||||
|
OP_AugmentInfo=0x0afb
|
||||||
|
OP_Petition=0x1901
|
||||||
|
OP_SomeItemPacketMaybe=0x747c
|
||||||
|
OP_PVPStats=0x4b15
|
||||||
|
OP_PVPLeaderBoardRequest=0x04aa
|
||||||
|
OP_PVPLeaderBoardReply=0x071f
|
||||||
|
OP_PVPLeaderBoardDetailsRequest=0x3707
|
||||||
|
OP_PVPLeaderBoardDetailsReply=0x25b7
|
||||||
|
OP_RestState=0x000f
|
||||||
|
OP_RespawnWindow=0x28bc
|
||||||
|
OP_LDoNButton=0x5327
|
||||||
|
OP_SetStartCity=0x6326
|
||||||
|
OP_VoiceMacroIn=0x17fd
|
||||||
|
OP_VoiceMacroOut=0x409a
|
||||||
|
OP_ItemViewUnknown=0x465b
|
||||||
|
OP_VetRewardsAvaliable=0x590e
|
||||||
|
OP_VetClaimRequest=0x1126
|
||||||
|
OP_VetClaimReply=0x16d4
|
||||||
|
OP_DisciplineUpdate=0x759e
|
||||||
|
OP_DisciplineTimer=0x6989
|
||||||
|
OP_BecomeCorpse=0x0000 # Unused?
|
||||||
|
OP_Action2=0x0000 # Unused?
|
||||||
|
OP_MobUpdate=0x2c84
|
||||||
|
OP_NPCMoveUpdate=0x5892
|
||||||
|
OP_CameraEffect=0x127f
|
||||||
|
OP_SpellEffect=0x5936
|
||||||
|
OP_RemoveNimbusEffect=0x7b1e
|
||||||
|
OP_AltCurrency=0x6b6d
|
||||||
|
OP_AltCurrencyMerchantRequest=0x5409
|
||||||
|
OP_AltCurrencyMerchantReply=0x27a2
|
||||||
|
OP_AltCurrencyPurchase=0x3788
|
||||||
|
OP_AltCurrencySell=0x40b6
|
||||||
|
OP_AltCurrencySellSelection=0x532a
|
||||||
|
OP_AltCurrencyReclaim=0x0339
|
||||||
|
OP_CrystalCountUpdate=0x467f
|
||||||
|
OP_CrystalCreate=0x7aee
|
||||||
|
OP_CrystalReclaim=0x2439
|
||||||
|
OP_Untargetable=0x053c
|
||||||
|
OP_IncreaseStats=0x70a3
|
||||||
|
OP_Weblink=0x6f4b
|
||||||
|
OP_OpenContainer=0x0000
|
||||||
|
OP_Marquee=0x502e
|
||||||
|
OP_ItemRecastDelay=0x15a9
|
||||||
|
#OP_OpenInventory=0x0000 # Likely does not exist in RoF -U
|
||||||
|
|
||||||
|
OP_DzQuit=0x205f
|
||||||
|
OP_DzListTimers=0x0398
|
||||||
|
OP_DzAddPlayer=0x59ca
|
||||||
|
OP_DzRemovePlayer=0x4701
|
||||||
|
OP_DzSwapPlayer=0x1abc
|
||||||
|
OP_DzMakeLeader=0x405b
|
||||||
|
OP_DzPlayerList=0x543d
|
||||||
|
OP_DzJoinExpeditionConfirm=0x14c6
|
||||||
|
OP_DzJoinExpeditionReply=0x7f4b
|
||||||
|
OP_DzExpeditionInfo=0x4f7e
|
||||||
|
OP_DzExpeditionList=0x9119
|
||||||
|
OP_DzMemberStatus=0xb2e3
|
||||||
|
OP_DzLeaderStatus=0x32f0
|
||||||
|
OP_DzExpeditionEndsWarning=0x7e94
|
||||||
|
OP_DzMemberList=0x3de9
|
||||||
|
OP_DzCompass=0x3e0e
|
||||||
|
OP_DzChooseZone=0x0b7d
|
||||||
|
|
||||||
|
# New Opcodes
|
||||||
|
OP_SpawnPositionUpdate=0x0000 # Actually OP_MobUpdate ?
|
||||||
|
OP_ManaUpdate=0x3791
|
||||||
|
OP_EnduranceUpdate=0x5f42
|
||||||
|
OP_MobManaUpdate=0x2404
|
||||||
|
OP_MobEnduranceUpdate=0x1c81
|
||||||
|
|
||||||
|
# Mercenary Opcodes
|
||||||
|
OP_MercenaryDataUpdateRequest=0x7b89
|
||||||
|
OP_MercenaryDataUpdate=0x61a4
|
||||||
|
OP_MercenaryDataRequest=0x11c1
|
||||||
|
OP_MercenaryDataResponse=0x72ce
|
||||||
|
OP_MercenaryHire=0x7169
|
||||||
|
OP_MercenaryDismiss=0x6e83
|
||||||
|
OP_MercenaryTimerRequest=0x31e4
|
||||||
|
OP_MercenaryTimer=0x0763
|
||||||
|
OP_MercenaryUnknown1=0x5d26
|
||||||
|
OP_MercenaryCommand=0x27f2
|
||||||
|
OP_MercenarySuspendRequest=0x4407
|
||||||
|
OP_MercenarySuspendResponse=0x6f03
|
||||||
|
OP_MercenaryUnsuspendResponse=0x27a0
|
||||||
|
|
||||||
|
# Looting
|
||||||
|
OP_LootRequest=0x0adf
|
||||||
|
OP_EndLootRequest=0x30f7
|
||||||
|
OP_LootItem=0x4dc9
|
||||||
|
OP_LootComplete=0x55c4
|
||||||
|
|
||||||
|
# bazaar trader stuff:
|
||||||
|
OP_BazaarSearch=0x39d6
|
||||||
|
OP_TraderDelItem=0x0000
|
||||||
|
OP_BecomeTrader=0x61b3
|
||||||
|
OP_TraderShop=0x31df
|
||||||
|
OP_Trader=0x4ef5
|
||||||
|
OP_TraderBuy=0x0000
|
||||||
|
OP_Barter=0x243a
|
||||||
|
OP_ShopItem=0x0000
|
||||||
|
OP_BazaarInspect=0x0000
|
||||||
|
OP_Bazaar=0x0000
|
||||||
|
OP_TraderItemUpdate=0x0000
|
||||||
|
|
||||||
|
# pc/npc trading
|
||||||
|
OP_TradeRequest=0x77b5
|
||||||
|
OP_TradeAcceptClick=0x69e2
|
||||||
|
OP_TradeRequestAck=0x14bf
|
||||||
|
OP_TradeCoins=0x4206
|
||||||
|
OP_FinishTrade=0x3993
|
||||||
|
OP_CancelTrade=0x354c
|
||||||
|
OP_TradeMoneyUpdate=0x68c2
|
||||||
|
OP_MoneyUpdate=0x640c
|
||||||
|
OP_TradeBusy=0x5505
|
||||||
|
|
||||||
|
# Sent after canceling trade or after closing tradeskill object
|
||||||
|
OP_FinishWindow=0x7349
|
||||||
|
OP_FinishWindow2=0x40ef
|
||||||
|
|
||||||
|
# Sent on Live for what seems to be item existance verification
|
||||||
|
# Ex. Before Right Click Effect happens from items
|
||||||
|
OP_ItemVerifyRequest=0x189c
|
||||||
|
OP_ItemVerifyReply=0x097b
|
||||||
|
|
||||||
|
# merchant stuff
|
||||||
|
OP_ShopPlayerSell=0x0000
|
||||||
|
OP_ShopRequest=0x4fed
|
||||||
|
OP_ShopEnd=0x30a8
|
||||||
|
OP_ShopEndConfirm=0x3196
|
||||||
|
OP_ShopPlayerBuy=0x0ddd
|
||||||
|
OP_ShopDelItem=0x724f
|
||||||
|
|
||||||
|
# tradeskill stuff:
|
||||||
|
OP_ClickObject=0x4aa1
|
||||||
|
OP_ClickObjectAction=0x0c1e
|
||||||
|
OP_ClearObject=0x7a11
|
||||||
|
OP_RecipeDetails=0x40d7
|
||||||
|
OP_RecipesFavorite=0x71b1
|
||||||
|
OP_RecipesSearch=0x1db6
|
||||||
|
OP_RecipeReply=0x6e02
|
||||||
|
OP_RecipeAutoCombine=0x6261
|
||||||
|
OP_TradeSkillCombine=0x579a
|
||||||
|
|
||||||
|
# Tribute Packets:
|
||||||
|
OP_OpenGuildTributeMaster=0x378d
|
||||||
|
OP_OpenTributeMaster=0x7666
|
||||||
|
OP_SelectTribute=0x79fc
|
||||||
|
OP_TributeItem=0x4f3e
|
||||||
|
OP_TributeMoney=0x58fb
|
||||||
|
OP_TributeToggle=0x241d
|
||||||
|
OP_TributePointUpdate=0x5300
|
||||||
|
OP_TributeNPC=0x0000
|
||||||
|
OP_GuildTributeInfo=0x0000
|
||||||
|
OP_OpenTributeReply=0x0000
|
||||||
|
OP_GuildTributeStatus=0x0000
|
||||||
|
|
||||||
|
# Adventure packets:
|
||||||
|
OP_LeaveAdventure=0x5d18
|
||||||
|
OP_AdventureFinish=0x400f
|
||||||
|
OP_AdventureInfoRequest=0x3cb0
|
||||||
|
OP_AdventureInfo=0x4c54
|
||||||
|
OP_AdventureRequest=0x2c6c
|
||||||
|
OP_AdventureDetails=0x5648
|
||||||
|
OP_AdventureData=0x7171
|
||||||
|
OP_AdventureUpdate=0x1b01
|
||||||
|
OP_AdventureMerchantRequest=0x6922
|
||||||
|
OP_AdventureMerchantResponse=0x3e47
|
||||||
|
OP_AdventureMerchantPurchase=0x5b72
|
||||||
|
OP_AdventureMerchantSell=0x2f9b
|
||||||
|
OP_AdventurePointsUpdate=0x65c3
|
||||||
|
OP_AdventureStatsRequest=0x5a62
|
||||||
|
OP_AdventureStatsReply=0x2370
|
||||||
|
OP_AdventureLeaderboardRequest=0x7093
|
||||||
|
OP_AdventureLeaderboardReply=0x7f79
|
||||||
|
|
||||||
|
# Group Opcodes
|
||||||
|
OP_GroupDisband=0x4c10
|
||||||
|
OP_GroupInvite=0x6110
|
||||||
|
OP_GroupFollow=0x1649
|
||||||
|
OP_GroupUpdate=0x3abb
|
||||||
|
OP_GroupUpdateB=0x6194
|
||||||
|
OP_GroupCancelInvite=0x0000
|
||||||
|
OP_GroupAcknowledge=0x7323
|
||||||
|
OP_GroupDelete=0x0f6c
|
||||||
|
OP_CancelInvite=0x2a50
|
||||||
|
OP_GroupFollow2=0x2060
|
||||||
|
OP_GroupInvite2=0x32c2
|
||||||
|
OP_GroupDisbandYou=0x1ae5
|
||||||
|
OP_GroupDisbandOther=0x74da
|
||||||
|
OP_GroupLeaderChange=0x21b4
|
||||||
|
OP_GroupRoles=0x70e2
|
||||||
|
OP_GroupMakeLeader=0x4229
|
||||||
|
OP_DoGroupLeadershipAbility=0x1fb5
|
||||||
|
OP_GroupLeadershipAAUpdate=0x02cf
|
||||||
|
OP_GroupMentor=0x3342
|
||||||
|
OP_InspectBuffs=0x486c
|
||||||
|
|
||||||
|
# LFG/LFP Opcodes
|
||||||
|
OP_LFGCommand=0x6060
|
||||||
|
OP_LFGGetMatchesRequest=0x0340
|
||||||
|
OP_LFGGetMatchesResponse=0x5048
|
||||||
|
OP_LFPGetMatchesRequest=0x4d7d
|
||||||
|
OP_LFPGetMatchesResponse=0x22c6
|
||||||
|
OP_LFPCommand=0x49a9
|
||||||
|
OP_LFGAppearance=0x0000
|
||||||
|
OP_LFGResponse=0x0000
|
||||||
|
|
||||||
|
# Raid Opcodes
|
||||||
|
OP_RaidInvite=0x55ac
|
||||||
|
OP_RaidUpdate=0x3973
|
||||||
|
OP_RaidJoin=0x0000
|
||||||
|
|
||||||
|
# Button-push commands
|
||||||
|
OP_Taunt=0x2703
|
||||||
|
OP_CombatAbility=0x3eba
|
||||||
|
OP_SenseTraps=0x02af
|
||||||
|
OP_PickPocket=0x39e8
|
||||||
|
OP_DisarmTraps=0x78bf
|
||||||
|
OP_Disarm=0x5ec8
|
||||||
|
OP_Sneak=0x5d55
|
||||||
|
OP_Fishing=0x1e2a
|
||||||
|
OP_InstillDoubt=0x640e
|
||||||
|
OP_FeignDeath=0x52fa
|
||||||
|
OP_Mend=0x0ecf
|
||||||
|
OP_Bind_Wound=0x0386
|
||||||
|
OP_LDoNOpen=0x3d5c
|
||||||
|
|
||||||
|
# Task packets
|
||||||
|
OP_TaskDescription=0x3714
|
||||||
|
OP_TaskActivity=0x08d3
|
||||||
|
OP_CompletedTasks=0x4eba
|
||||||
|
OP_TaskActivityComplete=0x5e19
|
||||||
|
OP_AcceptNewTask=0x0a23
|
||||||
|
OP_CancelTask=0x39f0
|
||||||
|
OP_TaskMemberList=0x5727
|
||||||
|
OP_OpenNewTasksWindow=0x48a2
|
||||||
|
OP_AvaliableTask=0x36e8
|
||||||
|
OP_TaskHistoryRequest=0x5f1c
|
||||||
|
OP_TaskHistoryReply=0x3d05
|
||||||
|
OP_DeclineAllTasks=0x0000
|
||||||
|
|
||||||
|
# Title opcodes
|
||||||
|
OP_NewTitlesAvailable=0x0d32
|
||||||
|
OP_RequestTitles=0x6344
|
||||||
|
OP_SendTitleList=0x2d08
|
||||||
|
OP_SetTitle=0x6527
|
||||||
|
OP_SetTitleReply=0x4c21
|
||||||
|
|
||||||
|
# mail opcodes
|
||||||
|
OP_Command=0x0000
|
||||||
|
OP_MailboxHeader=0x0000
|
||||||
|
OP_MailHeader=0x0000
|
||||||
|
OP_MailBody=0x0000
|
||||||
|
OP_NewMail=0x0000
|
||||||
|
OP_SentConfirm=0x0000
|
||||||
|
|
||||||
|
########### Below this point should not be needed ###########
|
||||||
|
|
||||||
|
# This section are all unknown in Titanium
|
||||||
|
OP_ForceFindPerson=0x0000
|
||||||
|
OP_LocInfo=0x0000
|
||||||
|
OP_ReloadUI=0x0000
|
||||||
|
OP_ItemName=0x0000
|
||||||
|
OP_ItemLinkText=0x0000
|
||||||
|
OP_MultiLineMsg=0x0000
|
||||||
|
OP_MendHPUpdate=0x0000
|
||||||
|
OP_TargetReject=0x0000
|
||||||
|
OP_SafePoint=0x0000
|
||||||
|
OP_ApproveZone=0x0000
|
||||||
|
OP_ZoneComplete=0x0000
|
||||||
|
OP_ClientError=0x0000
|
||||||
|
OP_DumpName=0x0000
|
||||||
|
OP_Heartbeat=0x0000
|
||||||
|
OP_CrashDump=0x0000
|
||||||
|
OP_LoginComplete=0x0000
|
||||||
|
|
||||||
|
# discovered opcodes not yet used:
|
||||||
|
OP_PickLockSuccess=0x0000
|
||||||
|
OP_PlayMP3=0x5770
|
||||||
|
OP_ReclaimCrystals=0x0000
|
||||||
|
OP_DynamicWall=0x0000
|
||||||
|
OP_OpenDiscordMerchant=0x0000
|
||||||
|
OP_DiscordMerchantInventory=0x0000
|
||||||
|
OP_GiveMoney=0x0000
|
||||||
|
OP_RequestKnowledgeBase=0x0000
|
||||||
|
OP_KnowledgeBase=0x0000
|
||||||
|
OP_SlashAdventure=0x0000 # /adventure
|
||||||
|
OP_BecomePVPPrompt=0x0000
|
||||||
|
OP_MoveLogRequest=0x0000 # gone I think
|
||||||
|
OP_MoveLogDisregard=0x0000 # gone I think
|
||||||
|
|
||||||
|
# named unknowns, to make looking for real unknown easier
|
||||||
|
OP_AnnoyingZoneUnknown=0x0000
|
||||||
|
OP_Some6ByteHPUpdate=0x0000 seems to happen when you target group members
|
||||||
|
OP_QueryResponseThing=0x0000
|
||||||
|
|
||||||
|
|
||||||
|
# realityincarnate: these are just here to stop annoying several thousand byte packet dumps
|
||||||
|
#OP_LoginUnknown1=0x46d3 # OP_SendSpellChecksum
|
||||||
|
#OP_LoginUnknown2=0x040b # OP_SendSkillCapsChecksum
|
||||||
|
|
||||||
|
# Petition Opcodes
|
||||||
|
OP_PetitionSearch=0x0000 search term for petition
|
||||||
|
OP_PetitionSearchResults=0x0000 (list of?) matches from search
|
||||||
|
OP_PetitionSearchText=0x0000 text results of search
|
||||||
|
|
||||||
|
OP_PetitionUpdate=0x0000
|
||||||
|
OP_PetitionCheckout=0x0000
|
||||||
|
OP_PetitionCheckIn=0x0000
|
||||||
|
OP_PetitionQue=0x0000
|
||||||
|
OP_PetitionUnCheckout=0x0000
|
||||||
|
OP_PetitionDelete=0x0000
|
||||||
|
OP_DeletePetition=0x0000
|
||||||
|
OP_PetitionResolve=0x0000
|
||||||
|
OP_PDeletePetition=0x0000
|
||||||
|
OP_PetitionBug=0x0000
|
||||||
|
OP_PetitionRefresh=0x0000
|
||||||
|
OP_PetitionCheckout2=0x0000
|
||||||
|
OP_PetitionViewPetition=0x0000
|
||||||
|
|
||||||
|
# Login opcodes
|
||||||
|
OP_SessionReady=0x0000
|
||||||
|
OP_Login=0x0000
|
||||||
|
OP_ServerListRequest=0x0000
|
||||||
|
OP_PlayEverquestRequest=0x0000
|
||||||
|
OP_PlayEverquestResponse=0x0000
|
||||||
|
OP_ChatMessage=0x0000
|
||||||
|
OP_LoginAccepted=0x0000
|
||||||
|
OP_ServerListResponse=0x0000
|
||||||
|
OP_Poll=0x0000
|
||||||
|
OP_EnterChat=0x0000
|
||||||
|
OP_PollResponse=0x0000
|
||||||
|
|
||||||
|
# raw opcodes
|
||||||
|
OP_RAWSessionRequest=0x0000
|
||||||
|
OP_RAWSessionResponse=0x0000
|
||||||
|
OP_RAWCombined=0x0000
|
||||||
|
OP_RAWSessionDisconnect=0x0000
|
||||||
|
OP_RAWKeepAlive=0x0000
|
||||||
|
OP_RAWSessionStatRequest=0x0000
|
||||||
|
OP_RAWSessionStatResponse=0x0000
|
||||||
|
OP_RAWPacket=0x0000
|
||||||
|
OP_RAWFragment=0x0000
|
||||||
|
OP_RAWOutOfOrderAck=0x0000
|
||||||
|
OP_RAWAck=0x0000
|
||||||
|
OP_RAWAppCombined=0x0000
|
||||||
|
OP_RAWOutOfSession=0x0000
|
||||||
|
|
||||||
|
# we need to document the differences between these packets to make identifying them easier
|
||||||
|
OP_Some3ByteHPUpdate=0x0000 # initial HP update for mobs
|
||||||
|
OP_InitialHPUpdate=0x0000
|
||||||
@ -158,7 +158,7 @@ OP_GMApproval=0x72fa # C
|
|||||||
OP_GMToggle=0x7566 # C
|
OP_GMToggle=0x7566 # C
|
||||||
OP_GMSummon=0x596d # C
|
OP_GMSummon=0x596d # C
|
||||||
OP_GMEmoteZone=0x3e7c # C
|
OP_GMEmoteZone=0x3e7c # C
|
||||||
OP_GMEmoteWorld=0x3e7c # C
|
OP_GMEmoteWorld=0x5298 # C
|
||||||
OP_GMFind=0x6e27 # C
|
OP_GMFind=0x6e27 # C
|
||||||
OP_GMKick=0x799c # C
|
OP_GMKick=0x799c # C
|
||||||
OP_GMKill=0x6685 # C
|
OP_GMKill=0x6685 # C
|
||||||
@ -369,7 +369,7 @@ OP_DzExpeditionEndsWarning=0x1879
|
|||||||
OP_DzExpeditionList=0x3657
|
OP_DzExpeditionList=0x3657
|
||||||
OP_DzMemberList=0x74e4
|
OP_DzMemberList=0x74e4
|
||||||
OP_DzCompass=0x35d3
|
OP_DzCompass=0x35d3
|
||||||
OP_DzChooseZone=0xd8a
|
OP_DzChooseZone=0x0d8a
|
||||||
#0x1d99 was grouped with these too but I don't really know it's purpose.
|
#0x1d99 was grouped with these too but I don't really know it's purpose.
|
||||||
|
|
||||||
# New Opcodes
|
# New Opcodes
|
||||||
@ -531,7 +531,8 @@ OP_Shroud=0x6d1f
|
|||||||
OP_ShroudRemove=0x17f6
|
OP_ShroudRemove=0x17f6
|
||||||
OP_ShroudUnknown1=0x169a
|
OP_ShroudUnknown1=0x169a
|
||||||
OP_ShroudUnknown2=0x4292
|
OP_ShroudUnknown2=0x4292
|
||||||
OP_ShroudClearAA=0x3bef
|
OP_ClearAA=0x3bef
|
||||||
|
OP_ClearLeadershipAbilities=0x6e58
|
||||||
OP_ShroudSelectionWindow=0x4d79
|
OP_ShroudSelectionWindow=0x4d79
|
||||||
OP_ShroudRequestStats=0x28ce
|
OP_ShroudRequestStats=0x28ce
|
||||||
OP_ShroudRespondStats=0x33f2
|
OP_ShroudRespondStats=0x33f2
|
||||||
@ -580,7 +581,6 @@ OP_MultiLineMsg=0x0000 #
|
|||||||
OP_MendHPUpdate=0x0000 #
|
OP_MendHPUpdate=0x0000 #
|
||||||
OP_TargetReject=0x0000 #
|
OP_TargetReject=0x0000 #
|
||||||
OP_SafePoint=0x0000 #
|
OP_SafePoint=0x0000 #
|
||||||
OP_IncreaseStats=0x0000 #
|
|
||||||
OP_ApproveZone=0x0000 #
|
OP_ApproveZone=0x0000 #
|
||||||
OP_ZoneComplete=0x0000 #
|
OP_ZoneComplete=0x0000 #
|
||||||
OP_ClientError=0x0000 #
|
OP_ClientError=0x0000 #
|
||||||
|
|||||||
@ -85,6 +85,8 @@ OP_TaskActivity=0x2E60 #SEQ 12/04/08
|
|||||||
OP_CompletedTasks=0x75AC #Derision 2009
|
OP_CompletedTasks=0x75AC #Derision 2009
|
||||||
OP_Weather=0x70A5 #SEQ 12/04/08
|
OP_Weather=0x70A5 #SEQ 12/04/08
|
||||||
OP_SendAATable=0x6F05 #Trevius 12/20/08
|
OP_SendAATable=0x6F05 #Trevius 12/20/08
|
||||||
|
OP_ClearAA=0x71b9
|
||||||
|
OP_ClearLeadershipAbilities=0x74e5
|
||||||
OP_UpdateAA=0x45D2 #Trevius 12/20/08
|
OP_UpdateAA=0x45D2 #Trevius 12/20/08
|
||||||
OP_RespondAA=0x4426 #Trevius 12/20/08
|
OP_RespondAA=0x4426 #Trevius 12/20/08
|
||||||
OP_ReqClientSpawn=0x014C #SEQ 12/04/08
|
OP_ReqClientSpawn=0x014C #SEQ 12/04/08
|
||||||
@ -331,6 +333,7 @@ OP_InspectMessageUpdate=0x67e9 # C
|
|||||||
OP_OpenInventory=0x66c8
|
OP_OpenInventory=0x66c8
|
||||||
OP_OpenContainer=0x10e3
|
OP_OpenContainer=0x10e3
|
||||||
OP_Marquee=0x2f75
|
OP_Marquee=0x2f75
|
||||||
|
OP_Untargetable=0x3e36
|
||||||
|
|
||||||
#expedition
|
#expedition
|
||||||
OP_DzQuit=0x20d6
|
OP_DzQuit=0x20d6
|
||||||
@ -530,7 +533,7 @@ OP_MultiLineMsg=0x0000 #
|
|||||||
OP_MendHPUpdate=0x0000 #
|
OP_MendHPUpdate=0x0000 #
|
||||||
OP_TargetReject=0x0000 #
|
OP_TargetReject=0x0000 #
|
||||||
OP_SafePoint=0x0000 #
|
OP_SafePoint=0x0000 #
|
||||||
OP_IncreaseStats=0x0000 #
|
OP_IncreaseStats=0x5ecb #
|
||||||
OP_ApproveZone=0x0000 #
|
OP_ApproveZone=0x0000 #
|
||||||
OP_ZoneComplete=0x0000 #
|
OP_ZoneComplete=0x0000 #
|
||||||
OP_ClientError=0x0000 #
|
OP_ClientError=0x0000 #
|
||||||
@ -544,9 +547,11 @@ OP_PickLockSuccess=0x0000 #
|
|||||||
OP_VetRewardsAvaliable=0x044b #
|
OP_VetRewardsAvaliable=0x044b #
|
||||||
OP_VetClaimRequest=0x7503
|
OP_VetClaimRequest=0x7503
|
||||||
OP_VetClaimReply=0x01e1
|
OP_VetClaimReply=0x01e1
|
||||||
OP_PlayMP3=0x0000 #
|
OP_PlayMP3=0x0d1c #
|
||||||
OP_ReclaimCrystals=0x0000 #
|
OP_ReclaimCrystals=0x0000 #
|
||||||
OP_CrystalCountUpdate=0x64C1 #
|
OP_CrystalCountUpdate=0x64C1 #
|
||||||
|
OP_CrystalCreate=0x65e2
|
||||||
|
OP_CrystalReclaim=0x0730
|
||||||
OP_DynamicWall=0x0000 #
|
OP_DynamicWall=0x0000 #
|
||||||
OP_OpenDiscordMerchant=0x0000 #
|
OP_OpenDiscordMerchant=0x0000 #
|
||||||
OP_DiscordMerchantInventory=0x0000 #
|
OP_DiscordMerchantInventory=0x0000 #
|
||||||
|
|||||||
@ -88,6 +88,8 @@ OP_TaskActivity=0x31f3 # C
|
|||||||
OP_CompletedTasks=0x687f # C
|
OP_CompletedTasks=0x687f # C
|
||||||
OP_Weather=0x4658 # V
|
OP_Weather=0x4658 # V
|
||||||
OP_SendAATable=0x6ef9 # V
|
OP_SendAATable=0x6ef9 # V
|
||||||
|
OP_ClearAA=0x2cd4
|
||||||
|
OP_ClearLeadershipAbilities=0x7b77
|
||||||
OP_UpdateAA=0x7bf6 # V
|
OP_UpdateAA=0x7bf6 # V
|
||||||
OP_RespondAA=0x1fbd # C 0x2bad
|
OP_RespondAA=0x1fbd # C 0x2bad
|
||||||
OP_ReqClientSpawn=0x69cd # V
|
OP_ReqClientSpawn=0x69cd # V
|
||||||
@ -315,7 +317,7 @@ OP_OnLevelMessage=0x24cb # C
|
|||||||
OP_AugmentInfo=0x31b1 # C
|
OP_AugmentInfo=0x31b1 # C
|
||||||
OP_Petition=0x31d1 # C
|
OP_Petition=0x31d1 # C
|
||||||
OP_SomeItemPacketMaybe=0x2c27 # C
|
OP_SomeItemPacketMaybe=0x2c27 # C
|
||||||
OP_PVPStats=0x0000 #
|
OP_PVPStats=0x5272 #
|
||||||
OP_PVPLeaderBoardRequest=0x4973 # C
|
OP_PVPLeaderBoardRequest=0x4973 # C
|
||||||
OP_PVPLeaderBoardReply=0x3842 # C
|
OP_PVPLeaderBoardReply=0x3842 # C
|
||||||
OP_PVPLeaderBoardDetailsRequest=0x6c75 # C
|
OP_PVPLeaderBoardDetailsRequest=0x6c75 # C
|
||||||
@ -373,7 +375,17 @@ OP_DzExpeditionEndsWarning=0x6ac2
|
|||||||
OP_DzExpeditionList=0x70d8
|
OP_DzExpeditionList=0x70d8
|
||||||
OP_DzMemberList=0x15c4
|
OP_DzMemberList=0x15c4
|
||||||
OP_DzCompass=0x01cb
|
OP_DzCompass=0x01cb
|
||||||
OP_DzChooseZone=0x0000
|
OP_DzChooseZone=0x65e1
|
||||||
|
|
||||||
|
#shroud
|
||||||
|
OP_ShroudSelectionWindow=0x72ad
|
||||||
|
OP_ShroudRequestStats=0x488b
|
||||||
|
OP_ShroudRespondStats=0x1910
|
||||||
|
OP_ShroudSelect=0x45d7
|
||||||
|
OP_ShroudSelectCancel=0x666d
|
||||||
|
OP_ShroudProgress=0x6016 # This clears current progress and sets
|
||||||
|
OP_ShroudProgress2=0x66b4 # This just sets progress
|
||||||
|
OP_Shroud=0x1643
|
||||||
|
|
||||||
# New Opcodes
|
# New Opcodes
|
||||||
OP_SpawnPositionUpdate=0x4656 # C
|
OP_SpawnPositionUpdate=0x4656 # C
|
||||||
|
|||||||
3
utils/scripts/opcode_scripts/.gitignore
vendored
Normal file
3
utils/scripts/opcode_scripts/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Input and Output txt and conf files
|
||||||
|
*.txt
|
||||||
|
*.conf
|
||||||
66
utils/scripts/opcode_scripts/conf_to_oplist.pl
Normal file
66
utils/scripts/opcode_scripts/conf_to_oplist.pl
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
#!/usr/bin/perl
|
||||||
|
|
||||||
|
# File Name: conf_to_oplist.pl
|
||||||
|
# Converts a Patch File into the Opcode List with Opcode Names for the Spreadsheet.
|
||||||
|
|
||||||
|
# Directions to use this script:
|
||||||
|
# 1. Paste the contents of the current patch file in the patch_OLD.conf file.
|
||||||
|
# 2. Run this script using "perl conf_to_oplist.pl"
|
||||||
|
# 3. This updates the opcodelist.txt with the values from the Patch File.
|
||||||
|
|
||||||
|
|
||||||
|
$stopmessage = "Failed to open file";
|
||||||
|
open OpcodeFile, "<", "opcodelist.txt" or die $stopmessage;
|
||||||
|
open PatchFile, "<", "patch_OLD.conf" or die $stopmessage;
|
||||||
|
|
||||||
|
my @OpcodeList = <OpcodeFile>;
|
||||||
|
my @PatchFile = <PatchFile>;
|
||||||
|
my %PatchHash = ();
|
||||||
|
|
||||||
|
foreach $line (@PatchFile)
|
||||||
|
{
|
||||||
|
@equalssplit = split(/=/, $line);
|
||||||
|
$ArraySize = @equalssplit;
|
||||||
|
if ($ArraySize > 1)
|
||||||
|
{
|
||||||
|
@OpcodeArray = split(//, $equalssplit[1]);
|
||||||
|
$CurOpcode = $OpcodeArray[0].$OpcodeArray[1].$OpcodeArray[2].$OpcodeArray[3].$OpcodeArray[4].$OpcodeArray[5];
|
||||||
|
$CurOpcode = lc($CurOpcode);
|
||||||
|
# Opcode Name => Opcode
|
||||||
|
$PatchHash{ $CurOpcode } = $equalssplit[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
close(OpcodeFile);
|
||||||
|
close(PatchFile);
|
||||||
|
|
||||||
|
# Clear out file contents
|
||||||
|
open OpcodeResultFile, ">", "opcodelist.txt" or die $stopmessage;
|
||||||
|
print OpcodeResultFile "";
|
||||||
|
close(OpcodeResultFile);
|
||||||
|
|
||||||
|
open OpcodeResultFile, ">>", "opcodelist.txt" or die $stopmessage;
|
||||||
|
|
||||||
|
while( my ($k, $v) = each %$PatchFile )
|
||||||
|
{
|
||||||
|
#print OpcodeResultFile "key: $k, value: $v.\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$TabSpace = " "; # Tab
|
||||||
|
foreach $line (@OpcodeList)
|
||||||
|
{
|
||||||
|
@LineSplit = split(//, $line);
|
||||||
|
$CurOpcode = $LineSplit[0].$LineSplit[1].$LineSplit[2].$LineSplit[3].$LineSplit[4].$LineSplit[5];
|
||||||
|
$CurOpcode = lc($CurOpcode);
|
||||||
|
$OpcodeName = ""; # Tab
|
||||||
|
if ($PatchHash{$CurOpcode})
|
||||||
|
{
|
||||||
|
$NameKey = $PatchHash{$CurOpcode};
|
||||||
|
$OpcodeName = $NameKey;
|
||||||
|
}
|
||||||
|
$CurLine = $CurOpcode.$TabSpace.$OpcodeName."\n";
|
||||||
|
print OpcodeResultFile $CurLine;
|
||||||
|
}
|
||||||
|
|
||||||
|
close(OpcodeResultFile);
|
||||||
1671
utils/scripts/opcode_scripts/opcodelist.txt
Normal file
1671
utils/scripts/opcode_scripts/opcodelist.txt
Normal file
File diff suppressed because it is too large
Load Diff
89
utils/scripts/opcode_scripts/oplist_to_conf.pl
Normal file
89
utils/scripts/opcode_scripts/oplist_to_conf.pl
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
#!/usr/bin/perl
|
||||||
|
|
||||||
|
# File Name: oplist_to_conf.pl
|
||||||
|
# Converts the Opcode List with Opcode Names from the Spreadsheet into a Patch File.
|
||||||
|
|
||||||
|
# Directions to use this script:
|
||||||
|
# 1. Copy the opcodes and opcode names columns from the opcode spreadsheet
|
||||||
|
# for the columns you want to create a new .conf file from into the file.
|
||||||
|
# 2. Remove the header row entries in the text file.
|
||||||
|
# 3. Find/Replace all Tabs " " with 2 spaces " " and save the file.
|
||||||
|
# 4. Paste the contents of the current patch file in the patch_OLD.conf file.
|
||||||
|
# 5. Run this script using "perl oplist_to_conf.pl"
|
||||||
|
# 6. This creates a new .conf file named patch_NEW.conf
|
||||||
|
# 7. Rename patch_NEW.conf to the desired name and you are all done
|
||||||
|
|
||||||
|
|
||||||
|
$stopmessage = "Failed to open file";
|
||||||
|
# Open the text file that contains the opcode and opcode name rows for a single client from the opcode list spreadsheet
|
||||||
|
open OpcodeFile, "<", "opcodelist.txt" or die $stopmessage;
|
||||||
|
# Open the .conf file to copy from
|
||||||
|
open PatchFile, "<", "patch_OLD.conf" or die $stopmessage;
|
||||||
|
|
||||||
|
# Read these files into arrays for looping and close the files
|
||||||
|
my @OpcodeList = <OpcodeFile>;
|
||||||
|
my @PatchFile = <PatchFile>;
|
||||||
|
close(OpcodeFile);
|
||||||
|
close(PatchFile);
|
||||||
|
|
||||||
|
# Open the new/destination .conf file and clear out file contents
|
||||||
|
open OpcodeResultFile, ">", "patch_NEW.conf" or die $stopmessage;
|
||||||
|
print OpcodeResultFile "";
|
||||||
|
# Close out the newly cleared .conf file
|
||||||
|
close(OpcodeResultFile);
|
||||||
|
|
||||||
|
# Open the new/destination .conf file again for appending
|
||||||
|
open OpcodeResultFile, ">>", "patch_NEW.conf" or die $stopmessage;
|
||||||
|
|
||||||
|
my %PatchHash = ();
|
||||||
|
|
||||||
|
foreach $line (@OpcodeList)
|
||||||
|
{
|
||||||
|
@equalssplit = split(/ /, $line);
|
||||||
|
$ArraySize = @equalssplit;
|
||||||
|
if ($ArraySize > 1)
|
||||||
|
{
|
||||||
|
my $CurOpcode = "";
|
||||||
|
my $CurOpcodeName = "";
|
||||||
|
@OpcodeArray = split(//, $equalssplit[0]);
|
||||||
|
if ($equalssplit[1] =~ /^OP_(.*)/i)
|
||||||
|
{
|
||||||
|
$CurOpcodeName = "OP_".$1;
|
||||||
|
}
|
||||||
|
foreach $Letter (@OpcodeArray)
|
||||||
|
{
|
||||||
|
if ($Letter =~ /[A-Za-z0-9]/)
|
||||||
|
{
|
||||||
|
$CurOpcode .= $Letter;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($CurOpcode && $CurOpcodeName)
|
||||||
|
{
|
||||||
|
$CurOpcode = lc($CurOpcode);
|
||||||
|
$PatchHash{ $CurOpcodeName } = $CurOpcode;
|
||||||
|
#print $CurOpcodeName."=". $CurOpcode."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$TabSpace = " "; # Tab
|
||||||
|
foreach $line (@PatchFile)
|
||||||
|
{
|
||||||
|
$CurLine = $line;
|
||||||
|
if ($line =~ /^OP_([^\=]+)=([^\s]+)(.*)/i)
|
||||||
|
{
|
||||||
|
$NewOpcode = "0x0000";
|
||||||
|
$OpcodeName = "OP_".$1;
|
||||||
|
|
||||||
|
if ($PatchHash{$OpcodeName})
|
||||||
|
{
|
||||||
|
$NewOpcode = $PatchHash{$OpcodeName};
|
||||||
|
}
|
||||||
|
|
||||||
|
$CurLine = $OpcodeName."=".$NewOpcode.$3."\n";
|
||||||
|
}
|
||||||
|
print OpcodeResultFile $CurLine;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
close(OpcodeResultFile);
|
||||||
660
utils/scripts/opcode_scripts/patch_NEW.conf
Normal file
660
utils/scripts/opcode_scripts/patch_NEW.conf
Normal file
@ -0,0 +1,660 @@
|
|||||||
|
# ShowEQ Import Notes:
|
||||||
|
# ZERO THE FILE first
|
||||||
|
# perl -pi -e 's/0x[0-9a-fA-F]{4}/0x0000/g' opcodes.conf
|
||||||
|
# Unknown Mapping:
|
||||||
|
# OP_Action2 -> OP_Damage
|
||||||
|
# OP_EnvDamage -> OP_Damage ---> might have been a one time mistake
|
||||||
|
# Name Differences:
|
||||||
|
# OP_CancelInvite -> OP_GroupCancelInvite
|
||||||
|
# OP_GMFind -> OP_FindPersonRequest
|
||||||
|
# OP_CommonMessage -> OP_ChannelMessage
|
||||||
|
|
||||||
|
OP_Unknown=0x0000
|
||||||
|
OP_ExploreUnknown=0x0000 # used for unknown explorer
|
||||||
|
|
||||||
|
# world packets
|
||||||
|
# Required to reach Char Select:
|
||||||
|
OP_SendLoginInfo=0x7a09
|
||||||
|
OP_ApproveWorld=0x7499
|
||||||
|
OP_LogServer=0x7ceb
|
||||||
|
OP_SendCharInfo=0x00d2
|
||||||
|
OP_ExpansionInfo=0x590d
|
||||||
|
OP_GuildsList=0x0000
|
||||||
|
OP_EnterWorld=0x578f
|
||||||
|
OP_PostEnterWorld=0x6259
|
||||||
|
OP_World_Client_CRC1=0x12cc
|
||||||
|
OP_World_Client_CRC2=0x0f13
|
||||||
|
OP_SendSpellChecksum=0x0000
|
||||||
|
OP_SendSkillCapsChecksum=0x0000
|
||||||
|
|
||||||
|
# Character Select Related:
|
||||||
|
OP_SendMaxCharacters=0x5475
|
||||||
|
OP_SendMembership=0x7acc
|
||||||
|
OP_SendMembershipDetails=0x057b
|
||||||
|
OP_CharacterCreateRequest=0x6773
|
||||||
|
OP_CharacterCreate=0x6bbf
|
||||||
|
OP_DeleteCharacter=0x1808
|
||||||
|
OP_RandomNameGenerator=0x5954
|
||||||
|
OP_ApproveName=0x56a2
|
||||||
|
OP_MOTD=0x0c22
|
||||||
|
OP_SetChatServer=0x1bc5
|
||||||
|
OP_SetChatServer2=0x7eec
|
||||||
|
OP_ZoneServerInfo=0x4c44
|
||||||
|
OP_WorldComplete=0x4493
|
||||||
|
OP_WorldUnknown001=0x2301
|
||||||
|
OP_FloatListThing=0x46c6
|
||||||
|
|
||||||
|
# Reasons for Disconnect:
|
||||||
|
OP_ZoneUnavail=0x4cb4
|
||||||
|
OP_WorldClientReady=0x23c1
|
||||||
|
OP_CharacterStillInZone=0x0000
|
||||||
|
OP_WorldChecksumFailure=0x0000
|
||||||
|
OP_WorldLoginFailed=0x0000
|
||||||
|
OP_WorldLogout=0x0000
|
||||||
|
OP_WorldLevelTooHigh=0x0000
|
||||||
|
OP_CharInacessable=0x0000
|
||||||
|
OP_UserCompInfo=0x0000
|
||||||
|
OP_SendExeChecksum=0x0000
|
||||||
|
OP_SendBaseDataChecksum=0x0000
|
||||||
|
|
||||||
|
# Zone in opcodes
|
||||||
|
OP_AckPacket=0x471d
|
||||||
|
OP_ZoneEntry=0x5089
|
||||||
|
OP_ReqNewZone=0x7887
|
||||||
|
OP_NewZone=0x1795
|
||||||
|
OP_ZoneSpawns=0x5237
|
||||||
|
OP_PlayerProfile=0x6506
|
||||||
|
OP_TimeOfDay=0x5070
|
||||||
|
OP_LevelUpdate=0x1eec
|
||||||
|
OP_Stamina=0x2a79
|
||||||
|
OP_RequestClientZoneChange=0x3fcf
|
||||||
|
OP_ZoneChange=0x2d18
|
||||||
|
OP_LockoutTimerInfo=0x0000
|
||||||
|
OP_ZoneServerReady=0x0000
|
||||||
|
OP_ZoneInUnknown=0x0000
|
||||||
|
OP_LogoutReply=0x0000
|
||||||
|
OP_PreLogoutReply=0x0000
|
||||||
|
|
||||||
|
# Required to fully log in
|
||||||
|
OP_SpawnAppearance=0x0971
|
||||||
|
OP_ChangeSize=0x4707
|
||||||
|
OP_TributeUpdate=0x5961
|
||||||
|
OP_TributeTimer=0x073d
|
||||||
|
OP_SendTributes=0x729b
|
||||||
|
OP_SendGuildTributes=0x1877
|
||||||
|
OP_TributeInfo=0x4254
|
||||||
|
OP_Weather=0x661e
|
||||||
|
OP_ReqClientSpawn=0x35fa
|
||||||
|
OP_SpawnDoor=0x7291
|
||||||
|
OP_GroundSpawn=0x6fca
|
||||||
|
OP_SendZonepoints=0x69a4
|
||||||
|
OP_BlockedBuffs=0x3033
|
||||||
|
OP_RemoveBlockedBuffs=0x0de7
|
||||||
|
OP_ClearBlockedBuffs=0x34cb
|
||||||
|
OP_WorldObjectsSent=0x5ae2
|
||||||
|
OP_SendExpZonein=0x5f8e
|
||||||
|
OP_SendAATable=0x66b5
|
||||||
|
OP_RespondAA=0x7a27
|
||||||
|
OP_UpdateAA=0x66f0
|
||||||
|
OP_SendAAStats=0x43c8
|
||||||
|
OP_AAExpUpdate=0x7d14
|
||||||
|
OP_ExpUpdate=0x20ed
|
||||||
|
OP_HPUpdate=0x2828
|
||||||
|
OP_ManaChange=0x5467
|
||||||
|
OP_TGB=0x0876
|
||||||
|
OP_SpecialMesg=0x0083
|
||||||
|
OP_GuildMemberList=0x12a6
|
||||||
|
OP_GuildMOTD=0x3e13
|
||||||
|
OP_CharInventory=0x5ca6
|
||||||
|
OP_WearChange=0x7994
|
||||||
|
OP_ClientUpdate=0x7dfc
|
||||||
|
OP_ClientReady=0x345d
|
||||||
|
OP_SetServerFilter=0x444d
|
||||||
|
|
||||||
|
# Guild Opcodes - Disabled until crashes are resolved in RoF
|
||||||
|
OP_GetGuildMOTD=0x36e0
|
||||||
|
OP_GetGuildMOTDReply=0x4f1f
|
||||||
|
OP_GuildMemberUpdate=0x69b9
|
||||||
|
OP_GuildInvite=0x7099
|
||||||
|
OP_GuildRemove=0x1444
|
||||||
|
OP_GuildPeace=0x67e3
|
||||||
|
OP_SetGuildMOTD=0x0b0b
|
||||||
|
OP_GuildList=0x6279
|
||||||
|
OP_GuildWar=0x1ffb
|
||||||
|
OP_GuildLeader=0x7e09
|
||||||
|
OP_GuildDelete=0x3708
|
||||||
|
OP_GuildInviteAccept=0x7053
|
||||||
|
OP_GuildDemote=0x2d4e
|
||||||
|
OP_GuildPromote=0x0000
|
||||||
|
OP_GuildPublicNote=0x5053
|
||||||
|
OP_GuildManageBanker=0x748f
|
||||||
|
OP_GuildBank=0x5134
|
||||||
|
OP_SetGuildRank=0x0b9c
|
||||||
|
OP_GuildUpdateURLAndChannel=0x2958
|
||||||
|
OP_GuildStatus=0x7326
|
||||||
|
OP_GuildCreate=0x76d9
|
||||||
|
OP_GuildMemberLevelUpdate=0x0000 # Unused?
|
||||||
|
OP_ZoneGuildList=0x0000 # Unused?
|
||||||
|
OP_GetGuildsList=0x0000 # Unused?
|
||||||
|
OP_LFGuild=0x0000
|
||||||
|
OP_GuildManageRemove=0x0000
|
||||||
|
OP_GuildManageAdd=0x0000
|
||||||
|
OP_GuildManageStatus=0x0000
|
||||||
|
|
||||||
|
# GM/Guide Opcodes
|
||||||
|
OP_GMServers=0x08c1
|
||||||
|
OP_GMBecomeNPC=0x3ae1
|
||||||
|
OP_GMZoneRequest=0x62ac
|
||||||
|
OP_GMZoneRequest2=0x7e1a
|
||||||
|
OP_GMGoto=0x7d8e
|
||||||
|
OP_GMSearchCorpse=0x357c
|
||||||
|
OP_GMHideMe=0x79c5
|
||||||
|
OP_GMDelCorpse=0x607e
|
||||||
|
OP_GMApproval=0x6db5
|
||||||
|
OP_GMToggle=0x2097
|
||||||
|
OP_GMSummon=0x486f
|
||||||
|
OP_GMEmoteZone=0x1cfd
|
||||||
|
OP_GMEmoteWorld=0x458e
|
||||||
|
OP_GMFind=0x4a8f
|
||||||
|
OP_GMKick=0x26a7
|
||||||
|
OP_GMKill=0x51d3
|
||||||
|
OP_GMNameChange=0x035f
|
||||||
|
OP_GMLastName=0x46ce
|
||||||
|
|
||||||
|
# Misc Opcodes
|
||||||
|
OP_InspectRequest=0x57bc
|
||||||
|
OP_InspectAnswer=0x71ac
|
||||||
|
OP_InspectMessageUpdate=0x4d25
|
||||||
|
OP_BeginCast=0x318f
|
||||||
|
OP_ColoredText=0x43af
|
||||||
|
OP_ConsentResponse=0x384a
|
||||||
|
OP_MemorizeSpell=0x217c
|
||||||
|
OP_SwapSpell=0x0efa
|
||||||
|
OP_CastSpell=0x1287
|
||||||
|
OP_Consider=0x742b
|
||||||
|
OP_FormattedMessage=0x1024
|
||||||
|
OP_SimpleMessage=0x213f
|
||||||
|
OP_Buff=0x659c
|
||||||
|
OP_Illusion=0x312a
|
||||||
|
OP_MoneyOnCorpse=0x5f44
|
||||||
|
OP_RandomReply=0x106b
|
||||||
|
OP_DenyResponse=0x2382
|
||||||
|
OP_SkillUpdate=0x04c
|
||||||
|
OP_GMTrainSkillConfirm=0x4b64
|
||||||
|
OP_RandomReq=0x7b10
|
||||||
|
OP_Death=0x6517
|
||||||
|
OP_GMTraining=0x1966
|
||||||
|
OP_GMEndTraining=0x4d6b
|
||||||
|
OP_GMTrainSkill=0x2a85
|
||||||
|
OP_Animation=0x7177
|
||||||
|
OP_Begging=0x6703
|
||||||
|
OP_Consent=0x1fd1
|
||||||
|
OP_ConsentDeny=0x7a45
|
||||||
|
OP_AutoFire=0x241e
|
||||||
|
OP_PetCommands=0x0159
|
||||||
|
OP_DeleteSpell=0x52e5
|
||||||
|
OP_Surname=0x0423
|
||||||
|
OP_ClearSurname=0x3fb0
|
||||||
|
OP_FaceChange=0x5578
|
||||||
|
OP_SenseHeading=0x260a
|
||||||
|
OP_Action=0x744c
|
||||||
|
OP_ConsiderCorpse=0x5204
|
||||||
|
OP_HideCorpse=0x49e1
|
||||||
|
OP_CorpseDrag=0x0904
|
||||||
|
OP_CorpseDrop=0x7037
|
||||||
|
OP_Bug=0x73f4
|
||||||
|
OP_Feedback=0x5602
|
||||||
|
OP_Report=0x1414
|
||||||
|
OP_Damage=0x6f15
|
||||||
|
OP_ChannelMessage=0x2b2d
|
||||||
|
OP_Assist=0x4478
|
||||||
|
OP_AssistGroup=0x27f8
|
||||||
|
OP_MoveCoin=0x0bcf
|
||||||
|
OP_ZonePlayerToBind=0x0ecb
|
||||||
|
OP_KeyRing=0x6857
|
||||||
|
OP_WhoAllRequest=0x674b
|
||||||
|
OP_WhoAllResponse=0x578c
|
||||||
|
OP_FriendsWho=0x3956
|
||||||
|
OP_ConfirmDelete=0x43a3
|
||||||
|
OP_Logout=0x4ac6
|
||||||
|
OP_Rewind=0x1745
|
||||||
|
OP_TargetCommand=0x58e2
|
||||||
|
OP_Hide=0x67fe
|
||||||
|
OP_Jump=0x31f4
|
||||||
|
OP_Camp=0x28ec
|
||||||
|
OP_Emote=0x373b
|
||||||
|
OP_SetRunMode=0x009f
|
||||||
|
OP_BankerChange=0x791e
|
||||||
|
OP_TargetMouse=0x075d
|
||||||
|
OP_MobHealth=0x37b1
|
||||||
|
OP_InitialMobHealth=0x0000 # Unused?
|
||||||
|
OP_TargetHoTT=0x0272
|
||||||
|
OP_XTargetResponse=0x672f
|
||||||
|
OP_XTargetRequest=0x45be
|
||||||
|
OP_XTargetAutoAddHaters=0x792c
|
||||||
|
OP_TargetBuffs=0x4f4b
|
||||||
|
OP_BuffCreate=0x3377
|
||||||
|
OP_BuffRemoveRequest=0x64f2
|
||||||
|
OP_DeleteSpawn=0x7280
|
||||||
|
OP_AutoAttack=0x109d
|
||||||
|
OP_AutoAttack2=0x3526
|
||||||
|
OP_Consume=0x4b70
|
||||||
|
OP_MoveItem=0x32ee
|
||||||
|
OP_DeleteItem=0x18ad
|
||||||
|
OP_DeleteCharge=0x01b8
|
||||||
|
OP_ItemPacket=0x368e
|
||||||
|
OP_ItemLinkResponse=0x70c0
|
||||||
|
OP_ItemLinkClick=0x4cef
|
||||||
|
OP_ItemPreview=0x6b5c
|
||||||
|
OP_NewSpawn=0x6097
|
||||||
|
OP_Track=0x17e5
|
||||||
|
OP_TrackTarget=0x0029
|
||||||
|
OP_TrackUnknown=0x4577
|
||||||
|
OP_ClickDoor=0x3a8f
|
||||||
|
OP_MoveDoor=0x08e8
|
||||||
|
OP_RemoveAllDoors=0x700c
|
||||||
|
OP_EnvDamage=0x51fd
|
||||||
|
OP_BoardBoat=0x4211
|
||||||
|
OP_Forage=0x5306
|
||||||
|
OP_LeaveBoat=0x7617
|
||||||
|
OP_ControlBoat=0x0ae7
|
||||||
|
OP_SafeFallSuccess=0x2219
|
||||||
|
OP_RezzComplete=0x760d
|
||||||
|
OP_RezzRequest=0x3c21
|
||||||
|
OP_RezzAnswer=0x701c
|
||||||
|
OP_Shielding=0x48c1
|
||||||
|
OP_RequestDuel=0x3af1
|
||||||
|
OP_MobRename=0x2c57
|
||||||
|
OP_AugmentItem=0x661b
|
||||||
|
OP_WeaponEquip1=0x34a7
|
||||||
|
OP_WeaponEquip2=0x559a
|
||||||
|
OP_WeaponUnequip2=0x2d25
|
||||||
|
OP_ApplyPoison=0x31e6
|
||||||
|
OP_Save=0x4a39
|
||||||
|
OP_TestBuff=0x7cb8
|
||||||
|
OP_CustomTitles=0x100e
|
||||||
|
OP_Split=0x3a54
|
||||||
|
OP_YellForHelp=0x4e56
|
||||||
|
OP_LoadSpellSet=0x261d
|
||||||
|
OP_Bandolier=0x7677
|
||||||
|
OP_PotionBelt=0x1a3e
|
||||||
|
OP_DuelResponse=0x6a46
|
||||||
|
OP_DuelResponse2=0x68d3
|
||||||
|
OP_SaveOnZoneReq=0x600d
|
||||||
|
OP_ReadBook=0x72df
|
||||||
|
OP_Dye=0x23b9
|
||||||
|
OP_InterruptCast=0x048c
|
||||||
|
OP_AAAction=0x424e
|
||||||
|
OP_LeadershipExpToggle=0x6c55
|
||||||
|
OP_LeadershipExpUpdate=0x2797
|
||||||
|
OP_PurchaseLeadershipAA=0x0026
|
||||||
|
OP_UpdateLeadershipAA=0x026
|
||||||
|
OP_MarkNPC=0x5a58
|
||||||
|
OP_MarkRaidNPC=0x74bd #unimplemented
|
||||||
|
OP_ClearNPCMarks=0x2003
|
||||||
|
OP_ClearRaidNPCMarks=0x20d3 #unimplemented
|
||||||
|
OP_DelegateAbility=0x76b8
|
||||||
|
OP_SetGroupTarget=0x2814
|
||||||
|
OP_Charm=0x5d92
|
||||||
|
OP_Stun=0x36a4
|
||||||
|
OP_SendFindableNPCs=0x4613
|
||||||
|
OP_FindPersonRequest=0x5cea
|
||||||
|
OP_FindPersonReply=0x7e58
|
||||||
|
OP_Sound=0x1a30
|
||||||
|
OP_PetBuffWindow=0x5882
|
||||||
|
OP_LevelAppearance=0x3bc9
|
||||||
|
OP_Translocate=0x6580
|
||||||
|
OP_Sacrifice=0x1821
|
||||||
|
OP_PopupResponse=0x08a6
|
||||||
|
OP_OnLevelMessage=0x4d6e
|
||||||
|
OP_AugmentInfo=0x0afb
|
||||||
|
OP_Petition=0x1901
|
||||||
|
OP_SomeItemPacketMaybe=0x747c
|
||||||
|
OP_PVPStats=0x4b15
|
||||||
|
OP_PVPLeaderBoardRequest=0x04aa
|
||||||
|
OP_PVPLeaderBoardReply=0x071f
|
||||||
|
OP_PVPLeaderBoardDetailsRequest=0x3707
|
||||||
|
OP_PVPLeaderBoardDetailsReply=0x25b7
|
||||||
|
OP_RestState=0x000f
|
||||||
|
OP_RespawnWindow=0x28bc
|
||||||
|
OP_LDoNButton=0x5327
|
||||||
|
OP_SetStartCity=0x6326
|
||||||
|
OP_VoiceMacroIn=0x17fd
|
||||||
|
OP_VoiceMacroOut=0x409a
|
||||||
|
OP_ItemViewUnknown=0x465b
|
||||||
|
OP_VetRewardsAvaliable=0x590e
|
||||||
|
OP_VetClaimRequest=0x1126
|
||||||
|
OP_VetClaimReply=0x16d4
|
||||||
|
OP_DisciplineUpdate=0x759e
|
||||||
|
OP_DisciplineTimer=0x6989
|
||||||
|
OP_BecomeCorpse=0x0000 # Unused?
|
||||||
|
OP_Action2=0x0000 # Unused?
|
||||||
|
OP_MobUpdate=0x2c84
|
||||||
|
OP_NPCMoveUpdate=0x5892
|
||||||
|
OP_CameraEffect=0x127f
|
||||||
|
OP_SpellEffect=0x5936
|
||||||
|
OP_RemoveNimbusEffect=0x7b1e
|
||||||
|
OP_AltCurrency=0x6b6d
|
||||||
|
OP_AltCurrencyMerchantRequest=0x5409
|
||||||
|
OP_AltCurrencyMerchantReply=0x27a2
|
||||||
|
OP_AltCurrencyPurchase=0x3788
|
||||||
|
OP_AltCurrencySell=0x40b6
|
||||||
|
OP_AltCurrencySellSelection=0x532a
|
||||||
|
OP_AltCurrencyReclaim=0x0339
|
||||||
|
OP_CrystalCountUpdate=0x467f
|
||||||
|
OP_CrystalCreate=0x7aee
|
||||||
|
OP_CrystalReclaim=0x2439
|
||||||
|
OP_Untargetable=0x053c
|
||||||
|
OP_IncreaseStats=0x70a3
|
||||||
|
OP_Weblink=0x6f4b
|
||||||
|
OP_OpenContainer=0x0000
|
||||||
|
OP_Marquee=0x502e
|
||||||
|
OP_ItemRecastDelay=0x15a9
|
||||||
|
#OP_OpenInventory=0x0000 # Likely does not exist in RoF -U
|
||||||
|
|
||||||
|
OP_DzQuit=0x205f
|
||||||
|
OP_DzListTimers=0x0398
|
||||||
|
OP_DzAddPlayer=0x59ca
|
||||||
|
OP_DzRemovePlayer=0x4701
|
||||||
|
OP_DzSwapPlayer=0x1abc
|
||||||
|
OP_DzMakeLeader=0x405b
|
||||||
|
OP_DzPlayerList=0x543d
|
||||||
|
OP_DzJoinExpeditionConfirm=0x14c6
|
||||||
|
OP_DzJoinExpeditionReply=0x7f4b
|
||||||
|
OP_DzExpeditionInfo=0x4f7e
|
||||||
|
OP_DzExpeditionList=0x9119
|
||||||
|
OP_DzMemberStatus=0xb2e3
|
||||||
|
OP_DzLeaderStatus=0x32f0
|
||||||
|
OP_DzExpeditionEndsWarning=0x7e94
|
||||||
|
OP_DzMemberList=0x3de9
|
||||||
|
OP_DzCompass=0x3e0e
|
||||||
|
OP_DzChooseZone=0x0b7d
|
||||||
|
|
||||||
|
# New Opcodes
|
||||||
|
OP_SpawnPositionUpdate=0x0000 # Actually OP_MobUpdate ?
|
||||||
|
OP_ManaUpdate=0x3791
|
||||||
|
OP_EnduranceUpdate=0x5f42
|
||||||
|
OP_MobManaUpdate=0x2404
|
||||||
|
OP_MobEnduranceUpdate=0x1c81
|
||||||
|
|
||||||
|
# Mercenary Opcodes
|
||||||
|
OP_MercenaryDataUpdateRequest=0x7b89
|
||||||
|
OP_MercenaryDataUpdate=0x61a4
|
||||||
|
OP_MercenaryDataRequest=0x11c1
|
||||||
|
OP_MercenaryDataResponse=0x72ce
|
||||||
|
OP_MercenaryHire=0x7169
|
||||||
|
OP_MercenaryDismiss=0x6e83
|
||||||
|
OP_MercenaryTimerRequest=0x31e4
|
||||||
|
OP_MercenaryTimer=0x0763
|
||||||
|
OP_MercenaryUnknown1=0x5d26
|
||||||
|
OP_MercenaryCommand=0x27f2
|
||||||
|
OP_MercenarySuspendRequest=0x4407
|
||||||
|
OP_MercenarySuspendResponse=0x6f03
|
||||||
|
OP_MercenaryUnsuspendResponse=0x27a0
|
||||||
|
|
||||||
|
# Looting
|
||||||
|
OP_LootRequest=0x0adf
|
||||||
|
OP_EndLootRequest=0x30f7
|
||||||
|
OP_LootItem=0x4dc9
|
||||||
|
OP_LootComplete=0x55c4
|
||||||
|
|
||||||
|
# bazaar trader stuff:
|
||||||
|
OP_BazaarSearch=0x39d6
|
||||||
|
OP_TraderDelItem=0x0000
|
||||||
|
OP_BecomeTrader=0x61b3
|
||||||
|
OP_TraderShop=0x31df
|
||||||
|
OP_Trader=0x4ef5
|
||||||
|
OP_TraderBuy=0x0000
|
||||||
|
OP_Barter=0x243a
|
||||||
|
OP_ShopItem=0x0000
|
||||||
|
OP_BazaarInspect=0x0000
|
||||||
|
OP_Bazaar=0x0000
|
||||||
|
OP_TraderItemUpdate=0x0000
|
||||||
|
|
||||||
|
# pc/npc trading
|
||||||
|
OP_TradeRequest=0x77b5
|
||||||
|
OP_TradeAcceptClick=0x69e2
|
||||||
|
OP_TradeRequestAck=0x14bf
|
||||||
|
OP_TradeCoins=0x4206
|
||||||
|
OP_FinishTrade=0x3993
|
||||||
|
OP_CancelTrade=0x354c
|
||||||
|
OP_TradeMoneyUpdate=0x68c2
|
||||||
|
OP_MoneyUpdate=0x640c
|
||||||
|
OP_TradeBusy=0x5505
|
||||||
|
|
||||||
|
# Sent after canceling trade or after closing tradeskill object
|
||||||
|
OP_FinishWindow=0x7349
|
||||||
|
OP_FinishWindow2=0x40ef
|
||||||
|
|
||||||
|
# Sent on Live for what seems to be item existance verification
|
||||||
|
# Ex. Before Right Click Effect happens from items
|
||||||
|
OP_ItemVerifyRequest=0x189c
|
||||||
|
OP_ItemVerifyReply=0x097b
|
||||||
|
|
||||||
|
# merchant stuff
|
||||||
|
OP_ShopPlayerSell=0x0000
|
||||||
|
OP_ShopRequest=0x4fed
|
||||||
|
OP_ShopEnd=0x30a8
|
||||||
|
OP_ShopEndConfirm=0x3196
|
||||||
|
OP_ShopPlayerBuy=0x0ddd
|
||||||
|
OP_ShopDelItem=0x724f
|
||||||
|
|
||||||
|
# tradeskill stuff:
|
||||||
|
OP_ClickObject=0x4aa1
|
||||||
|
OP_ClickObjectAction=0x0c1e
|
||||||
|
OP_ClearObject=0x7a11
|
||||||
|
OP_RecipeDetails=0x40d7
|
||||||
|
OP_RecipesFavorite=0x71b1
|
||||||
|
OP_RecipesSearch=0x1db6
|
||||||
|
OP_RecipeReply=0x6e02
|
||||||
|
OP_RecipeAutoCombine=0x6261
|
||||||
|
OP_TradeSkillCombine=0x579a
|
||||||
|
|
||||||
|
# Tribute Packets:
|
||||||
|
OP_OpenGuildTributeMaster=0x378d
|
||||||
|
OP_OpenTributeMaster=0x7666
|
||||||
|
OP_SelectTribute=0x79fc
|
||||||
|
OP_TributeItem=0x4f3e
|
||||||
|
OP_TributeMoney=0x58fb
|
||||||
|
OP_TributeToggle=0x241d
|
||||||
|
OP_TributePointUpdate=0x5300
|
||||||
|
OP_TributeNPC=0x0000
|
||||||
|
OP_GuildTributeInfo=0x0000
|
||||||
|
OP_OpenTributeReply=0x0000
|
||||||
|
OP_GuildTributeStatus=0x0000
|
||||||
|
|
||||||
|
# Adventure packets:
|
||||||
|
OP_LeaveAdventure=0x5d18
|
||||||
|
OP_AdventureFinish=0x400f
|
||||||
|
OP_AdventureInfoRequest=0x3cb0
|
||||||
|
OP_AdventureInfo=0x4c54
|
||||||
|
OP_AdventureRequest=0x2c6c
|
||||||
|
OP_AdventureDetails=0x5648
|
||||||
|
OP_AdventureData=0x7171
|
||||||
|
OP_AdventureUpdate=0x1b01
|
||||||
|
OP_AdventureMerchantRequest=0x6922
|
||||||
|
OP_AdventureMerchantResponse=0x3e47
|
||||||
|
OP_AdventureMerchantPurchase=0x5b72
|
||||||
|
OP_AdventureMerchantSell=0x2f9b
|
||||||
|
OP_AdventurePointsUpdate=0x65c3
|
||||||
|
OP_AdventureStatsRequest=0x5a62
|
||||||
|
OP_AdventureStatsReply=0x2370
|
||||||
|
OP_AdventureLeaderboardRequest=0x7093
|
||||||
|
OP_AdventureLeaderboardReply=0x7f79
|
||||||
|
|
||||||
|
# Group Opcodes
|
||||||
|
OP_GroupDisband=0x4c10
|
||||||
|
OP_GroupInvite=0x6110
|
||||||
|
OP_GroupFollow=0x1649
|
||||||
|
OP_GroupUpdate=0x3abb
|
||||||
|
OP_GroupUpdateB=0x6194
|
||||||
|
OP_GroupCancelInvite=0x0000
|
||||||
|
OP_GroupAcknowledge=0x7323
|
||||||
|
OP_GroupDelete=0x0f6c
|
||||||
|
OP_CancelInvite=0x2a50
|
||||||
|
OP_GroupFollow2=0x2060
|
||||||
|
OP_GroupInvite2=0x32c2
|
||||||
|
OP_GroupDisbandYou=0x1ae5
|
||||||
|
OP_GroupDisbandOther=0x74da
|
||||||
|
OP_GroupLeaderChange=0x21b4
|
||||||
|
OP_GroupRoles=0x70e2
|
||||||
|
OP_GroupMakeLeader=0x4229
|
||||||
|
OP_DoGroupLeadershipAbility=0x1fb5
|
||||||
|
OP_GroupLeadershipAAUpdate=0x02cf
|
||||||
|
OP_GroupMentor=0x3342
|
||||||
|
OP_InspectBuffs=0x486c
|
||||||
|
|
||||||
|
# LFG/LFP Opcodes
|
||||||
|
OP_LFGCommand=0x6060
|
||||||
|
OP_LFGGetMatchesRequest=0x0340
|
||||||
|
OP_LFGGetMatchesResponse=0x5048
|
||||||
|
OP_LFPGetMatchesRequest=0x4d7d
|
||||||
|
OP_LFPGetMatchesResponse=0x22c6
|
||||||
|
OP_LFPCommand=0x49a9
|
||||||
|
OP_LFGAppearance=0x0000
|
||||||
|
OP_LFGResponse=0x0000
|
||||||
|
|
||||||
|
# Raid Opcodes
|
||||||
|
OP_RaidInvite=0x55ac
|
||||||
|
OP_RaidUpdate=0x3973
|
||||||
|
OP_RaidJoin=0x0000
|
||||||
|
|
||||||
|
# Button-push commands
|
||||||
|
OP_Taunt=0x2703
|
||||||
|
OP_CombatAbility=0x3eba
|
||||||
|
OP_SenseTraps=0x02af
|
||||||
|
OP_PickPocket=0x39e8
|
||||||
|
OP_DisarmTraps=0x78bf
|
||||||
|
OP_Disarm=0x5ec8
|
||||||
|
OP_Sneak=0x5d55
|
||||||
|
OP_Fishing=0x1e2a
|
||||||
|
OP_InstillDoubt=0x640e
|
||||||
|
OP_FeignDeath=0x52fa
|
||||||
|
OP_Mend=0x0ecf
|
||||||
|
OP_Bind_Wound=0x0386
|
||||||
|
OP_LDoNOpen=0x3d5c
|
||||||
|
|
||||||
|
# Task packets
|
||||||
|
OP_TaskDescription=0x3714
|
||||||
|
OP_TaskActivity=0x08d3
|
||||||
|
OP_CompletedTasks=0x4eba
|
||||||
|
OP_TaskActivityComplete=0x5e19
|
||||||
|
OP_AcceptNewTask=0x0a23
|
||||||
|
OP_CancelTask=0x39f0
|
||||||
|
OP_TaskMemberList=0x5727
|
||||||
|
OP_OpenNewTasksWindow=0x48a2
|
||||||
|
OP_AvaliableTask=0x36e8
|
||||||
|
OP_TaskHistoryRequest=0x5f1c
|
||||||
|
OP_TaskHistoryReply=0x3d05
|
||||||
|
OP_DeclineAllTasks=0x0000
|
||||||
|
|
||||||
|
# Title opcodes
|
||||||
|
OP_NewTitlesAvailable=0x0d32
|
||||||
|
OP_RequestTitles=0x6344
|
||||||
|
OP_SendTitleList=0x2d08
|
||||||
|
OP_SetTitle=0x6527
|
||||||
|
OP_SetTitleReply=0x4c21
|
||||||
|
|
||||||
|
# mail opcodes
|
||||||
|
OP_Command=0x0000
|
||||||
|
OP_MailboxHeader=0x0000
|
||||||
|
OP_MailHeader=0x0000
|
||||||
|
OP_MailBody=0x0000
|
||||||
|
OP_NewMail=0x0000
|
||||||
|
OP_SentConfirm=0x0000
|
||||||
|
|
||||||
|
########### Below this point should not be needed ###########
|
||||||
|
|
||||||
|
# This section are all unknown in Titanium
|
||||||
|
OP_ForceFindPerson=0x0000
|
||||||
|
OP_LocInfo=0x0000
|
||||||
|
OP_ReloadUI=0x0000
|
||||||
|
OP_ItemName=0x0000
|
||||||
|
OP_ItemLinkText=0x0000
|
||||||
|
OP_MultiLineMsg=0x0000
|
||||||
|
OP_MendHPUpdate=0x0000
|
||||||
|
OP_TargetReject=0x0000
|
||||||
|
OP_SafePoint=0x0000
|
||||||
|
OP_ApproveZone=0x0000
|
||||||
|
OP_ZoneComplete=0x0000
|
||||||
|
OP_ClientError=0x0000
|
||||||
|
OP_DumpName=0x0000
|
||||||
|
OP_Heartbeat=0x0000
|
||||||
|
OP_CrashDump=0x0000
|
||||||
|
OP_LoginComplete=0x0000
|
||||||
|
|
||||||
|
# discovered opcodes not yet used:
|
||||||
|
OP_PickLockSuccess=0x0000
|
||||||
|
OP_PlayMP3=0x5770
|
||||||
|
OP_ReclaimCrystals=0x0000
|
||||||
|
OP_DynamicWall=0x0000
|
||||||
|
OP_OpenDiscordMerchant=0x0000
|
||||||
|
OP_DiscordMerchantInventory=0x0000
|
||||||
|
OP_GiveMoney=0x0000
|
||||||
|
OP_RequestKnowledgeBase=0x0000
|
||||||
|
OP_KnowledgeBase=0x0000
|
||||||
|
OP_SlashAdventure=0x0000 # /adventure
|
||||||
|
OP_BecomePVPPrompt=0x0000
|
||||||
|
OP_MoveLogRequest=0x0000 # gone I think
|
||||||
|
OP_MoveLogDisregard=0x0000 # gone I think
|
||||||
|
|
||||||
|
# named unknowns, to make looking for real unknown easier
|
||||||
|
OP_AnnoyingZoneUnknown=0x0000
|
||||||
|
OP_Some6ByteHPUpdate=0x0000 seems to happen when you target group members
|
||||||
|
OP_QueryResponseThing=0x0000
|
||||||
|
|
||||||
|
|
||||||
|
# realityincarnate: these are just here to stop annoying several thousand byte packet dumps
|
||||||
|
#OP_LoginUnknown1=0x46d3 # OP_SendSpellChecksum
|
||||||
|
#OP_LoginUnknown2=0x040b # OP_SendSkillCapsChecksum
|
||||||
|
|
||||||
|
# Petition Opcodes
|
||||||
|
OP_PetitionSearch=0x0000 search term for petition
|
||||||
|
OP_PetitionSearchResults=0x0000 (list of?) matches from search
|
||||||
|
OP_PetitionSearchText=0x0000 text results of search
|
||||||
|
|
||||||
|
OP_PetitionUpdate=0x0000
|
||||||
|
OP_PetitionCheckout=0x0000
|
||||||
|
OP_PetitionCheckIn=0x0000
|
||||||
|
OP_PetitionQue=0x0000
|
||||||
|
OP_PetitionUnCheckout=0x0000
|
||||||
|
OP_PetitionDelete=0x0000
|
||||||
|
OP_DeletePetition=0x0000
|
||||||
|
OP_PetitionResolve=0x0000
|
||||||
|
OP_PDeletePetition=0x0000
|
||||||
|
OP_PetitionBug=0x0000
|
||||||
|
OP_PetitionRefresh=0x0000
|
||||||
|
OP_PetitionCheckout2=0x0000
|
||||||
|
OP_PetitionViewPetition=0x0000
|
||||||
|
|
||||||
|
# Login opcodes
|
||||||
|
OP_SessionReady=0x0000
|
||||||
|
OP_Login=0x0000
|
||||||
|
OP_ServerListRequest=0x0000
|
||||||
|
OP_PlayEverquestRequest=0x0000
|
||||||
|
OP_PlayEverquestResponse=0x0000
|
||||||
|
OP_ChatMessage=0x0000
|
||||||
|
OP_LoginAccepted=0x0000
|
||||||
|
OP_ServerListResponse=0x0000
|
||||||
|
OP_Poll=0x0000
|
||||||
|
OP_EnterChat=0x0000
|
||||||
|
OP_PollResponse=0x0000
|
||||||
|
|
||||||
|
# raw opcodes
|
||||||
|
OP_RAWSessionRequest=0x0000
|
||||||
|
OP_RAWSessionResponse=0x0000
|
||||||
|
OP_RAWCombined=0x0000
|
||||||
|
OP_RAWSessionDisconnect=0x0000
|
||||||
|
OP_RAWKeepAlive=0x0000
|
||||||
|
OP_RAWSessionStatRequest=0x0000
|
||||||
|
OP_RAWSessionStatResponse=0x0000
|
||||||
|
OP_RAWPacket=0x0000
|
||||||
|
OP_RAWFragment=0x0000
|
||||||
|
OP_RAWOutOfOrderAck=0x0000
|
||||||
|
OP_RAWAck=0x0000
|
||||||
|
OP_RAWAppCombined=0x0000
|
||||||
|
OP_RAWOutOfSession=0x0000
|
||||||
|
|
||||||
|
# we need to document the differences between these packets to make identifying them easier
|
||||||
|
OP_Some3ByteHPUpdate=0x0000 # initial HP update for mobs
|
||||||
|
OP_InitialHPUpdate=0x0000
|
||||||
660
utils/scripts/opcode_scripts/patch_OLD.conf
Normal file
660
utils/scripts/opcode_scripts/patch_OLD.conf
Normal file
@ -0,0 +1,660 @@
|
|||||||
|
# ShowEQ Import Notes:
|
||||||
|
# ZERO THE FILE first
|
||||||
|
# perl -pi -e 's/0x[0-9a-fA-F]{4}/0x0000/g' opcodes.conf
|
||||||
|
# Unknown Mapping:
|
||||||
|
# OP_Action2 -> OP_Damage
|
||||||
|
# OP_EnvDamage -> OP_Damage ---> might have been a one time mistake
|
||||||
|
# Name Differences:
|
||||||
|
# OP_CancelInvite -> OP_GroupCancelInvite
|
||||||
|
# OP_GMFind -> OP_FindPersonRequest
|
||||||
|
# OP_CommonMessage -> OP_ChannelMessage
|
||||||
|
|
||||||
|
OP_Unknown=0x0000
|
||||||
|
OP_ExploreUnknown=0x0000 # used for unknown explorer
|
||||||
|
|
||||||
|
# world packets
|
||||||
|
# Required to reach Char Select:
|
||||||
|
OP_SendLoginInfo=0x7a09
|
||||||
|
OP_ApproveWorld=0x7499
|
||||||
|
OP_LogServer=0x7ceb
|
||||||
|
OP_SendCharInfo=0x00d2
|
||||||
|
OP_ExpansionInfo=0x590d
|
||||||
|
OP_GuildsList=0x0000
|
||||||
|
OP_EnterWorld=0x578f
|
||||||
|
OP_PostEnterWorld=0x6259
|
||||||
|
OP_World_Client_CRC1=0x12cc
|
||||||
|
OP_World_Client_CRC2=0x0f13
|
||||||
|
OP_SendSpellChecksum=0x0000
|
||||||
|
OP_SendSkillCapsChecksum=0x0000
|
||||||
|
|
||||||
|
# Character Select Related:
|
||||||
|
OP_SendMaxCharacters=0x5475
|
||||||
|
OP_SendMembership=0x7acc
|
||||||
|
OP_SendMembershipDetails=0x057b
|
||||||
|
OP_CharacterCreateRequest=0x6773
|
||||||
|
OP_CharacterCreate=0x6bbf
|
||||||
|
OP_DeleteCharacter=0x1808
|
||||||
|
OP_RandomNameGenerator=0x5954
|
||||||
|
OP_ApproveName=0x56a2
|
||||||
|
OP_MOTD=0x0c22
|
||||||
|
OP_SetChatServer=0x1bc5
|
||||||
|
OP_SetChatServer2=0x7eec
|
||||||
|
OP_ZoneServerInfo=0x4c44
|
||||||
|
OP_WorldComplete=0x4493
|
||||||
|
OP_WorldUnknown001=0x2301
|
||||||
|
OP_FloatListThing=0x46c6
|
||||||
|
|
||||||
|
# Reasons for Disconnect:
|
||||||
|
OP_ZoneUnavail=0x4cb4
|
||||||
|
OP_WorldClientReady=0x23c1
|
||||||
|
OP_CharacterStillInZone=0x0000
|
||||||
|
OP_WorldChecksumFailure=0x0000
|
||||||
|
OP_WorldLoginFailed=0x0000
|
||||||
|
OP_WorldLogout=0x0000
|
||||||
|
OP_WorldLevelTooHigh=0x0000
|
||||||
|
OP_CharInacessable=0x0000
|
||||||
|
OP_UserCompInfo=0x0000
|
||||||
|
OP_SendExeChecksum=0x0000
|
||||||
|
OP_SendBaseDataChecksum=0x0000
|
||||||
|
|
||||||
|
# Zone in opcodes
|
||||||
|
OP_AckPacket=0x471d
|
||||||
|
OP_ZoneEntry=0x5089
|
||||||
|
OP_ReqNewZone=0x7887
|
||||||
|
OP_NewZone=0x1795
|
||||||
|
OP_ZoneSpawns=0x5237
|
||||||
|
OP_PlayerProfile=0x6506
|
||||||
|
OP_TimeOfDay=0x5070
|
||||||
|
OP_LevelUpdate=0x1eec
|
||||||
|
OP_Stamina=0x2a79
|
||||||
|
OP_RequestClientZoneChange=0x3fcf
|
||||||
|
OP_ZoneChange=0x2d18
|
||||||
|
OP_LockoutTimerInfo=0x0000
|
||||||
|
OP_ZoneServerReady=0x0000
|
||||||
|
OP_ZoneInUnknown=0x0000
|
||||||
|
OP_LogoutReply=0x0000
|
||||||
|
OP_PreLogoutReply=0x0000
|
||||||
|
|
||||||
|
# Required to fully log in
|
||||||
|
OP_SpawnAppearance=0x0971
|
||||||
|
OP_ChangeSize=0x4707
|
||||||
|
OP_TributeUpdate=0x5961
|
||||||
|
OP_TributeTimer=0x073d
|
||||||
|
OP_SendTributes=0x729b
|
||||||
|
OP_SendGuildTributes=0x1877
|
||||||
|
OP_TributeInfo=0x4254
|
||||||
|
OP_Weather=0x661e
|
||||||
|
OP_ReqClientSpawn=0x35fa
|
||||||
|
OP_SpawnDoor=0x7291
|
||||||
|
OP_GroundSpawn=0x6fca
|
||||||
|
OP_SendZonepoints=0x69a4
|
||||||
|
OP_BlockedBuffs=0x3033
|
||||||
|
OP_RemoveBlockedBuffs=0x0de7
|
||||||
|
OP_ClearBlockedBuffs=0x34cb
|
||||||
|
OP_WorldObjectsSent=0x5ae2
|
||||||
|
OP_SendExpZonein=0x5f8e
|
||||||
|
OP_SendAATable=0x66b5
|
||||||
|
OP_RespondAA=0x7a27
|
||||||
|
OP_UpdateAA=0x66f0
|
||||||
|
OP_SendAAStats=0x43c8
|
||||||
|
OP_AAExpUpdate=0x7d14
|
||||||
|
OP_ExpUpdate=0x20ed
|
||||||
|
OP_HPUpdate=0x2828
|
||||||
|
OP_ManaChange=0x43af
|
||||||
|
OP_TGB=0x0876
|
||||||
|
OP_SpecialMesg=0x0083
|
||||||
|
OP_GuildMemberList=0x12a6
|
||||||
|
OP_GuildMOTD=0x3e13
|
||||||
|
OP_CharInventory=0x5ca6
|
||||||
|
OP_WearChange=0x7994
|
||||||
|
OP_ClientUpdate=0x7dfc
|
||||||
|
OP_ClientReady=0x345d
|
||||||
|
OP_SetServerFilter=0x444d
|
||||||
|
|
||||||
|
# Guild Opcodes - Disabled until crashes are resolved in RoF
|
||||||
|
OP_GetGuildMOTD=0x36e0
|
||||||
|
OP_GetGuildMOTDReply=0x4f1f
|
||||||
|
OP_GuildMemberUpdate=0x69b9
|
||||||
|
OP_GuildInvite=0x7099
|
||||||
|
OP_GuildRemove=0x1444
|
||||||
|
OP_GuildPeace=0x67e3
|
||||||
|
OP_SetGuildMOTD=0x0b0b
|
||||||
|
OP_GuildList=0x507a
|
||||||
|
OP_GuildWar=0x1ffb
|
||||||
|
OP_GuildLeader=0x7e09
|
||||||
|
OP_GuildDelete=0x3708
|
||||||
|
OP_GuildInviteAccept=0x7053
|
||||||
|
OP_GuildDemote=0x2d4e
|
||||||
|
OP_GuildPromote=0x0000
|
||||||
|
OP_GuildPublicNote=0x5053
|
||||||
|
OP_GuildManageBanker=0x748f
|
||||||
|
OP_GuildBank=0x5134
|
||||||
|
OP_SetGuildRank=0x0b9c
|
||||||
|
OP_GuildUpdateURLAndChannel=0x2958
|
||||||
|
OP_GuildStatus=0x7326
|
||||||
|
OP_GuildCreate=0x1dc8
|
||||||
|
OP_GuildMemberLevelUpdate=0x0000 # Unused?
|
||||||
|
OP_ZoneGuildList=0x0000 # Unused?
|
||||||
|
OP_GetGuildsList=0x0000 # Unused?
|
||||||
|
OP_LFGuild=0x0000
|
||||||
|
OP_GuildManageRemove=0x0000
|
||||||
|
OP_GuildManageAdd=0x0000
|
||||||
|
OP_GuildManageStatus=0x0000
|
||||||
|
|
||||||
|
# GM/Guide Opcodes
|
||||||
|
OP_GMServers=0x08c1
|
||||||
|
OP_GMBecomeNPC=0x3ae1
|
||||||
|
OP_GMZoneRequest=0x62ac
|
||||||
|
OP_GMZoneRequest2=0x7e1a
|
||||||
|
OP_GMGoto=0x7d8e
|
||||||
|
OP_GMSearchCorpse=0x357c
|
||||||
|
OP_GMHideMe=0x79c5
|
||||||
|
OP_GMDelCorpse=0x607e
|
||||||
|
OP_GMApproval=0x6db5
|
||||||
|
OP_GMToggle=0x2097
|
||||||
|
OP_GMSummon=0x486f
|
||||||
|
OP_GMEmoteZone=0x1cfd
|
||||||
|
OP_GMEmoteWorld=0x458e
|
||||||
|
OP_GMFind=0x4a8f
|
||||||
|
OP_GMKick=0x26a7
|
||||||
|
OP_GMKill=0x51d3
|
||||||
|
OP_GMNameChange=0x035f
|
||||||
|
OP_GMLastName=0x46ce
|
||||||
|
|
||||||
|
# Misc Opcodes
|
||||||
|
OP_InspectRequest=0x57bc
|
||||||
|
OP_InspectAnswer=0x71ac
|
||||||
|
OP_InspectMessageUpdate=0x4d25
|
||||||
|
OP_BeginCast=0x318f
|
||||||
|
OP_ColoredText=0x0000
|
||||||
|
OP_ConsentResponse=0x384a
|
||||||
|
OP_MemorizeSpell=0x217c
|
||||||
|
OP_SwapSpell=0x0efa
|
||||||
|
OP_CastSpell=0x1287
|
||||||
|
OP_Consider=0x742b
|
||||||
|
OP_FormattedMessage=0x1024
|
||||||
|
OP_SimpleMessage=0x213f
|
||||||
|
OP_Buff=0x659c
|
||||||
|
OP_Illusion=0x312a
|
||||||
|
OP_MoneyOnCorpse=0x5f44
|
||||||
|
OP_RandomReply=0x106b
|
||||||
|
OP_DenyResponse=0x2382
|
||||||
|
OP_SkillUpdate=0x004c
|
||||||
|
OP_GMTrainSkillConfirm=0x66dd
|
||||||
|
OP_RandomReq=0x7b10
|
||||||
|
OP_Death=0x6517
|
||||||
|
OP_GMTraining=0x1966
|
||||||
|
OP_GMEndTraining=0x4d6b
|
||||||
|
OP_GMTrainSkill=0x2a85
|
||||||
|
OP_Animation=0x7177
|
||||||
|
OP_Begging=0x6703
|
||||||
|
OP_Consent=0x1fd1
|
||||||
|
OP_ConsentDeny=0x7a45
|
||||||
|
OP_AutoFire=0x241e
|
||||||
|
OP_PetCommands=0x0159
|
||||||
|
OP_DeleteSpell=0x52e5
|
||||||
|
OP_Surname=0x0423
|
||||||
|
OP_ClearSurname=0x7d23
|
||||||
|
OP_FaceChange=0x5578
|
||||||
|
OP_SenseHeading=0x260a
|
||||||
|
OP_Action=0x744c
|
||||||
|
OP_ConsiderCorpse=0x5204
|
||||||
|
OP_HideCorpse=0x49e1
|
||||||
|
OP_CorpseDrag=0x0904
|
||||||
|
OP_CorpseDrop=0x7037
|
||||||
|
OP_Bug=0x73f4
|
||||||
|
OP_Feedback=0x5602
|
||||||
|
OP_Report=0x1414
|
||||||
|
OP_Damage=0x6f15
|
||||||
|
OP_ChannelMessage=0x2b2d
|
||||||
|
OP_Assist=0x4478
|
||||||
|
OP_AssistGroup=0x27f8
|
||||||
|
OP_MoveCoin=0x0bcf
|
||||||
|
OP_ZonePlayerToBind=0x0ecb
|
||||||
|
OP_KeyRing=0x6857
|
||||||
|
OP_WhoAllRequest=0x65ab
|
||||||
|
OP_WhoAllResponse=0x7c88
|
||||||
|
OP_FriendsWho=0x3956
|
||||||
|
OP_ConfirmDelete=0x43a3
|
||||||
|
OP_Logout=0x4ac6
|
||||||
|
OP_Rewind=0x1745
|
||||||
|
OP_TargetCommand=0x58e2
|
||||||
|
OP_Hide=0x67fe
|
||||||
|
OP_Jump=0x2060
|
||||||
|
OP_Camp=0x28ec
|
||||||
|
OP_Emote=0x373b
|
||||||
|
OP_SetRunMode=0x009f
|
||||||
|
OP_BankerChange=0x383c
|
||||||
|
OP_TargetMouse=0x075d
|
||||||
|
OP_MobHealth=0x37b1
|
||||||
|
OP_InitialMobHealth=0x0000 # Unused?
|
||||||
|
OP_TargetHoTT=0x0272
|
||||||
|
OP_XTargetResponse=0x672f
|
||||||
|
OP_XTargetRequest=0x45be
|
||||||
|
OP_XTargetAutoAddHaters=0x792c
|
||||||
|
OP_TargetBuffs=0x4f4b
|
||||||
|
OP_BuffCreate=0x3377
|
||||||
|
OP_BuffRemoveRequest=0x64f2
|
||||||
|
OP_DeleteSpawn=0x7280
|
||||||
|
OP_AutoAttack=0x109d
|
||||||
|
OP_AutoAttack2=0x3526
|
||||||
|
OP_Consume=0x4b70
|
||||||
|
OP_MoveItem=0x32ee
|
||||||
|
OP_DeleteItem=0x18ad
|
||||||
|
OP_DeleteCharge=0x01b8
|
||||||
|
OP_ItemPacket=0x368e
|
||||||
|
OP_ItemLinkResponse=0x633c
|
||||||
|
OP_ItemLinkClick=0x4cef
|
||||||
|
OP_ItemPreview=0x6b5c
|
||||||
|
OP_NewSpawn=0x6097
|
||||||
|
OP_Track=0x17e5
|
||||||
|
OP_TrackTarget=0x0029
|
||||||
|
OP_TrackUnknown=0x4577
|
||||||
|
OP_ClickDoor=0x3a8f
|
||||||
|
OP_MoveDoor=0x08e8
|
||||||
|
OP_RemoveAllDoors=0x700c
|
||||||
|
OP_EnvDamage=0x51fd
|
||||||
|
OP_BoardBoat=0x4211
|
||||||
|
OP_Forage=0x5306
|
||||||
|
OP_LeaveBoat=0x7617
|
||||||
|
OP_ControlBoat=0x0ae7
|
||||||
|
OP_SafeFallSuccess=0x2219
|
||||||
|
OP_RezzComplete=0x760d
|
||||||
|
OP_RezzRequest=0x3c21
|
||||||
|
OP_RezzAnswer=0x701c
|
||||||
|
OP_Shielding=0x48c1
|
||||||
|
OP_RequestDuel=0x3af1
|
||||||
|
OP_MobRename=0x2c57
|
||||||
|
OP_AugmentItem=0x661b
|
||||||
|
OP_WeaponEquip1=0x34a7
|
||||||
|
OP_WeaponEquip2=0x559a
|
||||||
|
OP_WeaponUnequip2=0x2d25
|
||||||
|
OP_ApplyPoison=0x31e6
|
||||||
|
OP_Save=0x4a39
|
||||||
|
OP_TestBuff=0x7cb8
|
||||||
|
OP_CustomTitles=0x100e
|
||||||
|
OP_Split=0x3a54
|
||||||
|
OP_YellForHelp=0x4e56
|
||||||
|
OP_LoadSpellSet=0x261d
|
||||||
|
OP_Bandolier=0x7677
|
||||||
|
OP_PotionBelt=0x1a3e
|
||||||
|
OP_DuelResponse=0x6a46
|
||||||
|
OP_DuelResponse2=0x68d3
|
||||||
|
OP_SaveOnZoneReq=0x600d
|
||||||
|
OP_ReadBook=0x72df
|
||||||
|
OP_Dye=0x23b9
|
||||||
|
OP_InterruptCast=0x048c
|
||||||
|
OP_AAAction=0x424e
|
||||||
|
OP_LeadershipExpToggle=0x6c55
|
||||||
|
OP_LeadershipExpUpdate=0x2797
|
||||||
|
OP_PurchaseLeadershipAA=0x0026
|
||||||
|
OP_UpdateLeadershipAA=0x026
|
||||||
|
OP_MarkNPC=0x5a58
|
||||||
|
OP_MarkRaidNPC=0x74bd #unimplemented
|
||||||
|
OP_ClearNPCMarks=0x2003
|
||||||
|
OP_ClearRaidNPCMarks=0x20d3 #unimplemented
|
||||||
|
OP_DelegateAbility=0x76b8
|
||||||
|
OP_SetGroupTarget=0x2814
|
||||||
|
OP_Charm=0x5d92
|
||||||
|
OP_Stun=0x36a4
|
||||||
|
OP_SendFindableNPCs=0x3897
|
||||||
|
OP_FindPersonRequest=0x5cea
|
||||||
|
OP_FindPersonReply=0x7e58
|
||||||
|
OP_Sound=0x1a30
|
||||||
|
OP_PetBuffWindow=0x5882
|
||||||
|
OP_LevelAppearance=0x3bc9
|
||||||
|
OP_Translocate=0x6580
|
||||||
|
OP_Sacrifice=0x1821
|
||||||
|
OP_PopupResponse=0x214a
|
||||||
|
OP_OnLevelMessage=0x4fd0
|
||||||
|
OP_AugmentInfo=0x0afb
|
||||||
|
OP_Petition=0x5f03
|
||||||
|
OP_SomeItemPacketMaybe=0x747c
|
||||||
|
OP_PVPStats=0x6f4b
|
||||||
|
OP_PVPLeaderBoardRequest=0x3707
|
||||||
|
OP_PVPLeaderBoardReply=0x25b7
|
||||||
|
OP_PVPLeaderBoardDetailsRequest=0x15a9
|
||||||
|
OP_PVPLeaderBoardDetailsReply=0x04aa
|
||||||
|
OP_RestState=0x00f
|
||||||
|
OP_RespawnWindow=0x28bc
|
||||||
|
OP_LDoNButton=0x5327
|
||||||
|
OP_SetStartCity=0x6326
|
||||||
|
OP_VoiceMacroIn=0x17fd
|
||||||
|
OP_VoiceMacroOut=0x409a
|
||||||
|
OP_ItemViewUnknown=0x2289
|
||||||
|
OP_VetRewardsAvaliable=0x590e
|
||||||
|
OP_VetClaimRequest=0x1126
|
||||||
|
OP_VetClaimReply=0x16d4
|
||||||
|
OP_DisciplineUpdate=0x759e
|
||||||
|
OP_DisciplineTimer=0x6989
|
||||||
|
OP_BecomeCorpse=0x0000 # Unused?
|
||||||
|
OP_Action2=0x0000 # Unused?
|
||||||
|
OP_MobUpdate=0x2c84
|
||||||
|
OP_NPCMoveUpdate=0x189c
|
||||||
|
OP_CameraEffect=0x127f
|
||||||
|
OP_SpellEffect=0x5936
|
||||||
|
OP_RemoveNimbusEffect=0xc693
|
||||||
|
OP_AltCurrency=0x7121
|
||||||
|
OP_AltCurrencyMerchantRequest=0x6b6d
|
||||||
|
OP_AltCurrencyMerchantReply=0x74ec
|
||||||
|
OP_AltCurrencyPurchase=0x61cb
|
||||||
|
OP_AltCurrencySell=0x0165
|
||||||
|
OP_AltCurrencySellSelection=0x5409
|
||||||
|
OP_AltCurrencyReclaim=0x532a
|
||||||
|
OP_CrystalCountUpdate=0x467f
|
||||||
|
OP_CrystalCreate=0x7aee
|
||||||
|
OP_CrystalReclaim=0x2439
|
||||||
|
OP_Untargetable=0x053c
|
||||||
|
OP_IncreaseStats=0x70a3
|
||||||
|
OP_Weblink=0x18d3
|
||||||
|
OP_OpenContainer=0x0000
|
||||||
|
OP_Marquee=0x0000
|
||||||
|
OP_ItemRecastDelay=0x08a6
|
||||||
|
#OP_OpenInventory=0x0000 # Likely does not exist in RoF -U
|
||||||
|
|
||||||
|
OP_DzQuit=0xb2e3
|
||||||
|
OP_DzListTimers=0x7b68
|
||||||
|
OP_DzAddPlayer=0x4701
|
||||||
|
OP_DzRemovePlayer=0x1abc
|
||||||
|
OP_DzSwapPlayer=0x405b
|
||||||
|
OP_DzMakeLeader=0x543d
|
||||||
|
OP_DzPlayerList=0x14c6
|
||||||
|
OP_DzJoinExpeditionConfirm=0x7f4b
|
||||||
|
OP_DzJoinExpeditionReply=0x1950
|
||||||
|
OP_DzExpeditionInfo=0x9119
|
||||||
|
OP_DzExpeditionList=0x205f
|
||||||
|
OP_DzMemberStatus=0x32f0
|
||||||
|
OP_DzLeaderStatus=0x3de9
|
||||||
|
OP_DzExpeditionEndsWarning=0x5189
|
||||||
|
OP_DzMemberList=0x5ae4
|
||||||
|
OP_DzCompass=0x3e0e
|
||||||
|
OP_DzChooseZone=0x0000
|
||||||
|
|
||||||
|
# New Opcodes
|
||||||
|
OP_SpawnPositionUpdate=0x0000 # Actually OP_MobUpdate ?
|
||||||
|
OP_ManaUpdate=0x3791
|
||||||
|
OP_EnduranceUpdate=0x5f42
|
||||||
|
OP_MobManaUpdate=0x2404
|
||||||
|
OP_MobEnduranceUpdate=0x1c81
|
||||||
|
|
||||||
|
# Mercenary Opcodes
|
||||||
|
OP_MercenaryDataUpdateRequest=0x7b89
|
||||||
|
OP_MercenaryDataUpdate=0x61a4
|
||||||
|
OP_MercenaryDataRequest=0x11c1
|
||||||
|
OP_MercenaryDataResponse=0x72ce
|
||||||
|
OP_MercenaryHire=0x7169
|
||||||
|
OP_MercenaryDismiss=0x6e83
|
||||||
|
OP_MercenaryTimerRequest=0x31e4
|
||||||
|
OP_MercenaryTimer=0x0763
|
||||||
|
OP_MercenaryUnknown1=0x5d26
|
||||||
|
OP_MercenaryCommand=0x27f2
|
||||||
|
OP_MercenarySuspendRequest=0x4407
|
||||||
|
OP_MercenarySuspendResponse=0x6f03
|
||||||
|
OP_MercenaryUnsuspendResponse=0x27a0
|
||||||
|
|
||||||
|
# Looting
|
||||||
|
OP_LootRequest=0x0adf
|
||||||
|
OP_EndLootRequest=0x30f7
|
||||||
|
OP_LootItem=0x4dc9
|
||||||
|
OP_LootComplete=0x55c4
|
||||||
|
|
||||||
|
# bazaar trader stuff:
|
||||||
|
OP_BazaarSearch=0x39d6
|
||||||
|
OP_TraderDelItem=0x0000
|
||||||
|
OP_BecomeTrader=0x61b3
|
||||||
|
OP_TraderShop=0x31df
|
||||||
|
OP_Trader=0x4ef5
|
||||||
|
OP_TraderBuy=0x0000
|
||||||
|
OP_Barter=0x243a
|
||||||
|
OP_ShopItem=0x0000
|
||||||
|
OP_BazaarInspect=0x0000
|
||||||
|
OP_Bazaar=0x0000
|
||||||
|
OP_TraderItemUpdate=0x0000
|
||||||
|
|
||||||
|
# pc/npc trading
|
||||||
|
OP_TradeRequest=0x77b5
|
||||||
|
OP_TradeAcceptClick=0x69e2
|
||||||
|
OP_TradeRequestAck=0x14bf
|
||||||
|
OP_TradeCoins=0x4206
|
||||||
|
OP_FinishTrade=0x3993
|
||||||
|
OP_CancelTrade=0x354c
|
||||||
|
OP_TradeMoneyUpdate=0x68c2
|
||||||
|
OP_MoneyUpdate=0x640c
|
||||||
|
OP_TradeBusy=0x5505
|
||||||
|
|
||||||
|
# Sent after canceling trade or after closing tradeskill object
|
||||||
|
OP_FinishWindow=0x7349
|
||||||
|
OP_FinishWindow2=0x40ef
|
||||||
|
|
||||||
|
# Sent on Live for what seems to be item existance verification
|
||||||
|
# Ex. Before Right Click Effect happens from items
|
||||||
|
OP_ItemVerifyRequest=0x097b
|
||||||
|
OP_ItemVerifyReply=0x2115
|
||||||
|
|
||||||
|
# merchant stuff
|
||||||
|
OP_ShopPlayerSell=0x1901
|
||||||
|
OP_ShopRequest=0x4fed
|
||||||
|
OP_ShopEnd=0x30a8
|
||||||
|
OP_ShopEndConfirm=0x3196
|
||||||
|
OP_ShopPlayerBuy=0x04c
|
||||||
|
OP_ShopDelItem=0x724f
|
||||||
|
|
||||||
|
# tradeskill stuff:
|
||||||
|
OP_ClickObject=0x4aa1
|
||||||
|
OP_ClickObjectAction=0x0c1e
|
||||||
|
OP_ClearObject=0x7a11
|
||||||
|
OP_RecipeDetails=0x40d7
|
||||||
|
OP_RecipesFavorite=0x5c74
|
||||||
|
OP_RecipesSearch=0x1db6
|
||||||
|
OP_RecipeReply=0x6e02
|
||||||
|
OP_RecipeAutoCombine=0x6261
|
||||||
|
OP_TradeSkillCombine=0x579a
|
||||||
|
|
||||||
|
# Tribute Packets:
|
||||||
|
OP_OpenGuildTributeMaster=0x378d
|
||||||
|
OP_OpenTributeMaster=0x7666
|
||||||
|
OP_SelectTribute=0x79fc
|
||||||
|
OP_TributeItem=0x4f3e
|
||||||
|
OP_TributeMoney=0x58fb
|
||||||
|
OP_TributeToggle=0x241d
|
||||||
|
OP_TributePointUpdate=0x5300
|
||||||
|
OP_TributeNPC=0x0000
|
||||||
|
OP_GuildTributeInfo=0x0000
|
||||||
|
OP_OpenTributeReply=0x0000
|
||||||
|
OP_GuildTributeStatus=0x0000
|
||||||
|
|
||||||
|
# Adventure packets:
|
||||||
|
OP_LeaveAdventure=0x5d18
|
||||||
|
OP_AdventureFinish=0x400f
|
||||||
|
OP_AdventureInfoRequest=0x3cb0
|
||||||
|
OP_AdventureInfo=0x4c54
|
||||||
|
OP_AdventureRequest=0x2c6c
|
||||||
|
OP_AdventureDetails=0x5648
|
||||||
|
OP_AdventureData=0x7171
|
||||||
|
OP_AdventureUpdate=0x1b01
|
||||||
|
OP_AdventureMerchantRequest=0x6922
|
||||||
|
OP_AdventureMerchantResponse=0x3e47
|
||||||
|
OP_AdventureMerchantPurchase=0x5b72
|
||||||
|
OP_AdventureMerchantSell=0x2f9b
|
||||||
|
OP_AdventurePointsUpdate=0x65c3
|
||||||
|
OP_AdventureStatsRequest=0x5a62
|
||||||
|
OP_AdventureStatsReply=0x2370
|
||||||
|
OP_AdventureLeaderboardRequest=0x7093
|
||||||
|
OP_AdventureLeaderboardReply=0x7f79
|
||||||
|
|
||||||
|
# Group Opcodes
|
||||||
|
OP_GroupDisband=0x4c10
|
||||||
|
OP_GroupInvite=0x1649
|
||||||
|
OP_GroupFollow=0x05ce
|
||||||
|
OP_GroupUpdate=0x3abb
|
||||||
|
OP_GroupUpdateB=0x6194
|
||||||
|
OP_GroupCancelInvite=0x0000
|
||||||
|
OP_GroupAcknowledge=0x7323
|
||||||
|
OP_GroupDelete=0x0f6c
|
||||||
|
OP_CancelInvite=0x32c2
|
||||||
|
OP_GroupFollow2=0x2a50
|
||||||
|
OP_GroupInvite2=0x6c65
|
||||||
|
OP_GroupDisbandYou=0x1ae5
|
||||||
|
OP_GroupDisbandOther=0x74da
|
||||||
|
OP_GroupLeaderChange=0x21b4
|
||||||
|
OP_GroupRoles=0x70e2
|
||||||
|
OP_GroupMakeLeader=0x4229
|
||||||
|
OP_DoGroupLeadershipAbility=0x1fb5
|
||||||
|
OP_GroupLeadershipAAUpdate=0x02cf
|
||||||
|
OP_GroupMentor=0x5892
|
||||||
|
OP_InspectBuffs=0x486c
|
||||||
|
|
||||||
|
# LFG/LFP Opcodes
|
||||||
|
OP_LFGCommand=0x6060
|
||||||
|
OP_LFGGetMatchesRequest=0x0340
|
||||||
|
OP_LFGGetMatchesResponse=0x5048
|
||||||
|
OP_LFPGetMatchesRequest=0x4d7d
|
||||||
|
OP_LFPGetMatchesResponse=0x22c6
|
||||||
|
OP_LFPCommand=0x49a9
|
||||||
|
OP_LFGAppearance=0x0000
|
||||||
|
OP_LFGResponse=0x0000
|
||||||
|
|
||||||
|
# Raid Opcodes
|
||||||
|
OP_RaidInvite=0x55ac
|
||||||
|
OP_RaidUpdate=0x3973
|
||||||
|
OP_RaidJoin=0x0000
|
||||||
|
|
||||||
|
# Button-push commands
|
||||||
|
OP_Taunt=0x2703
|
||||||
|
OP_CombatAbility=0x3eba
|
||||||
|
OP_SenseTraps=0x02af
|
||||||
|
OP_PickPocket=0x39e8
|
||||||
|
OP_DisarmTraps=0x78bf
|
||||||
|
OP_Disarm=0x5ec8
|
||||||
|
OP_Sneak=0x5d55
|
||||||
|
OP_Fishing=0x1e2a
|
||||||
|
OP_InstillDoubt=0x640e
|
||||||
|
OP_FeignDeath=0x52fa
|
||||||
|
OP_Mend=0x0ecf
|
||||||
|
OP_Bind_Wound=0x0386
|
||||||
|
OP_LDoNOpen=0x3d5c
|
||||||
|
|
||||||
|
# Task packets
|
||||||
|
OP_TaskDescription=0x083
|
||||||
|
OP_TaskActivity=0x3714
|
||||||
|
OP_CompletedTasks=0x4eba
|
||||||
|
OP_TaskActivityComplete=0x5e19
|
||||||
|
OP_AcceptNewTask=0x0a23
|
||||||
|
OP_CancelTask=0x08d3
|
||||||
|
OP_TaskMemberList=0x5727
|
||||||
|
OP_OpenNewTasksWindow=0x48a2
|
||||||
|
OP_AvaliableTask=0x36e8
|
||||||
|
OP_TaskHistoryRequest=0x5f1c
|
||||||
|
OP_TaskHistoryReply=0x3d05
|
||||||
|
OP_DeclineAllTasks=0x0000
|
||||||
|
|
||||||
|
# Title opcodes
|
||||||
|
OP_NewTitlesAvailable=0x0d32
|
||||||
|
OP_RequestTitles=0x6344
|
||||||
|
OP_SendTitleList=0x2d08
|
||||||
|
OP_SetTitle=0x6527
|
||||||
|
OP_SetTitleReply=0x4c21
|
||||||
|
|
||||||
|
# mail opcodes
|
||||||
|
OP_Command=0x0000
|
||||||
|
OP_MailboxHeader=0x0000
|
||||||
|
OP_MailHeader=0x0000
|
||||||
|
OP_MailBody=0x0000
|
||||||
|
OP_NewMail=0x0000
|
||||||
|
OP_SentConfirm=0x0000
|
||||||
|
|
||||||
|
########### Below this point should not be needed ###########
|
||||||
|
|
||||||
|
# This section are all unknown in Titanium
|
||||||
|
OP_ForceFindPerson=0x0000
|
||||||
|
OP_LocInfo=0x0000
|
||||||
|
OP_ReloadUI=0x0000
|
||||||
|
OP_ItemName=0x0000
|
||||||
|
OP_ItemLinkText=0x0000
|
||||||
|
OP_MultiLineMsg=0x0000
|
||||||
|
OP_MendHPUpdate=0x0000
|
||||||
|
OP_TargetReject=0x0000
|
||||||
|
OP_SafePoint=0x0000
|
||||||
|
OP_ApproveZone=0x0000
|
||||||
|
OP_ZoneComplete=0x0000
|
||||||
|
OP_ClientError=0x0000
|
||||||
|
OP_DumpName=0x0000
|
||||||
|
OP_Heartbeat=0x0000
|
||||||
|
OP_CrashDump=0x0000
|
||||||
|
OP_LoginComplete=0x0000
|
||||||
|
|
||||||
|
# discovered opcodes not yet used:
|
||||||
|
OP_PickLockSuccess=0x0000
|
||||||
|
OP_PlayMP3=0x0000
|
||||||
|
OP_ReclaimCrystals=0x0000
|
||||||
|
OP_DynamicWall=0x0000
|
||||||
|
OP_OpenDiscordMerchant=0x0000
|
||||||
|
OP_DiscordMerchantInventory=0x0000
|
||||||
|
OP_GiveMoney=0x0000
|
||||||
|
OP_RequestKnowledgeBase=0x0000
|
||||||
|
OP_KnowledgeBase=0x0000
|
||||||
|
OP_SlashAdventure=0x0000 # /adventure
|
||||||
|
OP_BecomePVPPrompt=0x0000
|
||||||
|
OP_MoveLogRequest=0x0000 # gone I think
|
||||||
|
OP_MoveLogDisregard=0x0000 # gone I think
|
||||||
|
|
||||||
|
# named unknowns, to make looking for real unknown easier
|
||||||
|
OP_AnnoyingZoneUnknown=0x0000
|
||||||
|
OP_Some6ByteHPUpdate=0x0000 seems to happen when you target group members
|
||||||
|
OP_QueryResponseThing=0x0000
|
||||||
|
|
||||||
|
|
||||||
|
# realityincarnate: these are just here to stop annoying several thousand byte packet dumps
|
||||||
|
#OP_LoginUnknown1=0x46d3 # OP_SendSpellChecksum
|
||||||
|
#OP_LoginUnknown2=0x040b # OP_SendSkillCapsChecksum
|
||||||
|
|
||||||
|
# Petition Opcodes
|
||||||
|
OP_PetitionSearch=0x0000 search term for petition
|
||||||
|
OP_PetitionSearchResults=0x0000 (list of?) matches from search
|
||||||
|
OP_PetitionSearchText=0x0000 text results of search
|
||||||
|
|
||||||
|
OP_PetitionUpdate=0x0000
|
||||||
|
OP_PetitionCheckout=0x0000
|
||||||
|
OP_PetitionCheckIn=0x0000
|
||||||
|
OP_PetitionQue=0x0000
|
||||||
|
OP_PetitionUnCheckout=0x0000
|
||||||
|
OP_PetitionDelete=0x0000
|
||||||
|
OP_DeletePetition=0x0000
|
||||||
|
OP_PetitionResolve=0x0000
|
||||||
|
OP_PDeletePetition=0x0000
|
||||||
|
OP_PetitionBug=0x0000
|
||||||
|
OP_PetitionRefresh=0x0000
|
||||||
|
OP_PetitionCheckout2=0x0000
|
||||||
|
OP_PetitionViewPetition=0x0000
|
||||||
|
|
||||||
|
# Login opcodes
|
||||||
|
OP_SessionReady=0x0000
|
||||||
|
OP_Login=0x0000
|
||||||
|
OP_ServerListRequest=0x0000
|
||||||
|
OP_PlayEverquestRequest=0x0000
|
||||||
|
OP_PlayEverquestResponse=0x0000
|
||||||
|
OP_ChatMessage=0x0000
|
||||||
|
OP_LoginAccepted=0x0000
|
||||||
|
OP_ServerListResponse=0x0000
|
||||||
|
OP_Poll=0x0000
|
||||||
|
OP_EnterChat=0x0000
|
||||||
|
OP_PollResponse=0x0000
|
||||||
|
|
||||||
|
# raw opcodes
|
||||||
|
OP_RAWSessionRequest=0x0000
|
||||||
|
OP_RAWSessionResponse=0x0000
|
||||||
|
OP_RAWCombined=0x0000
|
||||||
|
OP_RAWSessionDisconnect=0x0000
|
||||||
|
OP_RAWKeepAlive=0x0000
|
||||||
|
OP_RAWSessionStatRequest=0x0000
|
||||||
|
OP_RAWSessionStatResponse=0x0000
|
||||||
|
OP_RAWPacket=0x0000
|
||||||
|
OP_RAWFragment=0x0000
|
||||||
|
OP_RAWOutOfOrderAck=0x0000
|
||||||
|
OP_RAWAck=0x0000
|
||||||
|
OP_RAWAppCombined=0x0000
|
||||||
|
OP_RAWOutOfSession=0x0000
|
||||||
|
|
||||||
|
# we need to document the differences between these packets to make identifying them easier
|
||||||
|
OP_Some3ByteHPUpdate=0x0000 # initial HP update for mobs
|
||||||
|
OP_InitialHPUpdate=0x0000
|
||||||
@ -312,7 +312,7 @@
|
|||||||
9056|2014_11_08_RaidMembers.sql|SHOW COLUMNS FROM `raid_members` LIKE 'groupid'|missing|unsigned
|
9056|2014_11_08_RaidMembers.sql|SHOW COLUMNS FROM `raid_members` LIKE 'groupid'|missing|unsigned
|
||||||
9057|2014_11_13_spells_new_updates.sql|SHOW COLUMNS FROM `spells_new` LIKE 'disallow_sit'|empty|
|
9057|2014_11_13_spells_new_updates.sql|SHOW COLUMNS FROM `spells_new` LIKE 'disallow_sit'|empty|
|
||||||
9058|2014_11_26_InventoryTableUpdate.sql|SHOW COLUMNS FROM `inventory` LIKE 'ornamenticon'|empty|
|
9058|2014_11_26_InventoryTableUpdate.sql|SHOW COLUMNS FROM `inventory` LIKE 'ornamenticon'|empty|
|
||||||
9059|2014_11_30_mercs_table_update.sql|SHOW COLUMNS FROM `mercs` LIKE 'MercSize'|empty|
|
9059|2014_12_01_mercs_table_update.sql|SHOW COLUMNS FROM `mercs` LIKE 'MercSize'|empty|
|
||||||
|
|
||||||
# Upgrade conditions:
|
# Upgrade conditions:
|
||||||
# This won't be needed after this system is implemented, but it is used database that are not
|
# This won't be needed after this system is implemented, but it is used database that are not
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
#include "../common/rulesys.h"
|
#include "../common/rulesys.h"
|
||||||
#include "../common/misc_functions.h"
|
#include "../common/misc_functions.h"
|
||||||
#include "../common/string_util.h"
|
#include "../common/string_util.h"
|
||||||
|
#include "../common/random.h"
|
||||||
#include "adventure.h"
|
#include "adventure.h"
|
||||||
#include "adventure_manager.h"
|
#include "adventure_manager.h"
|
||||||
#include "worlddb.h"
|
#include "worlddb.h"
|
||||||
@ -14,6 +15,7 @@
|
|||||||
extern ZSList zoneserver_list;
|
extern ZSList zoneserver_list;
|
||||||
extern ClientList client_list;
|
extern ClientList client_list;
|
||||||
extern AdventureManager adventure_manager;
|
extern AdventureManager adventure_manager;
|
||||||
|
extern EQEmu::Random emu_random;
|
||||||
|
|
||||||
Adventure::Adventure(AdventureTemplate *t)
|
Adventure::Adventure(AdventureTemplate *t)
|
||||||
{
|
{
|
||||||
@ -392,8 +394,8 @@ void Adventure::MoveCorpsesToGraveyard()
|
|||||||
|
|
||||||
for (auto iter = dbid_list.begin(); iter != dbid_list.end(); ++iter)
|
for (auto iter = dbid_list.begin(); iter != dbid_list.end(); ++iter)
|
||||||
{
|
{
|
||||||
float x = GetTemplate()->graveyard_x + MakeRandomFloat(-GetTemplate()->graveyard_radius, GetTemplate()->graveyard_radius);
|
float x = GetTemplate()->graveyard_x + emu_random.Real(-GetTemplate()->graveyard_radius, GetTemplate()->graveyard_radius);
|
||||||
float y = GetTemplate()->graveyard_y + MakeRandomFloat(-GetTemplate()->graveyard_radius, GetTemplate()->graveyard_radius);
|
float y = GetTemplate()->graveyard_y + emu_random.Real(-GetTemplate()->graveyard_radius, GetTemplate()->graveyard_radius);
|
||||||
float z = GetTemplate()->graveyard_z;
|
float z = GetTemplate()->graveyard_z;
|
||||||
|
|
||||||
query = StringFormat("UPDATE character_corpses "
|
query = StringFormat("UPDATE character_corpses "
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
#include "../common/string_util.h"
|
#include "../common/string_util.h"
|
||||||
#include "../common/servertalk.h"
|
#include "../common/servertalk.h"
|
||||||
#include "../common/rulesys.h"
|
#include "../common/rulesys.h"
|
||||||
|
#include "../common/random.h"
|
||||||
#include "adventure.h"
|
#include "adventure.h"
|
||||||
#include "adventure_manager.h"
|
#include "adventure_manager.h"
|
||||||
#include "worlddb.h"
|
#include "worlddb.h"
|
||||||
@ -14,6 +15,7 @@
|
|||||||
|
|
||||||
extern ZSList zoneserver_list;
|
extern ZSList zoneserver_list;
|
||||||
extern ClientList client_list;
|
extern ClientList client_list;
|
||||||
|
extern EQEmu::Random emu_random;
|
||||||
|
|
||||||
AdventureManager::AdventureManager()
|
AdventureManager::AdventureManager()
|
||||||
{
|
{
|
||||||
@ -325,7 +327,7 @@ void AdventureManager::CalculateAdventureRequestReply(const char *data)
|
|||||||
if(eligible_adventures.size() > 0)
|
if(eligible_adventures.size() > 0)
|
||||||
{
|
{
|
||||||
ea_iter = eligible_adventures.begin();
|
ea_iter = eligible_adventures.begin();
|
||||||
int c_index = MakeRandomInt(0, (eligible_adventures.size()-1));
|
int c_index = emu_random.Int(0, (eligible_adventures.size()-1));
|
||||||
for(int i = 0; i < c_index; ++i)
|
for(int i = 0; i < c_index; ++i)
|
||||||
{
|
{
|
||||||
++ea_iter;
|
++ea_iter;
|
||||||
|
|||||||
@ -15,6 +15,7 @@
|
|||||||
#include "../common/extprofile.h"
|
#include "../common/extprofile.h"
|
||||||
#include "../common/string_util.h"
|
#include "../common/string_util.h"
|
||||||
#include "../common/clientversions.h"
|
#include "../common/clientversions.h"
|
||||||
|
#include "../common/random.h"
|
||||||
|
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
#include "worlddb.h"
|
#include "worlddb.h"
|
||||||
@ -61,6 +62,7 @@ std::vector<RaceClassCombos> character_create_race_class_combos;
|
|||||||
extern ZSList zoneserver_list;
|
extern ZSList zoneserver_list;
|
||||||
extern LoginServerList loginserverlist;
|
extern LoginServerList loginserverlist;
|
||||||
extern ClientList client_list;
|
extern ClientList client_list;
|
||||||
|
extern EQEmu::Random emu_random;
|
||||||
extern uint32 numclients;
|
extern uint32 numclients;
|
||||||
extern volatile bool RunLoops;
|
extern volatile bool RunLoops;
|
||||||
|
|
||||||
@ -221,7 +223,7 @@ void Client::SendMembership() {
|
|||||||
mc->entries[1] = 0xffffffff; // Max Level Restriction
|
mc->entries[1] = 0xffffffff; // Max Level Restriction
|
||||||
mc->entries[2] = 0xffffffff; // Max Char Slots per Account (not used by client?)
|
mc->entries[2] = 0xffffffff; // Max Char Slots per Account (not used by client?)
|
||||||
mc->entries[3] = 0xffffffff; // 1 for Silver
|
mc->entries[3] = 0xffffffff; // 1 for Silver
|
||||||
mc->entries[4] = 8; // Main Inventory Size (0xffffffff on Live for Gold, but limitting to 8 until 10 is supported)
|
mc->entries[4] = 8; // Main Inventory Size (0xffffffff on Live for Gold, but limiting to 8 until 10 is supported)
|
||||||
mc->entries[5] = 0xffffffff; // Max Platinum per level
|
mc->entries[5] = 0xffffffff; // Max Platinum per level
|
||||||
mc->entries[6] = 1; // 0 for Silver
|
mc->entries[6] = 1; // 0 for Silver
|
||||||
mc->entries[7] = 1; // 0 for Silver
|
mc->entries[7] = 1; // 0 for Silver
|
||||||
@ -519,7 +521,7 @@ bool Client::HandleGenerateRandomNamePacket(const EQApplicationPacket *app) {
|
|||||||
char cons[48]="bcdfghjklmnpqrstvwxzybcdgklmnprstvwbcdgkpstrkd";
|
char cons[48]="bcdfghjklmnpqrstvwxzybcdgklmnprstvwbcdgkpstrkd";
|
||||||
char rndname[17]="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
|
char rndname[17]="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
|
||||||
char paircons[33]="ngrkndstshthphsktrdrbrgrfrclcr";
|
char paircons[33]="ngrkndstshthphsktrdrbrgrfrclcr";
|
||||||
int rndnum=MakeRandomInt(0, 75),n=1;
|
int rndnum=emu_random.Int(0, 75),n=1;
|
||||||
bool dlc=false;
|
bool dlc=false;
|
||||||
bool vwl=false;
|
bool vwl=false;
|
||||||
bool dbl=false;
|
bool dbl=false;
|
||||||
@ -540,18 +542,18 @@ bool Client::HandleGenerateRandomNamePacket(const EQApplicationPacket *app) {
|
|||||||
rndname[0]=vowels[rndnum];
|
rndname[0]=vowels[rndnum];
|
||||||
vwl=true;
|
vwl=true;
|
||||||
}
|
}
|
||||||
int namlen=MakeRandomInt(5, 10);
|
int namlen=emu_random.Int(5, 10);
|
||||||
for (int i=n;i<namlen;i++)
|
for (int i=n;i<namlen;i++)
|
||||||
{
|
{
|
||||||
dlc=false;
|
dlc=false;
|
||||||
if (vwl) //last char was a vowel
|
if (vwl) //last char was a vowel
|
||||||
{ // so pick a cons or cons pair
|
{ // so pick a cons or cons pair
|
||||||
rndnum=MakeRandomInt(0, 62);
|
rndnum=emu_random.Int(0, 62);
|
||||||
if (rndnum>46)
|
if (rndnum>46)
|
||||||
{ // pick a cons pair
|
{ // pick a cons pair
|
||||||
if (i>namlen-3) // last 2 chars in name?
|
if (i>namlen-3) // last 2 chars in name?
|
||||||
{ // name can only end in cons pair "rk" "st" "sh" "th" "ph" "sk" "nd" or "ng"
|
{ // name can only end in cons pair "rk" "st" "sh" "th" "ph" "sk" "nd" or "ng"
|
||||||
rndnum=MakeRandomInt(0, 7)*2;
|
rndnum=emu_random.Int(0, 7)*2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // pick any from the set
|
{ // pick any from the set
|
||||||
@ -569,12 +571,12 @@ bool Client::HandleGenerateRandomNamePacket(const EQApplicationPacket *app) {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // select a vowel
|
{ // select a vowel
|
||||||
rndname[i]=vowels[MakeRandomInt(0, 16)];
|
rndname[i]=vowels[emu_random.Int(0, 16)];
|
||||||
}
|
}
|
||||||
vwl=!vwl;
|
vwl=!vwl;
|
||||||
if (!dbl && !dlc)
|
if (!dbl && !dlc)
|
||||||
{ // one chance at double letters in name
|
{ // one chance at double letters in name
|
||||||
if (!MakeRandomInt(0, i+9)) // chances decrease towards end of name
|
if (!emu_random.Int(0, i+9)) // chances decrease towards end of name
|
||||||
{
|
{
|
||||||
rndname[i+1]=rndname[i];
|
rndname[i+1]=rndname[i];
|
||||||
dbl=true;
|
dbl=true;
|
||||||
@ -831,7 +833,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
|
|||||||
QueuePacket(outapp);
|
QueuePacket(outapp);
|
||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
|
|
||||||
int MailKey = MakeRandomInt(1, INT_MAX);
|
int MailKey = emu_random.Int(1, INT_MAX);
|
||||||
|
|
||||||
database.SetMailKey(charid, GetIP(), MailKey);
|
database.SetMailKey(charid, GetIP(), MailKey);
|
||||||
|
|
||||||
@ -1242,8 +1244,8 @@ void Client::ZoneUnavail() {
|
|||||||
|
|
||||||
bool Client::GenPassKey(char* key) {
|
bool Client::GenPassKey(char* key) {
|
||||||
char* passKey=nullptr;
|
char* passKey=nullptr;
|
||||||
*passKey += ((char)('A'+((int)MakeRandomInt(0, 25))));
|
*passKey += ((char)('A'+((int)emu_random.Int(0, 25))));
|
||||||
*passKey += ((char)('A'+((int)MakeRandomInt(0, 25))));
|
*passKey += ((char)('A'+((int)emu_random.Int(0, 25))));
|
||||||
memcpy(key, passKey, strlen(passKey));
|
memcpy(key, passKey, strlen(passKey));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -69,6 +69,7 @@
|
|||||||
|
|
||||||
#include "../common/emu_tcp_server.h"
|
#include "../common/emu_tcp_server.h"
|
||||||
#include "../common/patches/patches.h"
|
#include "../common/patches/patches.h"
|
||||||
|
#include "../common/random.h"
|
||||||
#include "zoneserver.h"
|
#include "zoneserver.h"
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
#include "login_server.h"
|
#include "login_server.h"
|
||||||
@ -100,6 +101,7 @@ QueryServConnection QSLink;
|
|||||||
WebInterfaceConnection WILink;
|
WebInterfaceConnection WILink;
|
||||||
LauncherList launcher_list;
|
LauncherList launcher_list;
|
||||||
AdventureManager adventure_manager;
|
AdventureManager adventure_manager;
|
||||||
|
EQEmu::Random emu_random;
|
||||||
volatile bool RunLoops = true;
|
volatile bool RunLoops = true;
|
||||||
uint32 numclients = 0;
|
uint32 numclients = 0;
|
||||||
uint32 numzones = 0;
|
uint32 numzones = 0;
|
||||||
|
|||||||
@ -24,10 +24,12 @@
|
|||||||
#include "world_config.h"
|
#include "world_config.h"
|
||||||
#include "../common/servertalk.h"
|
#include "../common/servertalk.h"
|
||||||
#include "../common/string_util.h"
|
#include "../common/string_util.h"
|
||||||
|
#include "../common/random.h"
|
||||||
|
|
||||||
extern uint32 numzones;
|
extern uint32 numzones;
|
||||||
extern bool holdzones;
|
extern bool holdzones;
|
||||||
extern ConsoleList console_list;
|
extern ConsoleList console_list;
|
||||||
|
extern EQEmu::Random emu_random;
|
||||||
void CatchSignal(int sig_num);
|
void CatchSignal(int sig_num);
|
||||||
|
|
||||||
ZSList::ZSList()
|
ZSList::ZSList()
|
||||||
@ -565,7 +567,7 @@ void ZSList::RebootZone(const char* ip1,uint16 port,const char* ip2, uint32 skip
|
|||||||
safe_delete(tmp);
|
safe_delete(tmp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uint32 z = MakeRandomInt(0, y-1);
|
uint32 z = emu_random.Int(0, y-1);
|
||||||
|
|
||||||
ServerPacket* pack = new ServerPacket(ServerOP_ZoneReboot, sizeof(ServerZoneReboot_Struct));
|
ServerPacket* pack = new ServerPacket(ServerOP_ZoneReboot, sizeof(ServerZoneReboot_Struct));
|
||||||
ServerZoneReboot_Struct* s = (ServerZoneReboot_Struct*) pack->pBuffer;
|
ServerZoneReboot_Struct* s = (ServerZoneReboot_Struct*) pack->pBuffer;
|
||||||
|
|||||||
23
zone/aa.cpp
23
zone/aa.cpp
@ -988,13 +988,20 @@ void Client::BuyAA(AA_Action* action)
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32 real_cost;
|
uint32 real_cost;
|
||||||
|
uint8 req_level;
|
||||||
std::map<uint32, AALevelCost_Struct>::iterator RequiredLevel = AARequiredLevelAndCost.find(action->ability);
|
std::map<uint32, AALevelCost_Struct>::iterator RequiredLevel = AARequiredLevelAndCost.find(action->ability);
|
||||||
|
|
||||||
if(RequiredLevel != AARequiredLevelAndCost.end()) {
|
if(RequiredLevel != AARequiredLevelAndCost.end()) {
|
||||||
real_cost = RequiredLevel->second.Cost;
|
real_cost = RequiredLevel->second.Cost;
|
||||||
|
req_level = RequiredLevel->second.Level;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
real_cost = aa2->cost + (aa2->cost_inc * cur_level);
|
real_cost = aa2->cost + (aa2->cost_inc * cur_level);
|
||||||
|
req_level = aa2->class_type + (aa2->level_inc * cur_level);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (req_level > GetLevel())
|
||||||
|
return; //Cheater trying to Buy AA...
|
||||||
|
|
||||||
if (m_pp.aapoints >= real_cost && cur_level < aa2->max_level) {
|
if (m_pp.aapoints >= real_cost && cur_level < aa2->max_level) {
|
||||||
SetAA(aa2->id, cur_level + 1);
|
SetAA(aa2->id, cur_level + 1);
|
||||||
@ -1471,6 +1478,7 @@ bool ZoneDatabase::LoadAAEffects2() {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::ResetAA(){
|
void Client::ResetAA(){
|
||||||
RefundAA();
|
RefundAA();
|
||||||
uint32 i;
|
uint32 i;
|
||||||
@ -1495,11 +1503,24 @@ void Client::ResetAA(){
|
|||||||
|
|
||||||
database.DeleteCharacterAAs(this->CharacterID());
|
database.DeleteCharacterAAs(this->CharacterID());
|
||||||
SaveAA();
|
SaveAA();
|
||||||
|
SendClearAA();
|
||||||
|
SendAAList();
|
||||||
SendAATable();
|
SendAATable();
|
||||||
|
SendAAStats();
|
||||||
database.DeleteCharacterLeadershipAAs(this->CharacterID());
|
database.DeleteCharacterLeadershipAAs(this->CharacterID());
|
||||||
|
// undefined for these clients
|
||||||
|
if (GetClientVersionBit() & BIT_TitaniumAndEarlier)
|
||||||
Kick();
|
Kick();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Client::SendClearAA()
|
||||||
|
{
|
||||||
|
EQApplicationPacket *outapp = new EQApplicationPacket(OP_ClearLeadershipAbilities, 0);
|
||||||
|
FastQueuePacket(&outapp);
|
||||||
|
outapp = new EQApplicationPacket(OP_ClearAA, 0);
|
||||||
|
FastQueuePacket(&outapp);
|
||||||
|
}
|
||||||
|
|
||||||
int Client::GroupLeadershipAAHealthEnhancement()
|
int Client::GroupLeadershipAAHealthEnhancement()
|
||||||
{
|
{
|
||||||
if (IsRaidGrouped()) {
|
if (IsRaidGrouped()) {
|
||||||
|
|||||||
@ -15,18 +15,22 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../common/debug.h"
|
#include "../common/debug.h"
|
||||||
#include <stdlib.h>
|
|
||||||
#include <math.h>
|
|
||||||
#include "masterentity.h"
|
|
||||||
#include "../common/faction.h"
|
#include "../common/faction.h"
|
||||||
#include "map.h"
|
|
||||||
#include "../common/spdat.h"
|
|
||||||
#include "../common/skills.h"
|
|
||||||
#include "../common/misc_functions.h"
|
|
||||||
#include "../common/rulesys.h"
|
#include "../common/rulesys.h"
|
||||||
#include "string_ids.h"
|
#include "../common/spdat.h"
|
||||||
#include <iostream>
|
|
||||||
|
#include "client.h"
|
||||||
|
#include "corpse.h"
|
||||||
|
#include "entity.h"
|
||||||
|
#include "mob.h"
|
||||||
|
|
||||||
|
#ifdef BOTS
|
||||||
|
#include "bot.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "map.h"
|
||||||
|
|
||||||
extern Zone* zone;
|
extern Zone* zone;
|
||||||
//#define LOSDEBUG 6
|
//#define LOSDEBUG 6
|
||||||
@ -329,7 +333,7 @@ bool Mob::CheckWillAggro(Mob *mob) {
|
|||||||
||
|
||
|
||||||
(
|
(
|
||||||
fv == FACTION_THREATENLY
|
fv == FACTION_THREATENLY
|
||||||
&& MakeRandomInt(0,99) < THREATENLY_ARRGO_CHANCE - heroicCHA_mod
|
&& zone->random.Roll(THREATENLY_ARRGO_CHANCE - heroicCHA_mod)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -1254,7 +1258,7 @@ bool Mob::PassCharismaCheck(Mob* caster, Mob* spellTarget, uint16 spell_id) {
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
//1: The mob has a default 25% chance of being allowed a resistance check against the charm.
|
//1: The mob has a default 25% chance of being allowed a resistance check against the charm.
|
||||||
if (MakeRandomInt(0, 99) > RuleI(Spells, CharmBreakCheckChance))
|
if (zone->random.Int(0, 99) > RuleI(Spells, CharmBreakCheckChance))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (RuleB(Spells, CharismaCharmDuration))
|
if (RuleB(Spells, CharismaCharmDuration))
|
||||||
@ -1273,7 +1277,7 @@ bool Mob::PassCharismaCheck(Mob* caster, Mob* spellTarget, uint16 spell_id) {
|
|||||||
//3: At maxed ability, Total Domination has a 50% chance of preventing the charm break that otherwise would have occurred.
|
//3: At maxed ability, Total Domination has a 50% chance of preventing the charm break that otherwise would have occurred.
|
||||||
int16 TotalDominationBonus = caster->aabonuses.CharmBreakChance + caster->spellbonuses.CharmBreakChance + caster->itembonuses.CharmBreakChance;
|
int16 TotalDominationBonus = caster->aabonuses.CharmBreakChance + caster->spellbonuses.CharmBreakChance + caster->itembonuses.CharmBreakChance;
|
||||||
|
|
||||||
if (MakeRandomInt(0, 99) < TotalDominationBonus)
|
if (zone->random.Int(0, 99) < TotalDominationBonus)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -340,7 +340,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c
|
|||||||
// Did we hit?
|
// Did we hit?
|
||||||
//
|
//
|
||||||
|
|
||||||
float tohit_roll = MakeRandomFloat(0, 100);
|
float tohit_roll = zone->random.Real(0, 100);
|
||||||
|
|
||||||
mlog(COMBAT__TOHIT, "Final hit chance: %.2f%%. Hit roll %.2f", chancetohit, tohit_roll);
|
mlog(COMBAT__TOHIT, "Final hit chance: %.2f%%. Hit roll %.2f", chancetohit, tohit_roll);
|
||||||
|
|
||||||
@ -416,7 +416,7 @@ bool Mob::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte)
|
|||||||
//Live AA - HightenedAwareness
|
//Live AA - HightenedAwareness
|
||||||
int BlockBehindChance = aabonuses.BlockBehind + spellbonuses.BlockBehind + itembonuses.BlockBehind;
|
int BlockBehindChance = aabonuses.BlockBehind + spellbonuses.BlockBehind + itembonuses.BlockBehind;
|
||||||
|
|
||||||
if (BlockBehindChance && (BlockBehindChance > MakeRandomInt(1, 100))){
|
if (BlockBehindChance && zone->random.Roll(BlockBehindChance)) {
|
||||||
bBlockFromRear = true;
|
bBlockFromRear = true;
|
||||||
|
|
||||||
if (spellbonuses.BlockBehind || itembonuses.BlockBehind)
|
if (spellbonuses.BlockBehind || itembonuses.BlockBehind)
|
||||||
@ -509,7 +509,7 @@ bool Mob::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(damage > 0){
|
if(damage > 0){
|
||||||
roll = MakeRandomFloat(0,100);
|
roll = zone->random.Real(0,100);
|
||||||
if(roll <= RollTable[0]){
|
if(roll <= RollTable[0]){
|
||||||
damage = -3;
|
damage = -3;
|
||||||
}
|
}
|
||||||
@ -675,7 +675,7 @@ void Mob::MeleeMitigation(Mob *attacker, int32 &damage, int32 minhit, ExtraAttac
|
|||||||
if (acfail>100) acfail=100;
|
if (acfail>100) acfail=100;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (acfail<=0 || MakeRandomInt(0, 100)>acfail) {
|
if (acfail<=0 || zone->random.Int(0, 100)>acfail) {
|
||||||
float acreduction=1;
|
float acreduction=1;
|
||||||
int acrandom=300;
|
int acrandom=300;
|
||||||
if (database.GetVariable("ACreduction", tmp, 9))
|
if (database.GetVariable("ACreduction", tmp, 9))
|
||||||
@ -694,7 +694,7 @@ void Mob::MeleeMitigation(Mob *attacker, int32 &damage, int32 minhit, ExtraAttac
|
|||||||
damage -= (int32) (GetAC() * acreduction/100.0f);
|
damage -= (int32) (GetAC() * acreduction/100.0f);
|
||||||
}
|
}
|
||||||
if (acrandom>0) {
|
if (acrandom>0) {
|
||||||
damage -= (myac * MakeRandomInt(0, acrandom) / 10000);
|
damage -= (myac * zone->random.Int(0, acrandom) / 10000);
|
||||||
}
|
}
|
||||||
if (damage<1) damage=1;
|
if (damage<1) damage=1;
|
||||||
mlog(COMBAT__DAMAGE, "AC Damage Reduction: fail chance %d%%. Failed. Reduction %.3f%%, random %d. Resulting damage %d.", acfail, acreduction, acrandom, damage);
|
mlog(COMBAT__DAMAGE, "AC Damage Reduction: fail chance %d%%. Failed. Reduction %.3f%%, random %d. Resulting damage %d.", acfail, acreduction, acrandom, damage);
|
||||||
@ -722,8 +722,8 @@ int32 Mob::GetMeleeMitDmg(Mob *attacker, int32 damage, int32 minhit,
|
|||||||
float mit_rating, float atk_rating)
|
float mit_rating, float atk_rating)
|
||||||
{
|
{
|
||||||
float d = 10.0;
|
float d = 10.0;
|
||||||
float mit_roll = MakeRandomFloat(0, mit_rating);
|
float mit_roll = zone->random.Real(0, mit_rating);
|
||||||
float atk_roll = MakeRandomFloat(0, atk_rating);
|
float atk_roll = zone->random.Real(0, atk_rating);
|
||||||
|
|
||||||
if (atk_roll > mit_roll) {
|
if (atk_roll > mit_roll) {
|
||||||
float a_diff = atk_roll - mit_roll;
|
float a_diff = atk_roll - mit_roll;
|
||||||
@ -772,8 +772,8 @@ int32 Client::GetMeleeMitDmg(Mob *attacker, int32 damage, int32 minhit,
|
|||||||
dmg_bonus -= dmg_bonus * (itembonuses.MeleeMitigation / 100.0);
|
dmg_bonus -= dmg_bonus * (itembonuses.MeleeMitigation / 100.0);
|
||||||
dmg_interval -= dmg_interval * spellMeleeMit;
|
dmg_interval -= dmg_interval * spellMeleeMit;
|
||||||
|
|
||||||
float mit_roll = MakeRandomFloat(0, mit_rating);
|
float mit_roll = zone->random.Real(0, mit_rating);
|
||||||
float atk_roll = MakeRandomFloat(0, atk_rating);
|
float atk_roll = zone->random.Real(0, atk_rating);
|
||||||
|
|
||||||
if (atk_roll > mit_roll) {
|
if (atk_roll > mit_roll) {
|
||||||
float a_diff = atk_roll - mit_roll;
|
float a_diff = atk_roll - mit_roll;
|
||||||
@ -1273,7 +1273,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
|||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
damage = max_hit;
|
damage = max_hit;
|
||||||
else
|
else
|
||||||
damage = MakeRandomInt(min_hit, max_hit);
|
damage = zone->random.Int(min_hit, max_hit);
|
||||||
|
|
||||||
damage = mod_client_damage(damage, skillinuse, Hand, weapon, other);
|
damage = mod_client_damage(damage, skillinuse, Hand, weapon, other);
|
||||||
|
|
||||||
@ -1315,7 +1315,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
|||||||
OffhandRiposteFail *= -1; //Live uses a negative value for this.
|
OffhandRiposteFail *= -1; //Live uses a negative value for this.
|
||||||
|
|
||||||
if (OffhandRiposteFail &&
|
if (OffhandRiposteFail &&
|
||||||
(OffhandRiposteFail > 99 || (MakeRandomInt(0, 100) < OffhandRiposteFail))) {
|
(OffhandRiposteFail > 99 || zone->random.Roll(OffhandRiposteFail))) {
|
||||||
damage = 0; // Counts as a miss
|
damage = 0; // Counts as a miss
|
||||||
slippery_attack = true;
|
slippery_attack = true;
|
||||||
} else
|
} else
|
||||||
@ -1331,7 +1331,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
|||||||
if (((damage < 0) || slippery_attack) && !bRiposte && !IsStrikethrough) { // Hack to still allow Strikethrough chance w/ Slippery Attacks AA
|
if (((damage < 0) || slippery_attack) && !bRiposte && !IsStrikethrough) { // Hack to still allow Strikethrough chance w/ Slippery Attacks AA
|
||||||
int32 bonusStrikeThrough = itembonuses.StrikeThrough + spellbonuses.StrikeThrough + aabonuses.StrikeThrough;
|
int32 bonusStrikeThrough = itembonuses.StrikeThrough + spellbonuses.StrikeThrough + aabonuses.StrikeThrough;
|
||||||
|
|
||||||
if(bonusStrikeThrough && (MakeRandomInt(0, 100) < bonusStrikeThrough)) {
|
if(bonusStrikeThrough && zone->random.Roll(bonusStrikeThrough)) {
|
||||||
Message_StringID(MT_StrikeThrough, STRIKETHROUGH_STRING); // You strike through your opponents defenses!
|
Message_StringID(MT_StrikeThrough, STRIKETHROUGH_STRING); // You strike through your opponents defenses!
|
||||||
Attack(other, Hand, false, true); // Strikethrough only gives another attempted hit
|
Attack(other, Hand, false, true); // Strikethrough only gives another attempted hit
|
||||||
return false;
|
return false;
|
||||||
@ -1844,7 +1844,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
|
|||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
damage = (max_dmg+eleBane);
|
damage = (max_dmg+eleBane);
|
||||||
else
|
else
|
||||||
damage = MakeRandomInt((min_dmg+eleBane),(max_dmg+eleBane));
|
damage = zone->random.Int((min_dmg+eleBane),(max_dmg+eleBane));
|
||||||
|
|
||||||
|
|
||||||
//check if we're hitting above our max or below it.
|
//check if we're hitting above our max or below it.
|
||||||
@ -3451,17 +3451,16 @@ bool Client::CheckDoubleAttack(bool tripleAttack) {
|
|||||||
chance *= float(100.0f+triple_bonus)/100.0f; //Apply modifiers.
|
chance *= float(100.0f+triple_bonus)/100.0f; //Apply modifiers.
|
||||||
}
|
}
|
||||||
|
|
||||||
if((MakeRandomFloat(0, 1) < chance))
|
if(zone->random.Roll(chance))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Client::CheckDoubleRangedAttack() {
|
bool Client::CheckDoubleRangedAttack() {
|
||||||
|
|
||||||
int32 chance = spellbonuses.DoubleRangedAttack + itembonuses.DoubleRangedAttack + aabonuses.DoubleRangedAttack;
|
int32 chance = spellbonuses.DoubleRangedAttack + itembonuses.DoubleRangedAttack + aabonuses.DoubleRangedAttack;
|
||||||
|
|
||||||
if(chance && (MakeRandomInt(0, 100) < chance))
|
if(chance && zone->random.Roll(chance))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -3645,7 +3644,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stun_chance && MakeRandomInt(0, 99) < stun_chance) {
|
if (stun_chance && zone->random.Roll(stun_chance)) {
|
||||||
// Passed stun, try to resist now
|
// Passed stun, try to resist now
|
||||||
int stun_resist = itembonuses.StunResist + spellbonuses.StunResist;
|
int stun_resist = itembonuses.StunResist + spellbonuses.StunResist;
|
||||||
int frontal_stun_resist = itembonuses.FrontalStunResist + spellbonuses.FrontalStunResist;
|
int frontal_stun_resist = itembonuses.FrontalStunResist + spellbonuses.FrontalStunResist;
|
||||||
@ -3658,18 +3657,18 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
|
|||||||
|
|
||||||
// frontal stun check for ogres/bonuses
|
// frontal stun check for ogres/bonuses
|
||||||
if (((GetBaseRace() == OGRE && IsClient()) ||
|
if (((GetBaseRace() == OGRE && IsClient()) ||
|
||||||
(frontal_stun_resist && MakeRandomInt(0, 99) < frontal_stun_resist)) &&
|
(frontal_stun_resist && zone->random.Roll(frontal_stun_resist))) &&
|
||||||
!attacker->BehindMob(this, attacker->GetX(), attacker->GetY())) {
|
!attacker->BehindMob(this, attacker->GetX(), attacker->GetY())) {
|
||||||
mlog(COMBAT__HITS, "Frontal stun resisted. %d chance.", frontal_stun_resist);
|
mlog(COMBAT__HITS, "Frontal stun resisted. %d chance.", frontal_stun_resist);
|
||||||
} else {
|
} else {
|
||||||
// Normal stun resist check.
|
// Normal stun resist check.
|
||||||
if (stun_resist && MakeRandomInt(0, 99) < stun_resist) {
|
if (stun_resist && zone->random.Roll(stun_resist)) {
|
||||||
if (IsClient())
|
if (IsClient())
|
||||||
Message_StringID(MT_Stun, SHAKE_OFF_STUN);
|
Message_StringID(MT_Stun, SHAKE_OFF_STUN);
|
||||||
mlog(COMBAT__HITS, "Stun Resisted. %d chance.", stun_resist);
|
mlog(COMBAT__HITS, "Stun Resisted. %d chance.", stun_resist);
|
||||||
} else {
|
} else {
|
||||||
mlog(COMBAT__HITS, "Stunned. %d resist chance.", stun_resist);
|
mlog(COMBAT__HITS, "Stunned. %d resist chance.", stun_resist);
|
||||||
Stun(MakeRandomInt(0, 2) * 1000); // 0-2 seconds
|
Stun(zone->random.Int(0, 2) * 1000); // 0-2 seconds
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -3950,7 +3949,7 @@ void Mob::TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand) {
|
|||||||
for (int i = 0; i < MAX_PROCS; i++) {
|
for (int i = 0; i < MAX_PROCS; i++) {
|
||||||
if (IsValidSpell(DefensiveProcs[i].spellID)) {
|
if (IsValidSpell(DefensiveProcs[i].spellID)) {
|
||||||
float chance = ProcChance * (static_cast<float>(DefensiveProcs[i].chance)/100.0f);
|
float chance = ProcChance * (static_cast<float>(DefensiveProcs[i].chance)/100.0f);
|
||||||
if ((MakeRandomFloat(0, 1) <= chance)) {
|
if (zone->random.Roll(chance)) {
|
||||||
ExecWeaponProc(nullptr, DefensiveProcs[i].spellID, on);
|
ExecWeaponProc(nullptr, DefensiveProcs[i].spellID, on);
|
||||||
CheckNumHitsRemaining(NUMHIT_DefensiveSpellProcs,0,DefensiveProcs[i].base_spellID);
|
CheckNumHitsRemaining(NUMHIT_DefensiveSpellProcs,0,DefensiveProcs[i].base_spellID);
|
||||||
}
|
}
|
||||||
@ -4012,7 +4011,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on
|
|||||||
if (weapon->Proc.Type == ET_CombatProc) {
|
if (weapon->Proc.Type == ET_CombatProc) {
|
||||||
float WPC = ProcChance * (100.0f + // Proc chance for this weapon
|
float WPC = ProcChance * (100.0f + // Proc chance for this weapon
|
||||||
static_cast<float>(weapon->ProcRate)) / 100.0f;
|
static_cast<float>(weapon->ProcRate)) / 100.0f;
|
||||||
if (MakeRandomFloat(0, 1) <= WPC) { // 255 dex = 0.084 chance of proc. No idea what this number should be really.
|
if (zone->random.Roll(WPC)) { // 255 dex = 0.084 chance of proc. No idea what this number should be really.
|
||||||
if (weapon->Proc.Level > ourlevel) {
|
if (weapon->Proc.Level > ourlevel) {
|
||||||
mlog(COMBAT__PROCS,
|
mlog(COMBAT__PROCS,
|
||||||
"Tried to proc (%s), but our level (%d) is lower than required (%d)",
|
"Tried to proc (%s), but our level (%d) is lower than required (%d)",
|
||||||
@ -4050,7 +4049,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on
|
|||||||
if (aug->Proc.Type == ET_CombatProc) {
|
if (aug->Proc.Type == ET_CombatProc) {
|
||||||
float APC = ProcChance * (100.0f + // Proc chance for this aug
|
float APC = ProcChance * (100.0f + // Proc chance for this aug
|
||||||
static_cast<float>(aug->ProcRate)) / 100.0f;
|
static_cast<float>(aug->ProcRate)) / 100.0f;
|
||||||
if (MakeRandomFloat(0, 1) <= APC) {
|
if (zone->random.Roll(APC)) {
|
||||||
if (aug->Proc.Level > ourlevel) {
|
if (aug->Proc.Level > ourlevel) {
|
||||||
if (IsPet()) {
|
if (IsPet()) {
|
||||||
Mob *own = GetOwner();
|
Mob *own = GetOwner();
|
||||||
@ -4103,7 +4102,7 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on,
|
|||||||
if (!rangedattk) {
|
if (!rangedattk) {
|
||||||
// Perma procs (AAs)
|
// Perma procs (AAs)
|
||||||
if (PermaProcs[i].spellID != SPELL_UNKNOWN) {
|
if (PermaProcs[i].spellID != SPELL_UNKNOWN) {
|
||||||
if (MakeRandomInt(0, 99) < PermaProcs[i].chance) { // TODO: Do these get spell bonus?
|
if (zone->random.Roll(PermaProcs[i].chance)) { // TODO: Do these get spell bonus?
|
||||||
mlog(COMBAT__PROCS,
|
mlog(COMBAT__PROCS,
|
||||||
"Permanent proc %d procing spell %d (%d percent chance)",
|
"Permanent proc %d procing spell %d (%d percent chance)",
|
||||||
i, PermaProcs[i].spellID, PermaProcs[i].chance);
|
i, PermaProcs[i].spellID, PermaProcs[i].chance);
|
||||||
@ -4118,7 +4117,7 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on,
|
|||||||
// Spell procs (buffs)
|
// Spell procs (buffs)
|
||||||
if (SpellProcs[i].spellID != SPELL_UNKNOWN) {
|
if (SpellProcs[i].spellID != SPELL_UNKNOWN) {
|
||||||
float chance = ProcChance * (static_cast<float>(SpellProcs[i].chance) / 100.0f);
|
float chance = ProcChance * (static_cast<float>(SpellProcs[i].chance) / 100.0f);
|
||||||
if (MakeRandomFloat(0, 1) <= chance) {
|
if (zone->random.Roll(chance)) {
|
||||||
mlog(COMBAT__PROCS,
|
mlog(COMBAT__PROCS,
|
||||||
"Spell proc %d procing spell %d (%.2f percent chance)",
|
"Spell proc %d procing spell %d (%.2f percent chance)",
|
||||||
i, SpellProcs[i].spellID, chance);
|
i, SpellProcs[i].spellID, chance);
|
||||||
@ -4134,7 +4133,7 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on,
|
|||||||
// ranged spell procs (buffs)
|
// ranged spell procs (buffs)
|
||||||
if (RangedProcs[i].spellID != SPELL_UNKNOWN) {
|
if (RangedProcs[i].spellID != SPELL_UNKNOWN) {
|
||||||
float chance = ProcChance * (static_cast<float>(RangedProcs[i].chance) / 100.0f);
|
float chance = ProcChance * (static_cast<float>(RangedProcs[i].chance) / 100.0f);
|
||||||
if (MakeRandomFloat(0, 1) <= chance) {
|
if (zone->random.Roll(chance)) {
|
||||||
mlog(COMBAT__PROCS,
|
mlog(COMBAT__PROCS,
|
||||||
"Ranged proc %d procing spell %d (%.2f percent chance)",
|
"Ranged proc %d procing spell %d (%.2f percent chance)",
|
||||||
i, RangedProcs[i].spellID, chance);
|
i, RangedProcs[i].spellID, chance);
|
||||||
@ -4202,7 +4201,7 @@ void Mob::TryPetCriticalHit(Mob *defender, uint16 skill, int32 &damage)
|
|||||||
|
|
||||||
critChance /= 100;
|
critChance /= 100;
|
||||||
|
|
||||||
if(MakeRandomFloat(0, 1) < critChance)
|
if(zone->random.Roll(critChance))
|
||||||
{
|
{
|
||||||
critMod += GetCritDmgMob(skill) * 2; // To account for base crit mod being 200 not 100
|
critMod += GetCritDmgMob(skill) * 2; // To account for base crit mod being 200 not 100
|
||||||
damage = (damage * critMod) / 100;
|
damage = (damage * critMod) / 100;
|
||||||
@ -4241,7 +4240,7 @@ void Mob::TryCriticalHit(Mob *defender, uint16 skill, int32 &damage, ExtraAttack
|
|||||||
int32 SlayRateBonus = aabonuses.SlayUndead[0] + itembonuses.SlayUndead[0] + spellbonuses.SlayUndead[0];
|
int32 SlayRateBonus = aabonuses.SlayUndead[0] + itembonuses.SlayUndead[0] + spellbonuses.SlayUndead[0];
|
||||||
if (SlayRateBonus) {
|
if (SlayRateBonus) {
|
||||||
float slayChance = static_cast<float>(SlayRateBonus) / 10000.0f;
|
float slayChance = static_cast<float>(SlayRateBonus) / 10000.0f;
|
||||||
if (MakeRandomFloat(0, 1) < slayChance) {
|
if (zone->random.Roll(slayChance)) {
|
||||||
int32 SlayDmgBonus = aabonuses.SlayUndead[1] + itembonuses.SlayUndead[1] + spellbonuses.SlayUndead[1];
|
int32 SlayDmgBonus = aabonuses.SlayUndead[1] + itembonuses.SlayUndead[1] + spellbonuses.SlayUndead[1];
|
||||||
damage = (damage * SlayDmgBonus * 2.25) / 100;
|
damage = (damage * SlayDmgBonus * 2.25) / 100;
|
||||||
if (GetGender() == 1) // female
|
if (GetGender() == 1) // female
|
||||||
@ -4312,7 +4311,7 @@ void Mob::TryCriticalHit(Mob *defender, uint16 skill, int32 &damage, ExtraAttack
|
|||||||
|
|
||||||
critChance /= 100;
|
critChance /= 100;
|
||||||
|
|
||||||
if(MakeRandomFloat(0, 1) < critChance)
|
if(zone->random.Roll(critChance))
|
||||||
{
|
{
|
||||||
uint32 critMod = 200;
|
uint32 critMod = 200;
|
||||||
bool crip_success = false;
|
bool crip_success = false;
|
||||||
@ -4325,7 +4324,7 @@ void Mob::TryCriticalHit(Mob *defender, uint16 skill, int32 &damage, ExtraAttack
|
|||||||
if (!IsBerserk() && !IsBerskerSPA)
|
if (!IsBerserk() && !IsBerskerSPA)
|
||||||
critChance *= float(CripplingBlowChance)/100.0f;
|
critChance *= float(CripplingBlowChance)/100.0f;
|
||||||
|
|
||||||
if ((IsBerserk() || IsBerskerSPA) || MakeRandomFloat(0, 1) < critChance) {
|
if ((IsBerserk() || IsBerskerSPA) || zone->random.Roll(critChance)) {
|
||||||
critMod = 400;
|
critMod = 400;
|
||||||
crip_success = true;
|
crip_success = true;
|
||||||
}
|
}
|
||||||
@ -4335,7 +4334,7 @@ void Mob::TryCriticalHit(Mob *defender, uint16 skill, int32 &damage, ExtraAttack
|
|||||||
damage = damage * critMod / 100;
|
damage = damage * critMod / 100;
|
||||||
|
|
||||||
bool deadlySuccess = false;
|
bool deadlySuccess = false;
|
||||||
if (deadlyChance && MakeRandomFloat(0, 1) < static_cast<float>(deadlyChance) / 100.0f) {
|
if (deadlyChance && zone->random.Roll(static_cast<float>(deadlyChance) / 100.0f)) {
|
||||||
if (BehindMob(defender, GetX(), GetY())) {
|
if (BehindMob(defender, GetX(), GetY())) {
|
||||||
damage *= deadlyMod;
|
damage *= deadlyMod;
|
||||||
deadlySuccess = true;
|
deadlySuccess = true;
|
||||||
@ -4382,7 +4381,7 @@ bool Mob::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse)
|
|||||||
//Proc Chance value of 500 = 5%
|
//Proc Chance value of 500 = 5%
|
||||||
uint32 ProcChance = (aabonuses.FinishingBlow[0] + spellbonuses.FinishingBlow[0] + spellbonuses.FinishingBlow[0])/10;
|
uint32 ProcChance = (aabonuses.FinishingBlow[0] + spellbonuses.FinishingBlow[0] + spellbonuses.FinishingBlow[0])/10;
|
||||||
|
|
||||||
if(FB_Level && FB_Dmg && (defender->GetLevel() <= FB_Level) && (ProcChance >= MakeRandomInt(0, 1000))){
|
if(FB_Level && FB_Dmg && (defender->GetLevel() <= FB_Level) && (ProcChance >= zone->random.Int(0, 1000))){
|
||||||
entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, FINISHING_BLOW, GetName());
|
entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, FINISHING_BLOW, GetName());
|
||||||
DoSpecialAttackDamage(defender, skillinuse, FB_Dmg, 1, -1, 10, false, false);
|
DoSpecialAttackDamage(defender, skillinuse, FB_Dmg, 1, -1, 10, false, false);
|
||||||
return true;
|
return true;
|
||||||
@ -4409,7 +4408,7 @@ void Mob::DoRiposte(Mob* defender) {
|
|||||||
defender->itembonuses.DoubleRiposte;
|
defender->itembonuses.DoubleRiposte;
|
||||||
|
|
||||||
//Live AA - Double Riposte
|
//Live AA - Double Riposte
|
||||||
if(DoubleRipChance && (DoubleRipChance >= MakeRandomInt(0, 100))) {
|
if(DoubleRipChance && zone->random.Roll(DoubleRipChance)) {
|
||||||
mlog(COMBAT__ATTACKS, "Preforming a double riposed (%d percent chance)", DoubleRipChance);
|
mlog(COMBAT__ATTACKS, "Preforming a double riposed (%d percent chance)", DoubleRipChance);
|
||||||
defender->Attack(this, MainPrimary, true);
|
defender->Attack(this, MainPrimary, true);
|
||||||
if (HasDied()) return;
|
if (HasDied()) return;
|
||||||
@ -4420,7 +4419,7 @@ void Mob::DoRiposte(Mob* defender) {
|
|||||||
|
|
||||||
DoubleRipChance = defender->aabonuses.GiveDoubleRiposte[1];
|
DoubleRipChance = defender->aabonuses.GiveDoubleRiposte[1];
|
||||||
|
|
||||||
if(DoubleRipChance && (DoubleRipChance >= MakeRandomInt(0, 100))) {
|
if(DoubleRipChance && zone->random.Roll(DoubleRipChance)) {
|
||||||
mlog(COMBAT__ATTACKS, "Preforming a return SPECIAL ATTACK (%d percent chance)", DoubleRipChance);
|
mlog(COMBAT__ATTACKS, "Preforming a return SPECIAL ATTACK (%d percent chance)", DoubleRipChance);
|
||||||
|
|
||||||
if (defender->GetClass() == MONK)
|
if (defender->GetClass() == MONK)
|
||||||
@ -4532,7 +4531,6 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui
|
|||||||
if (spellbonuses.LimitToSkill[skill]){
|
if (spellbonuses.LimitToSkill[skill]){
|
||||||
|
|
||||||
for(int e = 0; e < MAX_SKILL_PROCS; e++){
|
for(int e = 0; e < MAX_SKILL_PROCS; e++){
|
||||||
|
|
||||||
if (CanProc &&
|
if (CanProc &&
|
||||||
(!Success && spellbonuses.SkillProc[e] && IsValidSpell(spellbonuses.SkillProc[e]))
|
(!Success && spellbonuses.SkillProc[e] && IsValidSpell(spellbonuses.SkillProc[e]))
|
||||||
|| (Success && spellbonuses.SkillProcSuccess[e] && IsValidSpell(spellbonuses.SkillProcSuccess[e]))) {
|
|| (Success && spellbonuses.SkillProcSuccess[e] && IsValidSpell(spellbonuses.SkillProcSuccess[e]))) {
|
||||||
@ -4541,7 +4539,6 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui
|
|||||||
ProcMod = 0;
|
ProcMod = 0;
|
||||||
|
|
||||||
for (int i = 0; i < EFFECT_COUNT; i++) {
|
for (int i = 0; i < EFFECT_COUNT; i++) {
|
||||||
|
|
||||||
if (spells[base_spell_id].effectid[i] == SE_SkillProc) {
|
if (spells[base_spell_id].effectid[i] == SE_SkillProc) {
|
||||||
proc_spell_id = spells[base_spell_id].base[i];
|
proc_spell_id = spells[base_spell_id].base[i];
|
||||||
ProcMod = static_cast<float>(spells[base_spell_id].base2[i]);
|
ProcMod = static_cast<float>(spells[base_spell_id].base2[i]);
|
||||||
@ -4551,7 +4548,7 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui
|
|||||||
|
|
||||||
if (CanProc && spells[base_spell_id].base[i] == skill && IsValidSpell(proc_spell_id)) {
|
if (CanProc && spells[base_spell_id].base[i] == skill && IsValidSpell(proc_spell_id)) {
|
||||||
float final_chance = chance * (ProcMod / 100.0f);
|
float final_chance = chance * (ProcMod / 100.0f);
|
||||||
if (MakeRandomFloat(0, 1) <= final_chance) {
|
if (zone->random.Roll(final_chance)) {
|
||||||
ExecWeaponProc(nullptr, proc_spell_id, on);
|
ExecWeaponProc(nullptr, proc_spell_id, on);
|
||||||
CheckNumHitsRemaining(NUMHIT_OffensiveSpellProcs,0, base_spell_id);
|
CheckNumHitsRemaining(NUMHIT_OffensiveSpellProcs,0, base_spell_id);
|
||||||
CanProc = false;
|
CanProc = false;
|
||||||
@ -4571,7 +4568,6 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui
|
|||||||
if (itembonuses.LimitToSkill[skill]){
|
if (itembonuses.LimitToSkill[skill]){
|
||||||
CanProc = true;
|
CanProc = true;
|
||||||
for(int e = 0; e < MAX_SKILL_PROCS; e++){
|
for(int e = 0; e < MAX_SKILL_PROCS; e++){
|
||||||
|
|
||||||
if (CanProc &&
|
if (CanProc &&
|
||||||
(!Success && itembonuses.SkillProc[e] && IsValidSpell(itembonuses.SkillProc[e]))
|
(!Success && itembonuses.SkillProc[e] && IsValidSpell(itembonuses.SkillProc[e]))
|
||||||
|| (Success && itembonuses.SkillProcSuccess[e] && IsValidSpell(itembonuses.SkillProcSuccess[e]))) {
|
|| (Success && itembonuses.SkillProcSuccess[e] && IsValidSpell(itembonuses.SkillProcSuccess[e]))) {
|
||||||
@ -4580,7 +4576,6 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui
|
|||||||
ProcMod = 0;
|
ProcMod = 0;
|
||||||
|
|
||||||
for (int i = 0; i < EFFECT_COUNT; i++) {
|
for (int i = 0; i < EFFECT_COUNT; i++) {
|
||||||
|
|
||||||
if (spells[base_spell_id].effectid[i] == SE_SkillProc) {
|
if (spells[base_spell_id].effectid[i] == SE_SkillProc) {
|
||||||
proc_spell_id = spells[base_spell_id].base[i];
|
proc_spell_id = spells[base_spell_id].base[i];
|
||||||
ProcMod = static_cast<float>(spells[base_spell_id].base2[i]);
|
ProcMod = static_cast<float>(spells[base_spell_id].base2[i]);
|
||||||
@ -4590,7 +4585,7 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui
|
|||||||
|
|
||||||
if (CanProc && spells[base_spell_id].base[i] == skill && IsValidSpell(proc_spell_id)) {
|
if (CanProc && spells[base_spell_id].base[i] == skill && IsValidSpell(proc_spell_id)) {
|
||||||
float final_chance = chance * (ProcMod / 100.0f);
|
float final_chance = chance * (ProcMod / 100.0f);
|
||||||
if (MakeRandomFloat(0, 1) <= final_chance) {
|
if (zone->random.Roll(final_chance)) {
|
||||||
ExecWeaponProc(nullptr, proc_spell_id, on);
|
ExecWeaponProc(nullptr, proc_spell_id, on);
|
||||||
CanProc = false;
|
CanProc = false;
|
||||||
break;
|
break;
|
||||||
@ -4615,7 +4610,6 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui
|
|||||||
uint32 slot = 0;
|
uint32 slot = 0;
|
||||||
|
|
||||||
for(int e = 0; e < MAX_SKILL_PROCS; e++){
|
for(int e = 0; e < MAX_SKILL_PROCS; e++){
|
||||||
|
|
||||||
if (CanProc &&
|
if (CanProc &&
|
||||||
(!Success && aabonuses.SkillProc[e])
|
(!Success && aabonuses.SkillProc[e])
|
||||||
|| (Success && aabonuses.SkillProcSuccess[e])){
|
|| (Success && aabonuses.SkillProcSuccess[e])){
|
||||||
@ -4643,7 +4637,7 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui
|
|||||||
if (CanProc && base1 == skill && IsValidSpell(proc_spell_id)) {
|
if (CanProc && base1 == skill && IsValidSpell(proc_spell_id)) {
|
||||||
float final_chance = chance * (ProcMod / 100.0f);
|
float final_chance = chance * (ProcMod / 100.0f);
|
||||||
|
|
||||||
if (MakeRandomFloat(0, 1) <= final_chance) {
|
if (zone->random.Roll(final_chance)) {
|
||||||
ExecWeaponProc(nullptr, proc_spell_id, on);
|
ExecWeaponProc(nullptr, proc_spell_id, on);
|
||||||
CanProc = false;
|
CanProc = false;
|
||||||
break;
|
break;
|
||||||
@ -4666,11 +4660,8 @@ float Mob::GetSkillProcChances(uint16 ReuseTime, uint16 hand) {
|
|||||||
float ProcChance = 0;
|
float ProcChance = 0;
|
||||||
|
|
||||||
if (!ReuseTime && hand) {
|
if (!ReuseTime && hand) {
|
||||||
|
|
||||||
weapon_speed = GetWeaponSpeedbyHand(hand);
|
weapon_speed = GetWeaponSpeedbyHand(hand);
|
||||||
|
|
||||||
ProcChance = static_cast<float>(weapon_speed) * (RuleR(Combat, AvgProcsPerMinute) / 60000.0f);
|
ProcChance = static_cast<float>(weapon_speed) * (RuleR(Combat, AvgProcsPerMinute) / 60000.0f);
|
||||||
|
|
||||||
if (hand != MainPrimary)
|
if (hand != MainPrimary)
|
||||||
ProcChance /= 2;
|
ProcChance /= 2;
|
||||||
}
|
}
|
||||||
@ -4688,7 +4679,7 @@ bool Mob::TryRootFadeByDamage(int buffslot, Mob* attacker) {
|
|||||||
There is no distinction of any kind between the caster inflicted damage, or anyone
|
There is no distinction of any kind between the caster inflicted damage, or anyone
|
||||||
else's damage. There is also no distinction between Direct and DOT damage in the root code.
|
else's damage. There is also no distinction between Direct and DOT damage in the root code.
|
||||||
|
|
||||||
/* General Mechanics
|
General Mechanics
|
||||||
- Check buffslot to make sure damage from a root does not cancel the root
|
- Check buffslot to make sure damage from a root does not cancel the root
|
||||||
- If multiple roots on target, always and only checks first root slot and if broken only removes that slots root.
|
- If multiple roots on target, always and only checks first root slot and if broken only removes that slots root.
|
||||||
- Only roots on determental spells can be broken by damage.
|
- Only roots on determental spells can be broken by damage.
|
||||||
@ -4699,7 +4690,6 @@ bool Mob::TryRootFadeByDamage(int buffslot, Mob* attacker) {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (IsDetrimentalSpell(spellbonuses.Root[1]) && spellbonuses.Root[1] != buffslot){
|
if (IsDetrimentalSpell(spellbonuses.Root[1]) && spellbonuses.Root[1] != buffslot){
|
||||||
|
|
||||||
int BreakChance = RuleI(Spells, RootBreakFromSpells);
|
int BreakChance = RuleI(Spells, RootBreakFromSpells);
|
||||||
|
|
||||||
BreakChance -= BreakChance*buffs[spellbonuses.Root[1]].RootBreakChance/100;
|
BreakChance -= BreakChance*buffs[spellbonuses.Root[1]].RootBreakChance/100;
|
||||||
@ -4719,7 +4709,7 @@ bool Mob::TryRootFadeByDamage(int buffslot, Mob* attacker) {
|
|||||||
if (BreakChance < 1)
|
if (BreakChance < 1)
|
||||||
BreakChance = 1;
|
BreakChance = 1;
|
||||||
|
|
||||||
if (MakeRandomInt(0, 99) < BreakChance) {
|
if (zone->random.Roll(BreakChance)) {
|
||||||
|
|
||||||
if (!TryFadeEffect(spellbonuses.Root[1])) {
|
if (!TryFadeEffect(spellbonuses.Root[1])) {
|
||||||
BuffFadeBySlot(spellbonuses.Root[1]);
|
BuffFadeBySlot(spellbonuses.Root[1]);
|
||||||
|
|||||||
146
zone/bot.cpp
146
zone/bot.cpp
@ -775,49 +775,49 @@ void Bot::GenerateAppearance() {
|
|||||||
// Randomize facial appearance
|
// Randomize facial appearance
|
||||||
int iFace = 0;
|
int iFace = 0;
|
||||||
if(this->GetRace() == 2) { // Barbarian w/Tatoo
|
if(this->GetRace() == 2) { // Barbarian w/Tatoo
|
||||||
iFace = MakeRandomInt(0, 79);
|
iFace = zone->random.Int(0, 79);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
iFace = MakeRandomInt(0, 7);
|
iFace = zone->random.Int(0, 7);
|
||||||
}
|
}
|
||||||
|
|
||||||
int iHair = 0;
|
int iHair = 0;
|
||||||
int iBeard = 0;
|
int iBeard = 0;
|
||||||
int iBeardColor = 1;
|
int iBeardColor = 1;
|
||||||
if(this->GetRace() == 522) {
|
if(this->GetRace() == 522) {
|
||||||
iHair = MakeRandomInt(0, 8);
|
iHair = zone->random.Int(0, 8);
|
||||||
iBeard = MakeRandomInt(0, 11);
|
iBeard = zone->random.Int(0, 11);
|
||||||
iBeardColor = MakeRandomInt(0, 3);
|
iBeardColor = zone->random.Int(0, 3);
|
||||||
}
|
}
|
||||||
else if(this->GetGender()) {
|
else if(this->GetGender()) {
|
||||||
iHair = MakeRandomInt(0, 2);
|
iHair = zone->random.Int(0, 2);
|
||||||
if(this->GetRace() == 8) { // Dwarven Females can have a beard
|
if(this->GetRace() == 8) { // Dwarven Females can have a beard
|
||||||
if(MakeRandomInt(1, 100) < 50) {
|
if(zone->random.Int(1, 100) < 50) {
|
||||||
iFace += 10;
|
iFace += 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
iHair = MakeRandomInt(0, 3);
|
iHair = zone->random.Int(0, 3);
|
||||||
iBeard = MakeRandomInt(0, 5);
|
iBeard = zone->random.Int(0, 5);
|
||||||
iBeardColor = MakeRandomInt(0, 19);
|
iBeardColor = zone->random.Int(0, 19);
|
||||||
}
|
}
|
||||||
|
|
||||||
int iHairColor = 0;
|
int iHairColor = 0;
|
||||||
if(this->GetRace() == 522) {
|
if(this->GetRace() == 522) {
|
||||||
iHairColor = MakeRandomInt(0, 3);
|
iHairColor = zone->random.Int(0, 3);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
iHairColor = MakeRandomInt(0, 19);
|
iHairColor = zone->random.Int(0, 19);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 iEyeColor1 = (uint8)MakeRandomInt(0, 9);
|
uint8 iEyeColor1 = (uint8)zone->random.Int(0, 9);
|
||||||
uint8 iEyeColor2 = 0;
|
uint8 iEyeColor2 = 0;
|
||||||
if(this->GetRace() == 522) {
|
if(this->GetRace() == 522) {
|
||||||
iEyeColor1 = iEyeColor2 = (uint8)MakeRandomInt(0, 11);
|
iEyeColor1 = iEyeColor2 = (uint8)zone->random.Int(0, 11);
|
||||||
}
|
}
|
||||||
else if(MakeRandomInt(1, 100) > 96) {
|
else if(zone->random.Int(1, 100) > 96) {
|
||||||
iEyeColor2 = MakeRandomInt(0, 9);
|
iEyeColor2 = zone->random.Int(0, 9);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
iEyeColor2 = iEyeColor1;
|
iEyeColor2 = iEyeColor1;
|
||||||
@ -827,9 +827,9 @@ void Bot::GenerateAppearance() {
|
|||||||
int iTattoo = 0;
|
int iTattoo = 0;
|
||||||
int iDetails = 0;
|
int iDetails = 0;
|
||||||
if(this->GetRace() == 522) {
|
if(this->GetRace() == 522) {
|
||||||
iHeritage = MakeRandomInt(0, 6);
|
iHeritage = zone->random.Int(0, 6);
|
||||||
iTattoo = MakeRandomInt(0, 7);
|
iTattoo = zone->random.Int(0, 7);
|
||||||
iDetails = MakeRandomInt(0, 7);
|
iDetails = zone->random.Int(0, 7);
|
||||||
}
|
}
|
||||||
|
|
||||||
this->luclinface = iFace;
|
this->luclinface = iFace;
|
||||||
@ -3098,7 +3098,7 @@ bool Bot::CheckBotDoubleAttack(bool tripleAttack) {
|
|||||||
chance *= float(100.0f+triple_bonus)/100.0f; //Apply modifiers.
|
chance *= float(100.0f+triple_bonus)/100.0f; //Apply modifiers.
|
||||||
}
|
}
|
||||||
|
|
||||||
if((MakeRandomFloat(0, 1) < chance))
|
if((zone->random.Real(0, 1) < chance))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -3148,7 +3148,7 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes
|
|||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
damage = max_hit;
|
damage = max_hit;
|
||||||
else
|
else
|
||||||
damage = MakeRandomInt(min_hit, max_hit);
|
damage = zone->random.Int(min_hit, max_hit);
|
||||||
|
|
||||||
if(!other->CheckHitChance(this, skillinuse, Hand, chance_mod)) {
|
if(!other->CheckHitChance(this, skillinuse, Hand, chance_mod)) {
|
||||||
damage = 0;
|
damage = 0;
|
||||||
@ -3203,7 +3203,7 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes
|
|||||||
if (damage > 0)
|
if (damage > 0)
|
||||||
CheckNumHitsRemaining(NUMHIT_OutgoingHitSuccess);
|
CheckNumHitsRemaining(NUMHIT_OutgoingHitSuccess);
|
||||||
|
|
||||||
if((skillinuse == SkillDragonPunch) && GetAA(aaDragonPunch) && MakeRandomInt(0, 99) < 25){
|
if((skillinuse == SkillDragonPunch) && GetAA(aaDragonPunch) && zone->random.Int(0, 99) < 25){
|
||||||
SpellFinished(904, other, 10, 0, -1, spells[904].ResistDiff);
|
SpellFinished(904, other, 10, 0, -1, spells[904].ResistDiff);
|
||||||
other->Stun(100);
|
other->Stun(100);
|
||||||
}
|
}
|
||||||
@ -3483,7 +3483,7 @@ void Bot::AI_Process() {
|
|||||||
meleeDistance = meleeDistance * .30;
|
meleeDistance = meleeDistance * .30;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
meleeDistance *= (float)MakeRandomFloat(.50, .85);
|
meleeDistance *= (float)zone->random.Real(.50, .85);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool atArcheryRange = IsArcheryRange(GetTarget());
|
bool atArcheryRange = IsArcheryRange(GetTarget());
|
||||||
@ -3616,7 +3616,7 @@ void Bot::AI_Process() {
|
|||||||
|
|
||||||
if (GetTarget() && flurrychance)
|
if (GetTarget() && flurrychance)
|
||||||
{
|
{
|
||||||
if(MakeRandomInt(0, 100) < flurrychance)
|
if(zone->random.Int(0, 100) < flurrychance)
|
||||||
{
|
{
|
||||||
Message_StringID(MT_NPCFlurry, YOU_FLURRY);
|
Message_StringID(MT_NPCFlurry, YOU_FLURRY);
|
||||||
Attack(GetTarget(), MainPrimary, false);
|
Attack(GetTarget(), MainPrimary, false);
|
||||||
@ -3633,7 +3633,7 @@ void Bot::AI_Process() {
|
|||||||
wpn->GetItem()->ItemType == ItemType2HBlunt ||
|
wpn->GetItem()->ItemType == ItemType2HBlunt ||
|
||||||
wpn->GetItem()->ItemType == ItemType2HPiercing )
|
wpn->GetItem()->ItemType == ItemType2HPiercing )
|
||||||
{
|
{
|
||||||
if(MakeRandomInt(0, 100) < ExtraAttackChanceBonus)
|
if(zone->random.Int(0, 100) < ExtraAttackChanceBonus)
|
||||||
{
|
{
|
||||||
Attack(GetTarget(), MainPrimary, false);
|
Attack(GetTarget(), MainPrimary, false);
|
||||||
}
|
}
|
||||||
@ -3678,7 +3678,7 @@ void Bot::AI_Process() {
|
|||||||
int32 DWBonus = spellbonuses.DualWieldChance + itembonuses.DualWieldChance;
|
int32 DWBonus = spellbonuses.DualWieldChance + itembonuses.DualWieldChance;
|
||||||
DualWieldProbability += DualWieldProbability*float(DWBonus)/ 100.0f;
|
DualWieldProbability += DualWieldProbability*float(DWBonus)/ 100.0f;
|
||||||
|
|
||||||
float random = MakeRandomFloat(0, 1);
|
float random = zone->random.Real(0, 1);
|
||||||
|
|
||||||
if (random < DualWieldProbability){ // Max 78% of DW
|
if (random < DualWieldProbability){ // Max 78% of DW
|
||||||
|
|
||||||
@ -3912,7 +3912,7 @@ void Bot::PetAIProcess() {
|
|||||||
if (botPet->GetTarget()) // Do we still have a target?
|
if (botPet->GetTarget()) // Do we still have a target?
|
||||||
{
|
{
|
||||||
// We're a pet so we re able to dual attack
|
// We're a pet so we re able to dual attack
|
||||||
int32 RandRoll = MakeRandomInt(0, 99);
|
int32 RandRoll = zone->random.Int(0, 99);
|
||||||
if (botPet->CanThisClassDoubleAttack() && (RandRoll < (botPet->GetLevel() + NPCDualAttackModifier)))
|
if (botPet->CanThisClassDoubleAttack() && (RandRoll < (botPet->GetLevel() + NPCDualAttackModifier)))
|
||||||
{
|
{
|
||||||
if(botPet->Attack(botPet->GetTarget(), MainPrimary))
|
if(botPet->Attack(botPet->GetTarget(), MainPrimary))
|
||||||
@ -3945,7 +3945,7 @@ void Bot::PetAIProcess() {
|
|||||||
|
|
||||||
//aa_chance += botPet->GetOwner()->GetAA(aaCompanionsAlacrity) * 3;
|
//aa_chance += botPet->GetOwner()->GetAA(aaCompanionsAlacrity) * 3;
|
||||||
|
|
||||||
if (MakeRandomInt(1, 100) < aa_chance)
|
if (zone->random.Int(1, 100) < aa_chance)
|
||||||
Flurry(nullptr);
|
Flurry(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3955,12 +3955,12 @@ void Bot::PetAIProcess() {
|
|||||||
if(botPet->GetOwner()->GetLevel() >= 24)
|
if(botPet->GetOwner()->GetLevel() >= 24)
|
||||||
{
|
{
|
||||||
float DualWieldProbability = (botPet->GetSkill(SkillDualWield) + botPet->GetLevel()) / 400.0f;
|
float DualWieldProbability = (botPet->GetSkill(SkillDualWield) + botPet->GetLevel()) / 400.0f;
|
||||||
DualWieldProbability -= MakeRandomFloat(0, 1);
|
DualWieldProbability -= zone->random.Real(0, 1);
|
||||||
if(DualWieldProbability < 0){
|
if(DualWieldProbability < 0){
|
||||||
botPet->Attack(botPet->GetTarget(), MainSecondary);
|
botPet->Attack(botPet->GetTarget(), MainSecondary);
|
||||||
if (botPet->CanThisClassDoubleAttack())
|
if (botPet->CanThisClassDoubleAttack())
|
||||||
{
|
{
|
||||||
int32 RandRoll = MakeRandomInt(0, 99);
|
int32 RandRoll = zone->random.Int(0, 99);
|
||||||
if (RandRoll < (botPet->GetLevel() + 20))
|
if (RandRoll < (botPet->GetLevel() + 20))
|
||||||
{
|
{
|
||||||
botPet->Attack(botPet->GetTarget(), MainSecondary);
|
botPet->Attack(botPet->GetTarget(), MainSecondary);
|
||||||
@ -6213,7 +6213,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
|||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
damage = max_hit;
|
damage = max_hit;
|
||||||
else
|
else
|
||||||
damage = MakeRandomInt(min_hit, max_hit);
|
damage = zone->random.Int(min_hit, max_hit);
|
||||||
|
|
||||||
mlog(COMBAT__DAMAGE, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)",
|
mlog(COMBAT__DAMAGE, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)",
|
||||||
damage, min_hit, max_hit, GetSTR(), GetSkill(skillinuse), weapon_damage, GetLevel());
|
damage, min_hit, max_hit, GetSTR(), GetSkill(skillinuse), weapon_damage, GetLevel());
|
||||||
@ -6258,7 +6258,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
|||||||
OffhandRiposteFail *= -1; //Live uses a negative value for this.
|
OffhandRiposteFail *= -1; //Live uses a negative value for this.
|
||||||
|
|
||||||
if (OffhandRiposteFail &&
|
if (OffhandRiposteFail &&
|
||||||
(OffhandRiposteFail > 99 || (MakeRandomInt(0, 100) < OffhandRiposteFail))) {
|
(OffhandRiposteFail > 99 || (zone->random.Int(0, 100) < OffhandRiposteFail))) {
|
||||||
damage = 0; // Counts as a miss
|
damage = 0; // Counts as a miss
|
||||||
slippery_attack = true;
|
slippery_attack = true;
|
||||||
} else
|
} else
|
||||||
@ -6274,7 +6274,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
|||||||
if (((damage < 0) || slippery_attack) && !FromRiposte && !IsStrikethrough) { // Hack to still allow Strikethrough chance w/ Slippery Attacks AA
|
if (((damage < 0) || slippery_attack) && !FromRiposte && !IsStrikethrough) { // Hack to still allow Strikethrough chance w/ Slippery Attacks AA
|
||||||
int32 bonusStrikeThrough = itembonuses.StrikeThrough + spellbonuses.StrikeThrough + aabonuses.StrikeThrough;
|
int32 bonusStrikeThrough = itembonuses.StrikeThrough + spellbonuses.StrikeThrough + aabonuses.StrikeThrough;
|
||||||
|
|
||||||
if(bonusStrikeThrough && (MakeRandomInt(0, 100) < bonusStrikeThrough)) {
|
if(bonusStrikeThrough && (zone->random.Int(0, 100) < bonusStrikeThrough)) {
|
||||||
Message_StringID(MT_StrikeThrough, STRIKETHROUGH_STRING); // You strike through your opponents defenses!
|
Message_StringID(MT_StrikeThrough, STRIKETHROUGH_STRING); // You strike through your opponents defenses!
|
||||||
Attack(other, Hand, false, true); // Strikethrough only gives another attempted hit
|
Attack(other, Hand, false, true); // Strikethrough only gives another attempted hit
|
||||||
return false;
|
return false;
|
||||||
@ -6623,7 +6623,7 @@ int32 Bot::CalcBotAAFocus(BotfocusType type, uint32 aa_ID, uint16 spell_id)
|
|||||||
{
|
{
|
||||||
if(type == focusTriggerOnCast)
|
if(type == focusTriggerOnCast)
|
||||||
{
|
{
|
||||||
if(MakeRandomInt(0, 100) <= base1){
|
if(zone->random.Int(0, 100) <= base1){
|
||||||
value = base2;
|
value = base2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6646,7 +6646,7 @@ int32 Bot::CalcBotAAFocus(BotfocusType type, uint32 aa_ID, uint16 spell_id)
|
|||||||
{
|
{
|
||||||
if(type == focusBlockNextSpell)
|
if(type == focusBlockNextSpell)
|
||||||
{
|
{
|
||||||
if(MakeRandomInt(1, 100) <= base1)
|
if(zone->random.Int(1, 100) <= base1)
|
||||||
value = 1;
|
value = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -6670,7 +6670,7 @@ int32 Bot::CalcBotAAFocus(BotfocusType type, uint32 aa_ID, uint16 spell_id)
|
|||||||
int32 cast_time = GetActSpellCasttime(spell_id, spells[spell_id].cast_time);
|
int32 cast_time = GetActSpellCasttime(spell_id, spells[spell_id].cast_time);
|
||||||
GetSympatheticProcChances(ProcBonus, ProcChance, cast_time, ProcRateMod);
|
GetSympatheticProcChances(ProcBonus, ProcChance, cast_time, ProcRateMod);
|
||||||
|
|
||||||
if(MakeRandomFloat(0, 1) <= ProcChance)
|
if(zone->random.Real(0, 1) <= ProcChance)
|
||||||
value = focus_id;
|
value = focus_id;
|
||||||
|
|
||||||
else
|
else
|
||||||
@ -7147,7 +7147,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel
|
|||||||
value = focus_spell.base[i];
|
value = focus_spell.base[i];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
value = MakeRandomInt(focus_spell.base[i], focus_spell.base2[i]);
|
value = zone->random.Int(focus_spell.base[i], focus_spell.base2[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -7165,7 +7165,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel
|
|||||||
value = focus_spell.base[i];
|
value = focus_spell.base[i];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
value = MakeRandomInt(focus_spell.base[i], focus_spell.base2[i]);
|
value = zone->random.Int(focus_spell.base[i], focus_spell.base2[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -7183,7 +7183,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel
|
|||||||
value = focus_spell.base[i];
|
value = focus_spell.base[i];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
value = MakeRandomInt(focus_spell.base[i], focus_spell.base2[i]);
|
value = zone->random.Int(focus_spell.base[i], focus_spell.base2[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -7273,7 +7273,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel
|
|||||||
{
|
{
|
||||||
if(bottype == BotfocusTriggerOnCast)
|
if(bottype == BotfocusTriggerOnCast)
|
||||||
|
|
||||||
if(MakeRandomInt(0, 100) <= focus_spell.base[i])
|
if(zone->random.Int(0, 100) <= focus_spell.base[i])
|
||||||
value = focus_spell.base2[i];
|
value = focus_spell.base2[i];
|
||||||
|
|
||||||
else
|
else
|
||||||
@ -7293,7 +7293,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel
|
|||||||
{
|
{
|
||||||
if(bottype == BotfocusBlockNextSpell)
|
if(bottype == BotfocusBlockNextSpell)
|
||||||
{
|
{
|
||||||
if(MakeRandomInt(1, 100) <= focus_spell.base[i])
|
if(zone->random.Int(1, 100) <= focus_spell.base[i])
|
||||||
value = 1;
|
value = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -7313,7 +7313,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel
|
|||||||
|
|
||||||
float ProcChance = GetSympatheticProcChances(spell_id, focus_spell.base[i]);
|
float ProcChance = GetSympatheticProcChances(spell_id, focus_spell.base[i]);
|
||||||
|
|
||||||
if(MakeRandomFloat(0, 1) <= ProcChance)
|
if(zone->random.Real(0, 1) <= ProcChance)
|
||||||
value = focus_id;
|
value = focus_id;
|
||||||
|
|
||||||
else
|
else
|
||||||
@ -7503,7 +7503,7 @@ bool Bot::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte)
|
|||||||
//Live AA - HightenedAwareness
|
//Live AA - HightenedAwareness
|
||||||
int BlockBehindChance = aabonuses.BlockBehind + spellbonuses.BlockBehind + itembonuses.BlockBehind;
|
int BlockBehindChance = aabonuses.BlockBehind + spellbonuses.BlockBehind + itembonuses.BlockBehind;
|
||||||
|
|
||||||
if (BlockBehindChance && (BlockBehindChance > MakeRandomInt(1, 100))){
|
if (BlockBehindChance && (BlockBehindChance > zone->random.Int(1, 100))){
|
||||||
bBlockFromRear = true;
|
bBlockFromRear = true;
|
||||||
|
|
||||||
if (spellbonuses.BlockBehind || itembonuses.BlockBehind)
|
if (spellbonuses.BlockBehind || itembonuses.BlockBehind)
|
||||||
@ -7595,7 +7595,7 @@ bool Bot::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte)
|
|||||||
|
|
||||||
if(damage > 0)
|
if(damage > 0)
|
||||||
{
|
{
|
||||||
roll = MakeRandomFloat(0,100);
|
roll = zone->random.Real(0,100);
|
||||||
if(roll <= RollTable[0]){
|
if(roll <= RollTable[0]){
|
||||||
damage = -3;
|
damage = -3;
|
||||||
}
|
}
|
||||||
@ -7662,7 +7662,7 @@ bool Bot::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse)
|
|||||||
uint32 damage = aabonuses.FinishingBlow[1];
|
uint32 damage = aabonuses.FinishingBlow[1];
|
||||||
uint16 levelreq = aabonuses.FinishingBlowLvl[0];
|
uint16 levelreq = aabonuses.FinishingBlowLvl[0];
|
||||||
|
|
||||||
if(defender->GetLevel() <= levelreq && (chance >= MakeRandomInt(0, 1000))){
|
if(defender->GetLevel() <= levelreq && (chance >= zone->random.Int(0, 1000))){
|
||||||
mlog(COMBAT__ATTACKS, "Landed a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel());
|
mlog(COMBAT__ATTACKS, "Landed a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel());
|
||||||
entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, FINISHING_BLOW, GetName());
|
entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, FINISHING_BLOW, GetName());
|
||||||
defender->Damage(this, damage, SPELL_UNKNOWN, skillinuse);
|
defender->Damage(this, damage, SPELL_UNKNOWN, skillinuse);
|
||||||
@ -7690,7 +7690,7 @@ void Bot::DoRiposte(Mob* defender) {
|
|||||||
defender->GetSpellBonuses().GiveDoubleRiposte[0] +
|
defender->GetSpellBonuses().GiveDoubleRiposte[0] +
|
||||||
defender->GetItemBonuses().GiveDoubleRiposte[0];
|
defender->GetItemBonuses().GiveDoubleRiposte[0];
|
||||||
|
|
||||||
if(DoubleRipChance && (DoubleRipChance >= MakeRandomInt(0, 100))) {
|
if(DoubleRipChance && (DoubleRipChance >= zone->random.Int(0, 100))) {
|
||||||
mlog(COMBAT__ATTACKS, "Preforming a double riposte (%d percent chance)", DoubleRipChance);
|
mlog(COMBAT__ATTACKS, "Preforming a double riposte (%d percent chance)", DoubleRipChance);
|
||||||
|
|
||||||
defender->Attack(this, MainPrimary, true);
|
defender->Attack(this, MainPrimary, true);
|
||||||
@ -7700,7 +7700,7 @@ void Bot::DoRiposte(Mob* defender) {
|
|||||||
//Coded narrowly: Limit to one per client. Limit AA only. [1 = Skill Attack Chance, 2 = Skill]
|
//Coded narrowly: Limit to one per client. Limit AA only. [1 = Skill Attack Chance, 2 = Skill]
|
||||||
DoubleRipChance = defender->GetAABonuses().GiveDoubleRiposte[1];
|
DoubleRipChance = defender->GetAABonuses().GiveDoubleRiposte[1];
|
||||||
|
|
||||||
if(DoubleRipChance && (DoubleRipChance >= MakeRandomInt(0, 100))) {
|
if(DoubleRipChance && (DoubleRipChance >= zone->random.Int(0, 100))) {
|
||||||
if (defender->GetClass() == MONK)
|
if (defender->GetClass() == MONK)
|
||||||
defender->MonkSpecialAttack(this, defender->GetAABonuses().GiveDoubleRiposte[2]);
|
defender->MonkSpecialAttack(this, defender->GetAABonuses().GiveDoubleRiposte[2]);
|
||||||
else if (defender->IsBot())
|
else if (defender->IsBot())
|
||||||
@ -7766,7 +7766,7 @@ void Bot::DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage,
|
|||||||
int kb_chance = 25;
|
int kb_chance = 25;
|
||||||
kb_chance += kb_chance*(100-aabonuses.SpecialAttackKBProc[0])/100;
|
kb_chance += kb_chance*(100-aabonuses.SpecialAttackKBProc[0])/100;
|
||||||
|
|
||||||
if (MakeRandomInt(0, 99) < kb_chance)
|
if (zone->random.Int(0, 99) < kb_chance)
|
||||||
SpellFinished(904, who, 10, 0, -1, spells[904].ResistDiff);
|
SpellFinished(904, who, 10, 0, -1, spells[904].ResistDiff);
|
||||||
//who->Stun(100); Kayen: This effect does not stun on live, it only moves the NPC.
|
//who->Stun(100); Kayen: This effect does not stun on live, it only moves the NPC.
|
||||||
}
|
}
|
||||||
@ -7807,7 +7807,7 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) {
|
|||||||
//Live AA - Seized Opportunity
|
//Live AA - Seized Opportunity
|
||||||
int FrontalBSChance = itembonuses.FrontalBackstabChance + spellbonuses.FrontalBackstabChance + aabonuses.FrontalBackstabChance;
|
int FrontalBSChance = itembonuses.FrontalBackstabChance + spellbonuses.FrontalBackstabChance + aabonuses.FrontalBackstabChance;
|
||||||
|
|
||||||
if (FrontalBSChance && (FrontalBSChance > MakeRandomInt(0, 100)))
|
if (FrontalBSChance && (FrontalBSChance > zone->random.Int(0, 100)))
|
||||||
bCanFrontalBS = true;
|
bCanFrontalBS = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7821,7 +7821,7 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) {
|
|||||||
!other->CastToNPC()->IsEngaged() && // not aggro
|
!other->CastToNPC()->IsEngaged() && // not aggro
|
||||||
other->GetHP()<=32000
|
other->GetHP()<=32000
|
||||||
&& other->IsNPC()
|
&& other->IsNPC()
|
||||||
&& MakeRandomFloat(0, 99) < chance // chance
|
&& zone->random.Real(0, 99) < chance // chance
|
||||||
) {
|
) {
|
||||||
entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, ASSASSINATES, GetName());
|
entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, ASSASSINATES, GetName());
|
||||||
RogueAssassinate(other);
|
RogueAssassinate(other);
|
||||||
@ -7832,12 +7832,12 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) {
|
|||||||
float DoubleAttackProbability = (GetSkill(SkillDoubleAttack) + GetLevel()) / 500.0f; // 62.4 max
|
float DoubleAttackProbability = (GetSkill(SkillDoubleAttack) + GetLevel()) / 500.0f; // 62.4 max
|
||||||
// Check for double attack with main hand assuming maxed DA Skill (MS)
|
// Check for double attack with main hand assuming maxed DA Skill (MS)
|
||||||
|
|
||||||
if(MakeRandomFloat(0, 1) < DoubleAttackProbability) // Max 62.4 % chance of DA
|
if(zone->random.Real(0, 1) < DoubleAttackProbability) // Max 62.4 % chance of DA
|
||||||
{
|
{
|
||||||
if(other->GetHP() > 0)
|
if(other->GetHP() > 0)
|
||||||
RogueBackstab(other,false,ReuseTime);
|
RogueBackstab(other,false,ReuseTime);
|
||||||
|
|
||||||
if (tripleChance && other->GetHP() > 0 && tripleChance > MakeRandomInt(0, 100))
|
if (tripleChance && other->GetHP() > 0 && tripleChance > zone->random.Int(0, 100))
|
||||||
RogueBackstab(other,false,ReuseTime);
|
RogueBackstab(other,false,ReuseTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -7851,11 +7851,11 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) {
|
|||||||
if (level > 54) {
|
if (level > 54) {
|
||||||
float DoubleAttackProbability = (GetSkill(SkillDoubleAttack) + GetLevel()) / 500.0f; // 62.4 max
|
float DoubleAttackProbability = (GetSkill(SkillDoubleAttack) + GetLevel()) / 500.0f; // 62.4 max
|
||||||
// Check for double attack with main hand assuming maxed DA Skill (MS)
|
// Check for double attack with main hand assuming maxed DA Skill (MS)
|
||||||
if(MakeRandomFloat(0, 1) < DoubleAttackProbability) // Max 62.4 % chance of DA
|
if(zone->random.Real(0, 1) < DoubleAttackProbability) // Max 62.4 % chance of DA
|
||||||
if(other->GetHP() > 0)
|
if(other->GetHP() > 0)
|
||||||
RogueBackstab(other,true, ReuseTime);
|
RogueBackstab(other,true, ReuseTime);
|
||||||
|
|
||||||
if (tripleChance && other->GetHP() > 0 && tripleChance > MakeRandomInt(0, 100))
|
if (tripleChance && other->GetHP() > 0 && tripleChance > zone->random.Int(0, 100))
|
||||||
RogueBackstab(other,false,ReuseTime);
|
RogueBackstab(other,false,ReuseTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -7929,7 +7929,7 @@ void Bot::RogueBackstab(Mob* other, bool min_damage, int ReuseTime)
|
|||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
ndamage = max_hit;
|
ndamage = max_hit;
|
||||||
else
|
else
|
||||||
ndamage = MakeRandomInt(min_hit, max_hit);
|
ndamage = zone->random.Int(min_hit, max_hit);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -8036,7 +8036,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
|
|||||||
canBash = true;
|
canBash = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!canBash || MakeRandomInt(0, 100) > 25) { //tested on live, warrior mobs both kick and bash, kick about 75% of the time, casting doesn't seem to make a difference.
|
if(!canBash || zone->random.Int(0, 100) > 25) { //tested on live, warrior mobs both kick and bash, kick about 75% of the time, casting doesn't seem to make a difference.
|
||||||
skill_to_use = SkillKick;
|
skill_to_use = SkillKick;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -8117,7 +8117,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
|
|||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
dmg = GetBashDamage();
|
dmg = GetBashDamage();
|
||||||
else
|
else
|
||||||
dmg = MakeRandomInt(1, GetBashDamage());
|
dmg = zone->random.Int(1, GetBashDamage());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -8164,7 +8164,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
|
|||||||
//Live parses show around 55% Triple 35% Double 10% Single, you will always get first hit.
|
//Live parses show around 55% Triple 35% Double 10% Single, you will always get first hit.
|
||||||
while(AtkRounds > 0) {
|
while(AtkRounds > 0) {
|
||||||
|
|
||||||
if (GetTarget() && (AtkRounds == 1 || MakeRandomInt(0,100) < 75)){
|
if (GetTarget() && (AtkRounds == 1 || zone->random.Int(0,100) < 75)){
|
||||||
DoSpecialAttackDamage(GetTarget(), SkillFrenzy, max_dmg, min_dmg, max_dmg , reuse, true);
|
DoSpecialAttackDamage(GetTarget(), SkillFrenzy, max_dmg, min_dmg, max_dmg , reuse, true);
|
||||||
}
|
}
|
||||||
AtkRounds--;
|
AtkRounds--;
|
||||||
@ -8192,7 +8192,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
|
|||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
dmg = GetKickDamage();
|
dmg = GetKickDamage();
|
||||||
else
|
else
|
||||||
dmg = MakeRandomInt(1, GetKickDamage());
|
dmg = zone->random.Int(1, GetKickDamage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8215,18 +8215,18 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
|
|||||||
|
|
||||||
//Live AA - Technique of Master Wu
|
//Live AA - Technique of Master Wu
|
||||||
uint32 bDoubleSpecialAttack = itembonuses.DoubleSpecialAttack + spellbonuses.DoubleSpecialAttack + aabonuses.DoubleSpecialAttack;
|
uint32 bDoubleSpecialAttack = itembonuses.DoubleSpecialAttack + spellbonuses.DoubleSpecialAttack + aabonuses.DoubleSpecialAttack;
|
||||||
if( bDoubleSpecialAttack && (bDoubleSpecialAttack >= 100 || bDoubleSpecialAttack > MakeRandomInt(0,100))) {
|
if( bDoubleSpecialAttack && (bDoubleSpecialAttack >= 100 || bDoubleSpecialAttack > zone->random.Int(0,100))) {
|
||||||
|
|
||||||
int MonkSPA [5] = { SkillFlyingKick, SkillDragonPunch, SkillEagleStrike, SkillTigerClaw, SkillRoundKick };
|
int MonkSPA [5] = { SkillFlyingKick, SkillDragonPunch, SkillEagleStrike, SkillTigerClaw, SkillRoundKick };
|
||||||
MonkSpecialAttack(target, MonkSPA[MakeRandomInt(0,4)]);
|
MonkSpecialAttack(target, MonkSPA[zone->random.Int(0,4)]);
|
||||||
|
|
||||||
int TripleChance = 25;
|
int TripleChance = 25;
|
||||||
|
|
||||||
if (bDoubleSpecialAttack > 100)
|
if (bDoubleSpecialAttack > 100)
|
||||||
TripleChance += TripleChance*(100-bDoubleSpecialAttack)/100;
|
TripleChance += TripleChance*(100-bDoubleSpecialAttack)/100;
|
||||||
|
|
||||||
if(TripleChance > MakeRandomInt(0,100)) {
|
if(TripleChance > zone->random.Int(0,100)) {
|
||||||
MonkSpecialAttack(target, MonkSPA[MakeRandomInt(0,4)]);
|
MonkSpecialAttack(target, MonkSPA[zone->random.Int(0,4)]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8259,7 +8259,7 @@ bool Bot::TryHeadShot(Mob* defender, SkillUseTypes skillInUse) {
|
|||||||
// WildcardX: These chance formula's below are arbitrary. If someone has a better formula that is more
|
// WildcardX: These chance formula's below are arbitrary. If someone has a better formula that is more
|
||||||
// consistent with live, feel free to update these.
|
// consistent with live, feel free to update these.
|
||||||
float AttackerChance = 0.20f + ((float)(rangerLevel - 51) * 0.005f);
|
float AttackerChance = 0.20f + ((float)(rangerLevel - 51) * 0.005f);
|
||||||
float DefenderChance = (float)MakeRandomFloat(0.00f, 1.00f);
|
float DefenderChance = (float)zone->random.Real(0.00f, 1.00f);
|
||||||
if(AttackerChance > DefenderChance) {
|
if(AttackerChance > DefenderChance) {
|
||||||
mlog(COMBAT__ATTACKS, "Landed a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance);
|
mlog(COMBAT__ATTACKS, "Landed a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance);
|
||||||
// WildcardX: At the time I wrote this, there wasnt a string id for something like HEADSHOT_BLOW
|
// WildcardX: At the time I wrote this, there wasnt a string id for something like HEADSHOT_BLOW
|
||||||
@ -8734,14 +8734,14 @@ int32 Bot::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) {
|
|||||||
if (spell_id == SPELL_IMP_HARM_TOUCH && (GetAA(aaSpellCastingFury) > 0) && (GetAA(aaUnholyTouch) > 0))
|
if (spell_id == SPELL_IMP_HARM_TOUCH && (GetAA(aaSpellCastingFury) > 0) && (GetAA(aaUnholyTouch) > 0))
|
||||||
chance = 100;
|
chance = 100;
|
||||||
|
|
||||||
if (MakeRandomInt(1,100) <= chance){
|
if (zone->random.Int(1,100) <= chance){
|
||||||
Critical = true;
|
Critical = true;
|
||||||
ratio += itembonuses.SpellCritDmgIncrease + spellbonuses.SpellCritDmgIncrease + aabonuses.SpellCritDmgIncrease;
|
ratio += itembonuses.SpellCritDmgIncrease + spellbonuses.SpellCritDmgIncrease + aabonuses.SpellCritDmgIncrease;
|
||||||
ratio += itembonuses.SpellCritDmgIncNoStack + spellbonuses.SpellCritDmgIncNoStack + aabonuses.SpellCritDmgIncNoStack;
|
ratio += itembonuses.SpellCritDmgIncNoStack + spellbonuses.SpellCritDmgIncNoStack + aabonuses.SpellCritDmgIncNoStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (GetClass() == WIZARD && (GetLevel() >= RuleI(Spells, WizCritLevel)) && (MakeRandomInt(1,100) <= RuleI(Spells, WizCritChance))) {
|
else if (GetClass() == WIZARD && (GetLevel() >= RuleI(Spells, WizCritLevel)) && (zone->random.Int(1,100) <= RuleI(Spells, WizCritChance))) {
|
||||||
ratio = MakeRandomInt(1,100); //Wizard innate critical chance is calculated seperately from spell effect and is not a set ratio.
|
ratio = zone->random.Int(1,100); //Wizard innate critical chance is calculated seperately from spell effect and is not a set ratio.
|
||||||
Critical = true;
|
Critical = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8820,7 +8820,7 @@ int32 Bot::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) {
|
|||||||
if (spellbonuses.CriticalHealDecay)
|
if (spellbonuses.CriticalHealDecay)
|
||||||
chance += GetDecayEffectValue(spell_id, SE_CriticalHealDecay);
|
chance += GetDecayEffectValue(spell_id, SE_CriticalHealDecay);
|
||||||
|
|
||||||
if(chance && (MakeRandomInt(0,99) < chance)) {
|
if(chance && (zone->random.Int(0,99) < chance)) {
|
||||||
Critical = true;
|
Critical = true;
|
||||||
modifier = 2; //At present time no critical heal amount modifier SPA exists.
|
modifier = 2; //At present time no critical heal amount modifier SPA exists.
|
||||||
}
|
}
|
||||||
@ -8851,7 +8851,7 @@ int32 Bot::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) {
|
|||||||
if (spellbonuses.CriticalRegenDecay)
|
if (spellbonuses.CriticalRegenDecay)
|
||||||
chance += GetDecayEffectValue(spell_id, SE_CriticalRegenDecay);
|
chance += GetDecayEffectValue(spell_id, SE_CriticalRegenDecay);
|
||||||
|
|
||||||
if(chance && (MakeRandomInt(0,99) < chance))
|
if(chance && (zone->random.Int(0,99) < chance))
|
||||||
return (value * 2);
|
return (value * 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8950,7 +8950,7 @@ int32 Bot::GetActSpellCost(uint16 spell_id, int32 cost) {
|
|||||||
// Formula = Unknown exact, based off a random percent chance up to mana cost(after focuses) of the cast spell
|
// Formula = Unknown exact, based off a random percent chance up to mana cost(after focuses) of the cast spell
|
||||||
if(this->itembonuses.Clairvoyance && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5)
|
if(this->itembonuses.Clairvoyance && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5)
|
||||||
{
|
{
|
||||||
int32 mana_back = this->itembonuses.Clairvoyance * MakeRandomInt(1, 100) / 100;
|
int32 mana_back = this->itembonuses.Clairvoyance * zone->random.Int(1, 100) / 100;
|
||||||
// Doesnt generate mana, so best case is a free spell
|
// Doesnt generate mana, so best case is a free spell
|
||||||
if(mana_back > cost)
|
if(mana_back > cost)
|
||||||
mana_back = cost;
|
mana_back = cost;
|
||||||
@ -8963,7 +8963,7 @@ int32 Bot::GetActSpellCost(uint16 spell_id, int32 cost) {
|
|||||||
// WildcardX
|
// WildcardX
|
||||||
float PercentManaReduction = 0;
|
float PercentManaReduction = 0;
|
||||||
float SpecializeSkill = GetSpecializeSkillValue(spell_id);
|
float SpecializeSkill = GetSpecializeSkillValue(spell_id);
|
||||||
int SuccessChance = MakeRandomInt(0, 100);
|
int SuccessChance = zone->random.Int(0, 100);
|
||||||
|
|
||||||
float bonus = 1.0;
|
float bonus = 1.0;
|
||||||
switch(GetAA(aaSpellCastingMastery))
|
switch(GetAA(aaSpellCastingMastery))
|
||||||
@ -9015,7 +9015,7 @@ int32 Bot::GetActSpellCost(uint16 spell_id, int32 cost) {
|
|||||||
|
|
||||||
if(focus_redux > 0)
|
if(focus_redux > 0)
|
||||||
{
|
{
|
||||||
PercentManaReduction += MakeRandomFloat(1, (double)focus_redux);
|
PercentManaReduction += zone->random.Real(1, (double)focus_redux);
|
||||||
}
|
}
|
||||||
|
|
||||||
cost -= (cost * (PercentManaReduction / 100));
|
cost -= (cost * (PercentManaReduction / 100));
|
||||||
@ -15580,7 +15580,7 @@ bool EntityList::Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, fl
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (iChance < 100) {
|
if (iChance < 100) {
|
||||||
uint8 tmp = MakeRandomInt(1, 100);
|
uint8 tmp = zone->random.Int(1, 100);
|
||||||
if (tmp > iChance)
|
if (tmp > iChance)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,7 +13,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (iChance < 100) {
|
if (iChance < 100) {
|
||||||
if (MakeRandomInt(0, 100) > iChance){
|
if (zone->random.Int(0, 100) > iChance){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -485,7 +485,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
|||||||
if(botClass == PALADIN)
|
if(botClass == PALADIN)
|
||||||
stunChance = 50;
|
stunChance = 50;
|
||||||
|
|
||||||
if(!tar->GetSpecialAbility(UNSTUNABLE) && !tar->IsStunned() && (MakeRandomInt(1, 100) <= stunChance)) {
|
if(!tar->GetSpecialAbility(UNSTUNABLE) && !tar->IsStunned() && (zone->random.Int(1, 100) <= stunChance)) {
|
||||||
botSpell = GetBestBotSpellForStunByTargetType(this, ST_Target);
|
botSpell = GetBestBotSpellForStunByTargetType(this, ST_Target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1843,7 +1843,7 @@ std::string Bot::GetBotMagicianPetType(Bot* botCaster) {
|
|||||||
result = std::string("SumEarth");
|
result = std::string("SumEarth");
|
||||||
else if(botCaster->GetLevel() < 30) {
|
else if(botCaster->GetLevel() < 30) {
|
||||||
// Under level 30
|
// Under level 30
|
||||||
int counter = MakeRandomInt(0, 3);
|
int counter = zone->random.Int(0, 3);
|
||||||
|
|
||||||
switch(counter) {
|
switch(counter) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -1865,7 +1865,7 @@ std::string Bot::GetBotMagicianPetType(Bot* botCaster) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Over level 30
|
// Over level 30
|
||||||
int counter = MakeRandomInt(0, 4);
|
int counter = zone->random.Int(0, 4);
|
||||||
|
|
||||||
switch(counter) {
|
switch(counter) {
|
||||||
case 0:
|
case 0:
|
||||||
|
|||||||
@ -2328,7 +2328,7 @@ bool Client::CheckIncreaseSkill(SkillUseTypes skillid, Mob *against_who, int cha
|
|||||||
if(Chance < 1)
|
if(Chance < 1)
|
||||||
Chance = 1; // Make it always possible
|
Chance = 1; // Make it always possible
|
||||||
|
|
||||||
if(MakeRandomFloat(0, 99) < Chance)
|
if(zone->random.Real(0, 99) < Chance)
|
||||||
{
|
{
|
||||||
SetSkill(skillid, GetRawSkill(skillid) + 1);
|
SetSkill(skillid, GetRawSkill(skillid) + 1);
|
||||||
_log(SKILLS__GAIN, "Skill %d at value %d successfully gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi);
|
_log(SKILLS__GAIN, "Skill %d at value %d successfully gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi);
|
||||||
@ -2356,7 +2356,7 @@ void Client::CheckLanguageSkillIncrease(uint8 langid, uint8 TeacherSkill) {
|
|||||||
int32 Chance = 5 + ((TeacherSkill - LangSkill)/10); // greater chance to learn if teacher's skill is much higher than yours
|
int32 Chance = 5 + ((TeacherSkill - LangSkill)/10); // greater chance to learn if teacher's skill is much higher than yours
|
||||||
Chance = (Chance * RuleI(Character, SkillUpModifier)/100);
|
Chance = (Chance * RuleI(Character, SkillUpModifier)/100);
|
||||||
|
|
||||||
if(MakeRandomFloat(0,100) < Chance) { // if they make the roll
|
if(zone->random.Real(0,100) < Chance) { // if they make the roll
|
||||||
IncreaseLanguageSkill(langid); // increase the language skill by 1
|
IncreaseLanguageSkill(langid); // increase the language skill by 1
|
||||||
_log(SKILLS__GAIN, "Language %d at value %d successfully gain with %.4f%%chance", langid, LangSkill, Chance);
|
_log(SKILLS__GAIN, "Language %d at value %d successfully gain with %.4f%%chance", langid, LangSkill, Chance);
|
||||||
}
|
}
|
||||||
@ -4904,7 +4904,7 @@ int Client::LDoNChest_SkillCheck(NPC *target, int skill)
|
|||||||
chance = 100.0f - base_difficulty;
|
chance = 100.0f - base_difficulty;
|
||||||
}
|
}
|
||||||
|
|
||||||
float d100 = (float)MakeRandomFloat(0, 100);
|
float d100 = (float)zone->random.Real(0, 100);
|
||||||
|
|
||||||
if(d100 <= chance)
|
if(d100 <= chance)
|
||||||
return 1;
|
return 1;
|
||||||
@ -7608,9 +7608,9 @@ void Client::GarbleMessage(char *message, uint8 variance)
|
|||||||
const char alpha_list[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; // only change alpha characters for now
|
const char alpha_list[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; // only change alpha characters for now
|
||||||
|
|
||||||
for (size_t i = 0; i < strlen(message); i++) {
|
for (size_t i = 0; i < strlen(message); i++) {
|
||||||
uint8 chance = (uint8)MakeRandomInt(0, 115); // variation just over worst possible scrambling
|
uint8 chance = (uint8)zone->random.Int(0, 115); // variation just over worst possible scrambling
|
||||||
if (isalpha(message[i]) && (chance <= variance)) {
|
if (isalpha(message[i]) && (chance <= variance)) {
|
||||||
uint8 rand_char = (uint8)MakeRandomInt(0,51); // choose a random character from the alpha list
|
uint8 rand_char = (uint8)zone->random.Int(0,51); // choose a random character from the alpha list
|
||||||
message[i] = alpha_list[rand_char];
|
message[i] = alpha_list[rand_char];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -7728,7 +7728,7 @@ void Client::SetFactionLevel(uint32 char_id, uint32 npc_id, uint8 char_class, ui
|
|||||||
// If our result is truncated, then double a mob's value every once and a while to equal what they would have got
|
// If our result is truncated, then double a mob's value every once and a while to equal what they would have got
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (MakeRandomInt(0, 100) < faction_mod)
|
if (zone->random.Int(0, 100) < faction_mod)
|
||||||
npc_value[i] *= 2;
|
npc_value[i] *= 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -7821,11 +7821,11 @@ void Client::MerchantRejectMessage(Mob *merchant, int primaryfaction)
|
|||||||
}
|
}
|
||||||
// If no primary faction or biggest influence is your faction hit
|
// If no primary faction or biggest influence is your faction hit
|
||||||
if (primaryfaction <= 0 || lowestvalue == tmpFactionValue) {
|
if (primaryfaction <= 0 || lowestvalue == tmpFactionValue) {
|
||||||
merchant->Say_StringID(MakeRandomInt(WONT_SELL_DEEDS1, WONT_SELL_DEEDS6));
|
merchant->Say_StringID(zone->random.Int(WONT_SELL_DEEDS1, WONT_SELL_DEEDS6));
|
||||||
} else if (lowestvalue == fmod.race_mod) { // race biggest
|
} else if (lowestvalue == fmod.race_mod) { // race biggest
|
||||||
// Non-standard race (ex. illusioned to wolf)
|
// Non-standard race (ex. illusioned to wolf)
|
||||||
if (GetRace() > PLAYER_RACE_COUNT) {
|
if (GetRace() > PLAYER_RACE_COUNT) {
|
||||||
messageid = MakeRandomInt(1, 3); // these aren't sequential StringIDs :(
|
messageid = zone->random.Int(1, 3); // these aren't sequential StringIDs :(
|
||||||
switch (messageid) {
|
switch (messageid) {
|
||||||
case 1:
|
case 1:
|
||||||
messageid = WONT_SELL_NONSTDRACE1;
|
messageid = WONT_SELL_NONSTDRACE1;
|
||||||
@ -7842,7 +7842,7 @@ void Client::MerchantRejectMessage(Mob *merchant, int primaryfaction)
|
|||||||
}
|
}
|
||||||
merchant->Say_StringID(messageid);
|
merchant->Say_StringID(messageid);
|
||||||
} else { // normal player races
|
} else { // normal player races
|
||||||
messageid = MakeRandomInt(1, 4);
|
messageid = zone->random.Int(1, 4);
|
||||||
switch (messageid) {
|
switch (messageid) {
|
||||||
case 1:
|
case 1:
|
||||||
messageid = WONT_SELL_RACE1;
|
messageid = WONT_SELL_RACE1;
|
||||||
@ -7863,7 +7863,7 @@ void Client::MerchantRejectMessage(Mob *merchant, int primaryfaction)
|
|||||||
merchant->Say_StringID(messageid, itoa(GetRace()));
|
merchant->Say_StringID(messageid, itoa(GetRace()));
|
||||||
}
|
}
|
||||||
} else if (lowestvalue == fmod.class_mod) {
|
} else if (lowestvalue == fmod.class_mod) {
|
||||||
merchant->Say_StringID(MakeRandomInt(WONT_SELL_CLASS1, WONT_SELL_CLASS5), itoa(GetClass()));
|
merchant->Say_StringID(zone->random.Int(WONT_SELL_CLASS1, WONT_SELL_CLASS5), itoa(GetClass()));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -7966,7 +7966,7 @@ void Client::TryItemTick(int slot)
|
|||||||
|
|
||||||
if(zone->tick_items.count(iid) > 0)
|
if(zone->tick_items.count(iid) > 0)
|
||||||
{
|
{
|
||||||
if( GetLevel() >= zone->tick_items[iid].level && MakeRandomInt(0, 100) >= (100 - zone->tick_items[iid].chance) && (zone->tick_items[iid].bagslot || slot <= EmuConstants::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 <= EmuConstants::EQUIPMENT_END) )
|
||||||
{
|
{
|
||||||
ItemInst* e_inst = (ItemInst*)inst;
|
ItemInst* e_inst = (ItemInst*)inst;
|
||||||
parse->EventItem(EVENT_ITEM_TICK, this, e_inst, nullptr, "", slot);
|
parse->EventItem(EVENT_ITEM_TICK, this, e_inst, nullptr, "", slot);
|
||||||
@ -7985,7 +7985,7 @@ void Client::TryItemTick(int slot)
|
|||||||
|
|
||||||
if(zone->tick_items.count(iid) > 0)
|
if(zone->tick_items.count(iid) > 0)
|
||||||
{
|
{
|
||||||
if( GetLevel() >= zone->tick_items[iid].level && MakeRandomInt(0, 100) >= (100 - zone->tick_items[iid].chance) )
|
if( GetLevel() >= zone->tick_items[iid].level && zone->random.Int(0, 100) >= (100 - zone->tick_items[iid].chance) )
|
||||||
{
|
{
|
||||||
ItemInst* e_inst = (ItemInst*)a_inst;
|
ItemInst* e_inst = (ItemInst*)a_inst;
|
||||||
parse->EventItem(EVENT_ITEM_TICK, this, e_inst, nullptr, "", slot);
|
parse->EventItem(EVENT_ITEM_TICK, this, e_inst, nullptr, "", slot);
|
||||||
|
|||||||
@ -755,6 +755,7 @@ public:
|
|||||||
//AA Methods
|
//AA Methods
|
||||||
void SendAAList();
|
void SendAAList();
|
||||||
void ResetAA();
|
void ResetAA();
|
||||||
|
void SendClearAA();
|
||||||
void SendAA(uint32 id, int seq=1);
|
void SendAA(uint32 id, int seq=1);
|
||||||
void SendPreviousAA(uint32 id, int seq=1);
|
void SendPreviousAA(uint32 id, int seq=1);
|
||||||
void BuyAA(AA_Action* action);
|
void BuyAA(AA_Action* action);
|
||||||
|
|||||||
@ -2956,7 +2956,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app)
|
|||||||
if ((PrimaryWeapon && PrimaryWeapon->GetItem()->ItemType == ItemType1HPiercing) ||
|
if ((PrimaryWeapon && PrimaryWeapon->GetItem()->ItemType == ItemType1HPiercing) ||
|
||||||
(SecondaryWeapon && SecondaryWeapon->GetItem()->ItemType == ItemType1HPiercing)) {
|
(SecondaryWeapon && SecondaryWeapon->GetItem()->ItemType == ItemType1HPiercing)) {
|
||||||
float SuccessChance = (GetSkill(SkillApplyPoison) + GetLevel()) / 400.0f;
|
float SuccessChance = (GetSkill(SkillApplyPoison) + GetLevel()) / 400.0f;
|
||||||
double ChanceRoll = MakeRandomFloat(0, 1);
|
double ChanceRoll = zone->random.Real(0, 1);
|
||||||
|
|
||||||
CheckIncreaseSkill(SkillApplyPoison, nullptr, 10);
|
CheckIncreaseSkill(SkillApplyPoison, nullptr, 10);
|
||||||
|
|
||||||
@ -3660,14 +3660,14 @@ void Client::Handle_OP_Begging(const EQApplicationPacket *app)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int RandomChance = MakeRandomInt(0, 100);
|
int RandomChance = zone->random.Int(0, 100);
|
||||||
|
|
||||||
int ChanceToAttack = 0;
|
int ChanceToAttack = 0;
|
||||||
|
|
||||||
if (GetLevel() > GetTarget()->GetLevel())
|
if (GetLevel() > GetTarget()->GetLevel())
|
||||||
ChanceToAttack = MakeRandomInt(0, 15);
|
ChanceToAttack = zone->random.Int(0, 15);
|
||||||
else
|
else
|
||||||
ChanceToAttack = MakeRandomInt(((this->GetTarget()->GetLevel() - this->GetLevel()) * 10) - 5, ((this->GetTarget()->GetLevel() - this->GetLevel()) * 10));
|
ChanceToAttack = zone->random.Int(((this->GetTarget()->GetLevel() - this->GetLevel()) * 10) - 5, ((this->GetTarget()->GetLevel() - this->GetLevel()) * 10));
|
||||||
|
|
||||||
if (ChanceToAttack < 0)
|
if (ChanceToAttack < 0)
|
||||||
ChanceToAttack = -ChanceToAttack;
|
ChanceToAttack = -ChanceToAttack;
|
||||||
@ -3686,7 +3686,7 @@ void Client::Handle_OP_Begging(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
if (RandomChance < ChanceToBeg)
|
if (RandomChance < ChanceToBeg)
|
||||||
{
|
{
|
||||||
brs->Amount = MakeRandomInt(1, 10);
|
brs->Amount = zone->random.Int(1, 10);
|
||||||
// This needs some work to determine how much money they can beg, based on skill level etc.
|
// This needs some work to determine how much money they can beg, based on skill level etc.
|
||||||
if (CurrentSkill < 50)
|
if (CurrentSkill < 50)
|
||||||
{
|
{
|
||||||
@ -4581,7 +4581,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
|||||||
delta_heading = ppu->delta_heading;
|
delta_heading = ppu->delta_heading;
|
||||||
|
|
||||||
if(IsTracking() && ((x_pos!=ppu->x_pos) || (y_pos!=ppu->y_pos))){
|
if(IsTracking() && ((x_pos!=ppu->x_pos) || (y_pos!=ppu->y_pos))){
|
||||||
if(MakeRandomFloat(0, 100) < 70)//should be good
|
if(zone->random.Real(0, 100) < 70)//should be good
|
||||||
CheckIncreaseSkill(SkillTracking, nullptr, -20);
|
CheckIncreaseSkill(SkillTracking, nullptr, -20);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5283,16 +5283,16 @@ void Client::Handle_OP_DisarmTraps(const EQApplicationPacket *app)
|
|||||||
if (trap && trap->detected)
|
if (trap && trap->detected)
|
||||||
{
|
{
|
||||||
int uskill = GetSkill(SkillDisarmTraps);
|
int uskill = GetSkill(SkillDisarmTraps);
|
||||||
if ((MakeRandomInt(0, 49) + uskill) >= (MakeRandomInt(0, 49) + trap->skill))
|
if ((zone->random.Int(0, 49) + uskill) >= (zone->random.Int(0, 49) + trap->skill))
|
||||||
{
|
{
|
||||||
Message(MT_Skills, "You disarm a trap.");
|
Message(MT_Skills, "You disarm a trap.");
|
||||||
trap->disarmed = true;
|
trap->disarmed = true;
|
||||||
trap->chkarea_timer.Disable();
|
trap->chkarea_timer.Disable();
|
||||||
trap->respawn_timer.Start((trap->respawn_time + MakeRandomInt(0, trap->respawn_var)) * 1000);
|
trap->respawn_timer.Start((trap->respawn_time + zone->random.Int(0, trap->respawn_var)) * 1000);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (MakeRandomInt(0, 99) < 25){
|
if (zone->random.Int(0, 99) < 25){
|
||||||
Message(MT_Skills, "You set off the trap while trying to disarm it!");
|
Message(MT_Skills, "You set off the trap while trying to disarm it!");
|
||||||
trap->Trigger(this);
|
trap->Trigger(this);
|
||||||
}
|
}
|
||||||
@ -5653,7 +5653,7 @@ void Client::Handle_OP_FeignDeath(const EQApplicationPacket *app)
|
|||||||
secfeign = 0;
|
secfeign = 0;
|
||||||
|
|
||||||
uint16 totalfeign = primfeign + secfeign;
|
uint16 totalfeign = primfeign + secfeign;
|
||||||
if (MakeRandomFloat(0, 160) > totalfeign) {
|
if (zone->random.Real(0, 160) > totalfeign) {
|
||||||
SetFeigned(false);
|
SetFeigned(false);
|
||||||
entity_list.MessageClose_StringID(this, false, 200, 10, STRING_FEIGNFAILED, GetName());
|
entity_list.MessageClose_StringID(this, false, 200, 10, STRING_FEIGNFAILED, GetName());
|
||||||
}
|
}
|
||||||
@ -7917,7 +7917,7 @@ void Client::Handle_OP_Hide(const EQApplicationPacket *app)
|
|||||||
p_timers.Start(pTimerHide, reuse - 1);
|
p_timers.Start(pTimerHide, reuse - 1);
|
||||||
|
|
||||||
float hidechance = ((GetSkill(SkillHide) / 250.0f) + .25) * 100;
|
float hidechance = ((GetSkill(SkillHide) / 250.0f) + .25) * 100;
|
||||||
float random = MakeRandomFloat(0, 100);
|
float random = zone->random.Real(0, 100);
|
||||||
CheckIncreaseSkill(SkillHide, nullptr, 5);
|
CheckIncreaseSkill(SkillHide, nullptr, 5);
|
||||||
if (random < hidechance) {
|
if (random < hidechance) {
|
||||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_SpawnAppearance, sizeof(SpawnAppearance_Struct));
|
EQApplicationPacket* outapp = new EQApplicationPacket(OP_SpawnAppearance, sizeof(SpawnAppearance_Struct));
|
||||||
@ -7941,7 +7941,7 @@ void Client::Handle_OP_Hide(const EQApplicationPacket *app)
|
|||||||
Mob *evadetar = GetTarget();
|
Mob *evadetar = GetTarget();
|
||||||
if (!auto_attack && (evadetar && evadetar->CheckAggro(this)
|
if (!auto_attack && (evadetar && evadetar->CheckAggro(this)
|
||||||
&& evadetar->IsNPC())) {
|
&& evadetar->IsNPC())) {
|
||||||
if (MakeRandomInt(0, 260) < (int)GetSkill(SkillHide)) {
|
if (zone->random.Int(0, 260) < (int)GetSkill(SkillHide)) {
|
||||||
msg->string_id = EVADE_SUCCESS;
|
msg->string_id = EVADE_SUCCESS;
|
||||||
RogueEvade(evadetar);
|
RogueEvade(evadetar);
|
||||||
}
|
}
|
||||||
@ -9324,11 +9324,11 @@ void Client::Handle_OP_Mend(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
int mendhp = GetMaxHP() / 4;
|
int mendhp = GetMaxHP() / 4;
|
||||||
int currenthp = GetHP();
|
int currenthp = GetHP();
|
||||||
if (MakeRandomInt(0, 199) < (int)GetSkill(SkillMend)) {
|
if (zone->random.Int(0, 199) < (int)GetSkill(SkillMend)) {
|
||||||
|
|
||||||
int criticalchance = spellbonuses.CriticalMend + itembonuses.CriticalMend + aabonuses.CriticalMend;
|
int criticalchance = spellbonuses.CriticalMend + itembonuses.CriticalMend + aabonuses.CriticalMend;
|
||||||
|
|
||||||
if (MakeRandomInt(0, 99) < criticalchance){
|
if (zone->random.Int(0, 99) < criticalchance){
|
||||||
mendhp *= 2;
|
mendhp *= 2;
|
||||||
Message_StringID(4, MEND_CRITICAL);
|
Message_StringID(4, MEND_CRITICAL);
|
||||||
}
|
}
|
||||||
@ -9343,7 +9343,7 @@ void Client::Handle_OP_Mend(const EQApplicationPacket *app)
|
|||||||
0 skill - 25% chance to worsen
|
0 skill - 25% chance to worsen
|
||||||
20 skill - 23% chance to worsen
|
20 skill - 23% chance to worsen
|
||||||
50 skill - 16% chance to worsen */
|
50 skill - 16% chance to worsen */
|
||||||
if ((GetSkill(SkillMend) <= 75) && (MakeRandomInt(GetSkill(SkillMend), 100) < 75) && (MakeRandomInt(1, 3) == 1))
|
if ((GetSkill(SkillMend) <= 75) && (zone->random.Int(GetSkill(SkillMend), 100) < 75) && (zone->random.Int(1, 3) == 1))
|
||||||
{
|
{
|
||||||
SetHP(currenthp > mendhp ? (GetHP() - mendhp) : 1);
|
SetHP(currenthp > mendhp ? (GetHP() - mendhp) : 1);
|
||||||
SendHPUpdate();
|
SendHPUpdate();
|
||||||
@ -10648,12 +10648,18 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
|
|||||||
case RaidCommandInviteIntoExisting:
|
case RaidCommandInviteIntoExisting:
|
||||||
case RaidCommandInvite: {
|
case RaidCommandInvite: {
|
||||||
Client *i = entity_list.GetClientByName(ri->player_name);
|
Client *i = entity_list.GetClientByName(ri->player_name);
|
||||||
if (i){
|
if (!i)
|
||||||
|
break;
|
||||||
Group *g = i->GetGroup();
|
Group *g = i->GetGroup();
|
||||||
if (g){
|
// These two messages should be generated by the client I think, just do this for now
|
||||||
if (g->IsLeader(i) == false)
|
if (i->HasRaid()) {
|
||||||
|
Message(13, "%s is already in a raid.", i->GetName());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (g && !g->IsLeader(i)) {
|
||||||
Message(13, "You can only invite an ungrouped player or group leader to join your raid.");
|
Message(13, "You can only invite an ungrouped player or group leader to join your raid.");
|
||||||
else{
|
break;
|
||||||
|
}
|
||||||
//This sends an "invite" to the client in question.
|
//This sends an "invite" to the client in question.
|
||||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidGeneral_Struct));
|
EQApplicationPacket* outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidGeneral_Struct));
|
||||||
RaidGeneral_Struct *rg = (RaidGeneral_Struct*)outapp->pBuffer;
|
RaidGeneral_Struct *rg = (RaidGeneral_Struct*)outapp->pBuffer;
|
||||||
@ -10664,21 +10670,6 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app)
|
|||||||
rg->action = 20;
|
rg->action = 20;
|
||||||
i->QueuePacket(outapp);
|
i->QueuePacket(outapp);
|
||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
//This sends an "invite" to the client in question.
|
|
||||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidGeneral_Struct));
|
|
||||||
RaidGeneral_Struct *rg = (RaidGeneral_Struct*)outapp->pBuffer;
|
|
||||||
strn0cpy(rg->leader_name, ri->leader_name, 64);
|
|
||||||
strn0cpy(rg->player_name, ri->player_name, 64);
|
|
||||||
|
|
||||||
rg->parameter = 0;
|
|
||||||
rg->action = 20;
|
|
||||||
i->QueuePacket(outapp);
|
|
||||||
safe_delete(outapp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case RaidCommandAcceptInvite: {
|
case RaidCommandAcceptInvite: {
|
||||||
@ -11244,7 +11235,7 @@ void Client::Handle_OP_RandomReq(const EQApplicationPacket *app)
|
|||||||
randLow = 0;
|
randLow = 0;
|
||||||
randHigh = 100;
|
randHigh = 100;
|
||||||
}
|
}
|
||||||
randResult = MakeRandomInt(randLow, randHigh);
|
randResult = zone->random.Int(randLow, randHigh);
|
||||||
|
|
||||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_RandomReply, sizeof(RandomReply_Struct));
|
EQApplicationPacket* outapp = new EQApplicationPacket(OP_RandomReply, sizeof(RandomReply_Struct));
|
||||||
RandomReply_Struct* rr = (RandomReply_Struct*)outapp->pBuffer;
|
RandomReply_Struct* rr = (RandomReply_Struct*)outapp->pBuffer;
|
||||||
@ -11734,7 +11725,7 @@ void Client::Handle_OP_SenseTraps(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
if (trap && trap->skill > 0) {
|
if (trap && trap->skill > 0) {
|
||||||
int uskill = GetSkill(SkillSenseTraps);
|
int uskill = GetSkill(SkillSenseTraps);
|
||||||
if ((MakeRandomInt(0, 99) + uskill) >= (MakeRandomInt(0, 99) + trap->skill*0.75))
|
if ((zone->random.Int(0, 99) + uskill) >= (zone->random.Int(0, 99) + trap->skill*0.75))
|
||||||
{
|
{
|
||||||
float xdif = trap->x - GetX();
|
float xdif = trap->x - GetX();
|
||||||
float ydif = trap->y - GetY();
|
float ydif = trap->y - GetY();
|
||||||
@ -12477,7 +12468,7 @@ void Client::Handle_OP_ShopRequest(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
// 1199 I don't have time for that now. etc
|
// 1199 I don't have time for that now. etc
|
||||||
if (!tmp->CastToNPC()->IsMerchantOpen()) {
|
if (!tmp->CastToNPC()->IsMerchantOpen()) {
|
||||||
tmp->Say_StringID(MakeRandomInt(1199, 1202));
|
tmp->Say_StringID(zone->random.Int(1199, 1202));
|
||||||
action = 0;
|
action = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -12532,7 +12523,7 @@ void Client::Handle_OP_Sneak(const EQApplicationPacket *app)
|
|||||||
CheckIncreaseSkill(SkillSneak, nullptr, 5);
|
CheckIncreaseSkill(SkillSneak, nullptr, 5);
|
||||||
}
|
}
|
||||||
float hidechance = ((GetSkill(SkillSneak) / 300.0f) + .25) * 100;
|
float hidechance = ((GetSkill(SkillSneak) / 300.0f) + .25) * 100;
|
||||||
float random = MakeRandomFloat(0, 99);
|
float random = zone->random.Real(0, 99);
|
||||||
if (!was && random < hidechance) {
|
if (!was && random < hidechance) {
|
||||||
sneaking = true;
|
sneaking = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -436,7 +436,7 @@ bool Client::Process() {
|
|||||||
|
|
||||||
if (auto_attack_target && flurrychance)
|
if (auto_attack_target && flurrychance)
|
||||||
{
|
{
|
||||||
if(MakeRandomInt(0, 99) < flurrychance)
|
if(zone->random.Int(0, 99) < flurrychance)
|
||||||
{
|
{
|
||||||
Message_StringID(MT_NPCFlurry, YOU_FLURRY);
|
Message_StringID(MT_NPCFlurry, YOU_FLURRY);
|
||||||
Attack(auto_attack_target, MainPrimary, false);
|
Attack(auto_attack_target, MainPrimary, false);
|
||||||
@ -453,7 +453,7 @@ bool Client::Process() {
|
|||||||
wpn->GetItem()->ItemType == ItemType2HBlunt ||
|
wpn->GetItem()->ItemType == ItemType2HBlunt ||
|
||||||
wpn->GetItem()->ItemType == ItemType2HPiercing )
|
wpn->GetItem()->ItemType == ItemType2HPiercing )
|
||||||
{
|
{
|
||||||
if(MakeRandomInt(0, 99) < ExtraAttackChanceBonus)
|
if(zone->random.Int(0, 99) < ExtraAttackChanceBonus)
|
||||||
{
|
{
|
||||||
Attack(auto_attack_target, MainPrimary, false);
|
Attack(auto_attack_target, MainPrimary, false);
|
||||||
}
|
}
|
||||||
@ -498,7 +498,7 @@ bool Client::Process() {
|
|||||||
int16 DWBonus = spellbonuses.DualWieldChance + itembonuses.DualWieldChance;
|
int16 DWBonus = spellbonuses.DualWieldChance + itembonuses.DualWieldChance;
|
||||||
DualWieldProbability += DualWieldProbability*float(DWBonus)/ 100.0f;
|
DualWieldProbability += DualWieldProbability*float(DWBonus)/ 100.0f;
|
||||||
|
|
||||||
float random = MakeRandomFloat(0, 1);
|
float random = zone->random.Real(0, 1);
|
||||||
CheckIncreaseSkill(SkillDualWield, auto_attack_target, -10);
|
CheckIncreaseSkill(SkillDualWield, auto_attack_target, -10);
|
||||||
if (random < DualWieldProbability){ // Max 78% of DW
|
if (random < DualWieldProbability){ // Max 78% of DW
|
||||||
if(CheckAAEffect(aaEffectRampage)) {
|
if(CheckAAEffect(aaEffectRampage)) {
|
||||||
@ -1003,7 +1003,7 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) {
|
|||||||
if (fac != 0 && GetModCharacterFactionLevel(fac) < ml.faction_required)
|
if (fac != 0 && GetModCharacterFactionLevel(fac) < ml.faction_required)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
handychance = MakeRandomInt(0, merlist.size() + tmp_merlist.size() - 1);
|
handychance = zone->random.Int(0, merlist.size() + tmp_merlist.size() - 1);
|
||||||
|
|
||||||
item = database.GetItem(ml.item);
|
item = database.GetItem(ml.item);
|
||||||
if (item) {
|
if (item) {
|
||||||
@ -1079,7 +1079,7 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) {
|
|||||||
zone->tmpmerchanttable[npcid] = tmp_merlist;
|
zone->tmpmerchanttable[npcid] = tmp_merlist;
|
||||||
if (merch != nullptr && handyitem) {
|
if (merch != nullptr && handyitem) {
|
||||||
char handy_id[8] = { 0 };
|
char handy_id[8] = { 0 };
|
||||||
int greeting = MakeRandomInt(0, 4);
|
int greeting = zone->random.Int(0, 4);
|
||||||
int greet_id = 0;
|
int greet_id = 0;
|
||||||
switch (greeting) {
|
switch (greeting) {
|
||||||
case 1:
|
case 1:
|
||||||
@ -1640,7 +1640,7 @@ void Client::OPGMTraining(const EQApplicationPacket *app)
|
|||||||
// welcome message
|
// welcome message
|
||||||
if (pTrainer && pTrainer->IsNPC())
|
if (pTrainer && pTrainer->IsNPC())
|
||||||
{
|
{
|
||||||
pTrainer->Say_StringID(MakeRandomInt(1204, 1207), GetCleanName());
|
pTrainer->Say_StringID(zone->random.Int(1204, 1207), GetCleanName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1667,7 +1667,7 @@ void Client::OPGMEndTraining(const EQApplicationPacket *app)
|
|||||||
// goodbye message
|
// goodbye message
|
||||||
if (pTrainer->IsNPC())
|
if (pTrainer->IsNPC())
|
||||||
{
|
{
|
||||||
pTrainer->Say_StringID(MakeRandomInt(1208, 1211), GetCleanName());
|
pTrainer->Say_StringID(zone->random.Int(1208, 1211), GetCleanName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -63,22 +63,17 @@ int32 NPC::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) {
|
|||||||
int ratio = 0;
|
int ratio = 0;
|
||||||
|
|
||||||
if (spells[spell_id].buffduration == 0) {
|
if (spells[spell_id].buffduration == 0) {
|
||||||
|
|
||||||
chance += spellbonuses.CriticalSpellChance + spellbonuses.FrenziedDevastation;
|
chance += spellbonuses.CriticalSpellChance + spellbonuses.FrenziedDevastation;
|
||||||
|
|
||||||
if (chance && MakeRandomInt(1,100) <= chance){
|
if (chance && zone->random.Roll(chance)) {
|
||||||
|
|
||||||
ratio += spellbonuses.SpellCritDmgIncrease + spellbonuses.SpellCritDmgIncNoStack;
|
ratio += spellbonuses.SpellCritDmgIncrease + spellbonuses.SpellCritDmgIncNoStack;
|
||||||
value += (value*ratio)/100;
|
value += (value*ratio)/100;
|
||||||
entity_list.MessageClose_StringID(this, true, 100, MT_SpellCrits, OTHER_CRIT_BLAST, GetCleanName(), itoa(-value));
|
entity_list.MessageClose_StringID(this, true, 100, MT_SpellCrits, OTHER_CRIT_BLAST, GetCleanName(), itoa(-value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
chance += spellbonuses.CriticalDoTChance;
|
chance += spellbonuses.CriticalDoTChance;
|
||||||
|
if (chance && zone->random.Roll(chance)) {
|
||||||
if (chance && MakeRandomInt(1,100) <= chance){
|
|
||||||
|
|
||||||
ratio += spellbonuses.DotCritDmgIncrease;
|
ratio += spellbonuses.DotCritDmgIncrease;
|
||||||
value += (value*ratio)/100;
|
value += (value*ratio)/100;
|
||||||
}
|
}
|
||||||
@ -119,14 +114,14 @@ int32 Client::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) {
|
|||||||
if (spell_id == SPELL_IMP_HARM_TOUCH && (GetAA(aaSpellCastingFury) > 0) && (GetAA(aaUnholyTouch) > 0))
|
if (spell_id == SPELL_IMP_HARM_TOUCH && (GetAA(aaSpellCastingFury) > 0) && (GetAA(aaUnholyTouch) > 0))
|
||||||
chance = 100;
|
chance = 100;
|
||||||
|
|
||||||
if (MakeRandomInt(1,100) <= chance){
|
if (zone->random.Roll(chance)) {
|
||||||
Critical = true;
|
Critical = true;
|
||||||
ratio += itembonuses.SpellCritDmgIncrease + spellbonuses.SpellCritDmgIncrease + aabonuses.SpellCritDmgIncrease;
|
ratio += itembonuses.SpellCritDmgIncrease + spellbonuses.SpellCritDmgIncrease + aabonuses.SpellCritDmgIncrease;
|
||||||
ratio += itembonuses.SpellCritDmgIncNoStack + spellbonuses.SpellCritDmgIncNoStack + aabonuses.SpellCritDmgIncNoStack;
|
ratio += itembonuses.SpellCritDmgIncNoStack + spellbonuses.SpellCritDmgIncNoStack + aabonuses.SpellCritDmgIncNoStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (GetClass() == WIZARD && (GetLevel() >= RuleI(Spells, WizCritLevel)) && (MakeRandomInt(1,100) <= RuleI(Spells, WizCritChance))) {
|
else if (GetClass() == WIZARD && (GetLevel() >= RuleI(Spells, WizCritLevel)) && (zone->random.Roll(RuleI(Spells, WizCritChance)))) {
|
||||||
ratio += MakeRandomInt(20,70); //Wizard innate critical chance is calculated seperately from spell effect and is not a set ratio. (20-70 is parse confirmed)
|
ratio += zone->random.Int(20,70); //Wizard innate critical chance is calculated seperately from spell effect and is not a set ratio. (20-70 is parse confirmed)
|
||||||
Critical = true;
|
Critical = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,19 +191,13 @@ int32 Client::GetActDoTDamage(uint16 spell_id, int32 value, Mob* target) {
|
|||||||
|
|
||||||
value_BaseEffect = value + (value*GetFocusEffect(focusFcBaseEffects, spell_id)/100);
|
value_BaseEffect = value + (value*GetFocusEffect(focusFcBaseEffects, spell_id)/100);
|
||||||
|
|
||||||
if (chance > 0 && (MakeRandomInt(1, 100) <= chance)) {
|
if (chance > 0 && (zone->random.Roll(chance))) {
|
||||||
|
|
||||||
int32 ratio = 200;
|
int32 ratio = 200;
|
||||||
ratio += itembonuses.DotCritDmgIncrease + spellbonuses.DotCritDmgIncrease + aabonuses.DotCritDmgIncrease;
|
ratio += itembonuses.DotCritDmgIncrease + spellbonuses.DotCritDmgIncrease + aabonuses.DotCritDmgIncrease;
|
||||||
|
|
||||||
value = value_BaseEffect*ratio/100;
|
value = value_BaseEffect*ratio/100;
|
||||||
|
|
||||||
value += int(value_BaseEffect*GetFocusEffect(focusImprovedDamage, spell_id)/100)*ratio/100;
|
value += int(value_BaseEffect*GetFocusEffect(focusImprovedDamage, spell_id)/100)*ratio/100;
|
||||||
|
|
||||||
value += int(value_BaseEffect*GetFocusEffect(focusFcDamagePctCrit, spell_id)/100)*ratio/100;
|
value += int(value_BaseEffect*GetFocusEffect(focusFcDamagePctCrit, spell_id)/100)*ratio/100;
|
||||||
|
|
||||||
value += int(value_BaseEffect*target->GetVulnerability(this, spell_id, 0)/100)*ratio/100;
|
value += int(value_BaseEffect*target->GetVulnerability(this, spell_id, 0)/100)*ratio/100;
|
||||||
|
|
||||||
extra_dmg = target->GetFcDamageAmtIncoming(this, spell_id) +
|
extra_dmg = target->GetFcDamageAmtIncoming(this, spell_id) +
|
||||||
int(GetFocusEffect(focusFcDamageAmtCrit, spell_id)*ratio/100) +
|
int(GetFocusEffect(focusFcDamageAmtCrit, spell_id)*ratio/100) +
|
||||||
GetFocusEffect(focusFcDamageAmt, spell_id);
|
GetFocusEffect(focusFcDamageAmt, spell_id);
|
||||||
@ -224,15 +213,10 @@ int32 Client::GetActDoTDamage(uint16 spell_id, int32 value, Mob* target) {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
value = value_BaseEffect;
|
value = value_BaseEffect;
|
||||||
|
|
||||||
value += value_BaseEffect*GetFocusEffect(focusImprovedDamage, spell_id)/100;
|
value += value_BaseEffect*GetFocusEffect(focusImprovedDamage, spell_id)/100;
|
||||||
|
|
||||||
value += value_BaseEffect*GetFocusEffect(focusFcDamagePctCrit, spell_id)/100;
|
value += value_BaseEffect*GetFocusEffect(focusFcDamagePctCrit, spell_id)/100;
|
||||||
|
|
||||||
value += value_BaseEffect*target->GetVulnerability(this, spell_id, 0)/100;
|
value += value_BaseEffect*target->GetVulnerability(this, spell_id, 0)/100;
|
||||||
|
|
||||||
extra_dmg = target->GetFcDamageAmtIncoming(this, spell_id) +
|
extra_dmg = target->GetFcDamageAmtIncoming(this, spell_id) +
|
||||||
GetFocusEffect(focusFcDamageAmtCrit, spell_id) +
|
GetFocusEffect(focusFcDamageAmtCrit, spell_id) +
|
||||||
GetFocusEffect(focusFcDamageAmt, spell_id);
|
GetFocusEffect(focusFcDamageAmt, spell_id);
|
||||||
@ -284,15 +268,13 @@ int32 NPC::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) {
|
|||||||
|
|
||||||
//Allow for critical heal chance if NPC is loading spell effect bonuses.
|
//Allow for critical heal chance if NPC is loading spell effect bonuses.
|
||||||
if (AI_HasSpellsEffects()){
|
if (AI_HasSpellsEffects()){
|
||||||
|
|
||||||
if(spells[spell_id].buffduration < 1) {
|
if(spells[spell_id].buffduration < 1) {
|
||||||
|
if(spellbonuses.CriticalHealChance && (zone->random.Roll(spellbonuses.CriticalHealChance))) {
|
||||||
if(spellbonuses.CriticalHealChance && (MakeRandomInt(0,99) < spellbonuses.CriticalHealChance)) {
|
|
||||||
value = value*2;
|
value = value*2;
|
||||||
entity_list.MessageClose_StringID(this, true, 100, MT_SpellCrits, OTHER_CRIT_HEAL, GetCleanName(), itoa(value));
|
entity_list.MessageClose_StringID(this, true, 100, MT_SpellCrits, OTHER_CRIT_HEAL, GetCleanName(), itoa(value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(spellbonuses.CriticalHealOverTime && (MakeRandomInt(0,99) < spellbonuses.CriticalHealOverTime)) {
|
else if(spellbonuses.CriticalHealOverTime && (zone->random.Roll(spellbonuses.CriticalHealOverTime))) {
|
||||||
value = value*2;
|
value = value*2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -326,7 +308,7 @@ int32 Client::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) {
|
|||||||
if (spellbonuses.CriticalHealDecay)
|
if (spellbonuses.CriticalHealDecay)
|
||||||
chance += GetDecayEffectValue(spell_id, SE_CriticalHealDecay);
|
chance += GetDecayEffectValue(spell_id, SE_CriticalHealDecay);
|
||||||
|
|
||||||
if(chance && (MakeRandomInt(0,99) < chance)) {
|
if(chance && (zone->random.Roll(chance))) {
|
||||||
Critical = true;
|
Critical = true;
|
||||||
modifier = 2; //At present time no critical heal amount modifier SPA exists.
|
modifier = 2; //At present time no critical heal amount modifier SPA exists.
|
||||||
}
|
}
|
||||||
@ -360,7 +342,7 @@ int32 Client::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) {
|
|||||||
if (spellbonuses.CriticalRegenDecay)
|
if (spellbonuses.CriticalRegenDecay)
|
||||||
chance += GetDecayEffectValue(spell_id, SE_CriticalRegenDecay);
|
chance += GetDecayEffectValue(spell_id, SE_CriticalRegenDecay);
|
||||||
|
|
||||||
if(chance && (MakeRandomInt(0,99) < chance))
|
if(chance && zone->random.Roll(chance))
|
||||||
return (value * 2);
|
return (value * 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -379,7 +361,7 @@ int32 Client::GetActSpellCost(uint16 spell_id, int32 cost)
|
|||||||
// Formula = Unknown exact, based off a random percent chance up to mana cost(after focuses) of the cast spell
|
// Formula = Unknown exact, based off a random percent chance up to mana cost(after focuses) of the cast spell
|
||||||
if(this->itembonuses.Clairvoyance && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5)
|
if(this->itembonuses.Clairvoyance && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5)
|
||||||
{
|
{
|
||||||
int16 mana_back = this->itembonuses.Clairvoyance * MakeRandomInt(1, 100) / 100;
|
int16 mana_back = this->itembonuses.Clairvoyance * zone->random.Int(1, 100) / 100;
|
||||||
// Doesnt generate mana, so best case is a free spell
|
// Doesnt generate mana, so best case is a free spell
|
||||||
if(mana_back > cost)
|
if(mana_back > cost)
|
||||||
mana_back = cost;
|
mana_back = cost;
|
||||||
@ -392,7 +374,7 @@ int32 Client::GetActSpellCost(uint16 spell_id, int32 cost)
|
|||||||
// WildcardX
|
// WildcardX
|
||||||
float PercentManaReduction = 0;
|
float PercentManaReduction = 0;
|
||||||
float SpecializeSkill = GetSpecializeSkillValue(spell_id);
|
float SpecializeSkill = GetSpecializeSkillValue(spell_id);
|
||||||
int SuccessChance = MakeRandomInt(0, 100);
|
int SuccessChance = zone->random.Int(0, 100);
|
||||||
|
|
||||||
float bonus = 1.0;
|
float bonus = 1.0;
|
||||||
switch(GetAA(aaSpellCastingMastery))
|
switch(GetAA(aaSpellCastingMastery))
|
||||||
@ -444,7 +426,7 @@ int32 Client::GetActSpellCost(uint16 spell_id, int32 cost)
|
|||||||
|
|
||||||
if(focus_redux > 0)
|
if(focus_redux > 0)
|
||||||
{
|
{
|
||||||
PercentManaReduction += MakeRandomFloat(1, (double)focus_redux);
|
PercentManaReduction += zone->random.Real(1, (double)focus_redux);
|
||||||
}
|
}
|
||||||
|
|
||||||
cost -= (cost * (PercentManaReduction / 100));
|
cost -= (cost * (PercentManaReduction / 100));
|
||||||
|
|||||||
@ -1521,7 +1521,7 @@ XS(XS__ChooseRandom)
|
|||||||
if (items < 1)
|
if (items < 1)
|
||||||
Perl_croak(aTHX_ "Usage: ChooseRandom(... list ...)");
|
Perl_croak(aTHX_ "Usage: ChooseRandom(... list ...)");
|
||||||
|
|
||||||
int index = MakeRandomInt(0, items-1);
|
int index = zone->random.Int(0, items-1);
|
||||||
|
|
||||||
SV *tmp = ST(0);
|
SV *tmp = ST(0);
|
||||||
ST(0) = ST(index);
|
ST(0) = ST(index);
|
||||||
|
|||||||
@ -631,7 +631,7 @@ void EntityList::AddCorpse(Corpse *corpse, uint32 in_id)
|
|||||||
void EntityList::AddNPC(NPC *npc, bool SendSpawnPacket, bool dontqueue)
|
void EntityList::AddNPC(NPC *npc, bool SendSpawnPacket, bool dontqueue)
|
||||||
{
|
{
|
||||||
npc->SetID(GetFreeID());
|
npc->SetID(GetFreeID());
|
||||||
npc->SetMerchantProbability((uint8) MakeRandomInt(0, 99));
|
npc->SetMerchantProbability((uint8) zone->random.Int(0, 99));
|
||||||
parse->EventNPC(EVENT_SPAWN, npc, nullptr, "", 0);
|
parse->EventNPC(EVENT_SPAWN, npc, nullptr, "", 0);
|
||||||
|
|
||||||
/* Web Interface: NPC Spawn (Pop) */
|
/* Web Interface: NPC Spawn (Pop) */
|
||||||
@ -1587,7 +1587,7 @@ Client *EntityList::GetRandomClient(float x, float y, float z, float Distance, C
|
|||||||
if (ClientsInRange.empty())
|
if (ClientsInRange.empty())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
return ClientsInRange[MakeRandomInt(0, ClientsInRange.size() - 1)];
|
return ClientsInRange[zone->random.Int(0, ClientsInRange.size() - 1)];
|
||||||
}
|
}
|
||||||
|
|
||||||
Corpse *EntityList::GetCorpseByOwner(Client *client)
|
Corpse *EntityList::GetCorpseByOwner(Client *client)
|
||||||
@ -2918,7 +2918,7 @@ void EntityList::ClearFeignAggro(Mob *targ)
|
|||||||
|
|
||||||
it->second->RemoveFromHateList(targ);
|
it->second->RemoveFromHateList(targ);
|
||||||
if (targ->IsClient()) {
|
if (targ->IsClient()) {
|
||||||
if (it->second->GetLevel() >= 35 && MakeRandomInt(1, 100) <= 60)
|
if (it->second->GetLevel() >= 35 && zone->random.Roll(60))
|
||||||
it->second->AddFeignMemory(targ->CastToClient());
|
it->second->AddFeignMemory(targ->CastToClient());
|
||||||
else
|
else
|
||||||
targ->CastToClient()->RemoveXTarget(it->second, false);
|
targ->CastToClient()->RemoveXTarget(it->second, false);
|
||||||
@ -4533,7 +4533,7 @@ void EntityList::AddLootToNPCS(uint32 item_id, uint32 count)
|
|||||||
selection.push_back(j);
|
selection.push_back(j);
|
||||||
|
|
||||||
while (selection.size() > 0 && count > 0) {
|
while (selection.size() > 0 && count > 0) {
|
||||||
int k = MakeRandomInt(0, selection.size() - 1);
|
int k = zone->random.Int(0, selection.size() - 1);
|
||||||
counts[selection[k]]++;
|
counts[selection[k]]++;
|
||||||
count--;
|
count--;
|
||||||
selection.erase(selection.begin() + k);
|
selection.erase(selection.begin() + k);
|
||||||
@ -4715,6 +4715,6 @@ Mob *EntityList::GetTargetForVirus(Mob *spreader, int range)
|
|||||||
if(TargetsInRange.size() == 0)
|
if(TargetsInRange.size() == 0)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
return TargetsInRange[MakeRandomInt(0, TargetsInRange.size() - 1)];
|
return TargetsInRange[zone->random.Int(0, TargetsInRange.size() - 1)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -186,8 +186,8 @@ void Mob::CalculateNewFearpoint()
|
|||||||
{
|
{
|
||||||
int ran = 250 - (loop*2);
|
int ran = 250 - (loop*2);
|
||||||
loop++;
|
loop++;
|
||||||
ranx = GetX()+MakeRandomInt(0, ran-1)-MakeRandomInt(0, ran-1);
|
ranx = GetX()+zone->random.Int(0, ran-1)-zone->random.Int(0, ran-1);
|
||||||
rany = GetY()+MakeRandomInt(0, ran-1)-MakeRandomInt(0, ran-1);
|
rany = GetY()+zone->random.Int(0, ran-1)-zone->random.Int(0, ran-1);
|
||||||
ranz = FindGroundZ(ranx,rany);
|
ranz = FindGroundZ(ranx,rany);
|
||||||
if (ranz == -999999)
|
if (ranz == -999999)
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@ -83,7 +83,7 @@ uint32 ZoneDatabase::GetZoneForage(uint32 ZoneID, uint8 skill) {
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
uint32 rindex = MakeRandomInt(1, chancepool);
|
uint32 rindex = zone->random.Int(1, chancepool);
|
||||||
|
|
||||||
for(int i = 0; i < index; i++) {
|
for(int i = 0; i < index; i++) {
|
||||||
if(rindex <= chance[i]) {
|
if(rindex <= chance[i]) {
|
||||||
@ -136,7 +136,7 @@ uint32 ZoneDatabase::GetZoneFishing(uint32 ZoneID, uint8 skill, uint32 &npc_id,
|
|||||||
if (index <= 0)
|
if (index <= 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
uint32 random = MakeRandomInt(1, chancepool);
|
uint32 random = zone->random.Int(1, chancepool);
|
||||||
for (int i = 0; i < index; i++)
|
for (int i = 0; i < index; i++)
|
||||||
{
|
{
|
||||||
if (random > chance[i])
|
if (random > chance[i])
|
||||||
@ -258,18 +258,18 @@ void Client::GoFish()
|
|||||||
fishing_skill = 100+((fishing_skill-100)/2);
|
fishing_skill = 100+((fishing_skill-100)/2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MakeRandomInt(0,175) < fishing_skill) {
|
if (zone->random.Int(0,175) < fishing_skill) {
|
||||||
uint32 food_id = 0;
|
uint32 food_id = 0;
|
||||||
|
|
||||||
//25% chance to fish an item.
|
//25% chance to fish an item.
|
||||||
if (MakeRandomInt(0, 399) <= fishing_skill ) {
|
if (zone->random.Int(0, 399) <= fishing_skill ) {
|
||||||
uint32 npc_id = 0;
|
uint32 npc_id = 0;
|
||||||
uint8 npc_chance = 0;
|
uint8 npc_chance = 0;
|
||||||
food_id = database.GetZoneFishing(m_pp.zone_id, fishing_skill, npc_id, npc_chance);
|
food_id = database.GetZoneFishing(m_pp.zone_id, fishing_skill, npc_id, npc_chance);
|
||||||
|
|
||||||
//check for add NPC
|
//check for add NPC
|
||||||
if(npc_chance > 0 && npc_id) {
|
if(npc_chance > 0 && npc_id) {
|
||||||
if(npc_chance < MakeRandomInt(0, 99)) {
|
if(npc_chance < zone->random.Int(0, 99)) {
|
||||||
const NPCType* tmp = database.GetNPCType(npc_id);
|
const NPCType* tmp = database.GetNPCType(npc_id);
|
||||||
if(tmp != nullptr) {
|
if(tmp != nullptr) {
|
||||||
NPC* npc = new NPC(tmp, nullptr, GetX()+3, GetY(), GetZ(), GetHeading(), FlyMode3);
|
NPC* npc = new NPC(tmp, nullptr, GetX()+3, GetY(), GetZ(), GetHeading(), FlyMode3);
|
||||||
@ -289,7 +289,7 @@ void Client::GoFish()
|
|||||||
DeleteItemInInventory(bslot, 1, true); //do we need client update?
|
DeleteItemInInventory(bslot, 1, true); //do we need client update?
|
||||||
|
|
||||||
if(food_id == 0) {
|
if(food_id == 0) {
|
||||||
int index = MakeRandomInt(0, MAX_COMMON_FISH_IDS-1);
|
int index = zone->random.Int(0, MAX_COMMON_FISH_IDS-1);
|
||||||
food_id = common_fish_ids[index];
|
food_id = common_fish_ids[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,11 +324,11 @@ void Client::GoFish()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
//chance to use bait when you dont catch anything...
|
//chance to use bait when you dont catch anything...
|
||||||
if (MakeRandomInt(0, 4) == 1) {
|
if (zone->random.Int(0, 4) == 1) {
|
||||||
DeleteItemInInventory(bslot, 1, true); //do we need client update?
|
DeleteItemInInventory(bslot, 1, true); //do we need client update?
|
||||||
Message_StringID(MT_Skills, FISHING_LOST_BAIT); //You lost your bait!
|
Message_StringID(MT_Skills, FISHING_LOST_BAIT); //You lost your bait!
|
||||||
} else {
|
} else {
|
||||||
if (MakeRandomInt(0, 15) == 1) //give about a 1 in 15 chance to spill your beer. we could make this a rule, but it doesn't really seem worth it
|
if (zone->random.Int(0, 15) == 1) //give about a 1 in 15 chance to spill your beer. we could make this a rule, but it doesn't really seem worth it
|
||||||
//TODO: check for & consume an alcoholic beverage from inventory when this triggers, and set it as a rule that's disabled by default
|
//TODO: check for & consume an alcoholic beverage from inventory when this triggers, and set it as a rule that's disabled by default
|
||||||
Message_StringID(MT_Skills, FISHING_SPILL_BEER); //You spill your beer while bringing in your line.
|
Message_StringID(MT_Skills, FISHING_SPILL_BEER); //You spill your beer while bringing in your line.
|
||||||
else
|
else
|
||||||
@ -341,7 +341,7 @@ void Client::GoFish()
|
|||||||
//chance to break fishing pole...
|
//chance to break fishing pole...
|
||||||
//this is potentially exploitable in that they can fish
|
//this is potentially exploitable in that they can fish
|
||||||
//and then swap out items in primary slot... too lazy to fix right now
|
//and then swap out items in primary slot... too lazy to fix right now
|
||||||
if (MakeRandomInt(0, 49) == 1) {
|
if (zone->random.Int(0, 49) == 1) {
|
||||||
Message_StringID(MT_Skills, FISHING_POLE_BROKE); //Your fishing pole broke!
|
Message_StringID(MT_Skills, FISHING_POLE_BROKE); //Your fishing pole broke!
|
||||||
DeleteItemInInventory(MainPrimary, 0, true);
|
DeleteItemInInventory(MainPrimary, 0, true);
|
||||||
}
|
}
|
||||||
@ -370,18 +370,18 @@ void Client::ForageItem(bool guarantee) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// these may need to be fine tuned, I am just guessing here
|
// these may need to be fine tuned, I am just guessing here
|
||||||
if (guarantee || MakeRandomInt(0,199) < skill_level) {
|
if (guarantee || zone->random.Int(0,199) < skill_level) {
|
||||||
uint32 foragedfood = 0;
|
uint32 foragedfood = 0;
|
||||||
uint32 stringid = FORAGE_NOEAT;
|
uint32 stringid = FORAGE_NOEAT;
|
||||||
|
|
||||||
if (MakeRandomInt(0,99) <= 25) {
|
if (zone->random.Roll(25)) {
|
||||||
foragedfood = database.GetZoneForage(m_pp.zone_id, skill_level);
|
foragedfood = database.GetZoneForage(m_pp.zone_id, skill_level);
|
||||||
}
|
}
|
||||||
|
|
||||||
//not an else in case theres no DB food
|
//not an else in case theres no DB food
|
||||||
if(foragedfood == 0) {
|
if(foragedfood == 0) {
|
||||||
uint8 index = 0;
|
uint8 index = 0;
|
||||||
index = MakeRandomInt(0, MAX_COMMON_FOOD_IDS-1);
|
index = zone->random.Int(0, MAX_COMMON_FOOD_IDS-1);
|
||||||
foragedfood = common_food_ids[index];
|
foragedfood = common_food_ids[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -438,7 +438,7 @@ void Client::ForageItem(bool guarantee) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int ChanceSecondForage = aabonuses.ForageAdditionalItems + itembonuses.ForageAdditionalItems + spellbonuses.ForageAdditionalItems;
|
int ChanceSecondForage = aabonuses.ForageAdditionalItems + itembonuses.ForageAdditionalItems + spellbonuses.ForageAdditionalItems;
|
||||||
if(!guarantee && MakeRandomInt(0,99) < ChanceSecondForage) {
|
if(!guarantee && zone->random.Roll(ChanceSecondForage)) {
|
||||||
Message_StringID(MT_Skills, FORAGE_MASTERY);
|
Message_StringID(MT_Skills, FORAGE_MASTERY);
|
||||||
ForageItem(true);
|
ForageItem(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -485,7 +485,7 @@ Mob *HateList::GetRandom()
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto iterator = list.begin();
|
auto iterator = list.begin();
|
||||||
int random = MakeRandomInt(0, count - 1);
|
int random = zone->random.Int(0, count - 1);
|
||||||
for (int i = 0; i < random; i++)
|
for (int i = 0; i < random; i++)
|
||||||
++iterator;
|
++iterator;
|
||||||
|
|
||||||
|
|||||||
@ -1032,7 +1032,25 @@ bool Client::MakeItemLink(char* &ret_link, const ItemInst *inst) {
|
|||||||
uint8 evolvedlevel = 0;
|
uint8 evolvedlevel = 0;
|
||||||
int hash = 0;
|
int hash = 0;
|
||||||
//int hash = GetItemLinkHash(inst); //eventually this will work (currently crashes zone), but for now we'll skip the extra overhead
|
//int hash = GetItemLinkHash(inst); //eventually this will work (currently crashes zone), but for now we'll skip the extra overhead
|
||||||
if (GetClientVersion() >= EQClientRoF)
|
if (GetClientVersion() >= EQClientRoF2)
|
||||||
|
{
|
||||||
|
MakeAnyLenString(&ret_link, "%1X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%01X" "%1X" "%04X" "%1X" "%05X" "%08X",
|
||||||
|
0,
|
||||||
|
item->ID,
|
||||||
|
inst->GetAugmentItemID(0),
|
||||||
|
inst->GetAugmentItemID(1),
|
||||||
|
inst->GetAugmentItemID(2),
|
||||||
|
inst->GetAugmentItemID(3),
|
||||||
|
inst->GetAugmentItemID(4),
|
||||||
|
inst->GetAugmentItemID(5),
|
||||||
|
evolving,
|
||||||
|
loregroup,
|
||||||
|
evolvedlevel,
|
||||||
|
0,
|
||||||
|
hash
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else if (GetClientVersion() >= EQClientRoF)
|
||||||
{
|
{
|
||||||
MakeAnyLenString(&ret_link, "%1X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%1X" "%04X" "%1X" "%05X" "%08X",
|
MakeAnyLenString(&ret_link, "%1X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%1X" "%04X" "%1X" "%05X" "%08X",
|
||||||
0,
|
0,
|
||||||
|
|||||||
@ -49,15 +49,15 @@ void ZoneDatabase::AddLootTableToNPC(NPC* npc,uint32 loottable_id, ItemList* ite
|
|||||||
if (lts->mincash == lts->maxcash)
|
if (lts->mincash == lts->maxcash)
|
||||||
cash = lts->mincash;
|
cash = lts->mincash;
|
||||||
else
|
else
|
||||||
cash = MakeRandomInt(lts->mincash, lts->maxcash);
|
cash = zone->random.Int(lts->mincash, lts->maxcash);
|
||||||
if (cash != 0) {
|
if (cash != 0) {
|
||||||
if (lts->avgcoin != 0) {
|
if (lts->avgcoin != 0) {
|
||||||
//this is some crazy ass stuff... and makes very little sense... dont use it, k?
|
//this is some crazy ass stuff... and makes very little sense... dont use it, k?
|
||||||
uint32 mincoin = (uint32) (lts->avgcoin * 0.75 + 1);
|
uint32 mincoin = (uint32) (lts->avgcoin * 0.75 + 1);
|
||||||
uint32 maxcoin = (uint32) (lts->avgcoin * 1.25 + 1);
|
uint32 maxcoin = (uint32) (lts->avgcoin * 1.25 + 1);
|
||||||
*copper = MakeRandomInt(mincoin, maxcoin);
|
*copper = zone->random.Int(mincoin, maxcoin);
|
||||||
*silver = MakeRandomInt(mincoin, maxcoin);
|
*silver = zone->random.Int(mincoin, maxcoin);
|
||||||
*gold = MakeRandomInt(mincoin, maxcoin);
|
*gold = zone->random.Int(mincoin, maxcoin);
|
||||||
if(*copper > cash) { *copper = cash; }
|
if(*copper > cash) { *copper = cash; }
|
||||||
cash -= *copper;
|
cash -= *copper;
|
||||||
if(*silver>(cash/10)) { *silver = (cash/10); }
|
if(*silver>(cash/10)) { *silver = (cash/10); }
|
||||||
@ -92,7 +92,7 @@ void ZoneDatabase::AddLootTableToNPC(NPC* npc,uint32 loottable_id, ItemList* ite
|
|||||||
|
|
||||||
float drop_chance = 0.0f;
|
float drop_chance = 0.0f;
|
||||||
if(ltchance > 0.0 && ltchance < 100.0) {
|
if(ltchance > 0.0 && ltchance < 100.0) {
|
||||||
drop_chance = MakeRandomFloat(0.0, 100.0);
|
drop_chance = zone->random.Real(0.0, 100.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ltchance != 0.0 && (ltchance == 100.0 || drop_chance < ltchance)) {
|
if (ltchance != 0.0 && (ltchance == 100.0 || drop_chance < ltchance)) {
|
||||||
@ -118,7 +118,7 @@ void ZoneDatabase::AddLootDropToNPC(NPC* npc,uint32 lootdrop_id, ItemList* iteml
|
|||||||
|
|
||||||
uint8 limit = 0;
|
uint8 limit = 0;
|
||||||
// Start at a random point in itemlist.
|
// Start at a random point in itemlist.
|
||||||
uint32 item = MakeRandomInt(0, lds->NumEntries-1);
|
uint32 item = zone->random.Int(0, lds->NumEntries-1);
|
||||||
// Main loop.
|
// Main loop.
|
||||||
for (uint32 i=0; i<lds->NumEntries;)
|
for (uint32 i=0; i<lds->NumEntries;)
|
||||||
{
|
{
|
||||||
@ -137,7 +137,7 @@ void ZoneDatabase::AddLootDropToNPC(NPC* npc,uint32 lootdrop_id, ItemList* iteml
|
|||||||
|
|
||||||
float drop_chance = 0.0;
|
float drop_chance = 0.0;
|
||||||
if(thischance != 100.0)
|
if(thischance != 100.0)
|
||||||
drop_chance = MakeRandomFloat(0.0, 100.0);
|
drop_chance = zone->random.Real(0.0, 100.0);
|
||||||
|
|
||||||
#if EQDEBUG>=11
|
#if EQDEBUG>=11
|
||||||
LogFile->write(EQEMuLog::Debug, "Drop chance for npc: %s, this chance:%f, drop roll:%f", npc->GetName(), thischance, drop_chance);
|
LogFile->write(EQEMuLog::Debug, "Drop chance for npc: %s, this chance:%f, drop roll:%f", npc->GetName(), thischance, drop_chance);
|
||||||
@ -282,7 +282,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
|
|||||||
eslot = MaterialPrimary;
|
eslot = MaterialPrimary;
|
||||||
}
|
}
|
||||||
else if (foundslot == MainSecondary
|
else if (foundslot == MainSecondary
|
||||||
&& (GetOwner() != nullptr || (GetLevel() >= 13 && MakeRandomInt(0,99) < NPC_DW_CHANCE) || (item2->Damage==0)) &&
|
&& (GetOwner() != nullptr || (GetLevel() >= 13 && zone->random.Roll(NPC_DW_CHANCE)) || (item2->Damage==0)) &&
|
||||||
(item2->ItemType == ItemType1HSlash || item2->ItemType == ItemType1HBlunt || item2->ItemType == ItemTypeShield ||
|
(item2->ItemType == ItemType1HSlash || item2->ItemType == ItemType1HBlunt || item2->ItemType == ItemTypeShield ||
|
||||||
item2->ItemType == ItemType1HPiercing))
|
item2->ItemType == ItemType1HPiercing))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1457,7 +1457,7 @@ void Merc::AI_Process() {
|
|||||||
meleeDistance = meleeDistance * .30;
|
meleeDistance = meleeDistance * .30;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
meleeDistance *= (float)MakeRandomFloat(.50, .85);
|
meleeDistance *= (float)zone->random.Real(.50, .85);
|
||||||
}
|
}
|
||||||
if(IsMercCaster() && GetLevel() > 12) {
|
if(IsMercCaster() && GetLevel() > 12) {
|
||||||
if(IsMercCasterCombatRange(GetTarget()))
|
if(IsMercCasterCombatRange(GetTarget()))
|
||||||
@ -1558,7 +1558,7 @@ void Merc::AI_Process() {
|
|||||||
|
|
||||||
if (GetTarget() && flurrychance)
|
if (GetTarget() && flurrychance)
|
||||||
{
|
{
|
||||||
if(MakeRandomInt(0, 100) < flurrychance)
|
if(zone->random.Roll(flurrychance))
|
||||||
{
|
{
|
||||||
Message_StringID(MT_NPCFlurry, YOU_FLURRY);
|
Message_StringID(MT_NPCFlurry, YOU_FLURRY);
|
||||||
Attack(GetTarget(), MainPrimary, false);
|
Attack(GetTarget(), MainPrimary, false);
|
||||||
@ -1569,7 +1569,7 @@ void Merc::AI_Process() {
|
|||||||
int16 ExtraAttackChanceBonus = spellbonuses.ExtraAttackChance + itembonuses.ExtraAttackChance + aabonuses.ExtraAttackChance;
|
int16 ExtraAttackChanceBonus = spellbonuses.ExtraAttackChance + itembonuses.ExtraAttackChance + aabonuses.ExtraAttackChance;
|
||||||
|
|
||||||
if (GetTarget() && ExtraAttackChanceBonus) {
|
if (GetTarget() && ExtraAttackChanceBonus) {
|
||||||
if(MakeRandomInt(0, 100) < ExtraAttackChanceBonus)
|
if(zone->random.Roll(ExtraAttackChanceBonus))
|
||||||
{
|
{
|
||||||
Attack(GetTarget(), MainPrimary, false);
|
Attack(GetTarget(), MainPrimary, false);
|
||||||
}
|
}
|
||||||
@ -1603,10 +1603,8 @@ void Merc::AI_Process() {
|
|||||||
int16 DWBonus = spellbonuses.DualWieldChance + itembonuses.DualWieldChance;
|
int16 DWBonus = spellbonuses.DualWieldChance + itembonuses.DualWieldChance;
|
||||||
DualWieldProbability += DualWieldProbability*float(DWBonus)/ 100.0f;
|
DualWieldProbability += DualWieldProbability*float(DWBonus)/ 100.0f;
|
||||||
|
|
||||||
float random = MakeRandomFloat(0, 1);
|
|
||||||
|
|
||||||
// Max 78% of DW
|
// Max 78% of DW
|
||||||
if (random < DualWieldProbability)
|
if (zone->random.Roll(DualWieldProbability))
|
||||||
{
|
{
|
||||||
Attack(GetTarget(), MainSecondary); // Single attack with offhand
|
Attack(GetTarget(), MainSecondary); // Single attack with offhand
|
||||||
|
|
||||||
@ -1868,7 +1866,7 @@ bool EntityList::Merc_AICheckCloseBeneficialSpells(Merc* caster, uint8 iChance,
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (iChance < 100) {
|
if (iChance < 100) {
|
||||||
int8 tmp = MakeRandomInt(1, 100);
|
int8 tmp = zone->random.Int(1, 100);
|
||||||
if (tmp > iChance)
|
if (tmp > iChance)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1964,7 +1962,7 @@ bool Merc::AICastSpell(int8 iChance, int32 iSpellTypes) {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (iChance < 100) {
|
if (iChance < 100) {
|
||||||
if (MakeRandomInt(0, 100) > iChance){
|
if (zone->random.Int(0, 100) > iChance){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2249,14 +2247,14 @@ bool Merc::AICastSpell(int8 iChance, int32 iSpellTypes) {
|
|||||||
|
|
||||||
if(selectedMercSpell.spellid == 0 && !tar->GetSpecialAbility(UNSTUNABLE) && !tar->IsStunned()) {
|
if(selectedMercSpell.spellid == 0 && !tar->GetSpecialAbility(UNSTUNABLE) && !tar->IsStunned()) {
|
||||||
uint8 stunChance = 15;
|
uint8 stunChance = 15;
|
||||||
if(MakeRandomInt(1, 100) <= stunChance) {
|
if(zone->random.Roll(stunChance)) {
|
||||||
selectedMercSpell = GetBestMercSpellForStun(this);
|
selectedMercSpell = GetBestMercSpellForStun(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(selectedMercSpell.spellid == 0) {
|
if(selectedMercSpell.spellid == 0) {
|
||||||
uint8 lureChance = 25;
|
uint8 lureChance = 25;
|
||||||
if(MakeRandomInt(1, 100) <= lureChance) {
|
if(zone->random.Roll(lureChance)) {
|
||||||
selectedMercSpell = GetBestMercSpellForNukeByTargetResists(this, tar);
|
selectedMercSpell = GetBestMercSpellForNukeByTargetResists(this, tar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2676,14 +2674,14 @@ int32 Merc::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) {
|
|||||||
|
|
||||||
int32 ratio = RuleI(Spells, BaseCritRatio); //Critical modifier is applied from spell effects only. Keep at 100 for live like criticals.
|
int32 ratio = RuleI(Spells, BaseCritRatio); //Critical modifier is applied from spell effects only. Keep at 100 for live like criticals.
|
||||||
|
|
||||||
if (MakeRandomInt(1,100) <= chance){
|
if (zone->random.Roll(chance)) {
|
||||||
Critical = true;
|
Critical = true;
|
||||||
ratio += itembonuses.SpellCritDmgIncrease + spellbonuses.SpellCritDmgIncrease + aabonuses.SpellCritDmgIncrease;
|
ratio += itembonuses.SpellCritDmgIncrease + spellbonuses.SpellCritDmgIncrease + aabonuses.SpellCritDmgIncrease;
|
||||||
ratio += itembonuses.SpellCritDmgIncNoStack + spellbonuses.SpellCritDmgIncNoStack + aabonuses.SpellCritDmgIncNoStack;
|
ratio += itembonuses.SpellCritDmgIncNoStack + spellbonuses.SpellCritDmgIncNoStack + aabonuses.SpellCritDmgIncNoStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (GetClass() == CASTERDPS && (GetLevel() >= RuleI(Spells, WizCritLevel)) && (MakeRandomInt(1,100) <= RuleI(Spells, WizCritChance))) {
|
else if (GetClass() == CASTERDPS && (GetLevel() >= RuleI(Spells, WizCritLevel)) && (zone->random.Roll(RuleI(Spells, WizCritChance)))) {
|
||||||
ratio = MakeRandomInt(1,100); //Wizard innate critical chance is calculated seperately from spell effect and is not a set ratio.
|
ratio = zone->random.Int(1,100); //Wizard innate critical chance is calculated seperately from spell effect and is not a set ratio.
|
||||||
Critical = true;
|
Critical = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2767,7 +2765,7 @@ int32 Merc::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) {
|
|||||||
if (spellbonuses.CriticalHealDecay)
|
if (spellbonuses.CriticalHealDecay)
|
||||||
chance += GetDecayEffectValue(spell_id, SE_CriticalHealDecay);
|
chance += GetDecayEffectValue(spell_id, SE_CriticalHealDecay);
|
||||||
|
|
||||||
if(chance && (MakeRandomInt(0,99) < chance)) {
|
if(chance && zone->random.Roll(chance)) {
|
||||||
Critical = true;
|
Critical = true;
|
||||||
modifier = 2; //At present time no critical heal amount modifier SPA exists.
|
modifier = 2; //At present time no critical heal amount modifier SPA exists.
|
||||||
}
|
}
|
||||||
@ -2798,7 +2796,7 @@ int32 Merc::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) {
|
|||||||
if (spellbonuses.CriticalRegenDecay)
|
if (spellbonuses.CriticalRegenDecay)
|
||||||
chance += GetDecayEffectValue(spell_id, SE_CriticalRegenDecay);
|
chance += GetDecayEffectValue(spell_id, SE_CriticalRegenDecay);
|
||||||
|
|
||||||
if(chance && (MakeRandomInt(0,99) < chance))
|
if(chance && zone->random.Roll(chance))
|
||||||
return (value * 2);
|
return (value * 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2810,7 +2808,7 @@ int32 Merc::GetActSpellCost(uint16 spell_id, int32 cost)
|
|||||||
// Formula = Unknown exact, based off a random percent chance up to mana cost(after focuses) of the cast spell
|
// Formula = Unknown exact, based off a random percent chance up to mana cost(after focuses) of the cast spell
|
||||||
if(this->itembonuses.Clairvoyance && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5)
|
if(this->itembonuses.Clairvoyance && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5)
|
||||||
{
|
{
|
||||||
int16 mana_back = this->itembonuses.Clairvoyance * MakeRandomInt(1, 100) / 100;
|
int16 mana_back = this->itembonuses.Clairvoyance * zone->random.Int(1, 100) / 100;
|
||||||
// Doesnt generate mana, so best case is a free spell
|
// Doesnt generate mana, so best case is a free spell
|
||||||
if(mana_back > cost)
|
if(mana_back > cost)
|
||||||
mana_back = cost;
|
mana_back = cost;
|
||||||
@ -2827,7 +2825,7 @@ int32 Merc::GetActSpellCost(uint16 spell_id, int32 cost)
|
|||||||
|
|
||||||
if(focus_redux > 0)
|
if(focus_redux > 0)
|
||||||
{
|
{
|
||||||
PercentManaReduction += MakeRandomFloat(1, (double)focus_redux);
|
PercentManaReduction += zone->random.Real(1, (double)focus_redux);
|
||||||
}
|
}
|
||||||
|
|
||||||
cost -= (cost * (PercentManaReduction / 100));
|
cost -= (cost * (PercentManaReduction / 100));
|
||||||
@ -3759,17 +3757,17 @@ MercSpell Merc::GetBestMercSpellForAENuke(Merc* caster, Mob* tar) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//check of we even want to cast an AE nuke
|
//check of we even want to cast an AE nuke
|
||||||
if(MakeRandomInt(1, 100) <= initialCastChance) {
|
if(zone->random.Roll(initialCastChance)) {
|
||||||
|
|
||||||
result = GetBestMercSpellForAERainNuke(caster, tar);
|
result = GetBestMercSpellForAERainNuke(caster, tar);
|
||||||
|
|
||||||
//check if we have a spell & allow for other AE nuke types
|
//check if we have a spell & allow for other AE nuke types
|
||||||
if(result.spellid == 0 && MakeRandomInt(1, 100) <= castChanceFalloff) {
|
if(result.spellid == 0 && zone->random.Roll(castChanceFalloff)) {
|
||||||
|
|
||||||
result = GetBestMercSpellForPBAENuke(caster, tar);
|
result = GetBestMercSpellForPBAENuke(caster, tar);
|
||||||
|
|
||||||
//check if we have a spell & allow for other AE nuke types
|
//check if we have a spell & allow for other AE nuke types
|
||||||
if(result.spellid == 0 && MakeRandomInt(1, 100) <= castChanceFalloff) {
|
if(result.spellid == 0 && zone->random.Roll(castChanceFalloff)) {
|
||||||
|
|
||||||
result = GetBestMercSpellForTargetedAENuke(caster, tar);
|
result = GetBestMercSpellForTargetedAENuke(caster, tar);
|
||||||
}
|
}
|
||||||
@ -3813,7 +3811,7 @@ MercSpell Merc::GetBestMercSpellForTargetedAENuke(Merc* caster, Mob* tar) {
|
|||||||
&& !IsPBAENukeSpell(mercSpellListItr->spellid) && CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
&& !IsPBAENukeSpell(mercSpellListItr->spellid) && CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||||
uint8 numTargets = 0;
|
uint8 numTargets = 0;
|
||||||
if(CheckAENuke(caster, tar, mercSpellListItr->spellid, numTargets)) {
|
if(CheckAENuke(caster, tar, mercSpellListItr->spellid, numTargets)) {
|
||||||
if(numTargets >= numTargetsCheck && MakeRandomInt(1, 100) <= castChance) {
|
if(numTargets >= numTargetsCheck && zone->random.Roll(castChance)) {
|
||||||
result.spellid = mercSpellListItr->spellid;
|
result.spellid = mercSpellListItr->spellid;
|
||||||
result.stance = mercSpellListItr->stance;
|
result.stance = mercSpellListItr->stance;
|
||||||
result.type = mercSpellListItr->type;
|
result.type = mercSpellListItr->type;
|
||||||
@ -3863,7 +3861,7 @@ MercSpell Merc::GetBestMercSpellForPBAENuke(Merc* caster, Mob* tar) {
|
|||||||
if(IsPBAENukeSpell(mercSpellListItr->spellid) && CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
if(IsPBAENukeSpell(mercSpellListItr->spellid) && CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||||
uint8 numTargets = 0;
|
uint8 numTargets = 0;
|
||||||
if(CheckAENuke(caster, caster, mercSpellListItr->spellid, numTargets)) {
|
if(CheckAENuke(caster, caster, mercSpellListItr->spellid, numTargets)) {
|
||||||
if(numTargets >= numTargetsCheck && MakeRandomInt(1, 100) <= castChance) {
|
if(numTargets >= numTargetsCheck && zone->random.Roll(castChance)) {
|
||||||
result.spellid = mercSpellListItr->spellid;
|
result.spellid = mercSpellListItr->spellid;
|
||||||
result.stance = mercSpellListItr->stance;
|
result.stance = mercSpellListItr->stance;
|
||||||
result.type = mercSpellListItr->type;
|
result.type = mercSpellListItr->type;
|
||||||
@ -3910,7 +3908,7 @@ MercSpell Merc::GetBestMercSpellForAERainNuke(Merc* caster, Mob* tar) {
|
|||||||
|
|
||||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(IsAERainNukeSpell(mercSpellListItr->spellid) && MakeRandomInt(1, 100) <= castChance && CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
if(IsAERainNukeSpell(mercSpellListItr->spellid) && zone->random.Roll(castChance) && CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||||
uint8 numTargets = 0;
|
uint8 numTargets = 0;
|
||||||
if(CheckAENuke(caster, tar, mercSpellListItr->spellid, numTargets)) {
|
if(CheckAENuke(caster, tar, mercSpellListItr->spellid, numTargets)) {
|
||||||
if(numTargets >= numTargetsCheck) {
|
if(numTargets >= numTargetsCheck) {
|
||||||
@ -3949,7 +3947,7 @@ MercSpell Merc::GetBestMercSpellForNuke(Merc* caster) {
|
|||||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||||
if(IsPureNukeSpell(mercSpellListItr->spellid) && !IsAENukeSpell(mercSpellListItr->spellid)
|
if(IsPureNukeSpell(mercSpellListItr->spellid) && !IsAENukeSpell(mercSpellListItr->spellid)
|
||||||
&& MakeRandomInt(1, 100) <= castChance && CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
&& zone->random.Roll(castChance) && CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||||
result.spellid = mercSpellListItr->spellid;
|
result.spellid = mercSpellListItr->spellid;
|
||||||
result.stance = mercSpellListItr->stance;
|
result.stance = mercSpellListItr->stance;
|
||||||
result.type = mercSpellListItr->type;
|
result.type = mercSpellListItr->type;
|
||||||
@ -4381,7 +4379,7 @@ bool Merc::CheckConfidence() {
|
|||||||
ConfidenceLossChance = 25 - ( 5 * (GetTierID() - 1));
|
ConfidenceLossChance = 25 - ( 5 * (GetTierID() - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(MakeRandomInt(0 ,100) < ConfidenceLossChance) {
|
if(zone->random.Roll(ConfidenceLossChance)) {
|
||||||
result = false;
|
result = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4527,7 +4525,7 @@ void Merc::DoClassAttacks(Mob *target) {
|
|||||||
break;
|
break;
|
||||||
case TANK:{
|
case TANK:{
|
||||||
if(level >= RuleI(Combat, NPCBashKickLevel)){
|
if(level >= RuleI(Combat, NPCBashKickLevel)){
|
||||||
if(MakeRandomInt(0, 100) > 25) //tested on live, warrior mobs both kick and bash, kick about 75% of the time, casting doesn't seem to make a difference.
|
if(zone->random.Int(0, 100) > 25) //tested on live, warrior mobs both kick and bash, kick about 75% of the time, casting doesn't seem to make a difference.
|
||||||
{
|
{
|
||||||
DoAnim(animKick);
|
DoAnim(animKick);
|
||||||
int32 dmg = 0;
|
int32 dmg = 0;
|
||||||
@ -4540,7 +4538,7 @@ void Merc::DoClassAttacks(Mob *target) {
|
|||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
dmg = GetKickDamage();
|
dmg = GetKickDamage();
|
||||||
else
|
else
|
||||||
dmg = MakeRandomInt(1, GetKickDamage());
|
dmg = zone->random.Int(1, GetKickDamage());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4562,7 +4560,7 @@ void Merc::DoClassAttacks(Mob *target) {
|
|||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
dmg = GetBashDamage();
|
dmg = GetBashDamage();
|
||||||
else
|
else
|
||||||
dmg = MakeRandomInt(1, GetBashDamage());
|
dmg = zone->random.Int(1, GetBashDamage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4690,7 +4688,7 @@ const char* Merc::GetRandomName(){
|
|||||||
bool valid = false;
|
bool valid = false;
|
||||||
|
|
||||||
while(!valid) {
|
while(!valid) {
|
||||||
int rndnum=MakeRandomInt(0, 75),n=1;
|
int rndnum=zone->random.Int(0, 75),n=1;
|
||||||
bool dlc=false;
|
bool dlc=false;
|
||||||
bool vwl=false;
|
bool vwl=false;
|
||||||
bool dbl=false;
|
bool dbl=false;
|
||||||
@ -4711,18 +4709,18 @@ const char* Merc::GetRandomName(){
|
|||||||
rndname[0]=vowels[rndnum];
|
rndname[0]=vowels[rndnum];
|
||||||
vwl=true;
|
vwl=true;
|
||||||
}
|
}
|
||||||
int namlen=MakeRandomInt(5, 10);
|
int namlen=zone->random.Int(5, 10);
|
||||||
for (int i=n;i<namlen;i++)
|
for (int i=n;i<namlen;i++)
|
||||||
{
|
{
|
||||||
dlc=false;
|
dlc=false;
|
||||||
if (vwl) //last char was a vowel
|
if (vwl) //last char was a vowel
|
||||||
{ // so pick a cons or cons pair
|
{ // so pick a cons or cons pair
|
||||||
rndnum=MakeRandomInt(0, 62);
|
rndnum=zone->random.Int(0, 62);
|
||||||
if (rndnum>46)
|
if (rndnum>46)
|
||||||
{ // pick a cons pair
|
{ // pick a cons pair
|
||||||
if (i>namlen-3) // last 2 chars in name?
|
if (i>namlen-3) // last 2 chars in name?
|
||||||
{ // name can only end in cons pair "rk" "st" "sh" "th" "ph" "sk" "nd" or "ng"
|
{ // name can only end in cons pair "rk" "st" "sh" "th" "ph" "sk" "nd" or "ng"
|
||||||
rndnum=MakeRandomInt(0, 7)*2;
|
rndnum=zone->random.Int(0, 7)*2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // pick any from the set
|
{ // pick any from the set
|
||||||
@ -4740,12 +4738,12 @@ const char* Merc::GetRandomName(){
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // select a vowel
|
{ // select a vowel
|
||||||
rndname[i]=vowels[MakeRandomInt(0, 16)];
|
rndname[i]=vowels[zone->random.Int(0, 16)];
|
||||||
}
|
}
|
||||||
vwl=!vwl;
|
vwl=!vwl;
|
||||||
if (!dbl && !dlc)
|
if (!dbl && !dlc)
|
||||||
{ // one chance at double letters in name
|
{ // one chance at double letters in name
|
||||||
if (!MakeRandomInt(0, i+9)) // chances decrease towards end of name
|
if (!zone->random.Int(0, i+9)) // chances decrease towards end of name
|
||||||
{
|
{
|
||||||
rndname[i+1]=rndname[i];
|
rndname[i+1]=rndname[i];
|
||||||
dbl=true;
|
dbl=true;
|
||||||
|
|||||||
152
zone/mob.cpp
152
zone/mob.cpp
@ -1602,157 +1602,157 @@ bool Mob::RandomizeFeatures(bool send_illusion, bool set_variables)
|
|||||||
uint32 DrakkinDetails = 0xFFFFFFFF;
|
uint32 DrakkinDetails = 0xFFFFFFFF;
|
||||||
|
|
||||||
// Set some common feature settings
|
// Set some common feature settings
|
||||||
EyeColor1 = MakeRandomInt(0, 9);
|
EyeColor1 = zone->random.Int(0, 9);
|
||||||
EyeColor2 = MakeRandomInt(0, 9);
|
EyeColor2 = zone->random.Int(0, 9);
|
||||||
LuclinFace = MakeRandomInt(0, 7);
|
LuclinFace = zone->random.Int(0, 7);
|
||||||
|
|
||||||
// Adjust all settings based on the min and max for each feature of each race and gender
|
// Adjust all settings based on the min and max for each feature of each race and gender
|
||||||
switch (GetRace())
|
switch (GetRace())
|
||||||
{
|
{
|
||||||
case 1: // Human
|
case 1: // Human
|
||||||
HairColor = MakeRandomInt(0, 19);
|
HairColor = zone->random.Int(0, 19);
|
||||||
if (Gender == 0) {
|
if (Gender == 0) {
|
||||||
BeardColor = HairColor;
|
BeardColor = HairColor;
|
||||||
HairStyle = MakeRandomInt(0, 3);
|
HairStyle = zone->random.Int(0, 3);
|
||||||
Beard = MakeRandomInt(0, 5);
|
Beard = zone->random.Int(0, 5);
|
||||||
}
|
}
|
||||||
if (Gender == 1) {
|
if (Gender == 1) {
|
||||||
HairStyle = MakeRandomInt(0, 2);
|
HairStyle = zone->random.Int(0, 2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2: // Barbarian
|
case 2: // Barbarian
|
||||||
HairColor = MakeRandomInt(0, 19);
|
HairColor = zone->random.Int(0, 19);
|
||||||
LuclinFace = MakeRandomInt(0, 87);
|
LuclinFace = zone->random.Int(0, 87);
|
||||||
if (Gender == 0) {
|
if (Gender == 0) {
|
||||||
BeardColor = HairColor;
|
BeardColor = HairColor;
|
||||||
HairStyle = MakeRandomInt(0, 3);
|
HairStyle = zone->random.Int(0, 3);
|
||||||
Beard = MakeRandomInt(0, 5);
|
Beard = zone->random.Int(0, 5);
|
||||||
}
|
}
|
||||||
if (Gender == 1) {
|
if (Gender == 1) {
|
||||||
HairStyle = MakeRandomInt(0, 2);
|
HairStyle = zone->random.Int(0, 2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3: // Erudite
|
case 3: // Erudite
|
||||||
if (Gender == 0) {
|
if (Gender == 0) {
|
||||||
BeardColor = MakeRandomInt(0, 19);
|
BeardColor = zone->random.Int(0, 19);
|
||||||
Beard = MakeRandomInt(0, 5);
|
Beard = zone->random.Int(0, 5);
|
||||||
LuclinFace = MakeRandomInt(0, 57);
|
LuclinFace = zone->random.Int(0, 57);
|
||||||
}
|
}
|
||||||
if (Gender == 1) {
|
if (Gender == 1) {
|
||||||
LuclinFace = MakeRandomInt(0, 87);
|
LuclinFace = zone->random.Int(0, 87);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4: // WoodElf
|
case 4: // WoodElf
|
||||||
HairColor = MakeRandomInt(0, 19);
|
HairColor = zone->random.Int(0, 19);
|
||||||
if (Gender == 0) {
|
if (Gender == 0) {
|
||||||
HairStyle = MakeRandomInt(0, 3);
|
HairStyle = zone->random.Int(0, 3);
|
||||||
}
|
}
|
||||||
if (Gender == 1) {
|
if (Gender == 1) {
|
||||||
HairStyle = MakeRandomInt(0, 2);
|
HairStyle = zone->random.Int(0, 2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 5: // HighElf
|
case 5: // HighElf
|
||||||
HairColor = MakeRandomInt(0, 14);
|
HairColor = zone->random.Int(0, 14);
|
||||||
if (Gender == 0) {
|
if (Gender == 0) {
|
||||||
HairStyle = MakeRandomInt(0, 3);
|
HairStyle = zone->random.Int(0, 3);
|
||||||
LuclinFace = MakeRandomInt(0, 37);
|
LuclinFace = zone->random.Int(0, 37);
|
||||||
BeardColor = HairColor;
|
BeardColor = HairColor;
|
||||||
}
|
}
|
||||||
if (Gender == 1) {
|
if (Gender == 1) {
|
||||||
HairStyle = MakeRandomInt(0, 2);
|
HairStyle = zone->random.Int(0, 2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6: // DarkElf
|
case 6: // DarkElf
|
||||||
HairColor = MakeRandomInt(13, 18);
|
HairColor = zone->random.Int(13, 18);
|
||||||
if (Gender == 0) {
|
if (Gender == 0) {
|
||||||
HairStyle = MakeRandomInt(0, 3);
|
HairStyle = zone->random.Int(0, 3);
|
||||||
LuclinFace = MakeRandomInt(0, 37);
|
LuclinFace = zone->random.Int(0, 37);
|
||||||
BeardColor = HairColor;
|
BeardColor = HairColor;
|
||||||
}
|
}
|
||||||
if (Gender == 1) {
|
if (Gender == 1) {
|
||||||
HairStyle = MakeRandomInt(0, 2);
|
HairStyle = zone->random.Int(0, 2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7: // HalfElf
|
case 7: // HalfElf
|
||||||
HairColor = MakeRandomInt(0, 19);
|
HairColor = zone->random.Int(0, 19);
|
||||||
if (Gender == 0) {
|
if (Gender == 0) {
|
||||||
HairStyle = MakeRandomInt(0, 3);
|
HairStyle = zone->random.Int(0, 3);
|
||||||
LuclinFace = MakeRandomInt(0, 37);
|
LuclinFace = zone->random.Int(0, 37);
|
||||||
BeardColor = HairColor;
|
BeardColor = HairColor;
|
||||||
}
|
}
|
||||||
if (Gender == 1) {
|
if (Gender == 1) {
|
||||||
HairStyle = MakeRandomInt(0, 2);
|
HairStyle = zone->random.Int(0, 2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 8: // Dwarf
|
case 8: // Dwarf
|
||||||
HairColor = MakeRandomInt(0, 19);
|
HairColor = zone->random.Int(0, 19);
|
||||||
BeardColor = HairColor;
|
BeardColor = HairColor;
|
||||||
if (Gender == 0) {
|
if (Gender == 0) {
|
||||||
HairStyle = MakeRandomInt(0, 3);
|
HairStyle = zone->random.Int(0, 3);
|
||||||
Beard = MakeRandomInt(0, 5);
|
Beard = zone->random.Int(0, 5);
|
||||||
}
|
}
|
||||||
if (Gender == 1) {
|
if (Gender == 1) {
|
||||||
HairStyle = MakeRandomInt(0, 2);
|
HairStyle = zone->random.Int(0, 2);
|
||||||
LuclinFace = MakeRandomInt(0, 17);
|
LuclinFace = zone->random.Int(0, 17);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 9: // Troll
|
case 9: // Troll
|
||||||
EyeColor1 = MakeRandomInt(0, 10);
|
EyeColor1 = zone->random.Int(0, 10);
|
||||||
EyeColor2 = MakeRandomInt(0, 10);
|
EyeColor2 = zone->random.Int(0, 10);
|
||||||
if (Gender == 1) {
|
if (Gender == 1) {
|
||||||
HairStyle = MakeRandomInt(0, 3);
|
HairStyle = zone->random.Int(0, 3);
|
||||||
HairColor = MakeRandomInt(0, 23);
|
HairColor = zone->random.Int(0, 23);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 10: // Ogre
|
case 10: // Ogre
|
||||||
if (Gender == 1) {
|
if (Gender == 1) {
|
||||||
HairStyle = MakeRandomInt(0, 3);
|
HairStyle = zone->random.Int(0, 3);
|
||||||
HairColor = MakeRandomInt(0, 23);
|
HairColor = zone->random.Int(0, 23);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 11: // Halfling
|
case 11: // Halfling
|
||||||
HairColor = MakeRandomInt(0, 19);
|
HairColor = zone->random.Int(0, 19);
|
||||||
if (Gender == 0) {
|
if (Gender == 0) {
|
||||||
BeardColor = HairColor;
|
BeardColor = HairColor;
|
||||||
HairStyle = MakeRandomInt(0, 3);
|
HairStyle = zone->random.Int(0, 3);
|
||||||
Beard = MakeRandomInt(0, 5);
|
Beard = zone->random.Int(0, 5);
|
||||||
}
|
}
|
||||||
if (Gender == 1) {
|
if (Gender == 1) {
|
||||||
HairStyle = MakeRandomInt(0, 2);
|
HairStyle = zone->random.Int(0, 2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 12: // Gnome
|
case 12: // Gnome
|
||||||
HairColor = MakeRandomInt(0, 24);
|
HairColor = zone->random.Int(0, 24);
|
||||||
if (Gender == 0) {
|
if (Gender == 0) {
|
||||||
BeardColor = HairColor;
|
BeardColor = HairColor;
|
||||||
HairStyle = MakeRandomInt(0, 3);
|
HairStyle = zone->random.Int(0, 3);
|
||||||
Beard = MakeRandomInt(0, 5);
|
Beard = zone->random.Int(0, 5);
|
||||||
}
|
}
|
||||||
if (Gender == 1) {
|
if (Gender == 1) {
|
||||||
HairStyle = MakeRandomInt(0, 2);
|
HairStyle = zone->random.Int(0, 2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 128: // Iksar
|
case 128: // Iksar
|
||||||
case 130: // VahShir
|
case 130: // VahShir
|
||||||
break;
|
break;
|
||||||
case 330: // Froglok
|
case 330: // Froglok
|
||||||
LuclinFace = MakeRandomInt(0, 9);
|
LuclinFace = zone->random.Int(0, 9);
|
||||||
case 522: // Drakkin
|
case 522: // Drakkin
|
||||||
HairColor = MakeRandomInt(0, 3);
|
HairColor = zone->random.Int(0, 3);
|
||||||
BeardColor = HairColor;
|
BeardColor = HairColor;
|
||||||
EyeColor1 = MakeRandomInt(0, 11);
|
EyeColor1 = zone->random.Int(0, 11);
|
||||||
EyeColor2 = MakeRandomInt(0, 11);
|
EyeColor2 = zone->random.Int(0, 11);
|
||||||
LuclinFace = MakeRandomInt(0, 6);
|
LuclinFace = zone->random.Int(0, 6);
|
||||||
DrakkinHeritage = MakeRandomInt(0, 6);
|
DrakkinHeritage = zone->random.Int(0, 6);
|
||||||
DrakkinTattoo = MakeRandomInt(0, 7);
|
DrakkinTattoo = zone->random.Int(0, 7);
|
||||||
DrakkinDetails = MakeRandomInt(0, 7);
|
DrakkinDetails = zone->random.Int(0, 7);
|
||||||
if (Gender == 0) {
|
if (Gender == 0) {
|
||||||
Beard = MakeRandomInt(0, 12);
|
Beard = zone->random.Int(0, 12);
|
||||||
HairStyle = MakeRandomInt(0, 8);
|
HairStyle = zone->random.Int(0, 8);
|
||||||
}
|
}
|
||||||
if (Gender == 1) {
|
if (Gender == 1) {
|
||||||
Beard = MakeRandomInt(0, 3);
|
Beard = zone->random.Int(0, 3);
|
||||||
HairStyle = MakeRandomInt(0, 7);
|
HairStyle = zone->random.Int(0, 7);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -2591,7 +2591,7 @@ uint32 Mob::RandomTimer(int min,int max) {
|
|||||||
int r = 14000;
|
int r = 14000;
|
||||||
if(min != 0 && max != 0 && min < max)
|
if(min != 0 && max != 0 && min < max)
|
||||||
{
|
{
|
||||||
r = MakeRandomInt(min, max);
|
r = zone->random.Int(min, max);
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
@ -2988,7 +2988,7 @@ void Mob::ExecWeaponProc(const ItemInst *inst, uint16 spell_id, Mob *on) {
|
|||||||
if(IsClient())
|
if(IsClient())
|
||||||
twinproc_chance = CastToClient()->GetFocusEffect(focusTwincast, spell_id);
|
twinproc_chance = CastToClient()->GetFocusEffect(focusTwincast, spell_id);
|
||||||
|
|
||||||
if(twinproc_chance && (MakeRandomInt(0,99) < twinproc_chance))
|
if(twinproc_chance && zone->random.Roll(twinproc_chance))
|
||||||
twinproc = true;
|
twinproc = true;
|
||||||
|
|
||||||
if (IsBeneficialSpell(spell_id)) {
|
if (IsBeneficialSpell(spell_id)) {
|
||||||
@ -3333,7 +3333,7 @@ bool Mob::TrySpellTrigger(Mob *target, uint32 spell_id, int effect)
|
|||||||
{
|
{
|
||||||
if (spells[spell_id].effectid[i] == SE_SpellTrigger)
|
if (spells[spell_id].effectid[i] == SE_SpellTrigger)
|
||||||
{
|
{
|
||||||
if(MakeRandomInt(0, trig_chance) <= spells[spell_id].base[i])
|
if(zone->random.Int(0, trig_chance) <= spells[spell_id].base[i])
|
||||||
{
|
{
|
||||||
// If we trigger an effect then its over.
|
// If we trigger an effect then its over.
|
||||||
if (IsValidSpell(spells[spell_id].base2[i])){
|
if (IsValidSpell(spells[spell_id].base2[i])){
|
||||||
@ -3353,7 +3353,7 @@ bool Mob::TrySpellTrigger(Mob *target, uint32 spell_id, int effect)
|
|||||||
// if the chances don't add to 100, then each effect gets a chance to fire, chance for no trigger as well.
|
// if the chances don't add to 100, then each effect gets a chance to fire, chance for no trigger as well.
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(MakeRandomInt(0, 100) <= spells[spell_id].base[effect])
|
if(zone->random.Int(0, 100) <= spells[spell_id].base[effect])
|
||||||
{
|
{
|
||||||
if (IsValidSpell(spells[spell_id].base2[effect])){
|
if (IsValidSpell(spells[spell_id].base2[effect])){
|
||||||
SpellFinished(spells[spell_id].base2[effect], target, 10, 0, -1, spells[spells[spell_id].base2[effect]].ResistDiff);
|
SpellFinished(spells[spell_id].base2[effect], target, 10, 0, -1, spells[spells[spell_id].base2[effect]].ResistDiff);
|
||||||
@ -3458,7 +3458,7 @@ void Mob::TryTwincast(Mob *caster, Mob *target, uint32 spell_id)
|
|||||||
|
|
||||||
if (focus > 0)
|
if (focus > 0)
|
||||||
{
|
{
|
||||||
if(MakeRandomInt(0, 100) <= focus)
|
if(zone->random.Roll(focus))
|
||||||
{
|
{
|
||||||
Message(MT_Spells,"You twincast %s!",spells[spell_id].name);
|
Message(MT_Spells,"You twincast %s!",spells[spell_id].name);
|
||||||
SpellFinished(spell_id, target, 10, 0, -1, spells[spell_id].ResistDiff);
|
SpellFinished(spell_id, target, 10, 0, -1, spells[spell_id].ResistDiff);
|
||||||
@ -3477,7 +3477,7 @@ void Mob::TryTwincast(Mob *caster, Mob *target, uint32 spell_id)
|
|||||||
int32 focus = CalcFocusEffect(focusTwincast, buffs[i].spellid, spell_id);
|
int32 focus = CalcFocusEffect(focusTwincast, buffs[i].spellid, spell_id);
|
||||||
if(focus > 0)
|
if(focus > 0)
|
||||||
{
|
{
|
||||||
if(MakeRandomInt(0, 100) <= focus)
|
if(zone->random.Roll(focus))
|
||||||
{
|
{
|
||||||
SpellFinished(spell_id, target, 10, 0, -1, spells[spell_id].ResistDiff);
|
SpellFinished(spell_id, target, 10, 0, -1, spells[spell_id].ResistDiff);
|
||||||
}
|
}
|
||||||
@ -4258,7 +4258,7 @@ void Mob::TrySpellOnKill(uint8 level, uint16 spell_id)
|
|||||||
{
|
{
|
||||||
if (IsValidSpell(spells[spell_id].base2[i]) && spells[spell_id].max[i] <= level)
|
if (IsValidSpell(spells[spell_id].base2[i]) && spells[spell_id].max[i] <= level)
|
||||||
{
|
{
|
||||||
if(MakeRandomInt(0,99) < spells[spell_id].base[i])
|
if(zone->random.Roll(spells[spell_id].base[i]))
|
||||||
SpellFinished(spells[spell_id].base2[i], this, 10, 0, -1, spells[spells[spell_id].base2[i]].ResistDiff);
|
SpellFinished(spells[spell_id].base2[i], this, 10, 0, -1, spells[spells[spell_id].base2[i]].ResistDiff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4273,17 +4273,17 @@ void Mob::TrySpellOnKill(uint8 level, uint16 spell_id)
|
|||||||
for(int i = 0; i < MAX_SPELL_TRIGGER*3; i+=3) {
|
for(int i = 0; i < MAX_SPELL_TRIGGER*3; i+=3) {
|
||||||
|
|
||||||
if(aabonuses.SpellOnKill[i] && IsValidSpell(aabonuses.SpellOnKill[i]) && (level >= aabonuses.SpellOnKill[i + 2])) {
|
if(aabonuses.SpellOnKill[i] && IsValidSpell(aabonuses.SpellOnKill[i]) && (level >= aabonuses.SpellOnKill[i + 2])) {
|
||||||
if(MakeRandomInt(0, 99) < static_cast<int>(aabonuses.SpellOnKill[i + 1]))
|
if(zone->random.Roll(static_cast<int>(aabonuses.SpellOnKill[i + 1])))
|
||||||
SpellFinished(aabonuses.SpellOnKill[i], this, 10, 0, -1, spells[aabonuses.SpellOnKill[i]].ResistDiff);
|
SpellFinished(aabonuses.SpellOnKill[i], this, 10, 0, -1, spells[aabonuses.SpellOnKill[i]].ResistDiff);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(itembonuses.SpellOnKill[i] && IsValidSpell(itembonuses.SpellOnKill[i]) && (level >= itembonuses.SpellOnKill[i + 2])){
|
if(itembonuses.SpellOnKill[i] && IsValidSpell(itembonuses.SpellOnKill[i]) && (level >= itembonuses.SpellOnKill[i + 2])){
|
||||||
if(MakeRandomInt(0, 99) < static_cast<int>(itembonuses.SpellOnKill[i + 1]))
|
if(zone->random.Roll(static_cast<int>(itembonuses.SpellOnKill[i + 1])))
|
||||||
SpellFinished(itembonuses.SpellOnKill[i], this, 10, 0, -1, spells[aabonuses.SpellOnKill[i]].ResistDiff);
|
SpellFinished(itembonuses.SpellOnKill[i], this, 10, 0, -1, spells[aabonuses.SpellOnKill[i]].ResistDiff);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(spellbonuses.SpellOnKill[i] && IsValidSpell(spellbonuses.SpellOnKill[i]) && (level >= spellbonuses.SpellOnKill[i + 2])) {
|
if(spellbonuses.SpellOnKill[i] && IsValidSpell(spellbonuses.SpellOnKill[i]) && (level >= spellbonuses.SpellOnKill[i + 2])) {
|
||||||
if(MakeRandomInt(0, 99) < static_cast<int>(spellbonuses.SpellOnKill[i + 1]))
|
if(zone->random.Roll(static_cast<int>(spellbonuses.SpellOnKill[i + 1])))
|
||||||
SpellFinished(spellbonuses.SpellOnKill[i], this, 10, 0, -1, spells[aabonuses.SpellOnKill[i]].ResistDiff);
|
SpellFinished(spellbonuses.SpellOnKill[i], this, 10, 0, -1, spells[aabonuses.SpellOnKill[i]].ResistDiff);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4300,19 +4300,19 @@ bool Mob::TrySpellOnDeath()
|
|||||||
|
|
||||||
for(int i = 0; i < MAX_SPELL_TRIGGER*2; i+=2) {
|
for(int i = 0; i < MAX_SPELL_TRIGGER*2; i+=2) {
|
||||||
if(IsClient() && aabonuses.SpellOnDeath[i] && IsValidSpell(aabonuses.SpellOnDeath[i])) {
|
if(IsClient() && aabonuses.SpellOnDeath[i] && IsValidSpell(aabonuses.SpellOnDeath[i])) {
|
||||||
if(MakeRandomInt(0, 99) < static_cast<int>(aabonuses.SpellOnDeath[i + 1])) {
|
if(zone->random.Roll(static_cast<int>(aabonuses.SpellOnDeath[i + 1]))) {
|
||||||
SpellFinished(aabonuses.SpellOnDeath[i], this, 10, 0, -1, spells[aabonuses.SpellOnDeath[i]].ResistDiff);
|
SpellFinished(aabonuses.SpellOnDeath[i], this, 10, 0, -1, spells[aabonuses.SpellOnDeath[i]].ResistDiff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(itembonuses.SpellOnDeath[i] && IsValidSpell(itembonuses.SpellOnDeath[i])) {
|
if(itembonuses.SpellOnDeath[i] && IsValidSpell(itembonuses.SpellOnDeath[i])) {
|
||||||
if(MakeRandomInt(0, 99) < static_cast<int>(itembonuses.SpellOnDeath[i + 1])) {
|
if(zone->random.Roll(static_cast<int>(itembonuses.SpellOnDeath[i + 1]))) {
|
||||||
SpellFinished(itembonuses.SpellOnDeath[i], this, 10, 0, -1, spells[itembonuses.SpellOnDeath[i]].ResistDiff);
|
SpellFinished(itembonuses.SpellOnDeath[i], this, 10, 0, -1, spells[itembonuses.SpellOnDeath[i]].ResistDiff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(spellbonuses.SpellOnDeath[i] && IsValidSpell(spellbonuses.SpellOnDeath[i])) {
|
if(spellbonuses.SpellOnDeath[i] && IsValidSpell(spellbonuses.SpellOnDeath[i])) {
|
||||||
if(MakeRandomInt(0, 99) < static_cast<int>(spellbonuses.SpellOnDeath[i + 1])) {
|
if(zone->random.Roll(static_cast<int>(spellbonuses.SpellOnDeath[i + 1]))) {
|
||||||
SpellFinished(spellbonuses.SpellOnDeath[i], this, 10, 0, -1, spells[spellbonuses.SpellOnDeath[i]].ResistDiff);
|
SpellFinished(spellbonuses.SpellOnDeath[i], this, 10, 0, -1, spells[spellbonuses.SpellOnDeath[i]].ResistDiff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4475,7 +4475,7 @@ bool Mob::TryReflectSpell(uint32 spell_id)
|
|||||||
|
|
||||||
int chance = itembonuses.reflect_chance + spellbonuses.reflect_chance + aabonuses.reflect_chance;
|
int chance = itembonuses.reflect_chance + spellbonuses.reflect_chance + aabonuses.reflect_chance;
|
||||||
|
|
||||||
if(chance && MakeRandomInt(0, 99) < chance)
|
if(chance && zone->random.Roll(chance))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -737,6 +737,7 @@ public:
|
|||||||
void ProjectileAttack();
|
void ProjectileAttack();
|
||||||
inline bool HasProjectileAttack() const { return ActiveProjectileATK; }
|
inline bool HasProjectileAttack() const { return ActiveProjectileATK; }
|
||||||
inline void SetProjectileAttack(bool value) { ActiveProjectileATK = value; }
|
inline void SetProjectileAttack(bool value) { ActiveProjectileATK = value; }
|
||||||
|
float GetRangeDistTargetSizeMod(Mob* other);
|
||||||
bool CanDoSpecialAttack(Mob *other);
|
bool CanDoSpecialAttack(Mob *other);
|
||||||
bool Flurry(ExtraAttackOptions *opts);
|
bool Flurry(ExtraAttackOptions *opts);
|
||||||
bool Rampage(ExtraAttackOptions *opts);
|
bool Rampage(ExtraAttackOptions *opts);
|
||||||
|
|||||||
@ -59,7 +59,7 @@ bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (iChance < 100) {
|
if (iChance < 100) {
|
||||||
if (MakeRandomInt(0, 100) >= iChance)
|
if (zone->random.Int(0, 100) >= iChance)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
|||||||
dist2 <= spells[AIspells[i].spellid].range*spells[AIspells[i].spellid].range
|
dist2 <= spells[AIspells[i].spellid].range*spells[AIspells[i].spellid].range
|
||||||
)
|
)
|
||||||
&& (mana_cost <= GetMana() || GetMana() == GetMaxMana())
|
&& (mana_cost <= GetMana() || GetMana() == GetMaxMana())
|
||||||
&& (AIspells[i].time_cancast + (MakeRandomInt(0, 4) * 1000)) <= Timer::GetCurrentTime() //break up the spelling casting over a period of time.
|
&& (AIspells[i].time_cancast + (zone->random.Int(0, 4) * 1000)) <= Timer::GetCurrentTime() //break up the spelling casting over a period of time.
|
||||||
) {
|
) {
|
||||||
|
|
||||||
#if MobAI_DEBUG_Spells >= 21
|
#if MobAI_DEBUG_Spells >= 21
|
||||||
@ -128,7 +128,7 @@ bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
|||||||
}
|
}
|
||||||
case SpellType_Root: {
|
case SpellType_Root: {
|
||||||
Mob *rootee = GetHateRandom();
|
Mob *rootee = GetHateRandom();
|
||||||
if (rootee && !rootee->IsRooted() && MakeRandomInt(0, 99) < 50
|
if (rootee && !rootee->IsRooted() && zone->random.Roll(50)
|
||||||
&& rootee->DontRootMeBefore() < Timer::GetCurrentTime()
|
&& rootee->DontRootMeBefore() < Timer::GetCurrentTime()
|
||||||
&& rootee->CanBuffStack(AIspells[i].spellid, GetLevel(), true) >= 0
|
&& rootee->CanBuffStack(AIspells[i].spellid, GetLevel(), true) >= 0
|
||||||
) {
|
) {
|
||||||
@ -167,7 +167,7 @@ bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case SpellType_InCombatBuff: {
|
case SpellType_InCombatBuff: {
|
||||||
if(MakeRandomInt(0, 99) < 50)
|
if(zone->random.Roll(50))
|
||||||
{
|
{
|
||||||
AIDoSpellCast(i, tar, mana_cost);
|
AIDoSpellCast(i, tar, mana_cost);
|
||||||
return true;
|
return true;
|
||||||
@ -186,7 +186,7 @@ bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
|||||||
case SpellType_Slow:
|
case SpellType_Slow:
|
||||||
case SpellType_Debuff: {
|
case SpellType_Debuff: {
|
||||||
Mob * debuffee = GetHateRandom();
|
Mob * debuffee = GetHateRandom();
|
||||||
if (debuffee && manaR >= 10 && MakeRandomInt(0, 99 < 70) &&
|
if (debuffee && manaR >= 10 && zone->random.Roll(70) &&
|
||||||
debuffee->CanBuffStack(AIspells[i].spellid, GetLevel(), true) >= 0) {
|
debuffee->CanBuffStack(AIspells[i].spellid, GetLevel(), true) >= 0) {
|
||||||
if (!checked_los) {
|
if (!checked_los) {
|
||||||
if (!CheckLosFN(debuffee))
|
if (!CheckLosFN(debuffee))
|
||||||
@ -200,7 +200,7 @@ bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
|||||||
}
|
}
|
||||||
case SpellType_Nuke: {
|
case SpellType_Nuke: {
|
||||||
if (
|
if (
|
||||||
manaR >= 10 && MakeRandomInt(0, 99) < 70
|
manaR >= 10 && zone->random.Roll(70)
|
||||||
&& tar->CanBuffStack(AIspells[i].spellid, GetLevel(), true) >= 0
|
&& tar->CanBuffStack(AIspells[i].spellid, GetLevel(), true) >= 0
|
||||||
) {
|
) {
|
||||||
if(!checked_los) {
|
if(!checked_los) {
|
||||||
@ -214,7 +214,7 @@ bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SpellType_Dispel: {
|
case SpellType_Dispel: {
|
||||||
if(MakeRandomInt(0, 99) < 15)
|
if(zone->random.Roll(15))
|
||||||
{
|
{
|
||||||
if(!checked_los) {
|
if(!checked_los) {
|
||||||
if(!CheckLosFN(tar))
|
if(!CheckLosFN(tar))
|
||||||
@ -230,7 +230,7 @@ bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SpellType_Mez: {
|
case SpellType_Mez: {
|
||||||
if(MakeRandomInt(0, 99) < 20)
|
if(zone->random.Roll(20))
|
||||||
{
|
{
|
||||||
Mob * mezTar = nullptr;
|
Mob * mezTar = nullptr;
|
||||||
mezTar = entity_list.GetTargetForMez(this);
|
mezTar = entity_list.GetTargetForMez(this);
|
||||||
@ -246,7 +246,7 @@ bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
|||||||
|
|
||||||
case SpellType_Charm:
|
case SpellType_Charm:
|
||||||
{
|
{
|
||||||
if(!IsPet() && MakeRandomInt(0, 99) < 20)
|
if(!IsPet() && zone->random.Roll(20))
|
||||||
{
|
{
|
||||||
Mob * chrmTar = GetHateRandom();
|
Mob * chrmTar = GetHateRandom();
|
||||||
if(chrmTar && chrmTar->CanBuffStack(AIspells[i].spellid, GetLevel(), true) >= 0)
|
if(chrmTar && chrmTar->CanBuffStack(AIspells[i].spellid, GetLevel(), true) >= 0)
|
||||||
@ -260,7 +260,7 @@ bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
|||||||
|
|
||||||
case SpellType_Pet: {
|
case SpellType_Pet: {
|
||||||
//keep mobs from recasting pets when they have them.
|
//keep mobs from recasting pets when they have them.
|
||||||
if (!IsPet() && !GetPetID() && MakeRandomInt(0, 99) < 25) {
|
if (!IsPet() && !GetPetID() && zone->random.Roll(25)) {
|
||||||
AIDoSpellCast(i, tar, mana_cost);
|
AIDoSpellCast(i, tar, mana_cost);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -268,7 +268,7 @@ bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
|||||||
}
|
}
|
||||||
case SpellType_Lifetap: {
|
case SpellType_Lifetap: {
|
||||||
if (GetHPRatio() <= 95
|
if (GetHPRatio() <= 95
|
||||||
&& MakeRandomInt(0, 99) < 50
|
&& zone->random.Roll(50)
|
||||||
&& tar->CanBuffStack(AIspells[i].spellid, GetLevel(), true) >= 0
|
&& tar->CanBuffStack(AIspells[i].spellid, GetLevel(), true) >= 0
|
||||||
) {
|
) {
|
||||||
if(!checked_los) {
|
if(!checked_los) {
|
||||||
@ -284,7 +284,7 @@ bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
|||||||
case SpellType_Snare: {
|
case SpellType_Snare: {
|
||||||
if (
|
if (
|
||||||
!tar->IsRooted()
|
!tar->IsRooted()
|
||||||
&& MakeRandomInt(0, 99) < 50
|
&& zone->random.Roll(50)
|
||||||
&& tar->DontSnareMeBefore() < Timer::GetCurrentTime()
|
&& tar->DontSnareMeBefore() < Timer::GetCurrentTime()
|
||||||
&& tar->CanBuffStack(AIspells[i].spellid, GetLevel(), true) >= 0
|
&& tar->CanBuffStack(AIspells[i].spellid, GetLevel(), true) >= 0
|
||||||
) {
|
) {
|
||||||
@ -302,7 +302,7 @@ bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
|||||||
}
|
}
|
||||||
case SpellType_DOT: {
|
case SpellType_DOT: {
|
||||||
if (
|
if (
|
||||||
MakeRandomInt(0, 99) < 60
|
zone->random.Roll(60)
|
||||||
&& tar->DontDotMeBefore() < Timer::GetCurrentTime()
|
&& tar->DontDotMeBefore() < Timer::GetCurrentTime()
|
||||||
&& tar->CanBuffStack(AIspells[i].spellid, GetLevel(), true) >= 0
|
&& tar->CanBuffStack(AIspells[i].spellid, GetLevel(), true) >= 0
|
||||||
) {
|
) {
|
||||||
@ -371,7 +371,7 @@ bool EntityList::AICheckCloseBeneficialSpells(NPC* caster, uint8 iChance, float
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (iChance < 100) {
|
if (iChance < 100) {
|
||||||
uint8 tmp = MakeRandomInt(0, 99);
|
uint8 tmp = zone->random.Int(0, 99);
|
||||||
if (tmp >= iChance)
|
if (tmp >= iChance)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -689,7 +689,7 @@ void Client::AI_SpellCast()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
uint32 idx = MakeRandomInt(0, (valid_spells.size()-1));
|
uint32 idx = zone->random.Int(0, (valid_spells.size()-1));
|
||||||
spell_to_cast = valid_spells[idx];
|
spell_to_cast = valid_spells[idx];
|
||||||
slot_to_use = slots[idx];
|
slot_to_use = slots[idx];
|
||||||
}
|
}
|
||||||
@ -877,7 +877,7 @@ void Client::AI_Process()
|
|||||||
|
|
||||||
if (flurrychance)
|
if (flurrychance)
|
||||||
{
|
{
|
||||||
if(MakeRandomInt(0, 100) < flurrychance)
|
if(zone->random.Roll(flurrychance))
|
||||||
{
|
{
|
||||||
Message_StringID(MT_NPCFlurry, YOU_FLURRY);
|
Message_StringID(MT_NPCFlurry, YOU_FLURRY);
|
||||||
Attack(GetTarget(), MainPrimary, false);
|
Attack(GetTarget(), MainPrimary, false);
|
||||||
@ -894,7 +894,7 @@ void Client::AI_Process()
|
|||||||
wpn->GetItem()->ItemType == ItemType2HBlunt ||
|
wpn->GetItem()->ItemType == ItemType2HBlunt ||
|
||||||
wpn->GetItem()->ItemType == ItemType2HPiercing )
|
wpn->GetItem()->ItemType == ItemType2HPiercing )
|
||||||
{
|
{
|
||||||
if(MakeRandomInt(0, 100) < ExtraAttackChanceBonus)
|
if(zone->random.Roll(ExtraAttackChanceBonus))
|
||||||
{
|
{
|
||||||
Attack(GetTarget(), MainPrimary, false);
|
Attack(GetTarget(), MainPrimary, false);
|
||||||
}
|
}
|
||||||
@ -933,7 +933,7 @@ void Client::AI_Process()
|
|||||||
int16 DWBonus = spellbonuses.DualWieldChance + itembonuses.DualWieldChance;
|
int16 DWBonus = spellbonuses.DualWieldChance + itembonuses.DualWieldChance;
|
||||||
DualWieldProbability += DualWieldProbability*float(DWBonus)/ 100.0f;
|
DualWieldProbability += DualWieldProbability*float(DWBonus)/ 100.0f;
|
||||||
|
|
||||||
if(MakeRandomFloat(0.0, 1.0) < DualWieldProbability)
|
if(zone->random.Roll(DualWieldProbability))
|
||||||
{
|
{
|
||||||
Attack(GetTarget(), MainSecondary);
|
Attack(GetTarget(), MainSecondary);
|
||||||
if(CheckDoubleAttack())
|
if(CheckDoubleAttack())
|
||||||
@ -1193,7 +1193,7 @@ void Mob::AI_Process() {
|
|||||||
//we use this random value in three comparisons with different
|
//we use this random value in three comparisons with different
|
||||||
//thresholds, and if its truely random, then this should work
|
//thresholds, and if its truely random, then this should work
|
||||||
//out reasonably and will save us compute resources.
|
//out reasonably and will save us compute resources.
|
||||||
int32 RandRoll = MakeRandomInt(0, 99);
|
int32 RandRoll = zone->random.Int(0, 99);
|
||||||
if ((CanThisClassDoubleAttack() || GetSpecialAbility(SPECATK_TRIPLE)
|
if ((CanThisClassDoubleAttack() || GetSpecialAbility(SPECATK_TRIPLE)
|
||||||
|| GetSpecialAbility(SPECATK_QUAD))
|
|| GetSpecialAbility(SPECATK_QUAD))
|
||||||
//check double attack, this is NOT the same rules that clients use...
|
//check double attack, this is NOT the same rules that clients use...
|
||||||
@ -1217,7 +1217,7 @@ void Mob::AI_Process() {
|
|||||||
int flurry_chance = GetSpecialAbilityParam(SPECATK_FLURRY, 0);
|
int flurry_chance = GetSpecialAbilityParam(SPECATK_FLURRY, 0);
|
||||||
flurry_chance = flurry_chance > 0 ? flurry_chance : RuleI(Combat, NPCFlurryChance);
|
flurry_chance = flurry_chance > 0 ? flurry_chance : RuleI(Combat, NPCFlurryChance);
|
||||||
|
|
||||||
if (MakeRandomInt(0, 99) < flurry_chance) {
|
if (zone->random.Roll(flurry_chance)) {
|
||||||
ExtraAttackOptions opts;
|
ExtraAttackOptions opts;
|
||||||
int cur = GetSpecialAbilityParam(SPECATK_FLURRY, 2);
|
int cur = GetSpecialAbilityParam(SPECATK_FLURRY, 2);
|
||||||
if (cur > 0)
|
if (cur > 0)
|
||||||
@ -1259,7 +1259,7 @@ void Mob::AI_Process() {
|
|||||||
int16 flurry_chance = owner->aabonuses.PetFlurry +
|
int16 flurry_chance = owner->aabonuses.PetFlurry +
|
||||||
owner->spellbonuses.PetFlurry + owner->itembonuses.PetFlurry;
|
owner->spellbonuses.PetFlurry + owner->itembonuses.PetFlurry;
|
||||||
|
|
||||||
if (flurry_chance && (MakeRandomInt(0, 99) < flurry_chance))
|
if (flurry_chance && zone->random.Roll(flurry_chance))
|
||||||
Flurry(nullptr);
|
Flurry(nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1268,7 +1268,7 @@ void Mob::AI_Process() {
|
|||||||
{
|
{
|
||||||
int rampage_chance = GetSpecialAbilityParam(SPECATK_RAMPAGE, 0);
|
int rampage_chance = GetSpecialAbilityParam(SPECATK_RAMPAGE, 0);
|
||||||
rampage_chance = rampage_chance > 0 ? rampage_chance : 20;
|
rampage_chance = rampage_chance > 0 ? rampage_chance : 20;
|
||||||
if(MakeRandomInt(0, 99) < rampage_chance) {
|
if(zone->random.Roll(rampage_chance)) {
|
||||||
ExtraAttackOptions opts;
|
ExtraAttackOptions opts;
|
||||||
int cur = GetSpecialAbilityParam(SPECATK_RAMPAGE, 2);
|
int cur = GetSpecialAbilityParam(SPECATK_RAMPAGE, 2);
|
||||||
if(cur > 0) {
|
if(cur > 0) {
|
||||||
@ -1307,7 +1307,7 @@ void Mob::AI_Process() {
|
|||||||
{
|
{
|
||||||
int rampage_chance = GetSpecialAbilityParam(SPECATK_AREA_RAMPAGE, 0);
|
int rampage_chance = GetSpecialAbilityParam(SPECATK_AREA_RAMPAGE, 0);
|
||||||
rampage_chance = rampage_chance > 0 ? rampage_chance : 20;
|
rampage_chance = rampage_chance > 0 ? rampage_chance : 20;
|
||||||
if(MakeRandomInt(0, 99) < rampage_chance) {
|
if(zone->random.Roll(rampage_chance)) {
|
||||||
ExtraAttackOptions opts;
|
ExtraAttackOptions opts;
|
||||||
int cur = GetSpecialAbilityParam(SPECATK_AREA_RAMPAGE, 2);
|
int cur = GetSpecialAbilityParam(SPECATK_AREA_RAMPAGE, 2);
|
||||||
if(cur > 0) {
|
if(cur > 0) {
|
||||||
@ -1351,13 +1351,12 @@ void Mob::AI_Process() {
|
|||||||
//can only dual wield without a weapon if your a monk
|
//can only dual wield without a weapon if your a monk
|
||||||
if(GetSpecialAbility(SPECATK_INNATE_DW) || (GetEquipment(MaterialSecondary) != 0 && GetLevel() > 29) || myclass == MONK || myclass == MONKGM) {
|
if(GetSpecialAbility(SPECATK_INNATE_DW) || (GetEquipment(MaterialSecondary) != 0 && GetLevel() > 29) || myclass == MONK || myclass == MONKGM) {
|
||||||
float DualWieldProbability = (GetSkill(SkillDualWield) + GetLevel()) / 400.0f;
|
float DualWieldProbability = (GetSkill(SkillDualWield) + GetLevel()) / 400.0f;
|
||||||
if(MakeRandomFloat(0.0, 1.0) < DualWieldProbability)
|
if(zone->random.Roll(DualWieldProbability))
|
||||||
{
|
{
|
||||||
Attack(target, MainSecondary);
|
Attack(target, MainSecondary);
|
||||||
if (CanThisClassDoubleAttack())
|
if (CanThisClassDoubleAttack())
|
||||||
{
|
{
|
||||||
int32 RandRoll = MakeRandomInt(0, 99);
|
if (zone->random.Roll(GetLevel() + 20))
|
||||||
if (RandRoll < (GetLevel() + 20))
|
|
||||||
{
|
{
|
||||||
Attack(target, MainSecondary);
|
Attack(target, MainSecondary);
|
||||||
}
|
}
|
||||||
@ -1621,12 +1620,12 @@ void NPC::AI_DoMovement() {
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
float movedist = roambox_distance*roambox_distance;
|
float movedist = roambox_distance*roambox_distance;
|
||||||
float movex = MakeRandomFloat(0, movedist);
|
float movex = zone->random.Real(0, movedist);
|
||||||
float movey = movedist - movex;
|
float movey = movedist - movex;
|
||||||
movex = sqrtf(movex);
|
movex = sqrtf(movex);
|
||||||
movey = sqrtf(movey);
|
movey = sqrtf(movey);
|
||||||
movex *= MakeRandomInt(0, 1) ? 1 : -1;
|
movex *= zone->random.Int(0, 1) ? 1 : -1;
|
||||||
movey *= MakeRandomInt(0, 1) ? 1 : -1;
|
movey *= zone->random.Int(0, 1) ? 1 : -1;
|
||||||
roambox_movingto_x = GetX() + movex;
|
roambox_movingto_x = GetX() + movex;
|
||||||
roambox_movingto_y = GetY() + movey;
|
roambox_movingto_y = GetY() + movey;
|
||||||
//Try to calculate new coord using distance.
|
//Try to calculate new coord using distance.
|
||||||
@ -1637,9 +1636,9 @@ void NPC::AI_DoMovement() {
|
|||||||
//New coord is still invalid, ignore distance and just pick a new random coord.
|
//New coord is still invalid, ignore distance and just pick a new random coord.
|
||||||
//If we're here we may have a roambox where one side is shorter than the specified distance. Commons, Wkarana, etc.
|
//If we're here we may have a roambox where one side is shorter than the specified distance. Commons, Wkarana, etc.
|
||||||
if (roambox_movingto_x > roambox_max_x || roambox_movingto_x < roambox_min_x)
|
if (roambox_movingto_x > roambox_max_x || roambox_movingto_x < roambox_min_x)
|
||||||
roambox_movingto_x = MakeRandomFloat(roambox_min_x+1,roambox_max_x-1);
|
roambox_movingto_x = zone->random.Real(roambox_min_x+1,roambox_max_x-1);
|
||||||
if (roambox_movingto_y > roambox_max_y || roambox_movingto_y < roambox_min_y)
|
if (roambox_movingto_y > roambox_max_y || roambox_movingto_y < roambox_min_y)
|
||||||
roambox_movingto_y = MakeRandomFloat(roambox_min_y+1,roambox_max_y-1);
|
roambox_movingto_y = zone->random.Real(roambox_min_y+1,roambox_max_y-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
mlog(AI__WAYPOINTS, "Roam Box: d=%.3f (%.3f->%.3f,%.3f->%.3f): Go To (%.3f,%.3f)",
|
mlog(AI__WAYPOINTS, "Roam Box: d=%.3f (%.3f->%.3f,%.3f->%.3f): Go To (%.3f,%.3f)",
|
||||||
@ -1890,7 +1889,7 @@ void Mob::AI_Event_NoLongerEngaged() {
|
|||||||
if (minLastFightingDelayMoving == maxLastFightingDelayMoving)
|
if (minLastFightingDelayMoving == maxLastFightingDelayMoving)
|
||||||
pLastFightingDelayMoving += minLastFightingDelayMoving;
|
pLastFightingDelayMoving += minLastFightingDelayMoving;
|
||||||
else
|
else
|
||||||
pLastFightingDelayMoving += MakeRandomInt(minLastFightingDelayMoving, maxLastFightingDelayMoving);
|
pLastFightingDelayMoving += zone->random.Int(minLastFightingDelayMoving, maxLastFightingDelayMoving);
|
||||||
// So mobs don't keep running as a ghost until AIwalking_timer fires
|
// So mobs don't keep running as a ghost until AIwalking_timer fires
|
||||||
// if they were moving prior to losing all hate
|
// if they were moving prior to losing all hate
|
||||||
if(IsMoving()){
|
if(IsMoving()){
|
||||||
|
|||||||
22
zone/npc.cpp
22
zone/npc.cpp
@ -293,7 +293,7 @@ NPC::NPC(const NPCType* d, Spawn2* in_respawn, float x, float y, float z, float
|
|||||||
if(trap_list.size() > 0)
|
if(trap_list.size() > 0)
|
||||||
{
|
{
|
||||||
std::list<LDoNTrapTemplate*>::iterator trap_list_iter = trap_list.begin();
|
std::list<LDoNTrapTemplate*>::iterator trap_list_iter = trap_list.begin();
|
||||||
std::advance(trap_list_iter, MakeRandomInt(0, trap_list.size() - 1));
|
std::advance(trap_list_iter, zone->random.Int(0, trap_list.size() - 1));
|
||||||
LDoNTrapTemplate* tt = (*trap_list_iter);
|
LDoNTrapTemplate* tt = (*trap_list_iter);
|
||||||
if(tt)
|
if(tt)
|
||||||
{
|
{
|
||||||
@ -550,10 +550,10 @@ void NPC::AddCash(uint16 in_copper, uint16 in_silver, uint16 in_gold, uint16 in_
|
|||||||
}
|
}
|
||||||
|
|
||||||
void NPC::AddCash() {
|
void NPC::AddCash() {
|
||||||
copper = MakeRandomInt(1, 100);
|
copper = zone->random.Int(1, 100);
|
||||||
silver = MakeRandomInt(1, 50);
|
silver = zone->random.Int(1, 50);
|
||||||
gold = MakeRandomInt(1, 10);
|
gold = zone->random.Int(1, 10);
|
||||||
platinum = MakeRandomInt(1, 5);
|
platinum = zone->random.Int(1, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NPC::RemoveCash() {
|
void NPC::RemoveCash() {
|
||||||
@ -1372,7 +1372,7 @@ void NPC::PickPocket(Client* thief) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(MakeRandomInt(0, 100) > 95){
|
if(zone->random.Roll(5)) {
|
||||||
AddToHateList(thief, 50);
|
AddToHateList(thief, 50);
|
||||||
Say("Stop thief!");
|
Say("Stop thief!");
|
||||||
thief->Message(13, "You are noticed trying to steal!");
|
thief->Message(13, "You are noticed trying to steal!");
|
||||||
@ -1401,7 +1401,7 @@ void NPC::PickPocket(Client* thief) {
|
|||||||
memset(charges,0,50);
|
memset(charges,0,50);
|
||||||
//Determine wheter to steal money or an item.
|
//Determine wheter to steal money or an item.
|
||||||
bool no_coin = ((money[0] + money[1] + money[2] + money[3]) == 0);
|
bool no_coin = ((money[0] + money[1] + money[2] + money[3]) == 0);
|
||||||
bool steal_item = (MakeRandomInt(0, 99) < 50 || no_coin);
|
bool steal_item = (zone->random.Roll(50) || no_coin);
|
||||||
if (steal_item)
|
if (steal_item)
|
||||||
{
|
{
|
||||||
ItemList::iterator cur,end;
|
ItemList::iterator cur,end;
|
||||||
@ -1431,7 +1431,7 @@ void NPC::PickPocket(Client* thief) {
|
|||||||
}
|
}
|
||||||
if (x > 0)
|
if (x > 0)
|
||||||
{
|
{
|
||||||
int random = MakeRandomInt(0, x-1);
|
int random = zone->random.Int(0, x-1);
|
||||||
inst = database.CreateItem(steal_items[random], charges[random]);
|
inst = database.CreateItem(steal_items[random], charges[random]);
|
||||||
if (inst)
|
if (inst)
|
||||||
{
|
{
|
||||||
@ -1466,7 +1466,7 @@ void NPC::PickPocket(Client* thief) {
|
|||||||
}
|
}
|
||||||
if (!steal_item) //Steal money
|
if (!steal_item) //Steal money
|
||||||
{
|
{
|
||||||
uint32 amt = MakeRandomInt(1, (steal_skill/25)+1);
|
uint32 amt = zone->random.Int(1, (steal_skill/25)+1);
|
||||||
int steal_type = 0;
|
int steal_type = 0;
|
||||||
if (!money[0])
|
if (!money[0])
|
||||||
{
|
{
|
||||||
@ -1481,7 +1481,7 @@ void NPC::PickPocket(Client* thief) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MakeRandomInt(0, 100) <= stealchance)
|
if (zone->random.Roll(stealchance))
|
||||||
{
|
{
|
||||||
switch (steal_type)
|
switch (steal_type)
|
||||||
{
|
{
|
||||||
@ -1962,7 +1962,7 @@ void NPC::ModifyNPCStat(const char *identifier, const char *newValue)
|
|||||||
|
|
||||||
void NPC::LevelScale() {
|
void NPC::LevelScale() {
|
||||||
|
|
||||||
uint8 random_level = (MakeRandomInt(level, maxlevel));
|
uint8 random_level = (zone->random.Int(level, maxlevel));
|
||||||
|
|
||||||
float scaling = (((random_level / (float)level) - 1) * (scalerate / 100.0f));
|
float scaling = (((random_level / (float)level) - 1) * (scalerate / 100.0f));
|
||||||
|
|
||||||
|
|||||||
@ -441,8 +441,8 @@ void Object::RandomSpawn(bool send_packet) {
|
|||||||
if(!m_ground_spawn)
|
if(!m_ground_spawn)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_data.x = MakeRandomFloat(m_min_x, m_max_x);
|
m_data.x = zone->random.Real(m_min_x, m_max_x);
|
||||||
m_data.y = MakeRandomFloat(m_min_y, m_max_y);
|
m_data.y = zone->random.Real(m_min_y, m_max_y);
|
||||||
respawn_timer.Disable();
|
respawn_timer.Disable();
|
||||||
|
|
||||||
if(send_packet) {
|
if(send_packet) {
|
||||||
|
|||||||
@ -1344,7 +1344,7 @@ PathNode* PathManager::FindPathNodeByCoordinates(float x, float y, float z)
|
|||||||
|
|
||||||
int PathManager::GetRandomPathNode()
|
int PathManager::GetRandomPathNode()
|
||||||
{
|
{
|
||||||
return MakeRandomInt(0, Head.PathNodeCount - 1);
|
return zone->random.Int(0, Head.PathNodeCount - 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -109,7 +109,7 @@ const char *GetRandPetName()
|
|||||||
"Zibann","Zibarer","Zibartik","Zibekn","Zibn","Zibobn","Zobaner","Zobann",
|
"Zibann","Zibarer","Zibartik","Zibekn","Zibn","Zibobn","Zobaner","Zobann",
|
||||||
"Zobarn","Zober","Zobn","Zonanab","Zonaner","Zonann","Zonantik","Zonarer",
|
"Zobarn","Zober","Zobn","Zonanab","Zonaner","Zonann","Zonantik","Zonarer",
|
||||||
"Zonartik","Zonobn","Zonobtik","Zontik","Ztik" };
|
"Zonartik","Zonobn","Zonobtik","Zontik","Ztik" };
|
||||||
int r = MakeRandomInt(0, (sizeof(petnames)/sizeof(const char *))-1);
|
int r = zone->random.Int(0, (sizeof(petnames)/sizeof(const char *))-1);
|
||||||
printf("Pet being created: %s\n",petnames[r]); // DO NOT COMMENT THIS OUT!
|
printf("Pet being created: %s\n",petnames[r]); // DO NOT COMMENT THIS OUT!
|
||||||
return petnames[r];
|
return petnames[r];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2658,14 +2658,16 @@ const char* QuestManager::saylink(char* Phrase, bool silent, const char* LinkNam
|
|||||||
char linktext[250];
|
char linktext[250];
|
||||||
|
|
||||||
if (initiator) {
|
if (initiator) {
|
||||||
if (initiator->GetClientVersion() >= EQClientRoF)
|
if (initiator->GetClientVersion() >= EQClientRoF2)
|
||||||
|
sprintf(linktext, "%c%06X%s%s%c", 0x12, sayid, "00000000000000000000000000000000000000000000000000", LinkName, 0x12);
|
||||||
|
else if (initiator->GetClientVersion() >= EQClientRoF)
|
||||||
sprintf(linktext, "%c%06X%s%s%c", 0x12, sayid, "0000000000000000000000000000000000000000000000000", LinkName, 0x12);
|
sprintf(linktext, "%c%06X%s%s%c", 0x12, sayid, "0000000000000000000000000000000000000000000000000", LinkName, 0x12);
|
||||||
else if (initiator->GetClientVersion() >= EQClientSoF)
|
else if (initiator->GetClientVersion() >= EQClientSoF)
|
||||||
sprintf(linktext, "%c%06X%s%s%c", 0x12, sayid, "00000000000000000000000000000000000000000000", LinkName, 0x12);
|
sprintf(linktext, "%c%06X%s%s%c", 0x12, sayid, "00000000000000000000000000000000000000000000", LinkName, 0x12);
|
||||||
else
|
else
|
||||||
sprintf(linktext, "%c%06X%s%s%c", 0x12, sayid, "000000000000000000000000000000000000000", LinkName, 0x12);
|
sprintf(linktext, "%c%06X%s%s%c", 0x12, sayid, "000000000000000000000000000000000000000", LinkName, 0x12);
|
||||||
} else { // If no initiator, create an RoF saylink, since older clients handle RoF ones better than RoF handles older ones.
|
} else { // If no initiator, create an RoF2 saylink, since older clients handle RoF2 ones better than RoF2 handles older ones.
|
||||||
sprintf(linktext,"%c%06X%s%s%c",0x12,sayid,"0000000000000000000000000000000000000000000000000",LinkName,0x12);
|
sprintf(linktext, "%c%06X%s%s%c", 0x12, sayid, "00000000000000000000000000000000000000000000000000", LinkName, 0x12);
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(Phrase,linktext);
|
strcpy(Phrase,linktext);
|
||||||
|
|||||||
@ -109,7 +109,7 @@ uint32 Spawn2::resetTimer()
|
|||||||
|
|
||||||
if (variance_ != 0) {
|
if (variance_ != 0) {
|
||||||
int var_over_2 = (variance_ * 1000) / 2;
|
int var_over_2 = (variance_ * 1000) / 2;
|
||||||
rspawn = MakeRandomInt(rspawn - var_over_2, rspawn + var_over_2);
|
rspawn = zone->random.Int(rspawn - var_over_2, rspawn + var_over_2);
|
||||||
|
|
||||||
//put a lower bound on it, not a lot of difference below 100, so set that as the bound.
|
//put a lower bound on it, not a lot of difference below 100, so set that as the bound.
|
||||||
if(rspawn < 100)
|
if(rspawn < 100)
|
||||||
@ -126,7 +126,7 @@ uint32 Spawn2::despawnTimer(uint32 despawn_timer)
|
|||||||
|
|
||||||
if (variance_ != 0) {
|
if (variance_ != 0) {
|
||||||
int var_over_2 = (variance_ * 1000) / 2;
|
int var_over_2 = (variance_ * 1000) / 2;
|
||||||
dspawn = MakeRandomInt(dspawn - var_over_2, dspawn + var_over_2);
|
dspawn = zone->random.Int(dspawn - var_over_2, dspawn + var_over_2);
|
||||||
|
|
||||||
//put a lower bound on it, not a lot of difference below 100, so set that as the bound.
|
//put a lower bound on it, not a lot of difference below 100, so set that as the bound.
|
||||||
if(dspawn < 100)
|
if(dspawn < 100)
|
||||||
|
|||||||
@ -25,8 +25,10 @@
|
|||||||
#include "zonedb.h"
|
#include "zonedb.h"
|
||||||
#include "../common/misc_functions.h"
|
#include "../common/misc_functions.h"
|
||||||
#include "../common/string_util.h"
|
#include "../common/string_util.h"
|
||||||
|
#include "zone.h"
|
||||||
|
|
||||||
extern EntityList entity_list;
|
extern EntityList entity_list;
|
||||||
|
extern Zone* zone;
|
||||||
|
|
||||||
SpawnEntry::SpawnEntry( uint32 in_NPCType, int in_chance, uint8 in_npc_spawn_limit ) {
|
SpawnEntry::SpawnEntry( uint32 in_NPCType, int in_chance, uint8 in_npc_spawn_limit ) {
|
||||||
NPCType = in_NPCType;
|
NPCType = in_NPCType;
|
||||||
@ -77,7 +79,7 @@ uint32 SpawnGroup::GetNPCType() {
|
|||||||
|
|
||||||
|
|
||||||
int32 roll = 0;
|
int32 roll = 0;
|
||||||
roll = MakeRandomInt(0, totalchance-1);
|
roll = zone->random.Int(0, totalchance-1);
|
||||||
|
|
||||||
cur = possible.begin();
|
cur = possible.begin();
|
||||||
end = possible.end();
|
end = possible.end();
|
||||||
|
|||||||
@ -155,7 +155,7 @@ void Mob::DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage,
|
|||||||
int kb_chance = 25;
|
int kb_chance = 25;
|
||||||
kb_chance += kb_chance*(100-aabonuses.SpecialAttackKBProc[0])/100;
|
kb_chance += kb_chance*(100-aabonuses.SpecialAttackKBProc[0])/100;
|
||||||
|
|
||||||
if (MakeRandomInt(0, 99) < kb_chance)
|
if (zone->random.Roll(kb_chance))
|
||||||
SpellFinished(904, who, 10, 0, -1, spells[904].ResistDiff);
|
SpellFinished(904, who, 10, 0, -1, spells[904].ResistDiff);
|
||||||
//who->Stun(100); Kayen: This effect does not stun on live, it only moves the NPC.
|
//who->Stun(100); Kayen: This effect does not stun on live, it only moves the NPC.
|
||||||
}
|
}
|
||||||
@ -256,7 +256,7 @@ void Client::OPCombatAbility(const EQApplicationPacket *app) {
|
|||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
ht = dmg = GetBashDamage();
|
ht = dmg = GetBashDamage();
|
||||||
else
|
else
|
||||||
ht = dmg = MakeRandomInt(1, GetBashDamage());
|
ht = dmg = zone->random.Int(1, GetBashDamage());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -295,8 +295,7 @@ void Client::OPCombatAbility(const EQApplicationPacket *app) {
|
|||||||
|
|
||||||
//Live parses show around 55% Triple 35% Double 10% Single, you will always get first hit.
|
//Live parses show around 55% Triple 35% Double 10% Single, you will always get first hit.
|
||||||
while(AtkRounds > 0) {
|
while(AtkRounds > 0) {
|
||||||
|
if (GetTarget() && (AtkRounds == 1 || zone->random.Roll(75))) {
|
||||||
if (GetTarget() && (AtkRounds == 1 || MakeRandomInt(0,100) < 75)){
|
|
||||||
DoSpecialAttackDamage(GetTarget(), SkillFrenzy, max_dmg, min_dmg, max_dmg , ReuseTime, true);
|
DoSpecialAttackDamage(GetTarget(), SkillFrenzy, max_dmg, min_dmg, max_dmg , ReuseTime, true);
|
||||||
}
|
}
|
||||||
AtkRounds--;
|
AtkRounds--;
|
||||||
@ -333,7 +332,7 @@ void Client::OPCombatAbility(const EQApplicationPacket *app) {
|
|||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
ht = dmg = GetKickDamage();
|
ht = dmg = GetKickDamage();
|
||||||
else
|
else
|
||||||
ht = dmg = MakeRandomInt(1, GetKickDamage());
|
ht = dmg = zone->random.Int(1, GetKickDamage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -348,18 +347,18 @@ void Client::OPCombatAbility(const EQApplicationPacket *app) {
|
|||||||
//Live AA - Technique of Master Wu
|
//Live AA - Technique of Master Wu
|
||||||
int wuchance = itembonuses.DoubleSpecialAttack + spellbonuses.DoubleSpecialAttack + aabonuses.DoubleSpecialAttack;
|
int wuchance = itembonuses.DoubleSpecialAttack + spellbonuses.DoubleSpecialAttack + aabonuses.DoubleSpecialAttack;
|
||||||
if (wuchance) {
|
if (wuchance) {
|
||||||
if (wuchance >= 100 || wuchance > MakeRandomInt(0, 99)) {
|
if (wuchance >= 100 || zone->random.Roll(wuchance)) {
|
||||||
int MonkSPA [5] = { SkillFlyingKick, SkillDragonPunch, SkillEagleStrike, SkillTigerClaw, SkillRoundKick };
|
int MonkSPA [5] = { SkillFlyingKick, SkillDragonPunch, SkillEagleStrike, SkillTigerClaw, SkillRoundKick };
|
||||||
int extra = 1;
|
int extra = 1;
|
||||||
// always 1/4 of the double attack chance, 25% at rank 5 (100/4)
|
// always 1/4 of the double attack chance, 25% at rank 5 (100/4)
|
||||||
if (wuchance / 4 > MakeRandomInt(0, 99))
|
if (zone->random.Roll(wuchance / 4))
|
||||||
extra++;
|
extra++;
|
||||||
// They didn't add a string ID for this.
|
// They didn't add a string ID for this.
|
||||||
std::string msg = StringFormat("The spirit of Master Wu fills you! You gain %d additional attack(s).", extra);
|
std::string msg = StringFormat("The spirit of Master Wu fills you! You gain %d additional attack(s).", extra);
|
||||||
// live uses 400 here -- not sure if it's the best for all clients though
|
// live uses 400 here -- not sure if it's the best for all clients though
|
||||||
SendColoredText(400, msg);
|
SendColoredText(400, msg);
|
||||||
while (extra) {
|
while (extra) {
|
||||||
MonkSpecialAttack(GetTarget(), MonkSPA[MakeRandomInt(0, 4)]);
|
MonkSpecialAttack(GetTarget(), MonkSPA[zone->random.Int(0, 4)]);
|
||||||
extra--;
|
extra--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -484,7 +483,7 @@ int Mob::MonkSpecialAttack(Mob* other, uint8 unchecked_type)
|
|||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
ht = ndamage = max_dmg;
|
ht = ndamage = max_dmg;
|
||||||
else
|
else
|
||||||
ht = ndamage = MakeRandomInt(min_dmg, max_dmg);
|
ht = ndamage = zone->random.Int(min_dmg, max_dmg);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
ht = max_dmg;
|
ht = max_dmg;
|
||||||
@ -525,12 +524,11 @@ void Mob::TryBackstab(Mob *other, int ReuseTime) {
|
|||||||
//Live AA - Seized Opportunity
|
//Live AA - Seized Opportunity
|
||||||
int FrontalBSChance = itembonuses.FrontalBackstabChance + spellbonuses.FrontalBackstabChance + aabonuses.FrontalBackstabChance;
|
int FrontalBSChance = itembonuses.FrontalBackstabChance + spellbonuses.FrontalBackstabChance + aabonuses.FrontalBackstabChance;
|
||||||
|
|
||||||
if (FrontalBSChance && (FrontalBSChance > MakeRandomInt(0, 100)))
|
if (FrontalBSChance && zone->random.Roll(FrontalBSChance))
|
||||||
bCanFrontalBS = true;
|
bCanFrontalBS = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bIsBehind || bCanFrontalBS){ // Player is behind other OR can do Frontal Backstab
|
if (bIsBehind || bCanFrontalBS){ // Player is behind other OR can do Frontal Backstab
|
||||||
|
|
||||||
if (bCanFrontalBS)
|
if (bCanFrontalBS)
|
||||||
CastToClient()->Message(0,"Your fierce attack is executed with such grace, your target did not see it coming!");
|
CastToClient()->Message(0,"Your fierce attack is executed with such grace, your target did not see it coming!");
|
||||||
|
|
||||||
@ -541,7 +539,7 @@ void Mob::TryBackstab(Mob *other, int ReuseTime) {
|
|||||||
if(other->GetHP() > 0)
|
if(other->GetHP() > 0)
|
||||||
RogueBackstab(other,false,ReuseTime);
|
RogueBackstab(other,false,ReuseTime);
|
||||||
|
|
||||||
if (tripleChance && other->GetHP() > 0 && tripleChance > MakeRandomInt(0, 100))
|
if (tripleChance && other->GetHP() > 0 && zone->random.Roll(tripleChance))
|
||||||
RogueBackstab(other,false,ReuseTime);
|
RogueBackstab(other,false,ReuseTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -562,7 +560,7 @@ void Mob::TryBackstab(Mob *other, int ReuseTime) {
|
|||||||
if(other->GetHP() > 0)
|
if(other->GetHP() > 0)
|
||||||
RogueBackstab(other,true, ReuseTime);
|
RogueBackstab(other,true, ReuseTime);
|
||||||
|
|
||||||
if (tripleChance && other->GetHP() > 0 && tripleChance > MakeRandomInt(0, 100))
|
if (tripleChance && other->GetHP() > 0 && zone->random.Roll(tripleChance))
|
||||||
RogueBackstab(other,false,ReuseTime);
|
RogueBackstab(other,false,ReuseTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -641,7 +639,7 @@ void Mob::RogueBackstab(Mob* other, bool min_damage, int ReuseTime)
|
|||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
ndamage = max_hit;
|
ndamage = max_hit;
|
||||||
else
|
else
|
||||||
ndamage = MakeRandomInt(min_hit, max_hit);
|
ndamage = zone->random.Int(min_hit, max_hit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -678,7 +676,8 @@ void Mob::RogueAssassinate(Mob* other)
|
|||||||
|
|
||||||
void Client::RangedAttack(Mob* other, bool CanDoubleAttack) {
|
void Client::RangedAttack(Mob* other, bool CanDoubleAttack) {
|
||||||
//conditions to use an attack checked before we are called
|
//conditions to use an attack checked before we are called
|
||||||
|
if (!other)
|
||||||
|
return;
|
||||||
//make sure the attack and ranged timers are up
|
//make sure the attack and ranged timers are up
|
||||||
//if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow
|
//if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow
|
||||||
if(!CanDoubleAttack && ((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check()))) {
|
if(!CanDoubleAttack && ((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check()))) {
|
||||||
@ -718,7 +717,7 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mlog(COMBAT__RANGED, "Shooting %s with bow %s (%d) and arrow %s (%d)", GetTarget()->GetName(), RangeItem->Name, RangeItem->ID, AmmoItem->Name, AmmoItem->ID);
|
mlog(COMBAT__RANGED, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetName(), RangeItem->Name, RangeItem->ID, AmmoItem->Name, AmmoItem->ID);
|
||||||
|
|
||||||
//look for ammo in inventory if we only have 1 left...
|
//look for ammo in inventory if we only have 1 left...
|
||||||
if(Ammo->GetCharges() == 1) {
|
if(Ammo->GetCharges() == 1) {
|
||||||
@ -765,19 +764,21 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float range = RangeItem->Range + AmmoItem->Range + 5.0f; //Fudge it a little, client will let you hit something at 0 0 0 when you are at 205 0 0
|
float range = RangeItem->Range + AmmoItem->Range + GetRangeDistTargetSizeMod(GetTarget());
|
||||||
mlog(COMBAT__RANGED, "Calculated bow range to be %.1f", range);
|
mlog(COMBAT__RANGED, "Calculated bow range to be %.1f", range);
|
||||||
range *= range;
|
range *= range;
|
||||||
if(DistNoRootNoZ(*GetTarget()) > range) {
|
float dist = DistNoRoot(*other);
|
||||||
mlog(COMBAT__RANGED, "Ranged attack out of range... client should catch this. (%f > %f).\n", DistNoRootNoZ(*GetTarget()), range);
|
if(dist > range) {
|
||||||
//target is out of range, client does a message
|
mlog(COMBAT__RANGED, "Ranged attack out of range... client should catch this. (%f > %f).\n", dist, range);
|
||||||
|
Message_StringID(13,TARGET_OUT_OF_RANGE);//Client enforces range and sends the message, this is a backup just incase.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if(DistNoRootNoZ(*GetTarget()) < (RuleI(Combat, MinRangedAttackDist)*RuleI(Combat, MinRangedAttackDist))){
|
else if(dist < (RuleI(Combat, MinRangedAttackDist)*RuleI(Combat, MinRangedAttackDist))){
|
||||||
|
Message_StringID(15,RANGED_TOO_CLOSE);//Client enforces range and sends the message, this is a backup just incase.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!IsAttackAllowed(GetTarget()) ||
|
if(!IsAttackAllowed(other) ||
|
||||||
IsCasting() ||
|
IsCasting() ||
|
||||||
IsSitting() ||
|
IsSitting() ||
|
||||||
(DivineAura() && !GetGM()) ||
|
(DivineAura() && !GetGM()) ||
|
||||||
@ -789,12 +790,12 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Shoots projectile and/or applies the archery damage
|
//Shoots projectile and/or applies the archery damage
|
||||||
DoArcheryAttackDmg(GetTarget(), RangeWeapon, Ammo,0,0,0,0,0,0, AmmoItem, ammo_slot);
|
DoArcheryAttackDmg(other, RangeWeapon, Ammo,0,0,0,0,0,0, AmmoItem, ammo_slot);
|
||||||
|
|
||||||
//EndlessQuiver AA base1 = 100% Chance to avoid consumption arrow.
|
//EndlessQuiver AA base1 = 100% Chance to avoid consumption arrow.
|
||||||
int ChanceAvoidConsume = aabonuses.ConsumeProjectile + itembonuses.ConsumeProjectile + spellbonuses.ConsumeProjectile;
|
int ChanceAvoidConsume = aabonuses.ConsumeProjectile + itembonuses.ConsumeProjectile + spellbonuses.ConsumeProjectile;
|
||||||
|
|
||||||
if (!ChanceAvoidConsume || (ChanceAvoidConsume < 100 && MakeRandomInt(0,99) > ChanceAvoidConsume)){
|
if (!ChanceAvoidConsume || (ChanceAvoidConsume < 100 && zone->random.Int(0,99) > ChanceAvoidConsume)){
|
||||||
DeleteItemInInventory(ammo_slot, 1, true);
|
DeleteItemInInventory(ammo_slot, 1, true);
|
||||||
mlog(COMBAT__RANGED, "Consumed one arrow from slot %d", ammo_slot);
|
mlog(COMBAT__RANGED, "Consumed one arrow from slot %d", ammo_slot);
|
||||||
} else {
|
} else {
|
||||||
@ -829,6 +830,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
|
|||||||
this function is then run again to do the damage portion
|
this function is then run again to do the damage portion
|
||||||
*/
|
*/
|
||||||
bool LaunchProjectile = false;
|
bool LaunchProjectile = false;
|
||||||
|
bool ProjectileImpact = false;
|
||||||
bool ProjectileMiss = false;
|
bool ProjectileMiss = false;
|
||||||
|
|
||||||
if (RuleB(Combat, ProjectileDmgOnImpact)){
|
if (RuleB(Combat, ProjectileDmgOnImpact)){
|
||||||
@ -845,6 +847,8 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
|
|||||||
|
|
||||||
if (!RangeWeapon && !Ammo && range_id && ammo_id){
|
if (!RangeWeapon && !Ammo && range_id && ammo_id){
|
||||||
|
|
||||||
|
ProjectileImpact = true;
|
||||||
|
|
||||||
if (weapon_damage == 0)
|
if (weapon_damage == 0)
|
||||||
ProjectileMiss = true; //This indicates that MISS was originally calculated.
|
ProjectileMiss = true; //This indicates that MISS was originally calculated.
|
||||||
|
|
||||||
@ -866,7 +870,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
|
|||||||
else if (AmmoItem)
|
else if (AmmoItem)
|
||||||
SendItemAnimation(other, AmmoItem, SkillArchery);
|
SendItemAnimation(other, AmmoItem, SkillArchery);
|
||||||
|
|
||||||
if (ProjectileMiss || !other->CheckHitChance(this, SkillArchery, MainPrimary, chance_mod)) {
|
if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillArchery, MainPrimary, chance_mod))) {
|
||||||
mlog(COMBAT__RANGED, "Ranged attack missed %s.", other->GetName());
|
mlog(COMBAT__RANGED, "Ranged attack missed %s.", other->GetName());
|
||||||
|
|
||||||
if (LaunchProjectile){
|
if (LaunchProjectile){
|
||||||
@ -921,11 +925,10 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
|
|||||||
|
|
||||||
bool dobonus = false;
|
bool dobonus = false;
|
||||||
if(GetClass() == RANGER && GetLevel() > 50){
|
if(GetClass() == RANGER && GetLevel() > 50){
|
||||||
|
|
||||||
int bonuschance = RuleI(Combat, ArcheryBonusChance);
|
int bonuschance = RuleI(Combat, ArcheryBonusChance);
|
||||||
bonuschance = mod_archery_bonus_chance(bonuschance, RangeWeapon);
|
bonuschance = mod_archery_bonus_chance(bonuschance, RangeWeapon);
|
||||||
|
|
||||||
if( !RuleB(Combat, UseArcheryBonusRoll) || (MakeRandomInt(1, 100) < bonuschance)){
|
if( !RuleB(Combat, UseArcheryBonusRoll) || zone->random.Roll(bonuschance)){
|
||||||
if(RuleB(Combat, ArcheryBonusRequiresStationary)){
|
if(RuleB(Combat, ArcheryBonusRequiresStationary)){
|
||||||
if(other->IsNPC() && !other->IsMoving() && !other->IsRooted())
|
if(other->IsNPC() && !other->IsMoving() && !other->IsRooted())
|
||||||
dobonus = true;
|
dobonus = true;
|
||||||
@ -950,7 +953,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
|
|||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
TotalDmg = MaxDmg;
|
TotalDmg = MaxDmg;
|
||||||
else
|
else
|
||||||
TotalDmg = MakeRandomInt(1, MaxDmg);
|
TotalDmg = zone->random.Int(1, MaxDmg);
|
||||||
|
|
||||||
int minDmg = 1;
|
int minDmg = 1;
|
||||||
if(GetLevel() > 25){
|
if(GetLevel() > 25){
|
||||||
@ -1125,6 +1128,45 @@ void Mob::ProjectileAttack()
|
|||||||
SetProjectileAttack(false);
|
SetProjectileAttack(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float Mob::GetRangeDistTargetSizeMod(Mob* other)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
Range is enforced client side, therefore these numbers do not need to be 100% accurate just close enough to
|
||||||
|
prevent any exploitation. The range mod changes in some situations depending on if size is from spawn or from SendIllusionPacket changes.
|
||||||
|
At present time only calculate from spawn (it is no consistent what happens to the calc when changing it after spawn).
|
||||||
|
*/
|
||||||
|
if (!other)
|
||||||
|
return 0.0f;
|
||||||
|
|
||||||
|
float tsize = other->GetSize();
|
||||||
|
|
||||||
|
if (GetSize() > tsize)
|
||||||
|
tsize = GetSize();
|
||||||
|
|
||||||
|
float mod = 0.0f;
|
||||||
|
/*These are correct numbers if mob size is changed via #size (Don't know why it matters but it does)
|
||||||
|
if (tsize < 7)
|
||||||
|
mod = 16.0f;
|
||||||
|
else if (tsize >=7 && tsize <= 20)
|
||||||
|
mod = 16.0f + (0.6f * (tsize - 6.0f));
|
||||||
|
else if (tsize >=20 && tsize <= 60)
|
||||||
|
mod = 25.0f + (1.25f * (tsize - 20.0f));
|
||||||
|
else
|
||||||
|
mod = 75.0f;
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (tsize < 10)
|
||||||
|
mod = 18.0f;
|
||||||
|
else if (tsize >=10 && tsize < 15)
|
||||||
|
mod = 20.0f + (4.0f * (tsize - 10.0f));
|
||||||
|
else if (tsize >=15 && tsize <= 20)
|
||||||
|
mod = 42.0f + (5.8f * (tsize - 15.0f));
|
||||||
|
else
|
||||||
|
mod = 75.0f;
|
||||||
|
|
||||||
|
return (mod + 2.0f); //Add 2.0f as buffer to prevent any chance of failures, client enforce range check regardless.
|
||||||
|
}
|
||||||
|
|
||||||
void NPC::RangedAttack(Mob* other)
|
void NPC::RangedAttack(Mob* other)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -1219,7 +1261,7 @@ void NPC::RangedAttack(Mob* other)
|
|||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
TotalDmg = MaxDmg;
|
TotalDmg = MaxDmg;
|
||||||
else
|
else
|
||||||
TotalDmg = MakeRandomInt(MinDmg, MaxDmg);
|
TotalDmg = zone->random.Int(MinDmg, MaxDmg);
|
||||||
|
|
||||||
TotalDmg += TotalDmg * GetSpecialAbilityParam(SPECATK_RANGED_ATK, 3) / 100; //Damage modifier
|
TotalDmg += TotalDmg * GetSpecialAbilityParam(SPECATK_RANGED_ATK, 3) / 100; //Damage modifier
|
||||||
|
|
||||||
@ -1263,7 +1305,7 @@ uint16 Mob::GetThrownDamage(int16 wDmg, int32& TotalDmg, int& minDmg) {
|
|||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
TotalDmg = MaxDmg;
|
TotalDmg = MaxDmg;
|
||||||
else
|
else
|
||||||
TotalDmg = MakeRandomInt(1, MaxDmg);
|
TotalDmg = zone->random.Int(1, MaxDmg);
|
||||||
|
|
||||||
minDmg = 1;
|
minDmg = 1;
|
||||||
if(GetLevel() > 25){
|
if(GetLevel() > 25){
|
||||||
@ -1282,7 +1324,8 @@ uint16 Mob::GetThrownDamage(int16 wDmg, int32& TotalDmg, int& minDmg) {
|
|||||||
|
|
||||||
void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51
|
void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51
|
||||||
//conditions to use an attack checked before we are called
|
//conditions to use an attack checked before we are called
|
||||||
|
if (!other)
|
||||||
|
return;
|
||||||
//make sure the attack and ranged timers are up
|
//make sure the attack and ranged timers are up
|
||||||
//if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow
|
//if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow
|
||||||
if((!CanDoubleAttack && (attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check()))) {
|
if((!CanDoubleAttack && (attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check()))) {
|
||||||
@ -1308,7 +1351,7 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mlog(COMBAT__RANGED, "Throwing %s (%d) at %s", item->Name, item->ID, GetTarget()->GetName());
|
mlog(COMBAT__RANGED, "Throwing %s (%d) at %s", item->Name, item->ID, other->GetName());
|
||||||
|
|
||||||
if(RangeWeapon->GetCharges() == 1) {
|
if(RangeWeapon->GetCharges() == 1) {
|
||||||
//first check ammo
|
//first check ammo
|
||||||
@ -1330,19 +1373,20 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int range = item->Range +50/*Fudge it a little, client will let you hit something at 0 0 0 when you are at 205 0 0*/;
|
float range = item->Range + GetRangeDistTargetSizeMod(other);
|
||||||
mlog(COMBAT__RANGED, "Calculated bow range to be %.1f", range);
|
mlog(COMBAT__RANGED, "Calculated bow range to be %.1f", range);
|
||||||
range *= range;
|
range *= range;
|
||||||
if(DistNoRootNoZ(*GetTarget()) > range) {
|
float dist = DistNoRoot(*other);
|
||||||
mlog(COMBAT__RANGED, "Throwing attack out of range... client should catch this. (%f > %f).\n", DistNoRootNoZ(*GetTarget()), range);
|
if(dist > range) {
|
||||||
//target is out of range, client does a message
|
mlog(COMBAT__RANGED, "Throwing attack out of range... client should catch this. (%f > %f).\n", dist, range);
|
||||||
|
Message_StringID(13,TARGET_OUT_OF_RANGE);//Client enforces range and sends the message, this is a backup just incase.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if(DistNoRootNoZ(*GetTarget()) < (RuleI(Combat, MinRangedAttackDist)*RuleI(Combat, MinRangedAttackDist))){
|
else if(dist < (RuleI(Combat, MinRangedAttackDist)*RuleI(Combat, MinRangedAttackDist))){
|
||||||
return;
|
Message_StringID(15,RANGED_TOO_CLOSE);//Client enforces range and sends the message, this is a backup just incase.
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!IsAttackAllowed(GetTarget()) ||
|
if(!IsAttackAllowed(other) ||
|
||||||
IsCasting() ||
|
IsCasting() ||
|
||||||
IsSitting() ||
|
IsSitting() ||
|
||||||
(DivineAura() && !GetGM()) ||
|
(DivineAura() && !GetGM()) ||
|
||||||
@ -1353,7 +1397,7 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DoThrowingAttackDmg(GetTarget(), RangeWeapon, item);
|
DoThrowingAttackDmg(other, RangeWeapon, item);
|
||||||
|
|
||||||
//consume ammo
|
//consume ammo
|
||||||
DeleteItemInInventory(ammo_slot, 1, true);
|
DeleteItemInInventory(ammo_slot, 1, true);
|
||||||
@ -1383,6 +1427,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
|
|||||||
this function is then run again to do the damage portion
|
this function is then run again to do the damage portion
|
||||||
*/
|
*/
|
||||||
bool LaunchProjectile = false;
|
bool LaunchProjectile = false;
|
||||||
|
bool ProjectileImpact = false;
|
||||||
bool ProjectileMiss = false;
|
bool ProjectileMiss = false;
|
||||||
|
|
||||||
if (RuleB(Combat, ProjectileDmgOnImpact)){
|
if (RuleB(Combat, ProjectileDmgOnImpact)){
|
||||||
@ -1392,6 +1437,8 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
|
|||||||
else{
|
else{
|
||||||
if (!RangeWeapon && range_id){
|
if (!RangeWeapon && range_id){
|
||||||
|
|
||||||
|
ProjectileImpact = true;
|
||||||
|
|
||||||
if (weapon_damage == 0)
|
if (weapon_damage == 0)
|
||||||
ProjectileMiss = true; //This indicates that MISS was originally calculated.
|
ProjectileMiss = true; //This indicates that MISS was originally calculated.
|
||||||
|
|
||||||
@ -1409,7 +1456,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
|
|||||||
else if (AmmoItem)
|
else if (AmmoItem)
|
||||||
SendItemAnimation(other, AmmoItem, SkillThrowing);
|
SendItemAnimation(other, AmmoItem, SkillThrowing);
|
||||||
|
|
||||||
if (ProjectileMiss || !other->CheckHitChance(this, SkillThrowing, MainPrimary, chance_mod)){
|
if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillThrowing, MainPrimary, chance_mod))){
|
||||||
mlog(COMBAT__RANGED, "Ranged attack missed %s.", other->GetName());
|
mlog(COMBAT__RANGED, "Ranged attack missed %s.", other->GetName());
|
||||||
if (LaunchProjectile){
|
if (LaunchProjectile){
|
||||||
TryProjectileAttack(other, AmmoItem, SkillThrowing, 0, RangeWeapon, nullptr, AmmoSlot, speed);
|
TryProjectileAttack(other, AmmoItem, SkillThrowing, 0, RangeWeapon, nullptr, AmmoSlot, speed);
|
||||||
@ -1681,7 +1728,7 @@ void NPC::DoClassAttacks(Mob *target) {
|
|||||||
}
|
}
|
||||||
case WARRIOR: case WARRIORGM:{
|
case WARRIOR: case WARRIORGM:{
|
||||||
if(level >= RuleI(Combat, NPCBashKickLevel)){
|
if(level >= RuleI(Combat, NPCBashKickLevel)){
|
||||||
if(MakeRandomInt(0, 100) > 25){ //tested on live, warrior mobs both kick and bash, kick about 75% of the time, casting doesn't seem to make a difference.
|
if(zone->random.Roll(75)) { //tested on live, warrior mobs both kick and bash, kick about 75% of the time, casting doesn't seem to make a difference.
|
||||||
DoAnim(animKick);
|
DoAnim(animKick);
|
||||||
int32 dmg = 0;
|
int32 dmg = 0;
|
||||||
|
|
||||||
@ -1693,7 +1740,7 @@ void NPC::DoClassAttacks(Mob *target) {
|
|||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
dmg = GetKickDamage();
|
dmg = GetKickDamage();
|
||||||
else
|
else
|
||||||
dmg = MakeRandomInt(1, GetKickDamage());
|
dmg = zone->random.Int(1, GetKickDamage());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1714,7 +1761,7 @@ void NPC::DoClassAttacks(Mob *target) {
|
|||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
dmg = GetBashDamage();
|
dmg = GetBashDamage();
|
||||||
else
|
else
|
||||||
dmg = MakeRandomInt(1, GetBashDamage());
|
dmg = zone->random.Int(1, GetBashDamage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1742,7 +1789,7 @@ void NPC::DoClassAttacks(Mob *target) {
|
|||||||
reuse = FrenzyReuseTime * 1000;
|
reuse = FrenzyReuseTime * 1000;
|
||||||
|
|
||||||
while(AtkRounds > 0) {
|
while(AtkRounds > 0) {
|
||||||
if (GetTarget() && (AtkRounds == 1 || MakeRandomInt(0,100) < 75)){
|
if (GetTarget() && (AtkRounds == 1 || zone->random.Roll(75))) {
|
||||||
DoSpecialAttackDamage(GetTarget(), SkillFrenzy, max_dmg, min_dmg, -1 , reuse, true);
|
DoSpecialAttackDamage(GetTarget(), SkillFrenzy, max_dmg, min_dmg, -1 , reuse, true);
|
||||||
}
|
}
|
||||||
AtkRounds--;
|
AtkRounds--;
|
||||||
@ -1767,7 +1814,7 @@ void NPC::DoClassAttacks(Mob *target) {
|
|||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
dmg = GetKickDamage();
|
dmg = GetKickDamage();
|
||||||
else
|
else
|
||||||
dmg = MakeRandomInt(1, GetKickDamage());
|
dmg = zone->random.Int(1, GetKickDamage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1792,7 +1839,7 @@ void NPC::DoClassAttacks(Mob *target) {
|
|||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
dmg = GetBashDamage();
|
dmg = GetBashDamage();
|
||||||
else
|
else
|
||||||
dmg = MakeRandomInt(1, GetBashDamage());
|
dmg = zone->random.Int(1, GetBashDamage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1901,7 +1948,7 @@ void Client::DoClassAttacks(Mob *ca_target, uint16 skill, bool IsRiposte)
|
|||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
dmg = GetBashDamage();
|
dmg = GetBashDamage();
|
||||||
else
|
else
|
||||||
dmg = MakeRandomInt(1, GetBashDamage());
|
dmg = zone->random.Int(1, GetBashDamage());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1938,7 +1985,7 @@ void Client::DoClassAttacks(Mob *ca_target, uint16 skill, bool IsRiposte)
|
|||||||
//Live parses show around 55% Triple 35% Double 10% Single, you will always get first hit.
|
//Live parses show around 55% Triple 35% Double 10% Single, you will always get first hit.
|
||||||
while(AtkRounds > 0) {
|
while(AtkRounds > 0) {
|
||||||
|
|
||||||
if (GetTarget() && (AtkRounds == 1 || MakeRandomInt(0,100) < 75)){
|
if (GetTarget() && (AtkRounds == 1 || zone->random.Roll(75))) {
|
||||||
DoSpecialAttackDamage(GetTarget(), SkillFrenzy, max_dmg, min_dmg, max_dmg , ReuseTime, true);
|
DoSpecialAttackDamage(GetTarget(), SkillFrenzy, max_dmg, min_dmg, max_dmg , ReuseTime, true);
|
||||||
}
|
}
|
||||||
AtkRounds--;
|
AtkRounds--;
|
||||||
@ -1965,7 +2012,7 @@ void Client::DoClassAttacks(Mob *ca_target, uint16 skill, bool IsRiposte)
|
|||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
dmg = GetKickDamage();
|
dmg = GetKickDamage();
|
||||||
else
|
else
|
||||||
dmg = MakeRandomInt(1, GetKickDamage());
|
dmg = zone->random.Int(1, GetKickDamage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1985,17 +2032,17 @@ void Client::DoClassAttacks(Mob *ca_target, uint16 skill, bool IsRiposte)
|
|||||||
//Live AA - Technique of Master Wu
|
//Live AA - Technique of Master Wu
|
||||||
int wuchance = itembonuses.DoubleSpecialAttack + spellbonuses.DoubleSpecialAttack + aabonuses.DoubleSpecialAttack;
|
int wuchance = itembonuses.DoubleSpecialAttack + spellbonuses.DoubleSpecialAttack + aabonuses.DoubleSpecialAttack;
|
||||||
if (wuchance) {
|
if (wuchance) {
|
||||||
if (wuchance >= 100 || wuchance > MakeRandomInt(0, 99)) {
|
if (wuchance >= 100 || zone->random.Roll(wuchance)) {
|
||||||
int MonkSPA [5] = { SkillFlyingKick, SkillDragonPunch, SkillEagleStrike, SkillTigerClaw, SkillRoundKick };
|
int MonkSPA [5] = { SkillFlyingKick, SkillDragonPunch, SkillEagleStrike, SkillTigerClaw, SkillRoundKick };
|
||||||
int extra = 1;
|
int extra = 1;
|
||||||
if (wuchance / 4 > MakeRandomInt(0, 99))
|
if (zone->random.Roll(wuchance / 4))
|
||||||
extra++;
|
extra++;
|
||||||
// They didn't add a string ID for this.
|
// They didn't add a string ID for this.
|
||||||
std::string msg = StringFormat("The spirit of Master Wu fills you! You gain %d additional attack(s).", extra);
|
std::string msg = StringFormat("The spirit of Master Wu fills you! You gain %d additional attack(s).", extra);
|
||||||
// live uses 400 here -- not sure if it's the best for all clients though
|
// live uses 400 here -- not sure if it's the best for all clients though
|
||||||
SendColoredText(400, msg);
|
SendColoredText(400, msg);
|
||||||
while (extra) {
|
while (extra) {
|
||||||
MonkSpecialAttack(ca_target, MonkSPA[MakeRandomInt(0, 4)]);
|
MonkSpecialAttack(ca_target, MonkSPA[zone->random.Int(0, 4)]);
|
||||||
extra--;
|
extra--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2079,7 +2126,7 @@ void Mob::Taunt(NPC* who, bool always_succeed, float chance_bonus) {
|
|||||||
|
|
||||||
tauntchance /= 100.0f;
|
tauntchance /= 100.0f;
|
||||||
|
|
||||||
if (tauntchance > MakeRandomFloat(0, 1)) {
|
if (tauntchance > zone->random.Real(0, 1)) {
|
||||||
if (hate_top && hate_top != this){
|
if (hate_top && hate_top != this){
|
||||||
newhate = (who->GetNPCHate(hate_top) - who->GetNPCHate(this)) + 1;
|
newhate = (who->GetNPCHate(hate_top) - who->GetNPCHate(this)) + 1;
|
||||||
who->CastToNPC()->AddToHateList(this, newhate);
|
who->CastToNPC()->AddToHateList(this, newhate);
|
||||||
@ -2135,7 +2182,7 @@ void Mob::InstillDoubt(Mob *who) {
|
|||||||
//target's counters
|
//target's counters
|
||||||
value -= target->GetLevel()*4 + who->GetWIS()/4;
|
value -= target->GetLevel()*4 + who->GetWIS()/4;
|
||||||
|
|
||||||
if (MakeRandomInt(0,99) < value) {
|
if (zone->random.Roll(value)) {
|
||||||
//temporary hack...
|
//temporary hack...
|
||||||
//cast fear on them... should prolly be a different spell
|
//cast fear on them... should prolly be a different spell
|
||||||
//and should be un-resistable.
|
//and should be un-resistable.
|
||||||
@ -2144,7 +2191,7 @@ void Mob::InstillDoubt(Mob *who) {
|
|||||||
} else {
|
} else {
|
||||||
Message_StringID(4,NOT_SCARING);
|
Message_StringID(4,NOT_SCARING);
|
||||||
//Idea from WR:
|
//Idea from WR:
|
||||||
/* if (target->IsNPC() && MakeRandomInt(0,99) < 10 ) {
|
/* if (target->IsNPC() && zone->random.Int(0,99) < 10 ) {
|
||||||
entity_list.MessageClose(target, false, 50, MT_NPCRampage, "%s lashes out in anger!",target->GetName());
|
entity_list.MessageClose(target, false, 50, MT_NPCRampage, "%s lashes out in anger!",target->GetName());
|
||||||
//should we actually do this? and the range is completely made up, unconfirmed
|
//should we actually do this? and the range is completely made up, unconfirmed
|
||||||
entity_list.AEAttack(target, 50);
|
entity_list.AEAttack(target, 50);
|
||||||
@ -2167,7 +2214,7 @@ uint32 Mob::TryHeadShot(Mob* defender, SkillUseTypes skillInUse) {
|
|||||||
|
|
||||||
if(HeadShot_Dmg && HeadShot_Level && (defender->GetLevel() <= HeadShot_Level)){
|
if(HeadShot_Dmg && HeadShot_Level && (defender->GetLevel() <= HeadShot_Level)){
|
||||||
float ProcChance = GetSpecialProcChances(MainRange);
|
float ProcChance = GetSpecialProcChances(MainRange);
|
||||||
if(ProcChance > MakeRandomFloat(0,1))
|
if(zone->random.Roll(ProcChance))
|
||||||
return HeadShot_Dmg;
|
return HeadShot_Dmg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2233,7 +2280,7 @@ uint32 Mob::TryAssassinate(Mob* defender, SkillUseTypes skillInUse, uint16 Reuse
|
|||||||
else
|
else
|
||||||
ProcChance = GetAssassinateProcChances(ReuseTime);
|
ProcChance = GetAssassinateProcChances(ReuseTime);
|
||||||
|
|
||||||
if(ProcChance > MakeRandomFloat(0,1))
|
if(zone->random.Roll(ProcChance))
|
||||||
return Assassinate_Dmg;
|
return Assassinate_Dmg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2324,7 +2371,7 @@ void Mob::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes
|
|||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
damage = max_hit;
|
damage = max_hit;
|
||||||
else
|
else
|
||||||
damage = MakeRandomInt(min_hit, max_hit);
|
damage = zone->random.Int(min_hit, max_hit);
|
||||||
|
|
||||||
if(!other->CheckHitChance(this, skillinuse, Hand, chance_mod)) {
|
if(!other->CheckHitChance(this, skillinuse, Hand, chance_mod)) {
|
||||||
damage = 0;
|
damage = 0;
|
||||||
@ -2363,7 +2410,7 @@ void Mob::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes
|
|||||||
int kb_chance = 25;
|
int kb_chance = 25;
|
||||||
kb_chance += kb_chance*(100-aabonuses.SpecialAttackKBProc[0])/100;
|
kb_chance += kb_chance*(100-aabonuses.SpecialAttackKBProc[0])/100;
|
||||||
|
|
||||||
if (MakeRandomInt(0, 99) < kb_chance)
|
if (zone->random.Roll(kb_chance))
|
||||||
SpellFinished(904, other, 10, 0, -1, spells[904].ResistDiff);
|
SpellFinished(904, other, 10, 0, -1, spells[904].ResistDiff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -455,7 +455,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
|
|
||||||
if(IsClient())
|
if(IsClient())
|
||||||
{
|
{
|
||||||
if(MakeRandomInt(0, 99) < RuleI(Spells, SuccorFailChance)) { //2% Fail chance by default
|
if(zone->random.Roll(RuleI(Spells, SuccorFailChance))) { //2% Fail chance by default
|
||||||
|
|
||||||
if(IsClient()) {
|
if(IsClient()) {
|
||||||
CastToClient()->Message_StringID(MT_SpellFailure,SUCCOR_FAIL);
|
CastToClient()->Message_StringID(MT_SpellFailure,SUCCOR_FAIL);
|
||||||
@ -710,7 +710,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
if (IsClient())
|
if (IsClient())
|
||||||
stun_resist += aabonuses.StunResist;
|
stun_resist += aabonuses.StunResist;
|
||||||
|
|
||||||
if (stun_resist <= 0 || MakeRandomInt(0,99) >= stun_resist) {
|
if (stun_resist <= 0 || zone->random.Int(0,99) >= stun_resist) {
|
||||||
mlog(COMBAT__HITS, "Stunned. We had %d percent resist chance.", stun_resist);
|
mlog(COMBAT__HITS, "Stunned. We had %d percent resist chance.", stun_resist);
|
||||||
|
|
||||||
if (caster->IsClient())
|
if (caster->IsClient())
|
||||||
@ -1033,7 +1033,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
#endif
|
#endif
|
||||||
if(!spellbonuses.AntiGate){
|
if(!spellbonuses.AntiGate){
|
||||||
|
|
||||||
if(MakeRandomInt(0, 99) < effect_value)
|
if(zone->random.Roll(effect_value))
|
||||||
Gate();
|
Gate();
|
||||||
else
|
else
|
||||||
caster->Message_StringID(MT_SpellFailure,GATE_FAIL);
|
caster->Message_StringID(MT_SpellFailure,GATE_FAIL);
|
||||||
@ -1484,7 +1484,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
|
|
||||||
wipechance += wipechance*bonus/100;
|
wipechance += wipechance*bonus/100;
|
||||||
|
|
||||||
if(MakeRandomInt(0, 99) < wipechance)
|
if(zone->random.Roll(wipechance))
|
||||||
{
|
{
|
||||||
if(IsAIControlled())
|
if(IsAIControlled())
|
||||||
{
|
{
|
||||||
@ -1597,7 +1597,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
|
|
||||||
if(IsClient()) {
|
if(IsClient()) {
|
||||||
|
|
||||||
if (MakeRandomInt(0, 99) > spells[spell_id].base[i]) {
|
if (zone->random.Int(0, 99) > spells[spell_id].base[i]) {
|
||||||
CastToClient()->SetFeigned(false);
|
CastToClient()->SetFeigned(false);
|
||||||
entity_list.MessageClose_StringID(this, false, 200, 10, STRING_FEIGNFAILED, GetName());
|
entity_list.MessageClose_StringID(this, false, 200, 10, STRING_FEIGNFAILED, GetName());
|
||||||
}
|
}
|
||||||
@ -2187,7 +2187,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
#ifdef SPELL_EFFECT_SPAM
|
#ifdef SPELL_EFFECT_SPAM
|
||||||
snprintf(effect_desc, _EDLEN, "Fading Memories");
|
snprintf(effect_desc, _EDLEN, "Fading Memories");
|
||||||
#endif
|
#endif
|
||||||
if(MakeRandomInt(0, 99) < spells[spell_id].base[i] ) {
|
if(zone->random.Roll(spells[spell_id].base[i])) {
|
||||||
|
|
||||||
if(caster && caster->IsClient())
|
if(caster && caster->IsClient())
|
||||||
caster->CastToClient()->Escape();
|
caster->CastToClient()->Escape();
|
||||||
@ -2724,7 +2724,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
if (buffslot >= 0)
|
if (buffslot >= 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if(!spells[spell_id].uninterruptable && IsCasting() && MakeRandomInt(0, 100) <= spells[spell_id].base[i])
|
if(!spells[spell_id].uninterruptable && IsCasting() && zone->random.Roll(spells[spell_id].base[i]))
|
||||||
InterruptSpell();
|
InterruptSpell();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -2746,8 +2746,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
case SE_ApplyEffect: {
|
case SE_ApplyEffect: {
|
||||||
|
|
||||||
if (caster && IsValidSpell(spells[spell_id].base2[i])){
|
if (caster && IsValidSpell(spells[spell_id].base2[i])){
|
||||||
|
if(zone->random.Roll(spells[spell_id].base[i]))
|
||||||
if(MakeRandomInt(0, 100) <= spells[spell_id].base[i])
|
|
||||||
caster->SpellFinished(spells[spell_id].base2[i], this, 10, 0, -1, spells[spells[spell_id].base2[i]].ResistDiff);
|
caster->SpellFinished(spells[spell_id].base2[i], this, 10, 0, -1, spells[spells[spell_id].base2[i]].ResistDiff);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -3209,7 +3208,7 @@ snare has both of them negative, yet their range should work the same:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 123: // added 2/6/04
|
case 123: // added 2/6/04
|
||||||
result = MakeRandomInt(ubase, abs(max));
|
result = zone->random.Int(ubase, abs(max));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 124: // check sign
|
case 124: // check sign
|
||||||
@ -3582,7 +3581,7 @@ void Mob::DoBuffTic(uint16 spell_id, int slot, uint32 ticsremaining, uint8 caste
|
|||||||
|
|
||||||
wipechance += wipechance*bonus/100;
|
wipechance += wipechance*bonus/100;
|
||||||
|
|
||||||
if(MakeRandomInt(0, 99) < wipechance)
|
if(zone->random.Roll(wipechance))
|
||||||
{
|
{
|
||||||
if(IsAIControlled())
|
if(IsAIControlled())
|
||||||
{
|
{
|
||||||
@ -3602,13 +3601,11 @@ void Mob::DoBuffTic(uint16 spell_id, int slot, uint32 ticsremaining, uint8 caste
|
|||||||
}
|
}
|
||||||
|
|
||||||
case SE_Root: {
|
case SE_Root: {
|
||||||
|
|
||||||
/* Root formula derived from extensive personal live parses - Kayen
|
/* Root formula derived from extensive personal live parses - Kayen
|
||||||
ROOT has a 70% chance to do a resist check to break.
|
ROOT has a 70% chance to do a resist check to break.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (MakeRandomInt(0, 99) < RuleI(Spells, RootBreakCheckChance)){
|
if (zone->random.Roll(RuleI(Spells, RootBreakCheckChance))) {
|
||||||
|
|
||||||
float resist_check = ResistSpell(spells[spell_id].resisttype, spell_id, caster, 0,0,0,0,true);
|
float resist_check = ResistSpell(spells[spell_id].resisttype, spell_id, caster, 0,0,0,0,true);
|
||||||
|
|
||||||
if(resist_check == 100)
|
if(resist_check == 100)
|
||||||
@ -3623,8 +3620,7 @@ void Mob::DoBuffTic(uint16 spell_id, int slot, uint32 ticsremaining, uint8 caste
|
|||||||
|
|
||||||
case SE_Fear:
|
case SE_Fear:
|
||||||
{
|
{
|
||||||
if (MakeRandomInt(0, 99) < RuleI(Spells, FearBreakCheckChance)){
|
if (zone->random.Roll(RuleI(Spells, FearBreakCheckChance))) {
|
||||||
|
|
||||||
float resist_check = ResistSpell(spells[spell_id].resisttype, spell_id, caster);
|
float resist_check = ResistSpell(spells[spell_id].resisttype, spell_id, caster);
|
||||||
|
|
||||||
if(resist_check == 100)
|
if(resist_check == 100)
|
||||||
@ -3664,7 +3660,7 @@ void Mob::DoBuffTic(uint16 spell_id, int slot, uint32 ticsremaining, uint8 caste
|
|||||||
break_chance -= (2 * (((double)GetSkill(SkillDivination) + ((double)GetLevel() * 3.0)) / 650.0));
|
break_chance -= (2 * (((double)GetSkill(SkillDivination) + ((double)GetLevel() * 3.0)) / 650.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(MakeRandomFloat(0.0, 100.0) < break_chance)
|
if(zone->random.Real(0.0, 100.0) < break_chance)
|
||||||
{
|
{
|
||||||
BuffModifyDurationBySpellID(spell_id, 3);
|
BuffModifyDurationBySpellID(spell_id, 3);
|
||||||
}
|
}
|
||||||
@ -3684,7 +3680,7 @@ void Mob::DoBuffTic(uint16 spell_id, int slot, uint32 ticsremaining, uint8 caste
|
|||||||
{
|
{
|
||||||
if(IsCasting())
|
if(IsCasting())
|
||||||
{
|
{
|
||||||
if(MakeRandomInt(0, 100) <= spells[spell_id].base[i])
|
if(zone->random.Roll(spells[spell_id].base[i]))
|
||||||
{
|
{
|
||||||
InterruptSpell();
|
InterruptSpell();
|
||||||
}
|
}
|
||||||
@ -4582,11 +4578,9 @@ int16 Client::CalcAAFocus(focusType type, uint32 aa_ID, uint16 spell_id)
|
|||||||
|
|
||||||
case SE_TriggerOnCast:
|
case SE_TriggerOnCast:
|
||||||
if(type == focusTriggerOnCast){
|
if(type == focusTriggerOnCast){
|
||||||
if(MakeRandomInt(0, 100) <= base1){
|
if(zone->random.Roll(base1)) {
|
||||||
value = base2;
|
value = base2;
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else{
|
|
||||||
value = 0;
|
value = 0;
|
||||||
LimitFailure = true;
|
LimitFailure = true;
|
||||||
}
|
}
|
||||||
@ -4600,7 +4594,7 @@ int16 Client::CalcAAFocus(focusType type, uint32 aa_ID, uint16 spell_id)
|
|||||||
|
|
||||||
case SE_BlockNextSpellFocus:
|
case SE_BlockNextSpellFocus:
|
||||||
if(type == focusBlockNextSpell){
|
if(type == focusBlockNextSpell){
|
||||||
if(MakeRandomInt(1, 100) <= base1)
|
if(zone->random.Roll(base1))
|
||||||
value = 1;
|
value = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -4955,7 +4949,7 @@ int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo
|
|||||||
value = focus_spell.base[i];
|
value = focus_spell.base[i];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
value = MakeRandomInt(focus_spell.base[i], focus_spell.base2[i]);
|
value = zone->random.Int(focus_spell.base[i], focus_spell.base2[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -4974,7 +4968,7 @@ int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo
|
|||||||
value = focus_spell.base[i];
|
value = focus_spell.base[i];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
value = MakeRandomInt(focus_spell.base[i], focus_spell.base2[i]);
|
value = zone->random.Int(focus_spell.base[i], focus_spell.base2[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -4993,7 +4987,7 @@ int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo
|
|||||||
value = focus_spell.base[i];
|
value = focus_spell.base[i];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
value = MakeRandomInt(focus_spell.base[i], focus_spell.base2[i]);
|
value = zone->random.Int(focus_spell.base[i], focus_spell.base2[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -5062,7 +5056,7 @@ int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo
|
|||||||
|
|
||||||
case SE_TriggerOnCast:
|
case SE_TriggerOnCast:
|
||||||
if(type == focusTriggerOnCast){
|
if(type == focusTriggerOnCast){
|
||||||
if(MakeRandomInt(1, 100) <= focus_spell.base[i])
|
if(zone->random.Roll(focus_spell.base[i]))
|
||||||
value = focus_spell.base2[i];
|
value = focus_spell.base2[i];
|
||||||
else
|
else
|
||||||
value = 0;
|
value = 0;
|
||||||
@ -5071,7 +5065,7 @@ int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo
|
|||||||
|
|
||||||
case SE_BlockNextSpellFocus:
|
case SE_BlockNextSpellFocus:
|
||||||
if(type == focusBlockNextSpell){
|
if(type == focusBlockNextSpell){
|
||||||
if(MakeRandomInt(1, 100) <= focus_spell.base[i])
|
if(zone->random.Roll(focus_spell.base[i]))
|
||||||
value = 1;
|
value = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -5219,12 +5213,9 @@ int16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) {
|
|||||||
if (TempItem && TempItem->Focus.Effect > 0 && IsValidSpell(TempItem->Focus.Effect)) {
|
if (TempItem && TempItem->Focus.Effect > 0 && IsValidSpell(TempItem->Focus.Effect)) {
|
||||||
|
|
||||||
proc_spellid = CalcFocusEffect(type, TempItem->Focus.Effect, spell_id);
|
proc_spellid = CalcFocusEffect(type, TempItem->Focus.Effect, spell_id);
|
||||||
|
|
||||||
if (IsValidSpell(proc_spellid)){
|
if (IsValidSpell(proc_spellid)){
|
||||||
|
|
||||||
ProcChance = GetSympatheticProcChances(spell_id, spells[TempItem->Focus.Effect].base[0], TempItem->ProcRate);
|
ProcChance = GetSympatheticProcChances(spell_id, spells[TempItem->Focus.Effect].base[0], TempItem->ProcRate);
|
||||||
|
if(zone->random.Roll(ProcChance))
|
||||||
if(MakeRandomFloat(0, 1) <= ProcChance)
|
|
||||||
SympatheticProcList.push_back(proc_spellid);
|
SympatheticProcList.push_back(proc_spellid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5240,14 +5231,10 @@ int16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) {
|
|||||||
{
|
{
|
||||||
const Item_Struct* TempItemAug = aug->GetItem();
|
const Item_Struct* TempItemAug = aug->GetItem();
|
||||||
if (TempItemAug && TempItemAug->Focus.Effect > 0 && IsValidSpell(TempItemAug->Focus.Effect)) {
|
if (TempItemAug && TempItemAug->Focus.Effect > 0 && IsValidSpell(TempItemAug->Focus.Effect)) {
|
||||||
|
|
||||||
proc_spellid = CalcFocusEffect(type, TempItemAug->Focus.Effect, spell_id);
|
proc_spellid = CalcFocusEffect(type, TempItemAug->Focus.Effect, spell_id);
|
||||||
|
|
||||||
if (IsValidSpell(proc_spellid)){
|
if (IsValidSpell(proc_spellid)){
|
||||||
|
|
||||||
ProcChance = GetSympatheticProcChances(spell_id, spells[TempItemAug->Focus.Effect].base[0], TempItemAug->ProcRate);
|
ProcChance = GetSympatheticProcChances(spell_id, spells[TempItemAug->Focus.Effect].base[0], TempItemAug->ProcRate);
|
||||||
|
if(zone->random.Roll(ProcChance))
|
||||||
if(MakeRandomFloat(0, 1) <= ProcChance)
|
|
||||||
SympatheticProcList.push_back(proc_spellid);
|
SympatheticProcList.push_back(proc_spellid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5275,8 +5262,7 @@ int16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) {
|
|||||||
if (IsValidSpell(proc_spellid)){
|
if (IsValidSpell(proc_spellid)){
|
||||||
|
|
||||||
ProcChance = GetSympatheticProcChances(spell_id, spells[focusspellid].base[0]);
|
ProcChance = GetSympatheticProcChances(spell_id, spells[focusspellid].base[0]);
|
||||||
|
if(zone->random.Roll(ProcChance))
|
||||||
if(MakeRandomFloat(0, 1) <= ProcChance)
|
|
||||||
SympatheticProcList.push_back(proc_spellid);
|
SympatheticProcList.push_back(proc_spellid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5302,10 +5288,8 @@ int16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) {
|
|||||||
proc_spellid = CalcAAFocus(type, aa_AA, spell_id);
|
proc_spellid = CalcAAFocus(type, aa_AA, spell_id);
|
||||||
|
|
||||||
if (IsValidSpell(proc_spellid)){
|
if (IsValidSpell(proc_spellid)){
|
||||||
|
|
||||||
ProcChance = GetSympatheticProcChances(spell_id, GetAABase1(aa_AA, 1));
|
ProcChance = GetSympatheticProcChances(spell_id, GetAABase1(aa_AA, 1));
|
||||||
|
if(zone->random.Roll(ProcChance))
|
||||||
if(MakeRandomFloat(0, 1) <= ProcChance)
|
|
||||||
SympatheticProcList.push_back(proc_spellid);
|
SympatheticProcList.push_back(proc_spellid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5313,7 +5297,7 @@ int16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) {
|
|||||||
|
|
||||||
if (SympatheticProcList.size() > 0)
|
if (SympatheticProcList.size() > 0)
|
||||||
{
|
{
|
||||||
uint8 random = MakeRandomInt(0, SympatheticProcList.size()-1);
|
uint8 random = zone->random.Int(0, SympatheticProcList.size()-1);
|
||||||
int FinalSympatheticProc = SympatheticProcList[random];
|
int FinalSympatheticProc = SympatheticProcList[random];
|
||||||
SympatheticProcList.clear();
|
SympatheticProcList.clear();
|
||||||
return FinalSympatheticProc;
|
return FinalSympatheticProc;
|
||||||
@ -5672,7 +5656,7 @@ bool Mob::TryDivineSave()
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
int32 SuccessChance = aabonuses.DivineSaveChance[0] + itembonuses.DivineSaveChance[0] + spellbonuses.DivineSaveChance[0];
|
int32 SuccessChance = aabonuses.DivineSaveChance[0] + itembonuses.DivineSaveChance[0] + spellbonuses.DivineSaveChance[0];
|
||||||
if (SuccessChance && MakeRandomInt(0, 100) <= SuccessChance)
|
if (SuccessChance && zone->random.Roll(SuccessChance))
|
||||||
{
|
{
|
||||||
SetHP(1);
|
SetHP(1);
|
||||||
|
|
||||||
@ -5731,7 +5715,7 @@ bool Mob::TryDeathSave() {
|
|||||||
if (SuccessChance > 95)
|
if (SuccessChance > 95)
|
||||||
SuccessChance = 95;
|
SuccessChance = 95;
|
||||||
|
|
||||||
if(SuccessChance >= MakeRandomInt(0, 100)) {
|
if(zone->random.Roll(SuccessChance)) {
|
||||||
|
|
||||||
if(spellbonuses.DeathSave[0] == 2)
|
if(spellbonuses.DeathSave[0] == 2)
|
||||||
HealAmt = RuleI(Spells, DivineInterventionHeal); //8000HP is how much LIVE Divine Intervention max heals
|
HealAmt = RuleI(Spells, DivineInterventionHeal); //8000HP is how much LIVE Divine Intervention max heals
|
||||||
@ -5762,7 +5746,7 @@ bool Mob::TryDeathSave() {
|
|||||||
if (SuccessChance > 95)
|
if (SuccessChance > 95)
|
||||||
SuccessChance = 95;
|
SuccessChance = 95;
|
||||||
|
|
||||||
if(SuccessChance >= MakeRandomInt(0, 100)) {
|
if(zone->random.Roll(SuccessChance)) {
|
||||||
|
|
||||||
if(spellbonuses.DeathSave[0] == 2)
|
if(spellbonuses.DeathSave[0] == 2)
|
||||||
HealAmt = RuleI(Spells, DivineInterventionHeal);
|
HealAmt = RuleI(Spells, DivineInterventionHeal);
|
||||||
@ -6064,7 +6048,7 @@ bool Mob::TryDispel(uint8 caster_level, uint8 buff_level, int level_modifier){
|
|||||||
else if (dispel_chance < 10)
|
else if (dispel_chance < 10)
|
||||||
dispel_chance = 10;
|
dispel_chance = 10;
|
||||||
|
|
||||||
if (MakeRandomInt(0,99) < dispel_chance)
|
if (zone->random.Roll(dispel_chance))
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -178,7 +178,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot,
|
|||||||
if(IsClient()){
|
if(IsClient()){
|
||||||
int chance = CastToClient()->GetFocusEffect(focusFcMute, spell_id);
|
int chance = CastToClient()->GetFocusEffect(focusFcMute, spell_id);
|
||||||
|
|
||||||
if (MakeRandomInt(0,99) < chance){
|
if (zone->random.Roll(chance)) {
|
||||||
Message_StringID(13, SILENCED_STRING);
|
Message_StringID(13, SILENCED_STRING);
|
||||||
if(IsClient())
|
if(IsClient())
|
||||||
CastToClient()->SendSpellBarEnable(spell_id);
|
CastToClient()->SendSpellBarEnable(spell_id);
|
||||||
@ -697,7 +697,7 @@ bool Client::CheckFizzle(uint16 spell_id)
|
|||||||
specialize = specialize * 1.3;
|
specialize = specialize * 1.3;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(((specialize/6.0f) + 15.0f) < MakeRandomFloat(0, 100)) {
|
if(((specialize/6.0f) + 15.0f) < zone->random.Real(0, 100)) {
|
||||||
specialize *= SPECIALIZE_FIZZLE / 200.0f;
|
specialize *= SPECIALIZE_FIZZLE / 200.0f;
|
||||||
} else {
|
} else {
|
||||||
specialize = 0.0f;
|
specialize = 0.0f;
|
||||||
@ -739,7 +739,7 @@ bool Client::CheckFizzle(uint16 spell_id)
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
float fizzle_roll = MakeRandomFloat(0, 100);
|
float fizzle_roll = zone->random.Real(0, 100);
|
||||||
|
|
||||||
mlog(SPELLS__CASTING, "Check Fizzle %s spell %d fizzlechance: %0.2f%% diff: %0.2f roll: %0.2f", GetName(), spell_id, fizzlechance, diff, fizzle_roll);
|
mlog(SPELLS__CASTING, "Check Fizzle %s spell %d fizzlechance: %0.2f%% diff: %0.2f roll: %0.2f", GetName(), spell_id, fizzlechance, diff, fizzle_roll);
|
||||||
|
|
||||||
@ -1028,7 +1028,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot,
|
|||||||
|
|
||||||
mlog(SPELLS__CASTING, "Checking Interruption: spell x: %f spell y: %f cur x: %f cur y: %f channelchance %f channeling skill %d\n", GetSpellX(), GetSpellY(), GetX(), GetY(), channelchance, GetSkill(SkillChanneling));
|
mlog(SPELLS__CASTING, "Checking Interruption: spell x: %f spell y: %f cur x: %f cur y: %f channelchance %f channeling skill %d\n", GetSpellX(), GetSpellY(), GetX(), GetY(), channelchance, GetSkill(SkillChanneling));
|
||||||
|
|
||||||
if(!spells[spell_id].uninterruptable && MakeRandomFloat(0, 100) > channelchance) {
|
if(!spells[spell_id].uninterruptable && zone->random.Real(0, 100) > channelchance) {
|
||||||
mlog(SPELLS__CASTING_ERR, "Casting of %d canceled: interrupted.", spell_id);
|
mlog(SPELLS__CASTING_ERR, "Casting of %d canceled: interrupted.", spell_id);
|
||||||
InterruptSpell();
|
InterruptSpell();
|
||||||
return;
|
return;
|
||||||
@ -1044,7 +1044,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot,
|
|||||||
// first check for component reduction
|
// first check for component reduction
|
||||||
if(IsClient()) {
|
if(IsClient()) {
|
||||||
int reg_focus = CastToClient()->GetFocusEffect(focusReagentCost,spell_id);
|
int reg_focus = CastToClient()->GetFocusEffect(focusReagentCost,spell_id);
|
||||||
if(MakeRandomInt(1, 100) <= reg_focus) {
|
if(zone->random.Roll(reg_focus)) {
|
||||||
mlog(SPELLS__CASTING, "Spell %d: Reagent focus item prevented reagent consumption (%d chance)", spell_id, reg_focus);
|
mlog(SPELLS__CASTING, "Spell %d: Reagent focus item prevented reagent consumption (%d chance)", spell_id, reg_focus);
|
||||||
} else {
|
} else {
|
||||||
if(reg_focus > 0)
|
if(reg_focus > 0)
|
||||||
@ -4204,7 +4204,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use
|
|||||||
{
|
{
|
||||||
IsFear = true;
|
IsFear = true;
|
||||||
int fear_resist_bonuses = CalcFearResistChance();
|
int fear_resist_bonuses = CalcFearResistChance();
|
||||||
if(MakeRandomInt(0, 99) < fear_resist_bonuses)
|
if(zone->random.Roll(fear_resist_bonuses))
|
||||||
{
|
{
|
||||||
mlog(SPELLS__RESISTS, "Resisted spell in fear resistance, had %d chance to resist", fear_resist_bonuses);
|
mlog(SPELLS__RESISTS, "Resisted spell in fear resistance, had %d chance to resist", fear_resist_bonuses);
|
||||||
return 0;
|
return 0;
|
||||||
@ -4215,14 +4215,14 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use
|
|||||||
|
|
||||||
//Check for Spell Effect specific resistance chances (ie AA Mental Fortitude)
|
//Check for Spell Effect specific resistance chances (ie AA Mental Fortitude)
|
||||||
int se_resist_bonuses = GetSpellEffectResistChance(spell_id);
|
int se_resist_bonuses = GetSpellEffectResistChance(spell_id);
|
||||||
if(se_resist_bonuses && (MakeRandomInt(0, 99) < se_resist_bonuses))
|
if(se_resist_bonuses && zone->random.Roll(se_resist_bonuses))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for Chance to Resist Spell bonuses (ie Sanctification Discipline)
|
// Check for Chance to Resist Spell bonuses (ie Sanctification Discipline)
|
||||||
int resist_bonuses = CalcResistChanceBonus();
|
int resist_bonuses = CalcResistChanceBonus();
|
||||||
if(resist_bonuses && (MakeRandomInt(0, 99) < resist_bonuses))
|
if(resist_bonuses && zone->random.Roll(resist_bonuses))
|
||||||
{
|
{
|
||||||
mlog(SPELLS__RESISTS, "Resisted spell in sanctification, had %d chance to resist", resist_bonuses);
|
mlog(SPELLS__RESISTS, "Resisted spell in sanctification, had %d chance to resist", resist_bonuses);
|
||||||
return 0;
|
return 0;
|
||||||
@ -4448,7 +4448,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Finally our roll
|
//Finally our roll
|
||||||
int roll = MakeRandomInt(0, 200);
|
int roll = zone->random.Int(0, 200);
|
||||||
if(roll > resist_chance)
|
if(roll > resist_chance)
|
||||||
{
|
{
|
||||||
return 100;
|
return 100;
|
||||||
@ -4665,7 +4665,7 @@ void Mob::Stun(int duration)
|
|||||||
if(IsValidSpell(casting_spell_id) && !spells[casting_spell_id].uninterruptable) {
|
if(IsValidSpell(casting_spell_id) && !spells[casting_spell_id].uninterruptable) {
|
||||||
int persistent_casting = spellbonuses.PersistantCasting + itembonuses.PersistantCasting + aabonuses.PersistantCasting;
|
int persistent_casting = spellbonuses.PersistantCasting + itembonuses.PersistantCasting + aabonuses.PersistantCasting;
|
||||||
|
|
||||||
if(MakeRandomInt(0,99) > persistent_casting)
|
if(zone->random.Int(0,99) > persistent_casting)
|
||||||
InterruptSpell();
|
InterruptSpell();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -396,7 +396,8 @@
|
|||||||
#define SONG_ENDS_OTHER 12688 //%1's song ends.
|
#define SONG_ENDS_OTHER 12688 //%1's song ends.
|
||||||
#define SONG_ENDS_ABRUPTLY_OTHER 12689 //%1's song ends abruptly.
|
#define SONG_ENDS_ABRUPTLY_OTHER 12689 //%1's song ends abruptly.
|
||||||
#define DIVINE_AURA_NO_ATK 12695 //You can't attack while invulnerable!
|
#define DIVINE_AURA_NO_ATK 12695 //You can't attack while invulnerable!
|
||||||
#define TRY_ATTACKING_SOMEONE 12696 //Try attacking someone other than yourself, it's more productive.
|
#define TRY_ATTACKING_SOMEONE 12696 //Try attacking someone other than yourself, it's more productive
|
||||||
|
#define RANGED_TOO_CLOSE 12698 //Your target is too close to use a ranged weapon!
|
||||||
#define BACKSTAB_WEAPON 12874 //You need a piercing weapon as your primary weapon in order to backstab
|
#define BACKSTAB_WEAPON 12874 //You need a piercing weapon as your primary weapon in order to backstab
|
||||||
#define MORE_SKILLED_THAN_I 12931 //%1 tells you, 'You are more skilled than I! What could I possibly teach you?'
|
#define MORE_SKILLED_THAN_I 12931 //%1 tells you, 'You are more skilled than I! What could I possibly teach you?'
|
||||||
#define SURNAME_EXISTS 12939 //You already have a surname. Operation failed.
|
#define SURNAME_EXISTS 12939 //You already have a surname. Operation failed.
|
||||||
|
|||||||
@ -923,7 +923,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
|
|||||||
_log(TRADESKILLS__TRACE, "...Current skill: %d , Trivial: %d , Success chance: %f percent", user_skill , spec->trivial , chance);
|
_log(TRADESKILLS__TRACE, "...Current skill: %d , Trivial: %d , Success chance: %f percent", user_skill , spec->trivial , chance);
|
||||||
_log(TRADESKILLS__TRACE, "...Bonusstat: %d , INT: %d , WIS: %d , DEX: %d , STR: %d", bonusstat , GetINT() , GetWIS() , GetDEX() , GetSTR());
|
_log(TRADESKILLS__TRACE, "...Bonusstat: %d , INT: %d , WIS: %d , DEX: %d , STR: %d", bonusstat , GetINT() , GetWIS() , GetDEX() , GetSTR());
|
||||||
|
|
||||||
float res = MakeRandomFloat(0, 99);
|
float res = zone->random.Real(0, 99);
|
||||||
int aa_chance = 0;
|
int aa_chance = 0;
|
||||||
|
|
||||||
//AA modifiers
|
//AA modifiers
|
||||||
@ -1057,7 +1057,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
|
|||||||
|
|
||||||
chance = mod_tradeskill_chance(chance, spec);
|
chance = mod_tradeskill_chance(chance, spec);
|
||||||
|
|
||||||
if (((spec->tradeskill==75) || GetGM() || (chance > res)) || MakeRandomInt(0, 99) < aa_chance){
|
if (((spec->tradeskill==75) || GetGM() || (chance > res)) || zone->random.Roll(aa_chance)) {
|
||||||
success_modifier = 1;
|
success_modifier = 1;
|
||||||
|
|
||||||
if(over_trivial < 0)
|
if(over_trivial < 0)
|
||||||
@ -1127,7 +1127,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
|
|||||||
uint8 sc = 0;
|
uint8 sc = 0;
|
||||||
while(itr != spec->salvage.end()) {
|
while(itr != spec->salvage.end()) {
|
||||||
for(sc = 0; sc < itr->second; sc++)
|
for(sc = 0; sc < itr->second; sc++)
|
||||||
if(MakeRandomInt(0,99) < SalvageChance)
|
if(zone->random.Roll(SalvageChance))
|
||||||
SummonItem(itr->first, 1);
|
SummonItem(itr->first, 1);
|
||||||
++itr;
|
++itr;
|
||||||
}
|
}
|
||||||
@ -1153,7 +1153,7 @@ void Client::CheckIncreaseTradeskill(int16 bonusstat, int16 stat_modifier, float
|
|||||||
//In stage2 the only thing that matters is your current unmodified skill.
|
//In stage2 the only thing that matters is your current unmodified skill.
|
||||||
//If you want to customize here you probbably need to implement your own
|
//If you want to customize here you probbably need to implement your own
|
||||||
//formula instead of tweaking the below one.
|
//formula instead of tweaking the below one.
|
||||||
if (chance_stage1 > MakeRandomFloat(0, 99)) {
|
if (chance_stage1 > zone->random.Real(0, 99)) {
|
||||||
if (current_raw_skill < 15) {
|
if (current_raw_skill < 15) {
|
||||||
//Always succeed
|
//Always succeed
|
||||||
chance_stage2 = 100;
|
chance_stage2 = 100;
|
||||||
@ -1168,7 +1168,7 @@ void Client::CheckIncreaseTradeskill(int16 bonusstat, int16 stat_modifier, float
|
|||||||
|
|
||||||
chance_stage2 = mod_tradeskill_skillup(chance_stage2);
|
chance_stage2 = mod_tradeskill_skillup(chance_stage2);
|
||||||
|
|
||||||
if (chance_stage2 > MakeRandomFloat(0, 99)) {
|
if (chance_stage2 > zone->random.Real(0, 99)) {
|
||||||
//Only if stage1 and stage2 succeeded you get a skillup.
|
//Only if stage1 and stage2 succeeded you get a skillup.
|
||||||
SetSkill(tradeskill, current_raw_skill + 1);
|
SetSkill(tradeskill, current_raw_skill + 1);
|
||||||
|
|
||||||
|
|||||||
@ -144,7 +144,7 @@ void Trap::Trigger(Mob* trigger)
|
|||||||
{
|
{
|
||||||
if ((tmp = database.GetNPCType(effectvalue)))
|
if ((tmp = database.GetNPCType(effectvalue)))
|
||||||
{
|
{
|
||||||
NPC* new_npc = new NPC(tmp, 0, x-5+MakeRandomInt(0, 10), y-5+MakeRandomInt(0, 10), z-5+MakeRandomInt(0, 10), MakeRandomInt(0, 249), FlyMode3);
|
NPC* new_npc = new NPC(tmp, 0, x-5+zone->random.Int(0, 10), y-5+zone->random.Int(0, 10), z-5+zone->random.Int(0, 10), zone->random.Int(0, 249), FlyMode3);
|
||||||
new_npc->AddLootTable();
|
new_npc->AddLootTable();
|
||||||
entity_list.AddNPC(new_npc);
|
entity_list.AddNPC(new_npc);
|
||||||
new_npc->AddToHateList(trigger,1);
|
new_npc->AddToHateList(trigger,1);
|
||||||
@ -165,7 +165,7 @@ void Trap::Trigger(Mob* trigger)
|
|||||||
{
|
{
|
||||||
if ((tmp = database.GetNPCType(effectvalue)))
|
if ((tmp = database.GetNPCType(effectvalue)))
|
||||||
{
|
{
|
||||||
NPC* new_npc = new NPC(tmp, 0, x-2+MakeRandomInt(0, 5), y-2+MakeRandomInt(0, 5), z-2+MakeRandomInt(0, 5), MakeRandomInt(0, 249), FlyMode3);
|
NPC* new_npc = new NPC(tmp, 0, x-2+zone->random.Int(0, 5), y-2+zone->random.Int(0, 5), z-2+zone->random.Int(0, 5), zone->random.Int(0, 249), FlyMode3);
|
||||||
new_npc->AddLootTable();
|
new_npc->AddLootTable();
|
||||||
entity_list.AddNPC(new_npc);
|
entity_list.AddNPC(new_npc);
|
||||||
new_npc->AddToHateList(trigger,1);
|
new_npc->AddToHateList(trigger,1);
|
||||||
@ -185,10 +185,10 @@ void Trap::Trigger(Mob* trigger)
|
|||||||
{
|
{
|
||||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_Damage, sizeof(CombatDamage_Struct));
|
EQApplicationPacket* outapp = new EQApplicationPacket(OP_Damage, sizeof(CombatDamage_Struct));
|
||||||
CombatDamage_Struct* a = (CombatDamage_Struct*)outapp->pBuffer;
|
CombatDamage_Struct* a = (CombatDamage_Struct*)outapp->pBuffer;
|
||||||
int dmg = MakeRandomInt(effectvalue, effectvalue2);
|
int dmg = zone->random.Int(effectvalue, effectvalue2);
|
||||||
trigger->SetHP(trigger->GetHP() - dmg);
|
trigger->SetHP(trigger->GetHP() - dmg);
|
||||||
a->damage = dmg;
|
a->damage = dmg;
|
||||||
a->sequence = MakeRandomInt(0, 1234567);
|
a->sequence = zone->random.Int(0, 1234567);
|
||||||
a->source = GetHiddenTrigger()!=nullptr ? GetHiddenTrigger()->GetID() : trigger->GetID();
|
a->source = GetHiddenTrigger()!=nullptr ? GetHiddenTrigger()->GetID() : trigger->GetID();
|
||||||
a->spellid = 0;
|
a->spellid = 0;
|
||||||
a->target = trigger->GetID();
|
a->target = trigger->GetID();
|
||||||
@ -197,7 +197,7 @@ void Trap::Trigger(Mob* trigger)
|
|||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
respawn_timer.Start((respawn_time + MakeRandomInt(0, respawn_var)) * 1000);
|
respawn_timer.Start((respawn_time + zone->random.Int(0, respawn_var)) * 1000);
|
||||||
chkarea_timer.Disable();
|
chkarea_timer.Disable();
|
||||||
disarmed = true;
|
disarmed = true;
|
||||||
}
|
}
|
||||||
@ -250,7 +250,7 @@ Mob* EntityList::GetTrapTrigger(Trap* trap) {
|
|||||||
if ((xdiff*xdiff + ydiff*ydiff) <= maxdist
|
if ((xdiff*xdiff + ydiff*ydiff) <= maxdist
|
||||||
&& zdiff < trap->maxzdiff)
|
&& zdiff < trap->maxzdiff)
|
||||||
{
|
{
|
||||||
if (MakeRandomInt(0,100) < trap->chance)
|
if (zone->random.Roll(trap->chance))
|
||||||
return(cur);
|
return(cur);
|
||||||
else
|
else
|
||||||
savemob = cur;
|
savemob = cur;
|
||||||
|
|||||||
@ -270,7 +270,7 @@ void NPC::CalculateNewWaypoint()
|
|||||||
if(closest.size() != 0)
|
if(closest.size() != 0)
|
||||||
{
|
{
|
||||||
iter = closest.begin();
|
iter = closest.begin();
|
||||||
std::advance(iter, MakeRandomInt(0, closest.size() - 1));
|
std::advance(iter, zone->random.Int(0, closest.size() - 1));
|
||||||
cur_wp = (*iter).index;
|
cur_wp = (*iter).index;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -278,7 +278,7 @@ void NPC::CalculateNewWaypoint()
|
|||||||
}
|
}
|
||||||
case 2: //random
|
case 2: //random
|
||||||
{
|
{
|
||||||
cur_wp = MakeRandomInt(0, Waypoints.size() - 1);
|
cur_wp = zone->random.Int(0, Waypoints.size() - 1);
|
||||||
if(cur_wp == old_wp)
|
if(cur_wp == old_wp)
|
||||||
{
|
{
|
||||||
if(cur_wp == (Waypoints.size() - 1))
|
if(cur_wp == (Waypoints.size() - 1))
|
||||||
@ -339,7 +339,7 @@ void NPC::CalculateNewWaypoint()
|
|||||||
if(closest.size() != 0)
|
if(closest.size() != 0)
|
||||||
{
|
{
|
||||||
iter = closest.begin();
|
iter = closest.begin();
|
||||||
std::advance(iter, MakeRandomInt(0, closest.size() - 1));
|
std::advance(iter, zone->random.Int(0, closest.size() - 1));
|
||||||
cur_wp = (*iter).index;
|
cur_wp = (*iter).index;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -412,13 +412,13 @@ void NPC::SetWaypointPause()
|
|||||||
switch (pausetype)
|
switch (pausetype)
|
||||||
{
|
{
|
||||||
case 0: //Random Half
|
case 0: //Random Half
|
||||||
AIwalking_timer->Start((cur_wp_pause - MakeRandomInt(0, cur_wp_pause-1)/2)*1000);
|
AIwalking_timer->Start((cur_wp_pause - zone->random.Int(0, cur_wp_pause-1)/2)*1000);
|
||||||
break;
|
break;
|
||||||
case 1: //Full
|
case 1: //Full
|
||||||
AIwalking_timer->Start(cur_wp_pause*1000);
|
AIwalking_timer->Start(cur_wp_pause*1000);
|
||||||
break;
|
break;
|
||||||
case 2: //Random Full
|
case 2: //Random Full
|
||||||
AIwalking_timer->Start(MakeRandomInt(0, cur_wp_pause-1)*1000);
|
AIwalking_timer->Start(zone->random.Int(0, cur_wp_pause-1)*1000);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1302,13 +1302,13 @@ void Zone::ChangeWeather()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int chance = MakeRandomInt(0, 3);
|
int chance = zone->random.Int(0, 3);
|
||||||
uint8 rainchance = zone->newzone_data.rain_chance[chance];
|
uint8 rainchance = zone->newzone_data.rain_chance[chance];
|
||||||
uint8 rainduration = zone->newzone_data.rain_duration[chance];
|
uint8 rainduration = zone->newzone_data.rain_duration[chance];
|
||||||
uint8 snowchance = zone->newzone_data.snow_chance[chance];
|
uint8 snowchance = zone->newzone_data.snow_chance[chance];
|
||||||
uint8 snowduration = zone->newzone_data.snow_duration[chance];
|
uint8 snowduration = zone->newzone_data.snow_duration[chance];
|
||||||
uint32 weathertimer = 0;
|
uint32 weathertimer = 0;
|
||||||
uint16 tmpweather = MakeRandomInt(0, 100);
|
uint16 tmpweather = zone->random.Int(0, 100);
|
||||||
uint8 duration = 0;
|
uint8 duration = 0;
|
||||||
uint8 tmpOldWeather = zone->zone_weather;
|
uint8 tmpOldWeather = zone->zone_weather;
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
@ -1317,7 +1317,7 @@ void Zone::ChangeWeather()
|
|||||||
{
|
{
|
||||||
if(rainchance > 0 || snowchance > 0)
|
if(rainchance > 0 || snowchance > 0)
|
||||||
{
|
{
|
||||||
uint8 intensity = MakeRandomInt(1, 10);
|
uint8 intensity = zone->random.Int(1, 10);
|
||||||
if((rainchance > snowchance) || (rainchance == snowchance))
|
if((rainchance > snowchance) || (rainchance == snowchance))
|
||||||
{
|
{
|
||||||
//It's gunna rain!
|
//It's gunna rain!
|
||||||
|
|||||||
@ -22,6 +22,7 @@
|
|||||||
#include "../common/linked_list.h"
|
#include "../common/linked_list.h"
|
||||||
#include "../common/rulesys.h"
|
#include "../common/rulesys.h"
|
||||||
#include "../common/types.h"
|
#include "../common/types.h"
|
||||||
|
#include "../common/random.h"
|
||||||
#include "qglobals.h"
|
#include "qglobals.h"
|
||||||
#include "spawn2.h"
|
#include "spawn2.h"
|
||||||
#include "spawngroup.h"
|
#include "spawngroup.h"
|
||||||
@ -253,6 +254,9 @@ public:
|
|||||||
void UpdateHotzone();
|
void UpdateHotzone();
|
||||||
std::unordered_map<int, item_tick_struct> tick_items;
|
std::unordered_map<int, item_tick_struct> tick_items;
|
||||||
|
|
||||||
|
// random object that provides random values for the zone
|
||||||
|
EQEmu::Random random;
|
||||||
|
|
||||||
//MODDING HOOKS
|
//MODDING HOOKS
|
||||||
void mod_init();
|
void mod_init();
|
||||||
void mod_repop();
|
void mod_repop();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user