mirror of
https://github.com/EQEmu/Server.git
synced 2026-08-30 22:06:46 +00:00
Merge from master terrible
This commit is contained in:
+98
-98
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 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 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
|
||||
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.
|
||||
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
|
||||
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
|
||||
*/
|
||||
|
||||
// Test 1
|
||||
@@ -195,21 +195,21 @@ void Client::ActivateAA(aaID activate){
|
||||
uint32 aaremain_min = (aaremain / 60) % 60;
|
||||
uint32 aaremain_sec = aaremain % 60;
|
||||
|
||||
if(aa2) {
|
||||
if (aaremain_hr >= 1) //1 hour or more
|
||||
Message(13, "You can use the ability %s again in %u hour(s) %u minute(s) %u seconds",
|
||||
aa2->name, aaremain_hr, aaremain_min, aaremain_sec);
|
||||
else //less than an hour
|
||||
Message(13, "You can use the ability %s again in %u minute(s) %u seconds",
|
||||
aa2->name, aaremain_min, aaremain_sec);
|
||||
} else {
|
||||
if (aaremain_hr >= 1) //1 hour or more
|
||||
Message(13, "You can use this ability again in %u hour(s) %u minute(s) %u seconds",
|
||||
aaremain_hr, aaremain_min, aaremain_sec);
|
||||
else //less than an hour
|
||||
Message(13, "You can use this ability again in %u minute(s) %u seconds",
|
||||
aaremain_min, aaremain_sec);
|
||||
}
|
||||
if(aa2) {
|
||||
if (aaremain_hr >= 1) //1 hour or more
|
||||
Message(13, "You can use the ability %s again in %u hour(s) %u minute(s) %u seconds",
|
||||
aa2->name, aaremain_hr, aaremain_min, aaremain_sec);
|
||||
else //less than an hour
|
||||
Message(13, "You can use the ability %s again in %u minute(s) %u seconds",
|
||||
aa2->name, aaremain_min, aaremain_sec);
|
||||
} else {
|
||||
if (aaremain_hr >= 1) //1 hour or more
|
||||
Message(13, "You can use this ability again in %u hour(s) %u minute(s) %u seconds",
|
||||
aaremain_hr, aaremain_min, aaremain_sec);
|
||||
else //less than an hour
|
||||
Message(13, "You can use this ability again in %u minute(s) %u seconds",
|
||||
aaremain_min, aaremain_sec);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -281,30 +281,30 @@ void Client::ActivateAA(aaID activate){
|
||||
if(caa->reuse_time > 0)
|
||||
{
|
||||
uint32 timer_base = CalcAAReuseTimer(caa);
|
||||
SendAATimer(AATimerID, 0, 0);
|
||||
p_timers.Start(AATimerID + pTimerAAStart, timer_base);
|
||||
SendAATimer(AATimerID, 0, 0);
|
||||
p_timers.Start(AATimerID + pTimerAAStart, timer_base);
|
||||
if(activate == aaImprovedHarmTouch || activate == aaLeechTouch)
|
||||
{
|
||||
p_timers.Start(pTimerHarmTouch, HarmTouchReuseTime);
|
||||
}
|
||||
// Bards can cast instant cast AAs while they are casting another song
|
||||
if (spells[caa->spell_id].cast_time == 0 && GetClass() == BARD && IsBardSong(casting_spell_id)) {
|
||||
if(!SpellFinished(caa->spell_id, entity_list.GetMob(target_id), 10, -1, -1, spells[caa->spell_id].ResistDiff, false)) {
|
||||
//Reset on failed cast
|
||||
SendAATimer(AATimerID, 0, 0xFFFFFF);
|
||||
Message_StringID(15,ABILITY_FAILED);
|
||||
p_timers.Clear(&database, AATimerID + pTimerAAStart);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if(!CastSpell(caa->spell_id, target_id, 10, -1, -1, 0, -1, AATimerID + pTimerAAStart, timer_base, 1)) {
|
||||
//Reset on failed cast
|
||||
SendAATimer(AATimerID, 0, 0xFFFFFF);
|
||||
Message_StringID(15,ABILITY_FAILED);
|
||||
p_timers.Clear(&database, AATimerID + pTimerAAStart);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Bards can cast instant cast AAs while they are casting another song
|
||||
if (spells[caa->spell_id].cast_time == 0 && GetClass() == BARD && IsBardSong(casting_spell_id)) {
|
||||
if(!SpellFinished(caa->spell_id, entity_list.GetMob(target_id), 10, -1, -1, spells[caa->spell_id].ResistDiff, false)) {
|
||||
//Reset on failed cast
|
||||
SendAATimer(AATimerID, 0, 0xFFFFFF);
|
||||
Message_StringID(15,ABILITY_FAILED);
|
||||
p_timers.Clear(&database, AATimerID + pTimerAAStart);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if(!CastSpell(caa->spell_id, target_id, 10, -1, -1, 0, -1, AATimerID + pTimerAAStart, timer_base, 1)) {
|
||||
//Reset on failed cast
|
||||
SendAATimer(AATimerID, 0, 0xFFFFFF);
|
||||
Message_StringID(15,ABILITY_FAILED);
|
||||
p_timers.Clear(&database, AATimerID + pTimerAAStart);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -405,7 +405,7 @@ void Client::HandleAAAction(aaID activate) {
|
||||
switch (GetClass())
|
||||
{
|
||||
case DRUID:
|
||||
spell_id = 2760; //2644?
|
||||
spell_id = 2760; //2644?
|
||||
break;
|
||||
case NECROMANCER:
|
||||
spell_id = 2759; //2643?
|
||||
@@ -468,7 +468,7 @@ void Client::HandleAAAction(aaID activate) {
|
||||
case aaActionEscape:
|
||||
Escape();
|
||||
break;
|
||||
|
||||
|
||||
// Don't think this code is used any longer for Bestial Alignment as the AA has a spell_id and no nonspell_action.
|
||||
case aaActionBeastialAlignment:
|
||||
switch(GetBaseRace()) {
|
||||
@@ -496,7 +496,7 @@ void Client::HandleAAAction(aaID activate) {
|
||||
break;
|
||||
|
||||
case aaActionFadingMemories:
|
||||
// Do nothing since spell effect works correctly, but mana isn't used.
|
||||
// Do nothing since spell effect works correctly, but mana isn't used.
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -602,10 +602,10 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u
|
||||
if(summon_count > MAX_SWARM_PETS)
|
||||
summon_count = MAX_SWARM_PETS;
|
||||
|
||||
static const float swarm_pet_x[MAX_SWARM_PETS] = { 5, -5, 5, -5,
|
||||
static const float swarm_pet_x[MAX_SWARM_PETS] = { 5, -5, 5, -5,
|
||||
10, -10, 10, -10,
|
||||
8, -8, 8, -8 };
|
||||
static const float swarm_pet_y[MAX_SWARM_PETS] = { 5, 5, -5, -5,
|
||||
static const float swarm_pet_y[MAX_SWARM_PETS] = { 5, 5, -5, -5,
|
||||
10, 10, -10, -10,
|
||||
8, 8, -8, -8 };
|
||||
TempPets(true);
|
||||
@@ -695,10 +695,10 @@ void Mob::TypesTemporaryPets(uint32 typesid, Mob *targ, const char *name_overrid
|
||||
if(summon_count > MAX_SWARM_PETS)
|
||||
summon_count = MAX_SWARM_PETS;
|
||||
|
||||
static const float swarm_pet_x[MAX_SWARM_PETS] = { 5, -5, 5, -5,
|
||||
static const float swarm_pet_x[MAX_SWARM_PETS] = { 5, -5, 5, -5,
|
||||
10, -10, 10, -10,
|
||||
8, -8, 8, -8 };
|
||||
static const float swarm_pet_y[MAX_SWARM_PETS] = { 5, 5, -5, -5,
|
||||
static const float swarm_pet_y[MAX_SWARM_PETS] = { 5, 5, -5, -5,
|
||||
10, 10, -10, -10,
|
||||
8, 8, -8, -8 };
|
||||
TempPets(true);
|
||||
@@ -1113,19 +1113,19 @@ void Client::SendAATimers() {
|
||||
}
|
||||
|
||||
void Client::SendAATable() {
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_RespondAA, sizeof(AATable_Struct));
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_RespondAA, sizeof(AATable_Struct));
|
||||
|
||||
AATable_Struct* aa2 = (AATable_Struct *)outapp->pBuffer;
|
||||
AATable_Struct* aa2 = (AATable_Struct *)outapp->pBuffer;
|
||||
aa2->aa_spent = GetAAPointsSpent();
|
||||
|
||||
uint32 i;
|
||||
uint32 i;
|
||||
for(i=0;i < MAX_PP_AA_ARRAY;i++){
|
||||
aa2->aa_list[i].aa_skill = aa[i]->AA;
|
||||
aa2->aa_list[i].aa_value = aa[i]->value;
|
||||
aa2->aa_list[i].unknown08 = 0;
|
||||
}
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
}
|
||||
|
||||
void Client::SendPreviousAA(uint32 id, int seq){
|
||||
@@ -1251,7 +1251,7 @@ void Client::SendAA(uint32 id, int seq) {
|
||||
Utilizes two new fields: sof_next_id (which is the next id in the series), sof_current_level (ranks the AA's as the current level)
|
||||
1) If no AA's purchased only display the base levels of each AA series.
|
||||
2) When you purchase an AA and its rank is maxed it sends the packet for the completed AA, and the packet
|
||||
for the next aa in the series. The previous tier is removed from your window, and the new AA is displayed.
|
||||
for the next aa in the series. The previous tier is removed from your window, and the new AA is displayed.
|
||||
3) When you zone/buy your player profile will be checked and determine what AA can be displayed base on what you have already.
|
||||
*/
|
||||
|
||||
@@ -1279,9 +1279,9 @@ void Client::SendAA(uint32 id, int seq) {
|
||||
|
||||
if (saa_pp->id == saa2->id)
|
||||
break; //You already have this in the player profile.
|
||||
else if ((saa_pp->sof_current_level < saa2->sof_current_level) && (aa_value < saa_pp->max_level))
|
||||
else if ((saa_pp->sof_current_level < saa2->sof_current_level) && (aa_value < saa_pp->max_level))
|
||||
return; //DISABLE DISPLAY HIGHER - You have not reached max level yet of your current AA.
|
||||
else if ((saa_pp->sof_current_level < saa2->sof_current_level) && (aa_value == saa_pp->max_level) && (saa_pp->sof_next_id == saa2->id))
|
||||
else if ((saa_pp->sof_current_level < saa2->sof_current_level) && (aa_value == saa_pp->max_level) && (saa_pp->sof_next_id == saa2->id))
|
||||
IsBaseLevel = false; //ALLOW DISPLAY HIGHER
|
||||
}
|
||||
}
|
||||
@@ -1321,9 +1321,9 @@ void Client::SendAA(uint32 id, int seq) {
|
||||
SendAA_Struct* saa_next = nullptr;
|
||||
saa_next = zone->FindAA(saa->sof_next_id);
|
||||
if (saa_next &&
|
||||
(((GetClientVersionBit() == 4) && (saa_next->clientver > 4))
|
||||
|| ((GetClientVersionBit() == 8) && (saa_next->clientver > 5))
|
||||
|| ((GetClientVersionBit() == 16) && (saa_next->clientver > 6)))){
|
||||
(((GetClientVersionBit() == 4) && (saa_next->clientver > 4))
|
||||
|| ((GetClientVersionBit() == 8) && (saa_next->clientver > 5))
|
||||
|| ((GetClientVersionBit() == 16) && (saa_next->clientver > 6)))){
|
||||
saa->next_id=0xFFFFFFFF;
|
||||
}
|
||||
}
|
||||
@@ -1359,7 +1359,7 @@ void Client::SendAA(uint32 id, int seq) {
|
||||
|
||||
if(value > 0)
|
||||
{
|
||||
// AA_Action stores the base ID
|
||||
// AA_Action stores the base ID
|
||||
const AA_DBAction *caa = &AA_Actions[saa->id - value + 1][value - 1];
|
||||
|
||||
if(caa && caa->reuse_time > 0)
|
||||
@@ -1385,7 +1385,7 @@ void Client::SendAA(uint32 id, int seq) {
|
||||
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
//will outapp delete the buffer for us even though it didnt make it? --- Yes, it should
|
||||
//will outapp delete the buffer for us even though it didnt make it? --- Yes, it should
|
||||
}
|
||||
|
||||
void Client::SendAAList(){
|
||||
@@ -1504,7 +1504,7 @@ void Client::ResetAA(){
|
||||
for(itr=aa_points.begin();itr!=aa_points.end();itr++)
|
||||
aa_points[itr->first] = 0;
|
||||
|
||||
for(int i = 0; i < _maxLeaderAA; ++i)
|
||||
for(int i = 0; i < _maxLeaderAA; ++i)
|
||||
m_pp.leader_abilities.ranks[i] = 0;
|
||||
|
||||
m_pp.group_leadership_points = 0;
|
||||
@@ -1634,13 +1634,13 @@ void Client::InspectBuffs(Client* Inspector, int Rank)
|
||||
//this really need to be renamed to LoadAAActions()
|
||||
bool ZoneDatabase::LoadAAEffects() {
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
|
||||
memset(AA_Actions, 0, sizeof(AA_Actions)); //I hope the compiler is smart about this size...
|
||||
|
||||
const char *query = "SELECT aaid,rank,reuse_time,spell_id,target,nonspell_action,nonspell_mana,nonspell_duration,"
|
||||
" redux_aa,redux_rate,redux_aa2,redux_rate2 FROM aa_actions";
|
||||
"redux_aa,redux_rate,redux_aa2,redux_rate2 FROM aa_actions";
|
||||
|
||||
if(RunQuery(query, static_cast<uint32>(strlen(query)), errbuf, &result)) {
|
||||
//safe_delete_array(query);
|
||||
@@ -1684,9 +1684,9 @@ bool ZoneDatabase::LoadAAEffects() {
|
||||
//AndMetal: this may now be obsolete since we have Zone::GetTotalAALevels()
|
||||
uint8 ZoneDatabase::GetTotalAALevels(uint32 skill_id) {
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
char *query = 0;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
int total=0;
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT count(slot) from aa_effects where aaid=%i", skill_id), errbuf, &result)) {
|
||||
safe_delete_array(query);
|
||||
@@ -1704,8 +1704,8 @@ uint8 ZoneDatabase::GetTotalAALevels(uint32 skill_id) {
|
||||
|
||||
//this will allow us to count the number of effects for an AA by pulling the info from memory instead of the database. hopefully this will same some CPU cycles
|
||||
uint8 Zone::GetTotalAALevels(uint32 skill_id) {
|
||||
size_t sz = aa_effects[skill_id].size();
|
||||
return sz >= 255 ? 255 : static_cast<uint8>(sz);
|
||||
size_t sz = aa_effects[skill_id].size();
|
||||
return sz >= 255 ? 255 : static_cast<uint8>(sz);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1728,9 +1728,9 @@ void ZoneDatabase::FillAAEffects(SendAA_Struct* aa_struct){
|
||||
return;
|
||||
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
char *query = 0;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT effectid, base1, base2, slot from aa_effects where aaid=%i order by slot asc", aa_struct->id), errbuf, &result)) {
|
||||
int ndx=0;
|
||||
while((row = mysql_fetch_row(result))!=nullptr) {
|
||||
@@ -1749,9 +1749,9 @@ void ZoneDatabase::FillAAEffects(SendAA_Struct* aa_struct){
|
||||
|
||||
uint32 ZoneDatabase::CountAAs(){
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
char *query = 0;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
int count=0;
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT count(title_sid) from altadv_vars"), errbuf, &result)) {
|
||||
if((row = mysql_fetch_row(result))!=nullptr)
|
||||
@@ -1766,9 +1766,9 @@ uint32 ZoneDatabase::CountAAs(){
|
||||
|
||||
uint32 ZoneDatabase::CountAAEffects(){
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
char *query = 0;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
int count=0;
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT count(id) from aa_effects"), errbuf, &result)) {
|
||||
if((row = mysql_fetch_row(result))!=nullptr){
|
||||
@@ -1864,7 +1864,7 @@ SendAA_Struct* ZoneDatabase::GetAASkillVars(uint32 skill_id)
|
||||
"WHERE "
|
||||
"p.skill_id = a.prereq_skill"
|
||||
"), "
|
||||
"0) AS prereq_skill_index, "
|
||||
"0) AS prereq_skill_index, "
|
||||
"a.prereq_minpoints, "
|
||||
"a.spell_type, "
|
||||
"a.spell_refresh, "
|
||||
@@ -1961,21 +1961,21 @@ void Client::DurationRampage(uint32 duration)
|
||||
}
|
||||
}
|
||||
|
||||
AA_SwarmPetInfo::AA_SwarmPetInfo()
|
||||
{
|
||||
target = 0;
|
||||
owner_id = 0;
|
||||
duration = nullptr;
|
||||
AA_SwarmPetInfo::AA_SwarmPetInfo()
|
||||
{
|
||||
target = 0;
|
||||
owner_id = 0;
|
||||
duration = nullptr;
|
||||
}
|
||||
|
||||
AA_SwarmPetInfo::~AA_SwarmPetInfo()
|
||||
{
|
||||
target = 0;
|
||||
owner_id = 0;
|
||||
safe_delete(duration);
|
||||
AA_SwarmPetInfo::~AA_SwarmPetInfo()
|
||||
{
|
||||
target = 0;
|
||||
owner_id = 0;
|
||||
safe_delete(duration);
|
||||
}
|
||||
|
||||
Mob *AA_SwarmPetInfo::GetOwner()
|
||||
{
|
||||
return entity_list.GetMobID(owner_id);
|
||||
Mob *AA_SwarmPetInfo::GetOwner()
|
||||
{
|
||||
return entity_list.GetMobID(owner_id);
|
||||
}
|
||||
|
||||
+162
-149
@@ -1,120 +1,133 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||
|
||||
SET(zone_sources
|
||||
AA.cpp
|
||||
aggro.cpp
|
||||
attack.cpp
|
||||
beacon.cpp
|
||||
bonuses.cpp
|
||||
bot.cpp
|
||||
botspellsai.cpp
|
||||
client.cpp
|
||||
client_logs.cpp
|
||||
client_mods.cpp
|
||||
client_packet.cpp
|
||||
client_process.cpp
|
||||
command.cpp
|
||||
doors.cpp
|
||||
effects.cpp
|
||||
embparser.cpp
|
||||
AA.cpp
|
||||
aggro.cpp
|
||||
attack.cpp
|
||||
beacon.cpp
|
||||
bonuses.cpp
|
||||
bot.cpp
|
||||
botspellsai.cpp
|
||||
client.cpp
|
||||
client_logs.cpp
|
||||
client_mods.cpp
|
||||
client_packet.cpp
|
||||
client_process.cpp
|
||||
command.cpp
|
||||
doors.cpp
|
||||
effects.cpp
|
||||
embparser.cpp
|
||||
embparser_api.cpp
|
||||
embperl.cpp
|
||||
embxs.cpp
|
||||
entity.cpp
|
||||
exp.cpp
|
||||
fearpath.cpp
|
||||
forage.cpp
|
||||
groups.cpp
|
||||
guild.cpp
|
||||
guild_mgr.cpp
|
||||
hate_list.cpp
|
||||
horse.cpp
|
||||
inventory.cpp
|
||||
loottables.cpp
|
||||
embperl.cpp
|
||||
embxs.cpp
|
||||
entity.cpp
|
||||
exp.cpp
|
||||
fearpath.cpp
|
||||
forage.cpp
|
||||
groups.cpp
|
||||
guild.cpp
|
||||
guild_mgr.cpp
|
||||
hate_list.cpp
|
||||
horse.cpp
|
||||
inventory.cpp
|
||||
loottables.cpp
|
||||
lua_client.cpp
|
||||
lua_entity.cpp
|
||||
lua_item.cpp
|
||||
lua_mob.cpp
|
||||
lua_npc.cpp
|
||||
lua_parser.cpp
|
||||
Map.cpp
|
||||
merc.cpp
|
||||
mob.cpp
|
||||
MobAI.cpp
|
||||
net.cpp
|
||||
npc.cpp
|
||||
NpcAI.cpp
|
||||
Object.cpp
|
||||
pathing.cpp
|
||||
perl_client.cpp
|
||||
perl_doors.cpp
|
||||
perl_entity.cpp
|
||||
perl_groups.cpp
|
||||
perl_hateentry.cpp
|
||||
perl_mob.cpp
|
||||
perl_npc.cpp
|
||||
perl_object.cpp
|
||||
perl_perlpacket.cpp
|
||||
perl_PlayerCorpse.cpp
|
||||
perl_questitem.cpp
|
||||
perl_raids.cpp
|
||||
perlpacket.cpp
|
||||
petitions.cpp
|
||||
pets.cpp
|
||||
PlayerCorpse.cpp
|
||||
QGlobals.cpp
|
||||
questmgr.cpp
|
||||
QuestParserCollection.cpp
|
||||
raids.cpp
|
||||
spawn2.cpp
|
||||
spawn2.h
|
||||
spawngroup.cpp
|
||||
special_attacks.cpp
|
||||
spell_effects.cpp
|
||||
spells.cpp
|
||||
tasks.cpp
|
||||
titles.cpp
|
||||
tradeskills.cpp
|
||||
trading.cpp
|
||||
trap.cpp
|
||||
tribute.cpp
|
||||
updatemgr.cpp
|
||||
watermap.cpp
|
||||
waypoints.cpp
|
||||
worldserver.cpp
|
||||
zone.cpp
|
||||
zone_logsys.cpp
|
||||
zone_profile.cpp
|
||||
ZoneConfig.cpp
|
||||
zonedb.cpp
|
||||
zonedbasync.cpp
|
||||
zoning.cpp
|
||||
embperl.cpp
|
||||
embxs.cpp
|
||||
entity.cpp
|
||||
exp.cpp
|
||||
fearpath.cpp
|
||||
forage.cpp
|
||||
groups.cpp
|
||||
guild.cpp
|
||||
guild_mgr.cpp
|
||||
hate_list.cpp
|
||||
horse.cpp
|
||||
inventory.cpp
|
||||
loottables.cpp
|
||||
Map.cpp
|
||||
merc.cpp
|
||||
mob.cpp
|
||||
MobAI.cpp
|
||||
mod_functions.cpp
|
||||
net.cpp
|
||||
npc.cpp
|
||||
NpcAI.cpp
|
||||
Object.cpp
|
||||
pathing.cpp
|
||||
perl_client.cpp
|
||||
perl_doors.cpp
|
||||
perl_entity.cpp
|
||||
perl_groups.cpp
|
||||
perl_hateentry.cpp
|
||||
perl_mob.cpp
|
||||
perl_npc.cpp
|
||||
perl_object.cpp
|
||||
perl_perlpacket.cpp
|
||||
perl_PlayerCorpse.cpp
|
||||
perl_questitem.cpp
|
||||
perl_raids.cpp
|
||||
perlpacket.cpp
|
||||
petitions.cpp
|
||||
pets.cpp
|
||||
PlayerCorpse.cpp
|
||||
QGlobals.cpp
|
||||
questmgr.cpp
|
||||
QuestParserCollection.cpp
|
||||
raids.cpp
|
||||
spawn2.cpp
|
||||
spawn2.h
|
||||
spawngroup.cpp
|
||||
special_attacks.cpp
|
||||
spell_effects.cpp
|
||||
spells.cpp
|
||||
tasks.cpp
|
||||
titles.cpp
|
||||
tradeskills.cpp
|
||||
trading.cpp
|
||||
trap.cpp
|
||||
tribute.cpp
|
||||
updatemgr.cpp
|
||||
watermap.cpp
|
||||
waypoints.cpp
|
||||
worldserver.cpp
|
||||
zone.cpp
|
||||
zone_logsys.cpp
|
||||
zone_profile.cpp
|
||||
ZoneConfig.cpp
|
||||
zonedb.cpp
|
||||
zonedbasync.cpp
|
||||
zoning.cpp
|
||||
)
|
||||
|
||||
SET(zone_headers
|
||||
AA.h
|
||||
basic_functions.h
|
||||
beacon.h
|
||||
bot.h
|
||||
botStructs.h
|
||||
client.h
|
||||
client_logs.h
|
||||
client_packet.h
|
||||
command.h
|
||||
common.h
|
||||
doors.h
|
||||
embparser.h
|
||||
embperl.h
|
||||
embxs.h
|
||||
entity.h
|
||||
errmsg.h
|
||||
event_codes.h
|
||||
forage.h
|
||||
groups.h
|
||||
guild_mgr.h
|
||||
hate_list.h
|
||||
horse.h
|
||||
AA.h
|
||||
basic_functions.h
|
||||
beacon.h
|
||||
bot.h
|
||||
botStructs.h
|
||||
client.h
|
||||
client_logs.h
|
||||
client_packet.h
|
||||
command.h
|
||||
common.h
|
||||
doors.h
|
||||
embparser.h
|
||||
embperl.h
|
||||
embxs.h
|
||||
entity.h
|
||||
errmsg.h
|
||||
event_codes.h
|
||||
forage.h
|
||||
groups.h
|
||||
guild_mgr.h
|
||||
hate_list.h
|
||||
horse.h
|
||||
lua_client.h
|
||||
lua_entity.h
|
||||
lua_item.h
|
||||
@@ -122,44 +135,44 @@ SET(zone_headers
|
||||
lua_npc.h
|
||||
lua_parser.h
|
||||
lua_trade.h
|
||||
map.h
|
||||
masterentity.h
|
||||
maxskill.h
|
||||
message.h
|
||||
merc.h
|
||||
mob.h
|
||||
net.h
|
||||
npc.h
|
||||
NpcAI.h
|
||||
object.h
|
||||
pathing.h
|
||||
perlpacket.h
|
||||
petitions.h
|
||||
pets.h
|
||||
PlayerCorpse.h
|
||||
QGlobals.h
|
||||
QuestInterface.h
|
||||
questmgr.h
|
||||
QuestParserCollection.h
|
||||
raid.h
|
||||
raids.h
|
||||
skills.h
|
||||
spawn2.cpp
|
||||
spawn2.h
|
||||
spawngroup.h
|
||||
StringIDs.h
|
||||
tasks.h
|
||||
titles.h
|
||||
trap.h
|
||||
updatemgr.h
|
||||
watermap.h
|
||||
worldserver.h
|
||||
zone.h
|
||||
zone_profile.h
|
||||
ZoneConfig.h
|
||||
zonedb.h
|
||||
zonedbasync.h
|
||||
zonedump.h
|
||||
map.h
|
||||
masterentity.h
|
||||
maxskill.h
|
||||
message.h
|
||||
merc.h
|
||||
mob.h
|
||||
net.h
|
||||
npc.h
|
||||
NpcAI.h
|
||||
object.h
|
||||
pathing.h
|
||||
perlpacket.h
|
||||
petitions.h
|
||||
pets.h
|
||||
PlayerCorpse.h
|
||||
QGlobals.h
|
||||
QuestInterface.h
|
||||
questmgr.h
|
||||
QuestParserCollection.h
|
||||
raid.h
|
||||
raids.h
|
||||
skills.h
|
||||
spawn2.cpp
|
||||
spawn2.h
|
||||
spawngroup.h
|
||||
StringIDs.h
|
||||
tasks.h
|
||||
titles.h
|
||||
trap.h
|
||||
updatemgr.h
|
||||
watermap.h
|
||||
worldserver.h
|
||||
zone.h
|
||||
zone_profile.h
|
||||
ZoneConfig.h
|
||||
zonedb.h
|
||||
zonedbasync.h
|
||||
zonedump.h
|
||||
)
|
||||
|
||||
ADD_EXECUTABLE(zone ${zone_sources} ${zone_headers})
|
||||
@@ -174,23 +187,23 @@ ENDIF(EQEMU_BUILD_LUA)
|
||||
|
||||
|
||||
IF(MSVC)
|
||||
SET_TARGET_PROPERTIES(zone PROPERTIES LINK_FLAGS_RELEASE "/OPT:REF /OPT:ICF")
|
||||
TARGET_LINK_LIBRARIES(zone "Ws2_32.lib")
|
||||
SET_TARGET_PROPERTIES(zone PROPERTIES LINK_FLAGS_RELEASE "/OPT:REF /OPT:ICF")
|
||||
TARGET_LINK_LIBRARIES(zone "Ws2_32.lib")
|
||||
ENDIF(MSVC)
|
||||
|
||||
IF(MINGW)
|
||||
TARGET_LINK_LIBRARIES(zone "WS2_32")
|
||||
TARGET_LINK_LIBRARIES(zone "WS2_32")
|
||||
ENDIF(MINGW)
|
||||
|
||||
IF(UNIX)
|
||||
IF(NOT FREEBSD)
|
||||
TARGET_LINK_LIBRARIES(zone "dl")
|
||||
ENDIF(NOT FREEBSD)
|
||||
TARGET_LINK_LIBRARIES(zone "z")
|
||||
TARGET_LINK_LIBRARIES(zone "m")
|
||||
TARGET_LINK_LIBRARIES(zone "rt")
|
||||
TARGET_LINK_LIBRARIES(zone "pthread")
|
||||
ADD_DEFINITIONS(-fPIC)
|
||||
TARGET_LINK_LIBRARIES(zone "z")
|
||||
TARGET_LINK_LIBRARIES(zone "m")
|
||||
TARGET_LINK_LIBRARIES(zone "rt")
|
||||
TARGET_LINK_LIBRARIES(zone "pthread")
|
||||
ADD_DEFINITIONS(-fPIC)
|
||||
ENDIF(UNIX)
|
||||
|
||||
SET(EXECUTABLE_OUTPUT_PATH ../Bin)
|
||||
|
||||
+132
-132
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
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
|
||||
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
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "../common/debug.h"
|
||||
#include "../common/MiscFunctions.h"
|
||||
@@ -64,15 +64,15 @@ Map* Map::LoadMapfile(const char* in_zonename, const char *directory) {
|
||||
char zBuf[64];
|
||||
char cWork[256];
|
||||
Map* ret = 0;
|
||||
|
||||
|
||||
//have to convert to lower because the short names im getting
|
||||
//are not all lower anymore, copy since strlwr edits the str.
|
||||
strn0cpy(zBuf, in_zonename, 64);
|
||||
|
||||
|
||||
if(directory == nullptr)
|
||||
directory = MAP_DIR;
|
||||
snprintf(cWork, 250, "%s/%s.map", directory, strlwr(zBuf));
|
||||
|
||||
|
||||
if ((fp = fopen( cWork, "rb" ))) {
|
||||
ret = new Map();
|
||||
if(ret != nullptr) {
|
||||
@@ -96,7 +96,7 @@ Map::Map() {
|
||||
_maxz = FLT_MIN;
|
||||
_maxx = FLT_MIN;
|
||||
_maxy = FLT_MIN;
|
||||
|
||||
|
||||
m_Faces = 0;
|
||||
m_Nodes = 0;
|
||||
m_FaceLists = 0;
|
||||
@@ -122,22 +122,22 @@ bool Map::loadMap(FILE *fp) {
|
||||
printf("Invalid map version 0x%lx\n", (unsigned long)head.version);
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
||||
printf("Map header: %lu faces, %u nodes, %lu facelists\n", (unsigned long)head.face_count, (unsigned int)head.node_count, (unsigned long)head.facelist_count);
|
||||
|
||||
m_Faces = head.face_count;
|
||||
m_Nodes = head.node_count;
|
||||
m_FaceLists = head.facelist_count;
|
||||
|
||||
|
||||
/* fread(&m_Vertex, 4, 1, fp);
|
||||
fread(&m_Faces , 4, 1, fp);*/
|
||||
// mFinalVertex = new VERTEX[m_Vertex];
|
||||
mFinalFaces = new FACE [m_Faces];
|
||||
mNodes = new NODE[m_Nodes];
|
||||
mFaceLists = new uint32[m_FaceLists];
|
||||
|
||||
|
||||
// fread(mFinalVertex, m_Vertex, sizeof(VERTEX), fp);
|
||||
|
||||
|
||||
//this was changed to this loop from the single read because valgrind was
|
||||
//hanging on this read otherwise... I dont pretend to understand it.
|
||||
#ifdef SLOW_AND_CRAPPY_MAKES_VALGRIND_HAPPY
|
||||
@@ -155,7 +155,7 @@ bool Map::loadMap(FILE *fp) {
|
||||
return(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef SLOW_AND_CRAPPY_MAKES_VALGRIND_HAPPY
|
||||
for(r = 0; r < m_Nodes; r++) {
|
||||
if(fread(mNodes+r, sizeof(NODE), 1, fp) != 1) {
|
||||
@@ -169,7 +169,7 @@ bool Map::loadMap(FILE *fp) {
|
||||
return(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef SLOW_AND_CRAPPY_MAKES_VALGRIND_HAPPY
|
||||
for(r = 0; r < m_FaceLists; r++) {
|
||||
if(fread(mFaceLists+r, sizeof(uint32), 1, fp) != 1) {
|
||||
@@ -183,8 +183,8 @@ bool Map::loadMap(FILE *fp) {
|
||||
return(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* mRoot = new NODE();
|
||||
RecLoadNode(mRoot, fp );*/
|
||||
|
||||
@@ -248,7 +248,7 @@ for(m = 0; m < _node->faces.count; m++) {
|
||||
FACE *c = &mFinalFaces[ *cfl ];
|
||||
printf(" %lu (%.2f, %.2f, %.2f) (%.2f, %.2f, %.2f) (%.2f, %.2f, %.2f)\n",
|
||||
*cfl, c->a.x, c->a.y, c->a.z,
|
||||
c->b.x, c->b.y, c->b.z,
|
||||
c->b.x, c->b.y, c->b.z,
|
||||
c->c.x, c->c.y, c->c.z);
|
||||
cfl++;
|
||||
}*/
|
||||
@@ -257,24 +257,24 @@ for(m = 0; m < _node->faces.count; m++) {
|
||||
}
|
||||
#ifdef DEBUG_SEEK
|
||||
printf(" Kids: %u, %u, %u, %u\n", _node->nodes[0], _node->nodes[1], _node->nodes[2], _node->nodes[3]);
|
||||
|
||||
|
||||
printf(" Contained In Box: (%.2f -> %.2f, %.2f -> %.2f)\n", _node->minx, _node->maxx, _node->miny, _node->maxy);
|
||||
|
||||
|
||||
/*printf(" Node found has children.\n");
|
||||
if(_node->node1 != nullptr) {
|
||||
printf("\tNode: (%.2f -> %.2f, %.2f -> %.2f)\n",
|
||||
printf("\tNode: (%.2f -> %.2f, %.2f -> %.2f)\n",
|
||||
_node->node1->minx, _node->node1->maxx, _node->node1->miny, _node->node1->maxy);
|
||||
}
|
||||
if(_node->node2 != nullptr) {
|
||||
printf("\tNode: (%.2f -> %.2f, %.2f -> %.2f)\n",
|
||||
printf("\tNode: (%.2f -> %.2f, %.2f -> %.2f)\n",
|
||||
_node->node2->minx, _node->node2->maxx, _node->node2->miny, _node->node2->maxy);
|
||||
}
|
||||
if(_node->node3 != nullptr) {
|
||||
printf("\tNode: (%.2f -> %.2f, %.2f -> %.2f)\n",
|
||||
printf("\tNode: (%.2f -> %.2f, %.2f -> %.2f)\n",
|
||||
_node->node3->minx, _node->node3->maxx, _node->node3->miny, _node->node3->maxy);
|
||||
}
|
||||
if(_node->node4 != nullptr) {
|
||||
printf("\tNode: (%.2f -> %.2f, %.2f -> %.2f)\n",
|
||||
printf("\tNode: (%.2f -> %.2f, %.2f -> %.2f)\n",
|
||||
_node->node4->minx, _node->node4->maxx, _node->node4->miny, _node->node4->maxy);
|
||||
}*/
|
||||
#endif
|
||||
@@ -294,7 +294,7 @@ if(_node->node4 != nullptr) {
|
||||
tmp = SeekNode( _node->nodes[1], x, y );
|
||||
}
|
||||
} else {
|
||||
if(y < midy) { //quad 4
|
||||
if(y < midy) { //quad 4
|
||||
if(_node->nodes[2] != NODE_NONE && _node->nodes[3] != node_r)
|
||||
tmp = SeekNode( _node->nodes[3], x, y );
|
||||
} else { //quad 1
|
||||
@@ -304,16 +304,16 @@ if(_node->node4 != nullptr) {
|
||||
}
|
||||
if( tmp != NODE_NONE ) return tmp;
|
||||
#else
|
||||
if(_node->nodes[0] == node_r) return(NODE_NONE); //prevent infinite recursion
|
||||
if(_node->nodes[0] == node_r) return(NODE_NONE); //prevent infinite recursion
|
||||
tmp = SeekNode( _node->nodes[0], x, y );
|
||||
if( tmp != NODE_NONE ) return tmp;
|
||||
if(_node->nodes[1] == node_r) return(NODE_NONE); //prevent infinite recursion
|
||||
if(_node->nodes[1] == node_r) return(NODE_NONE); //prevent infinite recursion
|
||||
tmp = SeekNode( _node->nodes[1], x, y );
|
||||
if( tmp != NODE_NONE ) return tmp;
|
||||
if(_node->nodes[2] == node_r) return(NODE_NONE); //prevent infinite recursion
|
||||
if(_node->nodes[2] == node_r) return(NODE_NONE); //prevent infinite recursion
|
||||
tmp = SeekNode( _node->nodes[2], x, y );
|
||||
if( tmp != NODE_NONE ) return tmp;
|
||||
if(_node->nodes[3] == node_r) return(NODE_NONE); //prevent infinite recursion
|
||||
if(_node->nodes[3] == node_r) return(NODE_NONE); //prevent infinite recursion
|
||||
tmp = SeekNode( _node->nodes[3], x, y );
|
||||
if( tmp != NODE_NONE ) return tmp;
|
||||
#endif
|
||||
@@ -326,16 +326,16 @@ printf(" No node found.\n");
|
||||
}
|
||||
|
||||
// maybe precalc edges.
|
||||
int* Map::SeekFace( NodeRef node_r, float x, float y ) {
|
||||
int* Map::SeekFace( NodeRef node_r, float x, float y ) {
|
||||
if( node_r == NODE_NONE || node_r >= m_Nodes) {
|
||||
return(nullptr);
|
||||
}
|
||||
const PNODE _node = &mNodes[node_r];
|
||||
if(!(_node->flags & nodeFinal)) {
|
||||
return(nullptr); //not a final node... could find the proper node...
|
||||
return(nullptr); //not a final node... could find the proper node...
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//printf("Seeking face for (%.2f, %.2f) with root 0x%x.\n", x, y, _node);
|
||||
float dx,dy;
|
||||
float nx,ny;
|
||||
@@ -346,19 +346,19 @@ int* Map::SeekFace( NodeRef node_r, float x, float y ) {
|
||||
const VERTEX &v1 = cf.a;
|
||||
const VERTEX &v2 = cf.b;
|
||||
const VERTEX &v3 = cf.c;
|
||||
|
||||
|
||||
dx = v2.x - v1.x; dy = v2.y - v1.y;
|
||||
nx = x - v1.x; ny = y - v1.y;
|
||||
nx = x - v1.x; ny = y - v1.y;
|
||||
if( dx*ny - dy*nx >0.0f ) continue;
|
||||
|
||||
|
||||
dx = v3.x - v2.x; dy = v3.y - v2.y;
|
||||
nx = x - v2.x; ny = y - v2.y;
|
||||
nx = x - v2.x; ny = y - v2.y;
|
||||
if( dx*ny - dy*nx >0.0f ) continue;
|
||||
|
||||
|
||||
dx = v1.x - v3.x; dy = v1.y - v3.y;
|
||||
nx = x - v3.x; ny = y - v3.y;
|
||||
nx = x - v3.x; ny = y - v3.y;
|
||||
if( dx*ny - dy*nx >0.0f ) continue;
|
||||
|
||||
|
||||
*face++ = mFaceLists[_node->faces.offset + i];
|
||||
}
|
||||
*face = -1;
|
||||
@@ -388,7 +388,7 @@ bool Map::LineIntersectsZone(VERTEX start, VERTEX end, float step_mag, VERTEX *r
|
||||
curz = start.z;
|
||||
|
||||
VERTEX cur = start;
|
||||
|
||||
|
||||
stepx = end.x - start.x;
|
||||
stepy = end.y - start.y;
|
||||
stepz = end.z - start.z;
|
||||
@@ -396,14 +396,14 @@ bool Map::LineIntersectsZone(VERTEX start, VERTEX end, float step_mag, VERTEX *r
|
||||
if((stepx == 0) && (stepy == 0) && (stepz == 0))
|
||||
return false;
|
||||
|
||||
float factor = sqrt(stepx*stepx + stepy*stepy + stepz*stepz);
|
||||
float factor = sqrt(stepx*stepx + stepy*stepy + stepz*stepz);
|
||||
|
||||
stepx = (stepx/factor)*step_mag;
|
||||
stepy = (stepy/factor)*step_mag;
|
||||
stepz = (stepz/factor)*step_mag;
|
||||
|
||||
NodeRef cnode, lnode, finalnode;
|
||||
lnode = NODE_NONE; //last node visited
|
||||
lnode = NODE_NONE; //last node visited
|
||||
|
||||
cnode = SeekNode(GetRoot(), start.x, start.y);
|
||||
finalnode = SeekNode(GetRoot(), end.x, end.y);
|
||||
@@ -416,23 +416,23 @@ bool Map::LineIntersectsZone(VERTEX start, VERTEX end, float step_mag, VERTEX *r
|
||||
stepy = (float)end.y - cury;
|
||||
stepz = (float)end.z - curz;
|
||||
|
||||
factor = sqrt(stepx*stepx + stepy*stepy + stepz*stepz);
|
||||
factor = sqrt(stepx*stepx + stepy*stepy + stepz*stepz);
|
||||
|
||||
stepx = (stepx/factor)*step_mag;
|
||||
stepy = (stepy/factor)*step_mag;
|
||||
stepz = (stepz/factor)*step_mag;
|
||||
|
||||
cnode = SeekNode(GetRoot(), curx, cury);
|
||||
|
||||
cnode = SeekNode(GetRoot(), curx, cury);
|
||||
if(cnode != lnode)
|
||||
{
|
||||
lnode = cnode;
|
||||
lnode = cnode;
|
||||
|
||||
if(cnode == NODE_NONE)
|
||||
return false;
|
||||
|
||||
if(LineIntersectsNode(cnode, start, end, result, on))
|
||||
return(true);
|
||||
|
||||
return(true);
|
||||
|
||||
if(cnode == finalnode)
|
||||
return false;
|
||||
}
|
||||
@@ -466,18 +466,18 @@ bool Map::LocWithinNode( NodeRef node_r, float x, float y ) const {
|
||||
bool Map::LineIntersectsNode( NodeRef node_r, VERTEX p1, VERTEX p2, VERTEX *result, FACE **on) const {
|
||||
_ZP(Map_LineIntersectsNode);
|
||||
if( node_r == NODE_NONE || node_r >= m_Nodes) {
|
||||
return(true); //can see through empty nodes, just allow LOS on error...
|
||||
return(true); //can see through empty nodes, just allow LOS on error...
|
||||
}
|
||||
const PNODE _node = &mNodes[node_r];
|
||||
if(!(_node->flags & nodeFinal)) {
|
||||
return(true); //not a final node... not sure best action
|
||||
return(true); //not a final node... not sure best action
|
||||
}
|
||||
|
||||
|
||||
unsigned long i;
|
||||
|
||||
|
||||
PFACE cur;
|
||||
const uint32 *cfl = mFaceLists + _node->faces.offset;
|
||||
|
||||
|
||||
for(i = 0; i < _node->faces.count; i++) {
|
||||
if(*cfl > m_Faces)
|
||||
continue; //watch for invalid lists, they seem to happen
|
||||
@@ -512,16 +512,16 @@ float Map::FindBestZ( NodeRef node_r, VERTEX p1, VERTEX *result, FACE **on) cons
|
||||
}
|
||||
const PNODE _node = &mNodes[node_r];
|
||||
if(!(_node->flags & nodeFinal)) {
|
||||
return(BEST_Z_INVALID); //not a final node... could find the proper node...
|
||||
return(BEST_Z_INVALID); //not a final node... could find the proper node...
|
||||
}
|
||||
|
||||
|
||||
VERTEX tmp_result; //dummy placeholder if they do not ask for a result.
|
||||
if(result == nullptr)
|
||||
result = &tmp_result;
|
||||
|
||||
|
||||
VERTEX p2(p1);
|
||||
p2.z = BEST_Z_INVALID;
|
||||
|
||||
|
||||
float best_z = BEST_Z_INVALID;
|
||||
int zAttempt;
|
||||
|
||||
@@ -531,7 +531,7 @@ float Map::FindBestZ( NodeRef node_r, VERTEX p1, VERTEX *result, FACE **on) cons
|
||||
|
||||
// If we don't find a bestZ on the first attempt, we try again from a position CurrentZ + 10 higher
|
||||
// This is in case the pathing between waypoints temporarily sends the NPC below ground level.
|
||||
//
|
||||
//
|
||||
for(zAttempt=1; zAttempt<=2; zAttempt++) {
|
||||
|
||||
const uint32 *cfl = mFaceLists + _node->faces.offset;
|
||||
@@ -541,7 +541,7 @@ printf("Start finding best Z...\n");
|
||||
#endif
|
||||
for(i = 0; i < _node->faces.count; i++) {
|
||||
if(*cfl > m_Faces)
|
||||
continue; //watch for invalid lists, they seem to happen, e.g. in eastwastes.map
|
||||
continue; //watch for invalid lists, they seem to happen, e.g. in eastwastes.map
|
||||
|
||||
cur = &mFinalFaces[ *cfl ];
|
||||
//printf("Intersecting with face %lu\n", *cfl);
|
||||
@@ -549,7 +549,7 @@ printf("Start finding best Z...\n");
|
||||
#ifdef DEBUG_BEST_Z
|
||||
printf(" %lu (%.2f, %.2f, %.2f) (%.2f, %.2f, %.2f) (%.2f, %.2f, %.2f)\n",
|
||||
*cfl, cur->a.x, cur->a.y, cur->a.z,
|
||||
cur->b.x, cur->b.y, cur->b.z,
|
||||
cur->b.x, cur->b.y, cur->b.z,
|
||||
cur->c.x, cur->c.y, cur->c.z);
|
||||
printf("Found a z: %.2f\n", result->z);
|
||||
#endif
|
||||
@@ -564,7 +564,7 @@ printf("Start finding best Z...\n");
|
||||
|
||||
if(best_z != BEST_Z_INVALID) return best_z;
|
||||
|
||||
p1.z = p1.z + 10 ; // If we can't find a best Z, the NPC is probably just under the world. Try again from 10 units higher up.
|
||||
p1.z = p1.z + 10 ; // If we can't find a best Z, the NPC is probably just under the world. Try again from 10 units higher up.
|
||||
}
|
||||
|
||||
#ifdef DEBUG_BEST_Z
|
||||
@@ -577,16 +577,16 @@ printf("Best Z found: %.2f\n", best_z);
|
||||
|
||||
bool Map::LineIntersectsFace( PFACE cface, VERTEX p1, VERTEX p2, VERTEX *result) const {
|
||||
if( cface == nullptr ) {
|
||||
return(false); //cant intersect a face we dont have... i guess
|
||||
return(false); //cant intersect a face we dont have... i guess
|
||||
}
|
||||
|
||||
|
||||
const VERTEX &pa = cface->a;
|
||||
const VERTEX &pb = cface->b;
|
||||
const VERTEX &pc = cface->c;
|
||||
|
||||
|
||||
//quick bounding box checks
|
||||
float tbb;
|
||||
|
||||
|
||||
tbb = Vmin3(x, pa, pb, pc);
|
||||
if(p1.x < tbb && p2.x < tbb)
|
||||
return(false);
|
||||
@@ -596,7 +596,7 @@ bool Map::LineIntersectsFace( PFACE cface, VERTEX p1, VERTEX p2, VERTEX *result)
|
||||
tbb = Vmin3(z, pa, pb, pc);
|
||||
if(p1.z < tbb && p2.z < tbb)
|
||||
return(false);
|
||||
|
||||
|
||||
tbb = Vmax3(x, pa, pb, pc);
|
||||
if(p1.x > tbb && p2.x > tbb)
|
||||
return(false);
|
||||
@@ -606,16 +606,16 @@ bool Map::LineIntersectsFace( PFACE cface, VERTEX p1, VERTEX p2, VERTEX *result)
|
||||
tbb = Vmax3(z, pa, pb, pc);
|
||||
if(p1.z > tbb && p2.z > tbb)
|
||||
return(false);
|
||||
|
||||
|
||||
//begin attempt 2
|
||||
//#define RTOD 57.2957795 //radians to degrees constant.
|
||||
//#define RTOD 57.2957795 //radians to degrees constant.
|
||||
|
||||
float d;
|
||||
float denom,mu;
|
||||
VERTEX n, intersect;
|
||||
|
||||
|
||||
// FACE *thisface = &mFinalFaces[ _node->pfaces[ i ] ];
|
||||
|
||||
|
||||
VERTEX *p = &intersect;
|
||||
if(result != nullptr)
|
||||
p = result;
|
||||
@@ -635,21 +635,21 @@ bool Map::LineIntersectsFace( PFACE cface, VERTEX p1, VERTEX p2, VERTEX *result)
|
||||
n.z = cface->nz;
|
||||
d = cface->nd;
|
||||
#endif
|
||||
|
||||
|
||||
//try inverting the normals...
|
||||
n.x = -n.x;
|
||||
n.y = -n.y;
|
||||
n.z = -n.z;
|
||||
d = - n.x * pa.x - n.y * pa.y - n.z * pa.z; //recalc
|
||||
|
||||
|
||||
|
||||
|
||||
// Calculate the position on the line that intersects the plane
|
||||
denom = n.x * (p2.x - p1.x) + n.y * (p2.y - p1.y) + n.z * (p2.z - p1.z);
|
||||
if (ABS(denom) < EPS) // Line and plane don't intersect
|
||||
return(false);
|
||||
if (ABS(denom) < EPS) // Line and plane don't intersect
|
||||
return(false);
|
||||
mu = - (d + n.x * p1.x + n.y * p1.y + n.z * p1.z) / denom;
|
||||
if (mu < 0 || mu > 1) // Intersection not along line segment
|
||||
return(false);
|
||||
if (mu < 0 || mu > 1) // Intersection not along line segment
|
||||
return(false);
|
||||
p->x = p1.x + mu * (p2.x - p1.x);
|
||||
p->y = p1.y + mu * (p2.y - p1.y);
|
||||
p->z = p1.z + mu * (p2.z - p1.z);
|
||||
@@ -676,18 +676,18 @@ bool Map::LineIntersectsFace( PFACE cface, VERTEX p1, VERTEX p2, VERTEX *result)
|
||||
a1 = pa1.x*pa2.x + pa1.y*pa2.y + pa1.z*pa2.z;
|
||||
a2 = pa2.x*pa3.x + pa2.y*pa3.y + pa2.z*pa3.z;
|
||||
a3 = pa3.x*pa1.x + pa3.y*pa1.y + pa3.z*pa1.z;
|
||||
|
||||
|
||||
//holy hell these 3 acos are slow, we need to rewrite this...
|
||||
// total = (acos(a1) + acos(a2) + acos(a3));
|
||||
// if (ABS(total - 2*M_PI) > EPS)
|
||||
total = (acos(a1) + acos(a2) + acos(a3)) * 57.2957795;
|
||||
if (ABS(total - 360) > EPS)
|
||||
return(false);
|
||||
return(false);
|
||||
|
||||
return(true);
|
||||
*/
|
||||
|
||||
/*
|
||||
/*
|
||||
//yet another failed method, project triangle and point into
|
||||
//2 space based on largest component of the normal
|
||||
//and check the triangle there.
|
||||
@@ -704,7 +704,7 @@ bool Map::LineIntersectsFace( PFACE cface, VERTEX p1, VERTEX p2, VERTEX *result)
|
||||
tz = -n.z;
|
||||
else
|
||||
tz = n.z;
|
||||
|
||||
|
||||
VERTEX pa2, pb2, pc2;
|
||||
if(tx < ty) {
|
||||
//keep x
|
||||
@@ -733,22 +733,22 @@ bool Map::LineIntersectsFace( PFACE cface, VERTEX p1, VERTEX p2, VERTEX *result)
|
||||
pc2.x = pc.x; pc2.y = pc.y;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Determine whether or not the intersection point is bounded by pa,pb,pc
|
||||
#define Sign(p1, p2, p3) \
|
||||
((p1->x - p3.x) * (p2.y - p3.y) - (p2.x - p3.x) * (p1->y - p3.y))
|
||||
bool b1, b2, b3;
|
||||
bool b1, b2, b3;
|
||||
|
||||
b1 = Sign(p, pa2, pb2) < 0.0f;
|
||||
b2 = Sign(p, pb2, pc2) < 0.0f;
|
||||
b3 = Sign(p, pc2, pa2) < 0.0f;
|
||||
b1 = Sign(p, pa2, pb2) < 0.0f;
|
||||
b2 = Sign(p, pb2, pc2) < 0.0f;
|
||||
b3 = Sign(p, pc2, pa2) < 0.0f;
|
||||
|
||||
return ((b1 == b2) && (b2 == b3));
|
||||
return ((b1 == b2) && (b2 == b3));
|
||||
*/
|
||||
|
||||
|
||||
/* //not working well, seems to block LOS a lot
|
||||
|
||||
//a new check based on barycentric coordinates, stolen from
|
||||
//a new check based on barycentric coordinates, stolen from
|
||||
//http://www.flipcode.com/cgi-bin/fcmsg.cgi?thread_show=7766
|
||||
float xcp, ycp, xab, yab, xac, yac;
|
||||
float divb;
|
||||
@@ -802,21 +802,21 @@ bool Map::LineIntersectsFace( PFACE cface, VERTEX p1, VERTEX p2, VERTEX *result)
|
||||
|
||||
return(true);
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
Yet another method adapted from this code:
|
||||
Vec3 pa1 = pa - p;
|
||||
Vec3 pa2 = pb - p;
|
||||
float d = pa1.cross(pa2).dot(n);
|
||||
if (d < 0) return false;
|
||||
Vec3 pa3 = pb - p;
|
||||
d = pa2.cross(pa3).dot(n);
|
||||
if (d < 0) return false;
|
||||
d = pa3.cross(pa1).dot(n);
|
||||
if (d < 0) return false;
|
||||
return true;
|
||||
Vec3 pa1 = pa - p;
|
||||
Vec3 pa2 = pb - p;
|
||||
float d = pa1.cross(pa2).dot(n);
|
||||
if (d < 0) return false;
|
||||
Vec3 pa3 = pb - p;
|
||||
d = pa2.cross(pa3).dot(n);
|
||||
if (d < 0) return false;
|
||||
d = pa3.cross(pa1).dot(n);
|
||||
if (d < 0) return false;
|
||||
return true;
|
||||
*/
|
||||
|
||||
|
||||
//in practice, this seems to actually take longer
|
||||
//than the arc cosine method above...
|
||||
n.x = -n.x;
|
||||
@@ -824,55 +824,55 @@ bool Map::LineIntersectsFace( PFACE cface, VERTEX p1, VERTEX p2, VERTEX *result)
|
||||
n.z = -n.z;
|
||||
VERTEX pa1,pa2,pa3, tmp;
|
||||
float t;
|
||||
|
||||
|
||||
//pa1 = pa - p
|
||||
pa1.x = pa.x - p->x;
|
||||
pa1.y = pa.y - p->y;
|
||||
pa1.z = pa.z - p->z;
|
||||
|
||||
|
||||
//pa2 = pb - p
|
||||
pa2.x = pb.x - p->x;
|
||||
pa2.y = pb.y - p->y;
|
||||
pa2.z = pb.z - p->z;
|
||||
|
||||
|
||||
//tmp = pa1 cross pa2
|
||||
tmp.x = pa1.y * pa2.z - pa1.z * pa2.y;
|
||||
tmp.y = pa1.z * pa2.x - pa1.x * pa2.z;
|
||||
tmp.z = pa1.x * pa2.y - pa1.y * pa2.x;
|
||||
|
||||
|
||||
//t = tmp dot n
|
||||
t = tmp.x * n.x + tmp.y * n.y + tmp.z * n.z;
|
||||
if(t < 0)
|
||||
return(false);
|
||||
//printf("t = %f\n", t);
|
||||
|
||||
|
||||
//pa3 = pb - p
|
||||
pa3.x = pc.x - p->x;
|
||||
pa3.y = pc.y - p->y;
|
||||
pa3.z = pc.z - p->z;
|
||||
|
||||
|
||||
//tmp = pa2 cross pa3
|
||||
tmp.x = pa2.y * pa3.z - pa2.z * pa3.y;
|
||||
tmp.y = pa2.z * pa3.x - pa2.x * pa3.z;
|
||||
tmp.z = pa2.x * pa3.y - pa2.y * pa3.x;
|
||||
|
||||
|
||||
//t = tmp dot n
|
||||
t = tmp.x * n.x + tmp.y * n.y + tmp.z * n.z;
|
||||
if(t < 0)
|
||||
return(false);
|
||||
//printf("t = %f\n", t);
|
||||
|
||||
|
||||
//tmp = pa3 cross pa1
|
||||
tmp.x = pa3.y * pa1.z - pa3.z * pa1.y;
|
||||
tmp.y = pa3.z * pa1.x - pa3.x * pa1.z;
|
||||
tmp.z = pa3.x * pa1.y - pa3.y * pa1.x;
|
||||
|
||||
|
||||
//t = tmp dot n
|
||||
t = tmp.x * n.x + tmp.y * n.y + tmp.z * n.z;
|
||||
if(t < 0)
|
||||
return(false);
|
||||
//printf("t = %f\n", t);
|
||||
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
@@ -890,7 +890,7 @@ bool Map::LineIntersectsZoneNoZLeaps(VERTEX start, VERTEX end, float step_mag, V
|
||||
cur.x = start.x;
|
||||
cur.y = start.y;
|
||||
cur.z = start.z;
|
||||
|
||||
|
||||
step.x = end.x - start.x;
|
||||
step.y = end.y - start.y;
|
||||
step.z = end.z - start.z;
|
||||
@@ -914,7 +914,7 @@ bool Map::LineIntersectsZoneNoZLeaps(VERTEX start, VERTEX end, float step_mag, V
|
||||
step.y = -0.001f;
|
||||
if (step.z < 0 && step.z > -0.001f)
|
||||
step.z = -0.001f;
|
||||
|
||||
|
||||
NodeRef cnode, lnode;
|
||||
lnode = 0;
|
||||
//while we are not past end
|
||||
@@ -926,7 +926,7 @@ bool Map::LineIntersectsZoneNoZLeaps(VERTEX start, VERTEX end, float step_mag, V
|
||||
if (cnode == NODE_NONE)
|
||||
{
|
||||
return(true);
|
||||
}
|
||||
}
|
||||
VERTEX me;
|
||||
me.x = cur.x;
|
||||
me.y = cur.y;
|
||||
@@ -948,7 +948,7 @@ bool Map::LineIntersectsZoneNoZLeaps(VERTEX start, VERTEX end, float step_mag, V
|
||||
}
|
||||
lnode = cnode;
|
||||
}
|
||||
|
||||
|
||||
//move 1 step
|
||||
if (cur.x != end.x)
|
||||
cur.x += step.x;
|
||||
@@ -956,7 +956,7 @@ bool Map::LineIntersectsZoneNoZLeaps(VERTEX start, VERTEX end, float step_mag, V
|
||||
cur.y += step.y;
|
||||
if (cur.z != end.z)
|
||||
cur.z += step.z;
|
||||
|
||||
|
||||
//watch for end conditions
|
||||
if ( (cur.x > end.x && end.x >= start.x) || (cur.x < end.x && end.x <= start.x) || (step.x == 0) ) {
|
||||
cur.x = end.x;
|
||||
@@ -968,7 +968,7 @@ bool Map::LineIntersectsZoneNoZLeaps(VERTEX start, VERTEX end, float step_mag, V
|
||||
cur.z = end.z;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//walked entire line and didnt run into anything...
|
||||
return(false);
|
||||
}
|
||||
@@ -980,19 +980,19 @@ float Map::FindClosestZ(VERTEX p ) const
|
||||
std::list<float> ZSet;
|
||||
|
||||
NodeRef NodeR = SeekNode(MAP_ROOT_NODE, p.x, p.y);
|
||||
|
||||
|
||||
if( NodeR == NODE_NONE || NodeR >= m_Nodes)
|
||||
return 0;
|
||||
|
||||
|
||||
PNODE CurrentNode = &mNodes[NodeR];
|
||||
|
||||
if(!(CurrentNode->flags & nodeFinal))
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
|
||||
VERTEX p1(p), p2(p), Result;
|
||||
|
||||
p1.z = 999999;
|
||||
|
||||
|
||||
p2.z = BEST_Z_INVALID;
|
||||
|
||||
const uint32 *CurrentFaceList = mFaceLists + CurrentNode->faces.offset;
|
||||
@@ -1006,7 +1006,7 @@ float Map::FindClosestZ(VERTEX p ) const
|
||||
|
||||
if(CurrentFace->nz > 0 && LineIntersectsFace(CurrentFace, p1, p2, &Result))
|
||||
ZSet.push_back(Result.z);
|
||||
|
||||
|
||||
CurrentFaceList++;
|
||||
|
||||
}
|
||||
|
||||
+467
-466
File diff suppressed because it is too large
Load Diff
+12
-12
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
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 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
|
||||
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.
|
||||
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
|
||||
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 NPCAI_H
|
||||
@@ -34,7 +34,7 @@ Seems more like a bitwise comparison client side..
|
||||
*/
|
||||
#define DEFAULT_AGGRORADIUS 70
|
||||
#define DEFAULT_FRENYRADIUS 70
|
||||
#define MAX_SHIELDRADIUS 20
|
||||
#define MAX_SHIELDRADIUS 20
|
||||
|
||||
uint32 GetLevelCon(uint8 PlayerLevel, uint8 NPCLevel);
|
||||
|
||||
|
||||
+86
-86
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2003 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2003 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
|
||||
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
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "../common/debug.h"
|
||||
@@ -42,10 +42,10 @@ extern EntityList entity_list;
|
||||
Object::Object(uint32 id, uint32 type, uint32 icon, const Object_Struct& object, const ItemInst* inst)
|
||||
: respawn_timer(0), decay_timer(300000)
|
||||
{
|
||||
|
||||
|
||||
user = nullptr;
|
||||
last_user = nullptr;
|
||||
|
||||
|
||||
// Initialize members
|
||||
m_id = id;
|
||||
m_type = type;
|
||||
@@ -62,7 +62,7 @@ Object::Object(uint32 id, uint32 type, uint32 icon, const Object_Struct& object,
|
||||
decay_timer.Disable();
|
||||
}
|
||||
respawn_timer.Disable();
|
||||
|
||||
|
||||
// Set drop_id to zero - it will be set when added to zone with SetID()
|
||||
m_data.drop_id = 0;
|
||||
}
|
||||
@@ -71,7 +71,7 @@ Object::Object(uint32 id, uint32 type, uint32 icon, const Object_Struct& object,
|
||||
Object::Object(const ItemInst* inst, char* name,float max_x,float min_x,float max_y,float min_y,float z,float heading,uint32 respawntimer)
|
||||
: respawn_timer(respawntimer), decay_timer(300000)
|
||||
{
|
||||
|
||||
|
||||
user = nullptr;
|
||||
last_user = nullptr;
|
||||
m_max_x=max_x;
|
||||
@@ -94,7 +94,7 @@ Object::Object(const ItemInst* inst, char* name,float max_x,float min_x,float ma
|
||||
respawn_timer.Disable();
|
||||
strcpy(m_data.object_name, name);
|
||||
RandomSpawn(false);
|
||||
|
||||
|
||||
// Hardcoded portion for unknown members
|
||||
m_data.unknown024 = 0x7f001194;
|
||||
m_data.unknown076 = 0x0000d5fe;
|
||||
@@ -107,7 +107,7 @@ Object::Object(Client* client, const ItemInst* inst)
|
||||
{
|
||||
user = nullptr;
|
||||
last_user = nullptr;
|
||||
|
||||
|
||||
// Initialize members
|
||||
m_id = 0;
|
||||
m_inst = (inst) ? inst->Clone() : nullptr;
|
||||
@@ -122,7 +122,7 @@ Object::Object(Client* client, const ItemInst* inst)
|
||||
m_data.y = client->GetY();
|
||||
m_data.z = client->GetZ();
|
||||
m_data.zone_id = zone->GetZoneID();
|
||||
|
||||
|
||||
decay_timer.Start();
|
||||
respawn_timer.Disable();
|
||||
|
||||
@@ -130,7 +130,7 @@ Object::Object(Client* client, const ItemInst* inst)
|
||||
m_data.unknown024 = 0x7f001194;
|
||||
m_data.unknown076 = 0x0000d5fe;
|
||||
m_data.unknown084 = 0xFFFFFFFF;
|
||||
|
||||
|
||||
// Set object name
|
||||
if (inst) {
|
||||
const Item_Struct* item = inst->GetItem();
|
||||
@@ -145,7 +145,7 @@ Object::Object(Client* client, const ItemInst* inst)
|
||||
if (len_copy > sizeof(DEFAULT_OBJECT_NAME_SUFFIX)) {
|
||||
len_copy = sizeof(DEFAULT_OBJECT_NAME_SUFFIX);
|
||||
}
|
||||
|
||||
|
||||
memcpy(&m_data.object_name[0], inst->GetItem()->IDFile, len_idfile);
|
||||
memcpy(&m_data.object_name[len_idfile], DEFAULT_OBJECT_NAME_SUFFIX, len_copy);
|
||||
}
|
||||
@@ -161,7 +161,7 @@ Object::Object(const ItemInst *inst, float x, float y, float z, float heading, u
|
||||
{
|
||||
user = nullptr;
|
||||
last_user = nullptr;
|
||||
|
||||
|
||||
// Initialize members
|
||||
m_id = 0;
|
||||
m_inst = (inst) ? inst->Clone() : nullptr;
|
||||
@@ -176,7 +176,7 @@ Object::Object(const ItemInst *inst, float x, float y, float z, float heading, u
|
||||
m_data.y = y;
|
||||
m_data.z = z;
|
||||
m_data.zone_id = zone->GetZoneID();
|
||||
|
||||
|
||||
if (decay_time)
|
||||
decay_timer.Start();
|
||||
|
||||
@@ -186,7 +186,7 @@ Object::Object(const ItemInst *inst, float x, float y, float z, float heading, u
|
||||
m_data.unknown024 = 0x7f001194;
|
||||
m_data.unknown076 = 0x0000d5fe;
|
||||
m_data.unknown084 = 0xFFFFFFFF;
|
||||
|
||||
|
||||
// Set object name
|
||||
if (inst) {
|
||||
const Item_Struct* item = inst->GetItem();
|
||||
@@ -201,7 +201,7 @@ Object::Object(const ItemInst *inst, float x, float y, float z, float heading, u
|
||||
if (len_copy > sizeof(DEFAULT_OBJECT_NAME_SUFFIX)) {
|
||||
len_copy = sizeof(DEFAULT_OBJECT_NAME_SUFFIX);
|
||||
}
|
||||
|
||||
|
||||
memcpy(&m_data.object_name[0], inst->GetItem()->IDFile, len_idfile);
|
||||
memcpy(&m_data.object_name[len_idfile], DEFAULT_OBJECT_NAME_SUFFIX, len_copy);
|
||||
}
|
||||
@@ -219,7 +219,7 @@ Object::Object(const char *model, float x, float y, float z, float heading, uint
|
||||
last_user = nullptr;
|
||||
ItemInst* inst = nullptr;
|
||||
inst = new ItemInst(ItemUseWorldContainer);
|
||||
|
||||
|
||||
// Initialize members
|
||||
m_id = 0;
|
||||
m_inst = (inst) ? inst->Clone() : nullptr;
|
||||
@@ -263,7 +263,7 @@ void Object::SetID(uint16 set_id)
|
||||
{
|
||||
// Invoke base class
|
||||
Entity::SetID(set_id);
|
||||
|
||||
|
||||
// Store new id as drop_id
|
||||
m_data.drop_id = (uint32)this->GetID();
|
||||
}
|
||||
@@ -272,7 +272,7 @@ void Object::SetID(uint16 set_id)
|
||||
void Object::ResetState()
|
||||
{
|
||||
safe_delete(m_inst);
|
||||
|
||||
|
||||
m_id = 0;
|
||||
m_type = 0;
|
||||
m_icon = 0;
|
||||
@@ -289,7 +289,7 @@ bool Object::Save()
|
||||
// Doesn't yet exist, add now
|
||||
m_id = database.AddObject(m_type, m_icon, m_data, m_inst);
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -302,7 +302,7 @@ uint16 Object::VarSave()
|
||||
else {
|
||||
// Doesn't yet exist, add now
|
||||
m_id = database.AddObject(m_type, m_icon, m_data, m_inst);
|
||||
}
|
||||
}
|
||||
return m_id;
|
||||
}
|
||||
|
||||
@@ -312,7 +312,7 @@ void Object::Delete(bool reset_state)
|
||||
if (m_id != 0) {
|
||||
database.DeleteObject(m_id);
|
||||
}
|
||||
|
||||
|
||||
if (reset_state) {
|
||||
ResetState();
|
||||
}
|
||||
@@ -325,7 +325,7 @@ void Object::PutItem(uint8 index, const ItemInst* inst)
|
||||
LogFile->write(EQEMuLog::Error, "Object::PutItem: Invalid index specified (%i)", index);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (m_inst && m_inst->IsType(ItemClassContainer)) {
|
||||
if (inst) {
|
||||
m_inst->PutItem(index, *inst);
|
||||
@@ -345,7 +345,7 @@ void Object::Close() {
|
||||
{
|
||||
last_user = user;
|
||||
// put any remaining items from the world container back into the player's inventory to avoid item loss
|
||||
// if they close the container without removing all items
|
||||
// if they close the container without removing all items
|
||||
ItemInst* container = this->m_inst;
|
||||
if(container != nullptr)
|
||||
{
|
||||
@@ -369,7 +369,7 @@ void Object::DeleteItem(uint8 index)
|
||||
{
|
||||
if (m_inst && m_inst->IsType(ItemClassContainer)) {
|
||||
m_inst->DeleteItem(index);
|
||||
|
||||
|
||||
// This is _highly_ inefficient, but for now it will work: Save entire object to database
|
||||
Save();
|
||||
}
|
||||
@@ -379,14 +379,14 @@ void Object::DeleteItem(uint8 index)
|
||||
ItemInst* Object::PopItem(uint8 index)
|
||||
{
|
||||
ItemInst* inst = nullptr;
|
||||
|
||||
|
||||
if (m_inst && m_inst->IsType(ItemClassContainer)) {
|
||||
inst = m_inst->PopItem(index);
|
||||
|
||||
|
||||
// This is _highly_ inefficient, but for now it will work: Save entire object to database
|
||||
Save();
|
||||
}
|
||||
|
||||
|
||||
return inst;
|
||||
}
|
||||
|
||||
@@ -422,7 +422,7 @@ bool Object::Process(){
|
||||
database.DeleteObject(m_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if(m_ground_spawn && respawn_timer.Check()){
|
||||
RandomSpawn(true);
|
||||
}
|
||||
@@ -432,11 +432,11 @@ bool Object::Process(){
|
||||
void Object::RandomSpawn(bool send_packet) {
|
||||
if(!m_ground_spawn)
|
||||
return;
|
||||
|
||||
|
||||
m_data.x = MakeRandomFloat(m_min_x, m_max_x);
|
||||
m_data.y = MakeRandomFloat(m_min_y, m_max_y);
|
||||
respawn_timer.Disable();
|
||||
|
||||
|
||||
if(send_packet) {
|
||||
EQApplicationPacket app;
|
||||
CreateSpawnPacket(&app);
|
||||
@@ -447,16 +447,16 @@ void Object::RandomSpawn(bool send_packet) {
|
||||
bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object)
|
||||
{
|
||||
if(m_ground_spawn){//This is a Cool Groundspawn
|
||||
respawn_timer.Start();
|
||||
respawn_timer.Start();
|
||||
}
|
||||
if (m_type == OT_DROPPEDITEM) {
|
||||
bool cursordelete = false;
|
||||
if (m_inst && sender) {
|
||||
// if there is a lore conflict, delete the offending item from the server inventory
|
||||
// if there is a lore conflict, delete the offending item from the server inventory
|
||||
// the client updates itself and takes care of sending "duplicate lore item" messages
|
||||
if(sender->CheckLoreConflict(m_inst->GetItem())) {
|
||||
int16 loreslot = sender->GetInv().HasItem(m_inst->GetItem()->ID, 0, invWhereBank);
|
||||
if(loreslot != SLOT_INVALID) // if the duplicate is in the bank, delete it.
|
||||
if(loreslot != SLOT_INVALID) // if the duplicate is in the bank, delete it.
|
||||
sender->DeleteItemInInventory(loreslot);
|
||||
else
|
||||
cursordelete = true; // otherwise, we delete the new one
|
||||
@@ -465,15 +465,15 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object)
|
||||
char buf[10];
|
||||
snprintf(buf, 9, "%u", m_inst->GetItem()->ID);
|
||||
buf[9] = '\0';
|
||||
parse->EventPlayer(EVENT_PLAYER_PICKUP, sender, buf, 0);
|
||||
parse->EventPlayer(EVENT_PLAYER_PICKUP, sender, buf, 0);
|
||||
|
||||
// Transfer item to client
|
||||
sender->PutItemInInventory(SLOT_CURSOR, *m_inst, false);
|
||||
sender->SendItemPacket(SLOT_CURSOR, m_inst, ItemPacketTrade);
|
||||
|
||||
if(cursordelete) // delete the item if it's a duplicate lore. We have to do this because the client expects the item packet
|
||||
sender->DeleteItemInInventory(SLOT_CURSOR);
|
||||
|
||||
|
||||
if(cursordelete) // delete the item if it's a duplicate lore. We have to do this because the client expects the item packet
|
||||
sender->DeleteItemInInventory(SLOT_CURSOR);
|
||||
|
||||
if(!m_ground_spawn)
|
||||
safe_delete(m_inst);
|
||||
|
||||
@@ -481,22 +481,22 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object)
|
||||
sender->SetTradeskillObject(nullptr);
|
||||
user = nullptr;
|
||||
}
|
||||
|
||||
|
||||
// Send click to all clients (removes entity on client)
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_ClickObject, sizeof(ClickObject_Struct));
|
||||
memcpy(outapp->pBuffer, click_object, sizeof(ClickObject_Struct));
|
||||
entity_list.QueueClients(nullptr, outapp, false);
|
||||
safe_delete(outapp);
|
||||
|
||||
|
||||
// Remove object
|
||||
database.DeleteObject(m_id);
|
||||
if(!m_ground_spawn)
|
||||
entity_list.RemoveEntity(this->GetID());
|
||||
entity_list.RemoveEntity(this->GetID());
|
||||
} else {
|
||||
// Tradeskill item
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_ClickObjectAction, sizeof(ClickObjectAction_Struct));
|
||||
ClickObjectAction_Struct* coa = (ClickObjectAction_Struct*)outapp->pBuffer;
|
||||
|
||||
|
||||
//TODO: there is prolly a better way to do this.
|
||||
//if this is not the main user, send them a close and a message
|
||||
if(user == nullptr || user == sender)
|
||||
@@ -507,12 +507,12 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object)
|
||||
}
|
||||
m_inuse = true;
|
||||
coa->type = m_type;
|
||||
coa->unknown16 = 0x0a;
|
||||
|
||||
coa->unknown16 = 0x0a;
|
||||
|
||||
coa->drop_id = click_object->drop_id;
|
||||
coa->player_id = click_object->player_id;
|
||||
coa->icon = m_icon;
|
||||
|
||||
|
||||
if(sender->IsLooting())
|
||||
{
|
||||
coa->open = 0x00;
|
||||
@@ -521,16 +521,16 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object)
|
||||
|
||||
sender->QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
|
||||
|
||||
//if the object allready had a user, we are done
|
||||
if(user != nullptr)
|
||||
return(false);
|
||||
|
||||
|
||||
// Starting to use this object
|
||||
sender->SetTradeskillObject(this);
|
||||
|
||||
|
||||
user = sender;
|
||||
|
||||
|
||||
// Send items inside of container
|
||||
|
||||
if (m_inst && m_inst->IsType(ItemClassContainer)) {
|
||||
@@ -538,7 +538,7 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object)
|
||||
//Clear out no-drop and no-rent items first if different player opens it
|
||||
if(user != last_user)
|
||||
m_inst->ClearByFlags(byFlagSet, byFlagSet);
|
||||
|
||||
|
||||
EQApplicationPacket* outapp=new EQApplicationPacket(OP_ClientReady,0);
|
||||
sender->QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
@@ -551,7 +551,7 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -559,29 +559,29 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object)
|
||||
uint32 ZoneDatabase::AddObject(uint32 type, uint32 icon, const Object_Struct& object, const ItemInst* inst)
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char* query = 0;
|
||||
|
||||
char* query = 0;
|
||||
|
||||
uint32 database_id = 0;
|
||||
uint32 item_id = 0;
|
||||
int16 charges = 0;
|
||||
|
||||
|
||||
if (inst && inst->GetItem()) {
|
||||
item_id = inst->GetItem()->ID;
|
||||
charges = inst->GetCharges();
|
||||
}
|
||||
|
||||
|
||||
// SQL Escape object_name
|
||||
uint32 len = strlen(object.object_name) * 2 + 1;
|
||||
char* object_name = new char[len];
|
||||
DoEscapeString(object_name, object.object_name, strlen(object.object_name));
|
||||
|
||||
|
||||
// Construct query
|
||||
uint32 len_query = MakeAnyLenString(&query,
|
||||
"insert into object (zoneid, xpos, ypos, zpos, heading, itemid, charges, objectname, "
|
||||
"type, icon) values (%i, %f, %f, %f, %f, %i, %i, '%s', %i, %i)",
|
||||
object.zone_id, object.x, object.y, object.z, object.heading,
|
||||
item_id, charges, object_name, type, icon);
|
||||
|
||||
|
||||
// Save new record for object
|
||||
if (!RunQuery(query, len_query, errbuf, nullptr, nullptr, &database_id)) {
|
||||
LogFile->write(EQEMuLog::Error, "Unable to insert object: %s", errbuf);
|
||||
@@ -592,7 +592,7 @@ uint32 ZoneDatabase::AddObject(uint32 type, uint32 icon, const Object_Struct& ob
|
||||
SaveWorldContainer(object.zone_id, database_id, inst);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
safe_delete_array(object_name);
|
||||
safe_delete_array(query);
|
||||
return database_id;
|
||||
@@ -602,28 +602,28 @@ uint32 ZoneDatabase::AddObject(uint32 type, uint32 icon, const Object_Struct& ob
|
||||
void ZoneDatabase::UpdateObject(uint32 id, uint32 type, uint32 icon, const Object_Struct& object, const ItemInst* inst)
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char* query = 0;
|
||||
|
||||
char* query = 0;
|
||||
|
||||
uint32 item_id = 0;
|
||||
int16 charges = 0;
|
||||
|
||||
|
||||
if (inst && inst->GetItem()) {
|
||||
item_id = inst->GetItem()->ID;
|
||||
charges = inst->GetCharges();
|
||||
}
|
||||
|
||||
|
||||
// SQL Escape object_name
|
||||
uint32 len = strlen(object.object_name) * 2 + 1;
|
||||
char* object_name = new char[len];
|
||||
DoEscapeString(object_name, object.object_name, strlen(object.object_name));
|
||||
|
||||
|
||||
// Construct query
|
||||
uint32 len_query = MakeAnyLenString(&query,
|
||||
"update object set zoneid=%i, xpos=%f, ypos=%f, zpos=%f, heading=%f, "
|
||||
"itemid=%i, charges=%i, objectname='%s', type=%i, icon=%i where id=%i",
|
||||
object.zone_id, object.x, object.y, object.z, object.heading,
|
||||
item_id, charges, object_name, type, icon, id);
|
||||
|
||||
|
||||
// Save new record for object
|
||||
if (!RunQuery(query, len_query, errbuf)) {
|
||||
LogFile->write(EQEMuLog::Error, "Unable to update object: %s", errbuf);
|
||||
@@ -634,16 +634,16 @@ void ZoneDatabase::UpdateObject(uint32 id, uint32 type, uint32 icon, const Objec
|
||||
SaveWorldContainer(object.zone_id, id, inst);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
safe_delete_array(object_name);
|
||||
safe_delete_array(query);
|
||||
}
|
||||
Ground_Spawns* ZoneDatabase::LoadGroundSpawns(uint32 zone_id, int16 version, Ground_Spawns* gs){
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
|
||||
char *query = 0;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT max_x,max_y,max_z,min_x,min_y,heading,name,item,max_allowed,respawn_timer from ground_spawns where zoneid=%i and (version=%u OR version=-1) limit 50", zone_id, version), errbuf, &result))
|
||||
{
|
||||
safe_delete_array(query);
|
||||
@@ -672,12 +672,12 @@ Ground_Spawns* ZoneDatabase::LoadGroundSpawns(uint32 zone_id, int16 version, Gro
|
||||
void ZoneDatabase::DeleteObject(uint32 id)
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char* query = 0;
|
||||
|
||||
char* query = 0;
|
||||
|
||||
// Construct query
|
||||
uint32 len_query = MakeAnyLenString(&query,
|
||||
"delete from object where id=%i", id);
|
||||
|
||||
|
||||
// Save new record for object
|
||||
if (!RunQuery(query, len_query, errbuf)) {
|
||||
LogFile->write(EQEMuLog::Error, "Unable to delete object: %s", errbuf);
|
||||
@@ -686,7 +686,7 @@ void ZoneDatabase::DeleteObject(uint32 id)
|
||||
// Delete contained items, if any
|
||||
// DeleteWorldContainer(id);
|
||||
//}
|
||||
|
||||
|
||||
safe_delete_array(query);
|
||||
}
|
||||
|
||||
@@ -712,7 +712,7 @@ uint32 Object::GetIcon()
|
||||
}
|
||||
|
||||
float Object::GetX()
|
||||
{
|
||||
{
|
||||
return this->m_data.x;
|
||||
}
|
||||
|
||||
@@ -840,7 +840,7 @@ uint32 Object::GetItemID()
|
||||
void Object::SetItemID(uint32 itemid)
|
||||
{
|
||||
safe_delete(this->m_inst);
|
||||
|
||||
|
||||
if (itemid)
|
||||
{
|
||||
this->m_inst = database.CreateItem(itemid);
|
||||
|
||||
+279
-279
File diff suppressed because it is too large
Load Diff
+12
-12
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
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 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
|
||||
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.
|
||||
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
|
||||
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 CORPSE_H
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
void Delete();
|
||||
void Bury();
|
||||
virtual void Depop();
|
||||
virtual void DepopCorpse();
|
||||
virtual void DepopCorpse();
|
||||
|
||||
uint32 GetCopper() { return copper; }
|
||||
uint32 GetSilver() { return silver; }
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@
|
||||
struct QGlobal
|
||||
{
|
||||
QGlobal() { }
|
||||
QGlobal(std::string g_name, uint32 c_id, uint32 n_id, uint32 z_id, std::string n_value, uint32 expire_date)
|
||||
QGlobal(std::string g_name, uint32 c_id, uint32 n_id, uint32 z_id, std::string n_value, uint32 expire_date)
|
||||
: name(g_name), char_id(c_id), npc_id(n_id), zone_id(z_id), value(n_value), expdate(expire_date) { id = 0; }
|
||||
std::string name;
|
||||
uint32 char_id;
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
|
||||
//assumes cacheA is already a valid or empty list and doesn't check for valid items.
|
||||
static void Combine(std::list<QGlobal> &cacheA, std::list<QGlobal> cacheB, uint32 npcID, uint32 charID, uint32 zoneID);
|
||||
|
||||
|
||||
void PurgeExpiredGlobals();
|
||||
void LoadByNPCID(uint32 npcID); //npc
|
||||
void LoadByCharID(uint32 charID); //client
|
||||
|
||||
+13
-13
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
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 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
|
||||
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.
|
||||
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
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "../common/debug.h"
|
||||
#include <iostream.h>
|
||||
@@ -71,7 +71,7 @@ bool ZoneDatabase::OpenQuery(char* zonename) {
|
||||
strcpy( Quest::m_pQuests[ l_cnt ].m_pQuestText, row[1] );
|
||||
Quest::m_pQuests[ l_cnt ].m_pQuestEnd = new char[ strlen( row[2] )+1 ];
|
||||
strcpy( Quest::m_pQuests[ l_cnt ].m_pQuestEnd, row[2] );
|
||||
|
||||
|
||||
Quest::m_pQuests[ l_cnt ].m_iNpcId = atoi( row[3] );
|
||||
Quest::m_pQuests[ l_cnt ].m_iQuestObject= atoi( row[4] );
|
||||
Quest::m_pQuests[ l_cnt ].m_iQuestPrice = atoi( row[5] );
|
||||
@@ -94,7 +94,7 @@ return false;
|
||||
pquest_entry Quest::Test( int NpcId, int QuestObject )
|
||||
{
|
||||
for( int i=0;i<m_nQuests;i++ )
|
||||
if( m_pQuests[ i ].m_iNpcId == NpcId && m_pQuests[ i ].m_iQuestObject == QuestObject )
|
||||
if( m_pQuests[ i ].m_iNpcId == NpcId && m_pQuests[ i ].m_iQuestObject == QuestObject )
|
||||
return &m_pQuests[ i ];
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+12
-12
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
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 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
|
||||
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.
|
||||
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
|
||||
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 __QUEST_H__
|
||||
#define __QUEST_H__
|
||||
@@ -33,7 +33,7 @@ typedef struct _tag_quest_entry{
|
||||
|
||||
|
||||
class Quest{
|
||||
public:
|
||||
public:
|
||||
Quest();
|
||||
~Quest();
|
||||
static pquest_entry Test(int NpcId, int QuestObject);
|
||||
|
||||
+33
-32
@@ -5,13 +5,13 @@
|
||||
#define GENERIC_9_STRINGS 1 //%1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||
#define TARGET_OUT_OF_RANGE 100 //Your target is out of range, get closer!
|
||||
#define TARGET_NOT_FOUND 101 //Target player not found.
|
||||
#define CANNOT_BIND 105 //You cannot form an affinity with this area. Try a city.
|
||||
#define CANNOT_BIND 105 //You cannot form an affinity with this area. Try a city.
|
||||
#define SPELL_DOES_NOT_WORK_HERE 106 //This spell does not work here.
|
||||
#define SPELL_DOES_NOT_WORK_PLANE 107 //This spell does not work on this plane.
|
||||
#define CANT_SEE_TARGET 108 //You cannot see your target.
|
||||
#define MGB_STRING 113 //The next group buff you cast will hit all targets in range.
|
||||
#define ABILITY_FAILED 116 //Your ability failed. Timer has been reset.
|
||||
#define ESCAPE 114 //You escape from combat, hiding yourself from view.
|
||||
#define ABILITY_FAILED 116 //Your ability failed. Timer has been reset.
|
||||
#define ESCAPE 114 //You escape from combat, hiding yourself from view.
|
||||
#define TARGET_TOO_FAR 124 //Your target is too far away, get closer!
|
||||
#define PROC_TOOLOW 126 //Your will is not sufficient to command this weapon.
|
||||
#define PROC_PETTOOLOW 127 //Your pet's will is not sufficient to command its weapon.
|
||||
@@ -86,7 +86,7 @@
|
||||
#define INVIS_BEGIN_BREAK 275 //You feel yourself starting to appear.
|
||||
#define DISCIPLINE_CONLOST 278 //You lose the concentration to remain in your fighting discipline.
|
||||
#define REZ_REGAIN 289 //You regain some experience from resurrection.
|
||||
#define DUP_LORE 290 //Duplicate lore items are not allowed.
|
||||
#define DUP_LORE 290 //Duplicate lore items are not allowed.
|
||||
#define TGB_ON 293 //Target other group buff is *ON*.
|
||||
#define TGB_OFF 294 //Target other group buff is *OFF*.
|
||||
#define LDON_SENSE_TRAP1 306 //You do not Sense any traps.
|
||||
@@ -99,7 +99,7 @@
|
||||
#define MEND_WORSEN 351 //You have worsened your wounds!
|
||||
#define MEND_FAIL 352 //You have failed to mend your wounds.
|
||||
#define LDON_SENSE_TRAP2 367 //You have not detected any traps.
|
||||
#define LOOT_LORE_ERROR 371 //You cannot loot this Lore Item. You already have one.
|
||||
#define LOOT_LORE_ERROR 371 //You cannot loot this Lore Item. You already have one.
|
||||
#define PICK_LORE 379 //You cannot pick up a lore item you already possess.
|
||||
#define CONSENT_DENIED 390 //You do not have consent to summon that corpse.
|
||||
#define DISCIPLINE_RDY 393 //You are ready to use a new discipline now.
|
||||
@@ -126,10 +126,10 @@
|
||||
#define OTHER_HIT_NONMELEE 434 //%1 was hit by non-melee for %2 points of damage.
|
||||
#define SPELL_WORN_OFF_OF 436 //Your %1 spell has worn off of %2.
|
||||
#define SPELL_WORN_OFF 437 //Your %1 spell has worn off.
|
||||
#define PET_TAUNTING 438 //Taunting attacker, Master.
|
||||
#define PET_TAUNTING 438 //Taunting attacker, Master.
|
||||
#define INTERRUPT_SPELL 439 //Your spell is interrupted.
|
||||
#define LOSE_LEVEL 442 //You LOST a level! You are now level %1!
|
||||
#define GAIN_ABILITY_POINT 446 //You have gained an ability point! You now have %1 ability point%2.
|
||||
#define GAIN_ABILITY_POINT 446 //You have gained an ability point! You now have %1 ability point%2.
|
||||
#define GAIN_LEVEL 447 //You have gained a level! Welcome to level %1!
|
||||
#define LANG_SKILL_IMPROVED 449 //Your language skills have improved.
|
||||
#define OTHER_LOOTED_MESSAGE 466 //--%1 has looted a %2--
|
||||
@@ -139,15 +139,15 @@
|
||||
#define FACTION_BEST 471 //Your faction standing with %1 could not possibly get any better.
|
||||
#define FACTION_BETTER 472 //Your faction standing with %1 got better.
|
||||
#define PET_REPORT_HP 488 //I have %1 percent of my hit points left.
|
||||
#define PET_NO_TAUNT 489 //No longer taunting attackers, Master.
|
||||
#define PET_DO_TAUNT 490 //Taunting attackers as normal, Master.
|
||||
#define PET_NO_TAUNT 489 //No longer taunting attackers, Master.
|
||||
#define PET_DO_TAUNT 490 //Taunting attackers as normal, Master.
|
||||
#define CORPSE_DECAY1 495 //This corpse will decay in %1 minute(s) %2 seconds.
|
||||
#define DISC_LEVEL_ERROR 503 //You must be a level %1 ... to use this discipline.
|
||||
#define DISCIPLINE_CANUSEIN 504 //You can use a new discipline in %1 minutes %2 seconds.
|
||||
#define PVP_ON 552 //You are now player kill and follow the ways of Discord.
|
||||
#define GENERIC_STRINGID_SAY 554 //%1 says '%T2'
|
||||
#define CANNOT_WAKE 555 //%1 tells you, 'I am unable to wake %2, master.'
|
||||
#define GUILD_NAME_IN_USE 711 //You cannot create a guild with that name, that guild already exists on this server.
|
||||
#define GUILD_NAME_IN_USE 711 //You cannot create a guild with that name, that guild already exists on this server.
|
||||
#define GM_GAINXP 1002 //[GM] You have gained %1 AXP and %2 EXP (%3).
|
||||
#define FINISHING_BLOW 1009 //%1 scores a Finishing Blow!!
|
||||
#define ASSASSINATES 1016 //%1 ASSASSINATES their victim!!
|
||||
@@ -169,9 +169,9 @@
|
||||
#define NPC_FLURRY 1045 //%1 executes a FLURRY of attacks on %2!
|
||||
#define DISCIPLINE_FEARLESS 1076 //%1 becomes fearless.
|
||||
#define DUEL_FINISHED 1088 //dont know text
|
||||
#define EATING_MESSAGE 1091 //Chomp, chomp, chomp... %1 takes a bite from a %2.
|
||||
#define DRINKING_MESSAGE 1093 //Glug, glug, glug... %1 takes a drink from a %2.
|
||||
#define SUCCESSFUL_TAUNT 1095 //I'll teach you to interfere with me %3.
|
||||
#define EATING_MESSAGE 1091 //Chomp, chomp, chomp... %1 takes a bite from a %2.
|
||||
#define DRINKING_MESSAGE 1093 //Glug, glug, glug... %1 takes a drink from a %2.
|
||||
#define SUCCESSFUL_TAUNT 1095 //I'll teach you to interfere with me %3.
|
||||
#define PET_SIT_STRING 1130 //Changing position, Master.
|
||||
#define PET_CALMING 1131 //Sorry, Master..calming down.
|
||||
#define PET_FOLLOWING 1132 //Following you, Master.
|
||||
@@ -180,26 +180,26 @@
|
||||
#define PET_GETLOST_STRING 1135 //As you wish, oh great one.
|
||||
#define PET_LEADERIS 1136 //My leader is %3.
|
||||
#define I_FOLLOW_NOONE 1137 //I follow no one.
|
||||
#define PET_ON_HOLD 1138 //Waiting for your order to attack, Master.
|
||||
#define NOT_LEGAL_TARGET 1139 //I beg forgiveness, Master. That is not a legal target.
|
||||
#define PET_ON_HOLD 1138 //Waiting for your order to attack, Master.
|
||||
#define NOT_LEGAL_TARGET 1139 //I beg forgiveness, Master. That is not a legal target.
|
||||
#define MERCHANT_BUSY 1143 //I'm sorry, I am busy right now.
|
||||
#define MERCHANT_GREETING 1144 //Welcome to my shop, %3.
|
||||
#define MERCHANT_HANDY_ITEM1 1145 //Hello there, %3. How about a nice %4?
|
||||
#define MERCHANT_HANDY_ITEM2 1146 //Greetings, %3. You look like you could use a %4.
|
||||
#define MERCHANT_HANDY_ITEM3 1147 //Hi there %3, just browsing? Have you seen the %4 I just got in?
|
||||
#define MERCHANT_HANDY_ITEM3 1147 //Hi there %3, just browsing? Have you seen the %4 I just got in?
|
||||
#define MERCHANT_HANDY_ITEM4 1148 //Welcome to my shop, %3. You would probably find a %4 handy.
|
||||
#define AA_POINT 1197 //point
|
||||
#define AA_POINTS 1215 //points
|
||||
#define SPELL_FIZZLE_OTHER 1218 //%1's spell fizzles!
|
||||
#define MISSED_NOTE_OTHER 1219 //A missed note brings %1's song to a close!
|
||||
#define CORPSE_DECAY_NOW 1227 //This corpse is waiting to expire.
|
||||
#define SURNAME_REJECTED 1374 //Your new surname was rejected. Please try a different name.
|
||||
#define SURNAME_REJECTED 1374 //Your new surname was rejected. Please try a different name.
|
||||
#define DUEL_DECLINE 1383 //%1 has declined your challenge to duel to the death.
|
||||
#define DUEL_ACCEPTED 1384 //%1 has already accepted a duel with someone else.
|
||||
#define DUEL_CONSIDERING 1385 //%1 is considering a duel with someone else.
|
||||
#define PLAYER_REGAIN 1394 //You have control of yourself again.
|
||||
#define REZZ_ALREADY_PENDING 1379 //You were unable to restore the corpse to life, but you may have success with a later attempt.
|
||||
#define IN_USE 1406 //Someone else is using that. Try again later.
|
||||
#define IN_USE 1406 //Someone else is using that. Try again later.
|
||||
#define DUEL_FLED 1408 //%1 has defeated %2 in a duel to the death! %3 has fled like a cowardly dog!
|
||||
#define MEMBER_OF_YOUR_GUILD 1429
|
||||
#define OFFICER_OF_YOUR_GUILD 1430
|
||||
@@ -216,7 +216,7 @@
|
||||
#define SUSPEND_MINION_UNSUSPEND 3267 //%1 tells you, 'I live again...'
|
||||
#define SUSPEND_MINION_SUSPEND 3268 //%1 tells you, 'By your command, master.'
|
||||
#define ONLY_SUMMONED_PETS 3269 //3269 This effect only works with summoned pets.
|
||||
#define SUSPEND_MINION_FIGHTING 3270 //Your pet must be at peace, first.
|
||||
#define SUSPEND_MINION_FIGHTING 3270 //Your pet must be at peace, first.
|
||||
#define TRADESKILL_MISSING_ITEM 3455 //You are missing a %1.
|
||||
#define TRADESKILL_MISSING_COMPONENTS 3456 //Sorry, but you don't have everything you need for this recipe in your general inventory.
|
||||
#define TRADESKILL_LEARN_RECIPE 3457 //You have learned the recipe %1!
|
||||
@@ -236,14 +236,14 @@
|
||||
#define MELEE_SILENCE 5806 //You *CANNOT* use this melee ability, you are suffering from amnesia!
|
||||
#define DISCIPLINE_REUSE_MSG 5807 //You can use the ability %1 again in %2 hour(s) %3 minute(s) %4 seconds.
|
||||
#define DISCIPLINE_REUSE_MSG2 5808 //You can use the ability %1 again in %2 minute(s) %3 seconds.
|
||||
#define FAILED_TAUNT 5811 //You have failed to taunt your target.
|
||||
#define FAILED_TAUNT 5811 //You have failed to taunt your target.
|
||||
#define AA_NO_TARGET 5825 //You must first select a target for this ability!
|
||||
#define FORAGE_MASTERY 6012 //Your forage mastery has enabled you to find something else!
|
||||
#define GUILD_BANK_CANNOT_DEPOSIT 6097 // Cannot deposit this item. Containers must be empty, and only one of each LORE and no NO TRADE or TEMPORARY items may be deposited.
|
||||
#define FORAGE_MASTERY 6012 //Your forage mastery has enabled you to find something else!
|
||||
#define GUILD_BANK_CANNOT_DEPOSIT 6097 // Cannot deposit this item. Containers must be empty, and only one of each LORE and no NO TRADE or TEMPORARY items may be deposited.
|
||||
#define GUILD_BANK_FULL 6098 // There is no more room in the Guild Bank.
|
||||
#define GUILD_BANK_TRANSFERRED 6100 // '%1' transferred to Guild Bank from Deposits.
|
||||
#define GUILD_BANK_EMPTY_HANDS 6108 // You must empty your hands to withdraw from the Guild Bank.
|
||||
#define GENERIC_STRING 6688 //%1 (used to any basic message)
|
||||
#define GENERIC_STRING 6688 //%1 (used to any basic message)
|
||||
#define SENTINEL_TRIG_YOU 6724 //You have triggered your sentinel.
|
||||
#define SENTINEL_TRIG_OTHER 6725 //%1 has triggered your sentinel.
|
||||
#define IDENTIFY_SPELL 6765 //Item Lore: %1.
|
||||
@@ -269,7 +269,7 @@
|
||||
#define MAX_RAID_LEADERSHIP_POINTS 8591 //
|
||||
#define LEADERSHIP_EXP_ON 8653 //
|
||||
#define LEADERSHIP_EXP_OFF 8654 //
|
||||
#define CURRENT_SPELL_EFFECTS 8757 //%1's current spell effects:
|
||||
#define CURRENT_SPELL_EFFECTS 8757 //%1's current spell effects:
|
||||
#define GAIN_GROUP_LEADERSHIP_EXP 8788 //
|
||||
#define GAIN_RAID_LEADERSHIP_EXP 8789 //
|
||||
#define BUFF_MINUTES_REMAINING 8799 //%1 (%2 minutes remaining)
|
||||
@@ -279,11 +279,11 @@
|
||||
#define SHAKE_OFF_STUN 9077
|
||||
#define STRIKETHROUGH_STRING 9078 //You strike through your opponent's defenses!
|
||||
#define SPELL_REFLECT 9082 //%1's spell has been reflected by %2.
|
||||
#define NEW_SPELLS_AVAIL 9149 //You have new spells available to you. Check the merchants near your guild master.
|
||||
#define PET_NOW_FOCUSING 9254 //Focusing on one target, Master.
|
||||
#define PET_NOT_FOCUSING 9263 //No longer focusing on one target, Master.
|
||||
#define PET_NOT_CASTING 9264 //Not casting spells, Master.
|
||||
#define PET_CASTING 9291 //Casting spells normally, Master.
|
||||
#define NEW_SPELLS_AVAIL 9149 //You have new spells available to you. Check the merchants near your guild master.
|
||||
#define PET_NOW_FOCUSING 9254 //Focusing on one target, Master.
|
||||
#define PET_NOT_FOCUSING 9263 //No longer focusing on one target, Master.
|
||||
#define PET_NOT_CASTING 9264 //Not casting spells, Master.
|
||||
#define PET_CASTING 9291 //Casting spells normally, Master.
|
||||
#define AE_RAMPAGE 11015 //%1 goes on a WILD RAMPAGE!
|
||||
#define FACE_ACCEPTED 12028 //Facial features accepted.
|
||||
#define SPELL_LEVEL_TO_LOW 12048 //You will have to achieve level %1 before you can scribe the %2.
|
||||
@@ -329,9 +329,9 @@
|
||||
#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 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 SURNAME_EXISTS 12939 //You already have a surname. Operation failed.
|
||||
#define SURNAME_LEVEL 12940 //You can only submit a surname upon reaching the 20th level. Operation failed.
|
||||
#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_LEVEL 12940 //You can only submit a surname upon reaching the 20th level. Operation failed.
|
||||
#define SURNAME_TOO_LONG 12942 //Surname must be less than 20 characters in length.
|
||||
#define REPORT_ONCE 12945 //You may only submit a report once per time that you zone. Thank you.
|
||||
#define NOW_INVISIBLE 12950 //%1 is now Invisible.
|
||||
@@ -344,3 +344,4 @@
|
||||
#define GENERIC_MISS 15041 //%1 missed %2
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+13
-13
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2006 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2006 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
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
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "../common/debug.h"
|
||||
#include "ZoneConfig.h"
|
||||
|
||||
+14
-14
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2006 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2006 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
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
|
||||
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 __ZoneConfig_H
|
||||
#define __ZoneConfig_H
|
||||
@@ -37,7 +37,7 @@ class ZoneConfig : public EQEmuConfig {
|
||||
|
||||
// Produce a const singleton
|
||||
static const ZoneConfig *get() {
|
||||
if (_zone_config == nullptr)
|
||||
if (_zone_config == nullptr)
|
||||
LoadConfig();
|
||||
return(_zone_config);
|
||||
}
|
||||
|
||||
+163
-165
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
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
|
||||
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
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "../common/debug.h"
|
||||
#include <stdlib.h>
|
||||
@@ -41,7 +41,7 @@ void EntityList::CheckClientAggro(Client *around) {
|
||||
Mob* mob = iterator.GetData();
|
||||
if(mob->IsClient()) //also ensures that mob != around
|
||||
continue;
|
||||
|
||||
|
||||
if(mob->CheckWillAggro(around)) {
|
||||
if(mob->IsEngaged())
|
||||
{
|
||||
@@ -57,24 +57,24 @@ void EntityList::CheckClientAggro(Client *around) {
|
||||
|
||||
void EntityList::DescribeAggro(Client *towho, NPC *from_who, float d, bool verbose) {
|
||||
float d2 = d*d;
|
||||
|
||||
|
||||
towho->Message(0, "Describing aggro for %s", from_who->GetName());
|
||||
|
||||
|
||||
bool engaged = from_who->IsEngaged();
|
||||
if(engaged) {
|
||||
Mob *top = from_who->GetHateTop();
|
||||
towho->Message(0, ".. I am currently fighting with %s", top == nullptr?"(nullptr)":top->GetName());
|
||||
}
|
||||
bool check_npcs = from_who->WillAggroNPCs();
|
||||
|
||||
|
||||
if(verbose) {
|
||||
char namebuf[256];
|
||||
|
||||
|
||||
int my_primary = from_who->GetPrimaryFaction();
|
||||
Mob *own = from_who->GetOwner();
|
||||
if(own != nullptr)
|
||||
my_primary = own->GetPrimaryFaction();
|
||||
|
||||
|
||||
if(my_primary == 0) {
|
||||
strcpy(namebuf, "(No faction)");
|
||||
} else if(my_primary < 0) {
|
||||
@@ -85,16 +85,16 @@ void EntityList::DescribeAggro(Client *towho, NPC *from_who, float d, bool verbo
|
||||
}
|
||||
towho->Message(0, ".. I am on faction %s (%d)\n", namebuf, my_primary);
|
||||
}
|
||||
|
||||
|
||||
LinkedListIterator<Mob*> iterator(mob_list);
|
||||
for(iterator.Reset(); iterator.MoreElements(); iterator.Advance()) {
|
||||
Mob* mob = iterator.GetData();
|
||||
if(mob->IsClient()) //also ensures that mob != around
|
||||
continue;
|
||||
|
||||
|
||||
if(mob->DistNoRoot(*from_who) > d2)
|
||||
continue;
|
||||
|
||||
|
||||
if(engaged) {
|
||||
uint32 amm = from_who->GetHateAmount(mob);
|
||||
if(amm == 0) {
|
||||
@@ -113,7 +113,7 @@ void EntityList::DescribeAggro(Client *towho, NPC *from_who, float d, bool verbo
|
||||
void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) {
|
||||
//this logic is duplicated from below, try to keep it up to date.
|
||||
float iAggroRange = GetAggroRange();
|
||||
|
||||
|
||||
float t1, t2, t3;
|
||||
t1 = mob->GetX() - GetX();
|
||||
t2 = mob->GetY() - GetY();
|
||||
@@ -125,50 +125,50 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) {
|
||||
t2 = 0 - t2;
|
||||
if(t3 < 0)
|
||||
t3 = 0 - t3;
|
||||
if( ( t1 > iAggroRange)
|
||||
|| ( t2 > iAggroRange)
|
||||
|| ( t3 > iAggroRange) ) {
|
||||
towho->Message(0, "...%s is out of range (fast). distances (%.3f,%.3f,%.3f), range %.3f", mob->GetName(),
|
||||
t1, t2, t3, iAggroRange);
|
||||
return;
|
||||
}
|
||||
|
||||
if(mob->IsInvisible(this)) {
|
||||
towho->Message(0, "...%s is invisible to me. ", mob->GetName());
|
||||
return;
|
||||
}
|
||||
if((mob->IsClient() &&
|
||||
(!mob->CastToClient()->Connected()
|
||||
|| mob->CastToClient()->IsLD()
|
||||
|| mob->CastToClient()->IsBecomeNPC()
|
||||
|| mob->CastToClient()->GetGM()
|
||||
)
|
||||
))
|
||||
{
|
||||
towho->Message(0, "...%s is my owner. ", mob->GetName());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(mob == GetOwner()) {
|
||||
towho->Message(0, "...%s a GM or is not connected. ", mob->GetName());
|
||||
return;
|
||||
if(( t1 > iAggroRange)
|
||||
|| ( t2 > iAggroRange)
|
||||
|| ( t3 > iAggroRange) ) {
|
||||
towho->Message(0, "...%s is out of range (fast). distances (%.3f,%.3f,%.3f), range %.3f", mob->GetName(),
|
||||
t1, t2, t3, iAggroRange);
|
||||
return;
|
||||
}
|
||||
|
||||
float dist2 = mob->DistNoRoot(*this);
|
||||
if(mob->IsInvisible(this)) {
|
||||
towho->Message(0, "...%s is invisible to me. ", mob->GetName());
|
||||
return;
|
||||
}
|
||||
if((mob->IsClient() &&
|
||||
(!mob->CastToClient()->Connected()
|
||||
|| mob->CastToClient()->IsLD()
|
||||
|| mob->CastToClient()->IsBecomeNPC()
|
||||
|| mob->CastToClient()->GetGM()
|
||||
)
|
||||
))
|
||||
{
|
||||
towho->Message(0, "...%s is my owner. ", mob->GetName());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(mob == GetOwner()) {
|
||||
towho->Message(0, "...%s a GM or is not connected. ", mob->GetName());
|
||||
return;
|
||||
}
|
||||
|
||||
float dist2 = mob->DistNoRoot(*this);
|
||||
float iAggroRange2 = iAggroRange*iAggroRange;
|
||||
if( dist2 > iAggroRange2 ) {
|
||||
towho->Message(0, "...%s is out of range. %.3f > %.3f ", mob->GetName(),
|
||||
dist2, iAggroRange2);
|
||||
return;
|
||||
towho->Message(0, "...%s is out of range. %.3f > %.3f ", mob->GetName(),
|
||||
dist2, iAggroRange2);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(GetINT() > 75 && mob->GetLevelCon(GetLevel()) == CON_GREEN ) {
|
||||
towho->Message(0, "...%s is red to me (basically)", mob->GetName(),
|
||||
dist2, iAggroRange2);
|
||||
return;
|
||||
towho->Message(0, "...%s is red to me (basically)", mob->GetName(),
|
||||
dist2, iAggroRange2);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(verbose) {
|
||||
int my_primary = GetPrimaryFaction();
|
||||
int mob_primary = mob->GetPrimaryFaction();
|
||||
@@ -178,7 +178,7 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) {
|
||||
own = mob->GetOwner();
|
||||
if(mob_primary > 0 && own != nullptr)
|
||||
mob_primary = own->GetPrimaryFaction();
|
||||
|
||||
|
||||
if(mob_primary == 0) {
|
||||
towho->Message(0, "...%s has no primary faction", mob->GetName());
|
||||
} else if(mob_primary < 0) {
|
||||
@@ -214,9 +214,9 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FACTION_VALUE fv = mob->GetReverseFactionCon(this);
|
||||
|
||||
|
||||
if(!(
|
||||
fv == FACTION_SCOWLS
|
||||
||
|
||||
@@ -224,18 +224,18 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) {
|
||||
||
|
||||
fv == FACTION_THREATENLY
|
||||
)) {
|
||||
towho->Message(0, "...%s faction not low enough. value='%s'", mob->GetName(), FactionValueToString(fv));
|
||||
return;
|
||||
towho->Message(0, "...%s faction not low enough. value='%s'", mob->GetName(), FactionValueToString(fv));
|
||||
return;
|
||||
}
|
||||
if(fv == FACTION_THREATENLY) {
|
||||
towho->Message(0, "...%s threatening to me, so they only have a %d chance per check of attacking.", mob->GetName());
|
||||
towho->Message(0, "...%s threatening to me, so they only have a %d chance per check of attacking.", mob->GetName());
|
||||
}
|
||||
|
||||
|
||||
if(!CheckLosFN(mob)) {
|
||||
towho->Message(0, "...%s is out of sight.", mob->GetName());
|
||||
towho->Message(0, "...%s is out of sight.", mob->GetName());
|
||||
}
|
||||
|
||||
towho->Message(0, "...%s meets all conditions, I should be attacking them.", mob->GetName());
|
||||
|
||||
towho->Message(0, "...%s meets all conditions, I should be attacking them.", mob->GetName());
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -249,24 +249,24 @@ bool Mob::CheckWillAggro(Mob *mob) {
|
||||
|
||||
//sometimes if a client has some lag while zoning into a dangerous place while either invis or a GM
|
||||
//they will aggro mobs even though it's supposed to be impossible, to lets make sure we've finished connecting
|
||||
if (mob->IsClient()) {
|
||||
if (mob->IsClient()) {
|
||||
if (!mob->CastToClient()->ClientFinishedLoading() || mob->CastToClient()->IsHoveringForRespawn())
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Mob *ownr = mob->GetOwner();
|
||||
if(ownr && ownr->IsClient() && !ownr->CastToClient()->ClientFinishedLoading())
|
||||
return false;
|
||||
|
||||
float iAggroRange = GetAggroRange();
|
||||
|
||||
|
||||
// Check If it's invisible and if we can see invis
|
||||
// Check if it's a client, and that the client is connected and not linkdead,
|
||||
// and that the client isn't Playing an NPC, with thier gm flag on
|
||||
// and that the client isn't Playing an NPC, with thier gm flag on
|
||||
// Check if it's not a Interactive NPC
|
||||
// Trumpcard: The 1st 3 checks are low cost calcs to filter out unnessecary distance checks. Leave them at the beginning, they are the most likely occurence.
|
||||
// Image: I moved this up by itself above faction and distance checks because if one of these return true, theres no reason to go through the other information
|
||||
|
||||
|
||||
float t1, t2, t3;
|
||||
t1 = mob->GetX() - GetX();
|
||||
t2 = mob->GetY() - GetY();
|
||||
@@ -278,17 +278,17 @@ bool Mob::CheckWillAggro(Mob *mob) {
|
||||
t2 = 0 - t2;
|
||||
if(t3 < 0)
|
||||
t3 = 0 - t3;
|
||||
if( ( t1 > iAggroRange)
|
||||
|| ( t2 > iAggroRange)
|
||||
|| ( t3 > iAggroRange)
|
||||
||(mob->IsInvisible(this))
|
||||
|| (mob->IsClient() &&
|
||||
(!mob->CastToClient()->Connected()
|
||||
|| mob->CastToClient()->IsLD()
|
||||
|| mob->CastToClient()->IsBecomeNPC()
|
||||
|| mob->CastToClient()->GetGM()
|
||||
)
|
||||
))
|
||||
if(( t1 > iAggroRange)
|
||||
|| ( t2 > iAggroRange)
|
||||
|| ( t3 > iAggroRange)
|
||||
||(mob->IsInvisible(this))
|
||||
|| (mob->IsClient() &&
|
||||
(!mob->CastToClient()->Connected()
|
||||
|| mob->CastToClient()->IsLD()
|
||||
|| mob->CastToClient()->IsBecomeNPC()
|
||||
|| mob->CastToClient()->GetGM()
|
||||
)
|
||||
))
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
@@ -301,18 +301,18 @@ bool Mob::CheckWillAggro(Mob *mob) {
|
||||
return(false);
|
||||
}
|
||||
|
||||
float dist2 = mob->DistNoRoot(*this);
|
||||
float dist2 = mob->DistNoRoot(*this);
|
||||
float iAggroRange2 = iAggroRange*iAggroRange;
|
||||
|
||||
if( dist2 > iAggroRange2 ) {
|
||||
// Skip it, out of range
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
||||
//Image: Get their current target and faction value now that its required
|
||||
//this function call should seem backwards
|
||||
FACTION_VALUE fv = mob->GetReverseFactionCon(this);
|
||||
|
||||
|
||||
// Make sure they're still in the zone
|
||||
// Are they in range?
|
||||
// Are they kos?
|
||||
@@ -354,15 +354,15 @@ bool Mob::CheckWillAggro(Mob *mob) {
|
||||
#endif
|
||||
return(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
#if EQDEBUG >= 6
|
||||
printf("Is In zone?:%d\n", mob->InZone());
|
||||
printf("Dist^2: %f\n", dist2);
|
||||
printf("Range^2: %f\n", iAggroRange2);
|
||||
printf("Faction: %d\n", fv);
|
||||
printf("Int: %d\n", GetINT());
|
||||
printf("Con: %d\n", GetLevelCon(mob->GetLevel()));
|
||||
#endif
|
||||
printf("Is In zone?:%d\n", mob->InZone());
|
||||
printf("Dist^2: %f\n", dist2);
|
||||
printf("Range^2: %f\n", iAggroRange2);
|
||||
printf("Faction: %d\n", fv);
|
||||
printf("Int: %d\n", GetINT());
|
||||
printf("Con: %d\n", GetLevelCon(mob->GetLevel()));
|
||||
#endif
|
||||
return(false);
|
||||
}
|
||||
|
||||
@@ -381,11 +381,11 @@ Mob* EntityList::AICheckCloseAggro(Mob* sender, float iAggroRange, float iAssist
|
||||
//float distZ;
|
||||
while(iterator.MoreElements()) {
|
||||
Mob* mob = iterator.GetData();
|
||||
|
||||
|
||||
if(sender->CheckWillAggro(mob)) {
|
||||
return(mob);
|
||||
}
|
||||
|
||||
|
||||
iterator.Advance();
|
||||
}
|
||||
//LogFile->write(EQEMuLog::Debug, "Check aggro for %s no target.", sender->GetName());
|
||||
@@ -407,7 +407,7 @@ int EntityList::GetHatedCount(Mob *attacker, Mob *exclude) {
|
||||
NPC* mob = iterator.GetData();
|
||||
|
||||
if(!mob || (mob == exclude)) continue;
|
||||
|
||||
|
||||
if(!mob->IsEngaged()) continue;
|
||||
|
||||
if(mob->IsFeared() || mob->IsMezzed()) continue;
|
||||
@@ -419,7 +419,7 @@ int EntityList::GetHatedCount(Mob *attacker, Mob *exclude) {
|
||||
float AggroRange = mob->GetAggroRange();
|
||||
|
||||
// Square it because we will be using DistNoRoot
|
||||
|
||||
|
||||
AggroRange = AggroRange * AggroRange;
|
||||
|
||||
if(mob->DistNoRoot(*attacker) > AggroRange) continue;
|
||||
@@ -438,9 +438,9 @@ void EntityList::AIYellForHelp(Mob* sender, Mob* attacker) {
|
||||
return;
|
||||
if (sender->GetPrimaryFaction() == 0 )
|
||||
return; // well, if we dont have a faction set, we're gonna be indiff to everybody
|
||||
|
||||
|
||||
LinkedListIterator<NPC*> iterator(npc_list);
|
||||
|
||||
|
||||
for(iterator.Reset(); iterator.MoreElements(); iterator.Advance()) {
|
||||
NPC* mob = iterator.GetData();
|
||||
if(!mob){
|
||||
@@ -478,10 +478,10 @@ void EntityList::AIYellForHelp(Mob* sender, Mob* attacker) {
|
||||
if(useprimfaction || sender->GetReverseFactionCon(mob) <= FACTION_AMIABLE )
|
||||
{
|
||||
//attacking someone on same faction, or a friend
|
||||
//Father Nitwit: make sure we can see them.
|
||||
//Father Nitwit: make sure we can see them.
|
||||
if(mob->CheckLosFN(sender)) {
|
||||
#if (EQDEBUG>=5)
|
||||
LogFile->write(EQEMuLog::Debug, "AIYellForHelp(\"%s\",\"%s\") %s attacking %s Dist %f Z %f",
|
||||
#if (EQDEBUG>=5)
|
||||
LogFile->write(EQEMuLog::Debug, "AIYellForHelp(\"%s\",\"%s\") %s attacking %s Dist %f Z %f",
|
||||
sender->GetName(), attacker->GetName(), mob->GetName(), attacker->GetName(), mob->DistNoRoot(*sender), fabs(sender->GetZ()+mob->GetZ()));
|
||||
#endif
|
||||
mob->AddToHateList(attacker, 1, 0, false);
|
||||
@@ -495,7 +495,7 @@ void EntityList::AIYellForHelp(Mob* sender, Mob* attacker) {
|
||||
/*
|
||||
solar: returns false if attack should not be allowed
|
||||
I try to list every type of conflict that's possible here, so it's easy
|
||||
to see how the decision is made. Yea, it could be condensed and made
|
||||
to see how the decision is made. Yea, it could be condensed and made
|
||||
faster, but I'm doing it this way to make it readable and easy to modify
|
||||
*/
|
||||
|
||||
@@ -528,7 +528,7 @@ bool Mob::IsAttackAllowed(Mob *target, bool isSpellAttack)
|
||||
return false;
|
||||
else if(our_owner && our_owner == target)
|
||||
return false;
|
||||
|
||||
|
||||
//cannot hurt untargetable mobs
|
||||
bodyType bt = target->GetBodyType();
|
||||
|
||||
@@ -553,11 +553,11 @@ bool Mob::IsAttackAllowed(Mob *target, bool isSpellAttack)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// solar: the format here is a matrix of mob type vs mob type.
|
||||
// redundant ones are omitted and the reverse is tried if it falls through.
|
||||
|
||||
// first figure out if we're pets. we always look at the master's flags.
|
||||
|
||||
// first figure out if we're pets. we always look at the master's flags.
|
||||
// no need to compare pets to anything
|
||||
mob1 = our_owner ? our_owner : this;
|
||||
mob2 = target_owner ? target_owner : target;
|
||||
@@ -571,7 +571,7 @@ bool Mob::IsAttackAllowed(Mob *target, bool isSpellAttack)
|
||||
{
|
||||
c1 = mob1->CastToClient();
|
||||
c2 = mob2->CastToClient();
|
||||
|
||||
|
||||
if // if both are pvp they can fight
|
||||
(
|
||||
c1->GetPVP() &&
|
||||
@@ -590,19 +590,19 @@ bool Mob::IsAttackAllowed(Mob *target, bool isSpellAttack)
|
||||
return false;
|
||||
}
|
||||
else if(_NPC(mob2)) // client vs npc
|
||||
{
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if(_BECOMENPC(mob2)) // client vs becomenpc
|
||||
{
|
||||
c1 = mob1->CastToClient();
|
||||
becomenpc = mob2->CastToClient();
|
||||
|
||||
|
||||
if(c1->GetLevel() > becomenpc->GetBecomeNPCLevel())
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if(_CLIENTCORPSE(mob2)) // client vs client corpse
|
||||
{
|
||||
return false;
|
||||
@@ -706,7 +706,7 @@ type', in which case, the answer is yes.
|
||||
|
||||
|
||||
// solar: this is to check if non detrimental things are allowed to be done
|
||||
// to the target. clients cannot affect npcs and vice versa, and clients
|
||||
// to the target. clients cannot affect npcs and vice versa, and clients
|
||||
// cannot affect other clients that are not of the same pvp flag as them.
|
||||
// also goes for their pets
|
||||
bool Mob::IsBeneficialAllowed(Mob *target)
|
||||
@@ -722,8 +722,8 @@ bool Mob::IsBeneficialAllowed(Mob *target)
|
||||
return true;
|
||||
|
||||
// solar: see IsAttackAllowed for notes
|
||||
|
||||
// first figure out if we're pets. we always look at the master's flags.
|
||||
|
||||
// first figure out if we're pets. we always look at the master's flags.
|
||||
// no need to compare pets to anything
|
||||
mob1 = this->GetOwnerID() ? this->GetOwner() : this;
|
||||
mob2 = target->GetOwnerID() ? target->GetOwner() : target;
|
||||
@@ -757,7 +757,7 @@ bool Mob::IsBeneficialAllowed(Mob *target)
|
||||
}
|
||||
else if(_NPC(mob2)) // client to npc
|
||||
{
|
||||
/* fall through and swap positions */
|
||||
/* fall through and swap positions */
|
||||
}
|
||||
else if(_BECOMENPC(mob2)) // client to becomenpc
|
||||
{
|
||||
@@ -880,7 +880,7 @@ bool Mob::CombatRange(Mob* other)
|
||||
// prevention of ridiculously sized hit boxes
|
||||
if (size_mod > 10000)
|
||||
size_mod = size_mod / 7;
|
||||
|
||||
|
||||
if (DistNoRoot(*other) <= size_mod)
|
||||
{
|
||||
return true;
|
||||
@@ -914,17 +914,17 @@ bool Mob::CheckLos(Mob* other) {
|
||||
float dist_z = tmp_z - trg_z;
|
||||
if (dist_z < 0)
|
||||
dist_z *= -1;
|
||||
if (dist_x < dist_y && dist_z < dist_y)
|
||||
if (dist_x < dist_y && dist_z < dist_y)
|
||||
{
|
||||
perwalk_x /= (dist_y/dist_x);
|
||||
perwalk_z /= (dist_y/dist_z);
|
||||
}
|
||||
else if (dist_y < dist_x && dist_z < dist_x)
|
||||
else if (dist_y < dist_x && dist_z < dist_x)
|
||||
{
|
||||
perwalk_y /= (dist_x/dist_y);
|
||||
perwalk_z /= (dist_x/dist_z);
|
||||
}
|
||||
else if (dist_x < dist_z && dist_y < dist_z)
|
||||
else if (dist_x < dist_z && dist_y < dist_z)
|
||||
{
|
||||
perwalk_x /= (dist_z/dist_x);
|
||||
perwalk_y /= (dist_z/dist_y);
|
||||
@@ -1003,7 +1003,7 @@ bool Mob::CheckLos(Mob* other) {
|
||||
iface++;
|
||||
}
|
||||
/* solar: our aggro code isn't using this right now, just spells, so i'm
|
||||
taking out the +-10 check for now to make it work right on hills
|
||||
taking out the +-10 check for now to make it work right on hills
|
||||
if (best_z - 10 > trg_z || best_z + 10 < trg_z)
|
||||
{
|
||||
return false;
|
||||
@@ -1036,16 +1036,16 @@ bool Mob::CheckLosFN(float posX, float posY, float posZ, float mobSize) {
|
||||
#endif
|
||||
}
|
||||
_ZP(Mob_CheckLosFN);
|
||||
|
||||
|
||||
VERTEX myloc;
|
||||
VERTEX oloc;
|
||||
|
||||
|
||||
#define LOS_DEFAULT_HEIGHT 6.0f
|
||||
|
||||
|
||||
myloc.x = GetX();
|
||||
myloc.y = GetY();
|
||||
myloc.z = GetZ() + (GetSize()==0.0?LOS_DEFAULT_HEIGHT:GetSize())/2 * HEAD_POSITION;
|
||||
|
||||
|
||||
oloc.x = posX;
|
||||
oloc.y = posY;
|
||||
oloc.z = posZ + (mobSize==0.0?LOS_DEFAULT_HEIGHT:mobSize)/2 * SEE_POSITION;
|
||||
@@ -1053,11 +1053,11 @@ bool Mob::CheckLosFN(float posX, float posY, float posZ, float mobSize) {
|
||||
#if LOSDEBUG>=5
|
||||
LogFile->write(EQEMuLog::Debug, "LOS from (%.2f, %.2f, %.2f) to (%.2f, %.2f, %.2f) sizes: (%.2f, %.2f)", myloc.x, myloc.y, myloc.z, oloc.x, oloc.y, oloc.z, GetSize(), mobSize);
|
||||
#endif
|
||||
|
||||
|
||||
FACE *onhit;
|
||||
NodeRef mynode;
|
||||
NodeRef onode;
|
||||
|
||||
|
||||
VERTEX hit;
|
||||
//see if anything in our node is in the way
|
||||
mynode = zone->zonemap->SeekNode( zone->zonemap->GetRoot(), myloc.x, myloc.y);
|
||||
@@ -1067,18 +1067,18 @@ bool Mob::CheckLosFN(float posX, float posY, float posZ, float mobSize) {
|
||||
LogFile->write(EQEMuLog::Debug, "Check LOS for %s target position, cannot see.", GetName());
|
||||
LogFile->write(EQEMuLog::Debug, "\tPoly: (%.2f, %.2f, %.2f) (%.2f, %.2f, %.2f) (%.2f, %.2f, %.2f)\n",
|
||||
onhit->a.x, onhit->a.y, onhit->a.z,
|
||||
onhit->b.x, onhit->b.y, onhit->b.z,
|
||||
onhit->b.x, onhit->b.y, onhit->b.z,
|
||||
onhit->c.x, onhit->c.y, onhit->c.z);
|
||||
#endif
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
#if LOSDEBUG>=5
|
||||
else {
|
||||
else {
|
||||
LogFile->write(EQEMuLog::Debug, "WTF, I have no node, what am I standing on??? (%.2f, %.2f).", myloc.x, myloc.y);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//see if they are in a different node.
|
||||
//if so, see if anything in their node is blocking me.
|
||||
if(! zone->zonemap->LocWithinNode(mynode, oloc.x, oloc.y)) {
|
||||
@@ -1089,35 +1089,35 @@ bool Mob::CheckLosFN(float posX, float posY, float posZ, float mobSize) {
|
||||
LogFile->write(EQEMuLog::Debug, "Check LOS for %s target position, cannot see (2).", GetName());
|
||||
LogFile->write(EQEMuLog::Debug, "\tPoly: (%.2f, %.2f, %.2f) (%.2f, %.2f, %.2f) (%.2f, %.2f, %.2f)\n",
|
||||
onhit->a.x, onhit->a.y, onhit->a.z,
|
||||
onhit->b.x, onhit->b.y, onhit->b.z,
|
||||
onhit->b.x, onhit->b.y, onhit->b.z,
|
||||
onhit->c.x, onhit->c.y, onhit->c.z);
|
||||
#endif
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
#if LOSDEBUG>=5
|
||||
else if(onode == NODE_NONE) {
|
||||
else if(onode == NODE_NONE) {
|
||||
LogFile->write(EQEMuLog::Debug, "WTF, They have no node, what are they standing on??? (%.2f, %.2f).", myloc.x, myloc.y);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
if(zone->zonemap->LineIntersectsZone(myloc, oloc, CHECK_LOS_STEP, &onhit)) {
|
||||
#if LOSDEBUG>=5
|
||||
LogFile->write(EQEMuLog::Debug, "Check LOS for %s target %s, cannot see.", GetName(), other->GetName() );
|
||||
LogFile->write(EQEMuLog::Debug, "\tPoly: (%.2f, %.2f, %.2f) (%.2f, %.2f, %.2f) (%.2f, %.2f, %.2f)\n",
|
||||
onhit->a.x, onhit->a.y, onhit->a.z,
|
||||
onhit->b.x, onhit->b.y, onhit->b.z,
|
||||
onhit->b.x, onhit->b.y, onhit->b.z,
|
||||
onhit->c.x, onhit->c.y, onhit->c.z);
|
||||
#endif
|
||||
return(false);
|
||||
}*/
|
||||
|
||||
|
||||
#if LOSDEBUG>=5
|
||||
LogFile->write(EQEMuLog::Debug, "Check LOS for %s target position, CAN SEE.", GetName());
|
||||
#endif
|
||||
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
@@ -1189,8 +1189,8 @@ int32 Mob::CheckAggroAmount(uint16 spellid, bool isproc) {
|
||||
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], this->GetLevel(), spell_id);
|
||||
if (val < 0)
|
||||
{
|
||||
AggroAmount -= val*2;
|
||||
}
|
||||
AggroAmount -= val*2;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SE_ResistMagic:
|
||||
@@ -1245,7 +1245,7 @@ int32 Mob::CheckAggroAmount(uint16 spellid, bool isproc) {
|
||||
}
|
||||
case SE_Amnesia:
|
||||
case SE_Silence:{
|
||||
AggroAmount += slevel*2;
|
||||
AggroAmount += slevel*2;
|
||||
break;
|
||||
}
|
||||
case SE_Destroy:{
|
||||
@@ -1287,7 +1287,7 @@ int32 Mob::CheckAggroAmount(uint16 spellid, bool isproc) {
|
||||
}
|
||||
case SE_CancelMagic:
|
||||
case SE_DispelDetrimental:{
|
||||
AggroAmount += slevel;
|
||||
AggroAmount += slevel;
|
||||
break;
|
||||
}
|
||||
case SE_ReduceHate:
|
||||
@@ -1313,7 +1313,7 @@ int32 Mob::CheckAggroAmount(uint16 spellid, bool isproc) {
|
||||
AggroAmount = AggroAmount * RuleI(Aggro, SongAggroMod) / 100;
|
||||
if (GetOwner() && IsPet())
|
||||
AggroAmount = AggroAmount * RuleI(Aggro, PetSpellAggroMod) / 100;
|
||||
|
||||
|
||||
if(AggroAmount > 0)
|
||||
{
|
||||
|
||||
@@ -1333,8 +1333,8 @@ int32 Mob::CheckAggroAmount(uint16 spellid, bool isproc) {
|
||||
//every time you cast on live you get a certain amount of "this is a spell" aggro
|
||||
//confirmed by EQ devs to be 100 exactly at level 85. From their wording it doesn't seem like it's affected
|
||||
//by hate modifiers either.
|
||||
//AggroAmount += (slevel*slevel/72);
|
||||
// Saved so I can reimplement it;
|
||||
//AggroAmount += (slevel*slevel/72);
|
||||
// Saved so I can reimplement it;
|
||||
// this should only be on the spell to aggro the npc not every spell
|
||||
|
||||
}
|
||||
@@ -1365,8 +1365,8 @@ int32 Mob::CheckHealAggroAmount(uint16 spellid, uint32 heal_possible) {
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (IsBardSong(spell_id))
|
||||
@@ -1385,7 +1385,7 @@ int32 Mob::CheckHealAggroAmount(uint16 spellid, uint32 heal_possible) {
|
||||
|
||||
//Live AA - Spell casting subtlety
|
||||
HateMod += aabonuses.hatemod + spellbonuses.hatemod + itembonuses.hatemod;
|
||||
|
||||
|
||||
AggroAmount = (AggroAmount * HateMod) / 100;
|
||||
|
||||
//made up number probably scales a bit differently on live but it seems like it will be close enough
|
||||
@@ -1413,7 +1413,7 @@ void Mob::AddFeignMemory(Client* attacker) {
|
||||
void Mob::RemoveFromFeignMemory(Client* attacker) {
|
||||
feign_memory_list.erase(attacker->CharacterID());
|
||||
if(feign_memory_list.empty() && AIfeignremember_timer != nullptr)
|
||||
AIfeignremember_timer->Disable();
|
||||
AIfeignremember_timer->Disable();
|
||||
if(feign_memory_list.empty())
|
||||
{
|
||||
minLastFightingDelayMoving = RuleI(NPC, LastFightingDelayMovingMin);
|
||||
@@ -1424,14 +1424,14 @@ void Mob::RemoveFromFeignMemory(Client* attacker) {
|
||||
}
|
||||
|
||||
void Mob::ClearFeignMemory() {
|
||||
std::set<uint32>::iterator RememberedCharID = feign_memory_list.begin();
|
||||
while (RememberedCharID != feign_memory_list.end())
|
||||
{
|
||||
Client* remember_client = entity_list.GetClientByCharID(*RememberedCharID);
|
||||
if(remember_client != nullptr) //Still in zone
|
||||
remember_client->RemoveXTarget(this, false);
|
||||
++RememberedCharID;
|
||||
}
|
||||
std::set<uint32>::iterator RememberedCharID = feign_memory_list.begin();
|
||||
while (RememberedCharID != feign_memory_list.end())
|
||||
{
|
||||
Client* remember_client = entity_list.GetClientByCharID(*RememberedCharID);
|
||||
if(remember_client != nullptr) //Still in zone
|
||||
remember_client->RemoveXTarget(this, false);
|
||||
++RememberedCharID;
|
||||
}
|
||||
|
||||
feign_memory_list.clear();
|
||||
minLastFightingDelayMoving = RuleI(NPC, LastFightingDelayMovingMin);
|
||||
@@ -1461,15 +1461,15 @@ bool Mob::PassCharismaCheck(Mob* caster, Mob* spellTarget, uint16 spell_id) {
|
||||
|
||||
//2: The mob makes a resistance check against the charm
|
||||
if (resist_check == 100)
|
||||
return true;
|
||||
|
||||
return true;
|
||||
|
||||
else
|
||||
{
|
||||
if (caster->IsClient())
|
||||
{
|
||||
//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.
|
||||
uint16 TotalDominationBonus = caster->aabonuses.CharmBreakChance + caster->spellbonuses.CharmBreakChance + caster->itembonuses.CharmBreakChance;
|
||||
|
||||
|
||||
if (MakeRandomInt(0, 100) < TotalDominationBonus)
|
||||
return true;
|
||||
|
||||
@@ -1481,11 +1481,9 @@ bool Mob::PassCharismaCheck(Mob* caster, Mob* spellTarget, uint16 spell_id) {
|
||||
{
|
||||
// Assume this is a harmony/pacify spell
|
||||
if (resist_check == 100)
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+394
-393
File diff suppressed because it is too large
Load Diff
+43
-43
@@ -25,7 +25,7 @@ char com_list[512];
|
||||
int calc(char * stuff) {
|
||||
int result = 0;
|
||||
int i = 0;
|
||||
int a = 0;
|
||||
int a = 0;
|
||||
static char temp[100];
|
||||
int op = 0;
|
||||
memset(temp,0x0,100);
|
||||
@@ -105,15 +105,15 @@ int GetArgs(char * string)
|
||||
char temp[255];
|
||||
char c_name[255];
|
||||
int params = 0;
|
||||
//char *buffer = new char[512]; // this is never deleted, causes zone to crash
|
||||
char *buffer = com_list;
|
||||
memset(temp,0x0,255);
|
||||
//memset(buffer,0x0,512);
|
||||
//#ifdef WIN32
|
||||
//strcpy(buffer,com_list);
|
||||
//#else
|
||||
//strncpy(buffer,com_list,sizeof(buffer)-1);
|
||||
//#endif
|
||||
//char *buffer = new char[512]; // this is never deleted, causes zone to crash
|
||||
char *buffer = com_list;
|
||||
memset(temp,0x0,255);
|
||||
//memset(buffer,0x0,512);
|
||||
//#ifdef WIN32
|
||||
//strcpy(buffer,com_list);
|
||||
//#else
|
||||
//strncpy(buffer,com_list,sizeof(buffer)-1);
|
||||
//#endif
|
||||
int i=0;
|
||||
while (*buffer)
|
||||
{
|
||||
@@ -136,39 +136,39 @@ int GetArgs(char * string)
|
||||
}
|
||||
return 0;
|
||||
#else
|
||||
if (strstr(string,"if")) { return 0; }
|
||||
if (strstr(string,"sfollow")) { return 0; }
|
||||
if (strstr(string,"save")) { return 0; }
|
||||
if (strstr(string,"while")) { return 0; }
|
||||
if (strstr(string,"break")) { return 1; }
|
||||
if (strstr(string,"follow")) { return 1; }
|
||||
if (strstr(string,"setallskill")) { return 1; }
|
||||
if (strstr(string,"me")) { return 1; }
|
||||
if (strstr(string,"flagcheck")) { return 1; }
|
||||
if (strstr(string,"echo")) { return 1; }
|
||||
if (strstr(string,"summonitem")) { return 1; }
|
||||
if (strstr(string,"say")) { return 1; }
|
||||
if (strstr(string,"emote")) { return 1; }
|
||||
if (strstr(string,"shout")) { return 1; }
|
||||
if (strstr(string,"depop")) { return 1; }
|
||||
if (strstr(string,"cumflag")) { return 1; }
|
||||
if (strstr(string,"exp")) { return 1; }
|
||||
if (strstr(string,"level")) { return 1; }
|
||||
if (strstr(string,"safemove")) { return 1; }
|
||||
if (strstr(string,"rain")) { return 1; }
|
||||
if (strstr(string,"snow")) { return 1; }
|
||||
if (strstr(string,"pvp")) { return 1; }
|
||||
if (strstr(string,"doanim")) { return 1; }
|
||||
if (strstr(string,"dbspawnadd")) { return 2; }
|
||||
if (strstr(string,"castspell")) { return 2; }
|
||||
if (strstr(string,"flagcheck")) { return 2; }
|
||||
if (strstr(string,"addskill")) { return 2; }
|
||||
if (strstr(string,"write")) { return 2; }
|
||||
if (strstr(string,"settarget")) { return 2; }
|
||||
if (strstr(string,"givecash")) { return 4; }
|
||||
if (strstr(string,"movepc")) { return 4; }
|
||||
if (strstr(string,"spawn")) { return 6; }
|
||||
return 0;
|
||||
if (strstr(string,"if")) { return 0; }
|
||||
if (strstr(string,"sfollow")) { return 0; }
|
||||
if (strstr(string,"save")) { return 0; }
|
||||
if (strstr(string,"while")) { return 0; }
|
||||
if (strstr(string,"break")) { return 1; }
|
||||
if (strstr(string,"follow")) { return 1; }
|
||||
if (strstr(string,"setallskill")) { return 1; }
|
||||
if (strstr(string,"me")) { return 1; }
|
||||
if (strstr(string,"flagcheck")) { return 1; }
|
||||
if (strstr(string,"echo")) { return 1; }
|
||||
if (strstr(string,"summonitem")) { return 1; }
|
||||
if (strstr(string,"say")) { return 1; }
|
||||
if (strstr(string,"emote")) { return 1; }
|
||||
if (strstr(string,"shout")) { return 1; }
|
||||
if (strstr(string,"depop")) { return 1; }
|
||||
if (strstr(string,"cumflag")) { return 1; }
|
||||
if (strstr(string,"exp")) { return 1; }
|
||||
if (strstr(string,"level")) { return 1; }
|
||||
if (strstr(string,"safemove")) { return 1; }
|
||||
if (strstr(string,"rain")) { return 1; }
|
||||
if (strstr(string,"snow")) { return 1; }
|
||||
if (strstr(string,"pvp")) { return 1; }
|
||||
if (strstr(string,"doanim")) { return 1; }
|
||||
if (strstr(string,"dbspawnadd")) { return 2; }
|
||||
if (strstr(string,"castspell")) { return 2; }
|
||||
if (strstr(string,"flagcheck")) { return 2; }
|
||||
if (strstr(string,"addskill")) { return 2; }
|
||||
if (strstr(string,"write")) { return 2; }
|
||||
if (strstr(string,"settarget")) { return 2; }
|
||||
if (strstr(string,"givecash")) { return 4; }
|
||||
if (strstr(string,"movepc")) { return 4; }
|
||||
if (strstr(string,"spawn")) { return 6; }
|
||||
return 0;
|
||||
#endif // 0
|
||||
}
|
||||
|
||||
|
||||
+16
-16
@@ -1,24 +1,24 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2003 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2003 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
|
||||
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
|
||||
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
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
solar: Beacon class, extends Mob. Used for AE rain spells to have a mob
|
||||
solar: Beacon class, extends Mob. Used for AE rain spells to have a mob
|
||||
target to center around.
|
||||
|
||||
*/
|
||||
@@ -30,7 +30,7 @@ target to center around.
|
||||
#define vsnprintf _vsnprintf
|
||||
#endif
|
||||
#define strncasecmp _strnicmp
|
||||
#define strcasecmp _stricmp
|
||||
#define strcasecmp _stricmp
|
||||
#endif
|
||||
|
||||
#include "masterentity.h"
|
||||
@@ -122,7 +122,7 @@ void Beacon::AELocationSpell(Mob *caster, uint16 cast_spell_id, int16 resist_adj
|
||||
{
|
||||
if(!IsValidSpell(cast_spell_id) || !caster)
|
||||
return;
|
||||
|
||||
|
||||
caster_id = caster->GetID();
|
||||
spell_id = cast_spell_id;
|
||||
this->resist_adjust = resist_adjust;
|
||||
|
||||
+12
-12
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
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 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
|
||||
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.
|
||||
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
|
||||
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 BEACON_H
|
||||
@@ -29,7 +29,7 @@ class Beacon : public Mob
|
||||
public:
|
||||
Beacon(Mob *at_mob, int lifetime);
|
||||
~Beacon();
|
||||
|
||||
|
||||
//abstract virtual function implementations requird by base abstract class
|
||||
virtual void Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillType attack_skill) { return; }
|
||||
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false) { return; }
|
||||
|
||||
+257
-256
File diff suppressed because it is too large
Load Diff
+159
-159
@@ -1288,7 +1288,7 @@ void Bot::GenerateArmorClass()
|
||||
|
||||
uint16 Bot::GetPrimarySkillValue()
|
||||
{
|
||||
SkillType skill = HIGHEST_SKILL; //because nullptr == 0, which is 1H Slashing, & we want it to return 0 from GetSkill
|
||||
SkillType skill = HIGHEST_SKILL; //because nullptr == 0, which is 1H Slashing, & we want it to return 0 from GetSkill
|
||||
bool equiped = m_inv.GetItem(SLOT_PRIMARY);
|
||||
|
||||
if(!equiped)
|
||||
@@ -1297,7 +1297,7 @@ uint16 Bot::GetPrimarySkillValue()
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8 type = m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType; //is this the best way to do this?
|
||||
uint8 type = m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType; //is this the best way to do this?
|
||||
switch(type)
|
||||
{
|
||||
case ItemType1HS: // 1H Slashing
|
||||
@@ -1471,7 +1471,7 @@ void Bot::LoadAAs() {
|
||||
MYSQL_RES* DatasetResult;
|
||||
MYSQL_ROW DataRow;
|
||||
|
||||
int maxAAExpansion = RuleI(Bots, BotAAExpansion); //get expansion to get AAs up to
|
||||
int maxAAExpansion = RuleI(Bots, BotAAExpansion); //get expansion to get AAs up to
|
||||
botAAs.clear(); //start fresh
|
||||
|
||||
if(GetClass() == BERSERKER)
|
||||
@@ -1502,7 +1502,7 @@ void Bot::LoadAAs() {
|
||||
|
||||
//Get level required for AA
|
||||
if(RequiredLevel != AARequiredLevelAndCost.end())
|
||||
req_level = RequiredLevel->second.Level;
|
||||
req_level = RequiredLevel->second.Level;
|
||||
else
|
||||
req_level = (sendAA->class_type + i * sendAA->level_inc);
|
||||
|
||||
@@ -1903,7 +1903,7 @@ void Bot::ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon)
|
||||
{
|
||||
if(!newbon->SpellOnKill[i] || ((newbon->SpellOnKill[i] == base2) && (newbon->SpellOnKill[i+1] < base1)))
|
||||
{
|
||||
//base1 = chance, base2 = SpellID to be triggered, base3 = min npc level
|
||||
//base1 = chance, base2 = SpellID to be triggered, base3 = min npc level
|
||||
newbon->SpellOnKill[i] = base2;
|
||||
newbon->SpellOnKill[i+1] = base1;
|
||||
|
||||
@@ -2473,17 +2473,17 @@ void Bot::SaveBuffs() {
|
||||
IsPersistent = 0;
|
||||
|
||||
if(!database.RunQuery(Query, MakeAnyLenString(&Query, "INSERT INTO botbuffs (BotId, SpellId, CasterLevel, DurationFormula, "
|
||||
"TicsRemaining, PoisonCounters, DiseaseCounters, CurseCounters, CorruptionCounters, HitCount, MeleeRune, MagicRune, "
|
||||
"DeathSaveSuccessChance, CasterAARank, Persistent) VALUES (%u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u);",
|
||||
GetBotID(), buffs[BuffCount].spellid, buffs[BuffCount].casterlevel, spells[buffs[BuffCount].spellid].buffdurationformula,
|
||||
buffs[BuffCount].ticsremaining,
|
||||
CalculatePoisonCounters(buffs[BuffCount].spellid) > 0 ? buffs[BuffCount].counters : 0,
|
||||
CalculateDiseaseCounters(buffs[BuffCount].spellid) > 0 ? buffs[BuffCount].counters : 0,
|
||||
CalculateCurseCounters(buffs[BuffCount].spellid) > 0 ? buffs[BuffCount].counters : 0,
|
||||
CalculateCorruptionCounters(buffs[BuffCount].spellid) > 0 ? buffs[BuffCount].counters : 0,
|
||||
buffs[BuffCount].numhits, buffs[BuffCount].melee_rune, buffs[BuffCount].magic_rune,
|
||||
buffs[BuffCount].deathSaveSuccessChance,
|
||||
buffs[BuffCount].deathsaveCasterAARank, IsPersistent), TempErrorMessageBuffer)) {
|
||||
"TicsRemaining, PoisonCounters, DiseaseCounters, CurseCounters, CorruptionCounters, HitCount, MeleeRune, MagicRune, "
|
||||
"DeathSaveSuccessChance, CasterAARank, Persistent) VALUES (%u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u);",
|
||||
GetBotID(), buffs[BuffCount].spellid, buffs[BuffCount].casterlevel, spells[buffs[BuffCount].spellid].buffdurationformula,
|
||||
buffs[BuffCount].ticsremaining,
|
||||
CalculatePoisonCounters(buffs[BuffCount].spellid) > 0 ? buffs[BuffCount].counters : 0,
|
||||
CalculateDiseaseCounters(buffs[BuffCount].spellid) > 0 ? buffs[BuffCount].counters : 0,
|
||||
CalculateCurseCounters(buffs[BuffCount].spellid) > 0 ? buffs[BuffCount].counters : 0,
|
||||
CalculateCorruptionCounters(buffs[BuffCount].spellid) > 0 ? buffs[BuffCount].counters : 0,
|
||||
buffs[BuffCount].numhits, buffs[BuffCount].melee_rune, buffs[BuffCount].magic_rune,
|
||||
buffs[BuffCount].deathSaveSuccessChance,
|
||||
buffs[BuffCount].deathsaveCasterAARank, IsPersistent), TempErrorMessageBuffer)) {
|
||||
errorMessage = std::string(TempErrorMessageBuffer);
|
||||
safe_delete(Query);
|
||||
Query = 0;
|
||||
@@ -2527,15 +2527,15 @@ void Bot::LoadBuffs() {
|
||||
buffs[BuffCount].casterlevel = atoi(DataRow[1]);
|
||||
buffs[BuffCount].ticsremaining = atoi(DataRow[3]);
|
||||
|
||||
if(CalculatePoisonCounters(buffs[BuffCount].spellid) > 0) {
|
||||
buffs[BuffCount].counters = atoi(DataRow[4]);
|
||||
} else if(CalculateDiseaseCounters(buffs[BuffCount].spellid) > 0) {
|
||||
buffs[BuffCount].counters = atoi(DataRow[5]);
|
||||
} else if(CalculateCurseCounters(buffs[BuffCount].spellid) > 0) {
|
||||
buffs[BuffCount].counters = atoi(DataRow[6]);
|
||||
} else if(CalculateCorruptionCounters(buffs[BuffCount].spellid) > 0) {
|
||||
buffs[BuffCount].counters = atoi(DataRow[7]);
|
||||
}
|
||||
if(CalculatePoisonCounters(buffs[BuffCount].spellid) > 0) {
|
||||
buffs[BuffCount].counters = atoi(DataRow[4]);
|
||||
} else if(CalculateDiseaseCounters(buffs[BuffCount].spellid) > 0) {
|
||||
buffs[BuffCount].counters = atoi(DataRow[5]);
|
||||
} else if(CalculateCurseCounters(buffs[BuffCount].spellid) > 0) {
|
||||
buffs[BuffCount].counters = atoi(DataRow[6]);
|
||||
} else if(CalculateCorruptionCounters(buffs[BuffCount].spellid) > 0) {
|
||||
buffs[BuffCount].counters = atoi(DataRow[7]);
|
||||
}
|
||||
buffs[BuffCount].numhits = atoi(DataRow[8]);
|
||||
buffs[BuffCount].melee_rune = atoi(DataRow[9]);
|
||||
buffs[BuffCount].magic_rune = atoi(DataRow[10]);
|
||||
@@ -3340,7 +3340,7 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillType skil
|
||||
}
|
||||
}
|
||||
|
||||
if (damage == -3) {
|
||||
if (damage == -3) {
|
||||
DoRiposte(other);
|
||||
if (HasDied())
|
||||
return;
|
||||
@@ -3577,7 +3577,7 @@ void Bot::AI_Process() {
|
||||
|
||||
if(!IsEngaged()) {
|
||||
if(GetFollowID()) {
|
||||
if(BotOwner && BotOwner->GetTarget() && BotOwner->GetTarget()->IsNPC() && (BotOwner->GetTarget()->GetHateAmount(BotOwner)
|
||||
if(BotOwner && BotOwner->GetTarget() && BotOwner->GetTarget()->IsNPC() && (BotOwner->GetTarget()->GetHateAmount(BotOwner)
|
||||
|| BotOwner->CastToClient()->AutoAttackEnabled()) && IsAttackAllowed(BotOwner->GetTarget())) {
|
||||
AddToHateList(BotOwner->GetTarget(), 1);
|
||||
|
||||
@@ -3591,7 +3591,7 @@ void Bot::AI_Process() {
|
||||
for(int counter = 0; counter < g->GroupCount(); counter++) {
|
||||
if(g->members[counter]) {
|
||||
Mob* tar = g->members[counter]->GetTarget();
|
||||
if(tar && tar->IsNPC() && tar->GetHateAmount(g->members[counter]) && IsAttackAllowed(g->members[counter]->GetTarget())) {
|
||||
if(tar && tar->IsNPC() && tar->GetHateAmount(g->members[counter]) && IsAttackAllowed(g->members[counter]->GetTarget())) {
|
||||
AddToHateList(tar, 1);
|
||||
|
||||
if(HasPet())
|
||||
@@ -6189,7 +6189,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
item2 = database.GetItem(items[y]);
|
||||
if(item2) {
|
||||
if(botCanWear[y]) {
|
||||
Say("Thank you for the %s, %s.", item2->Name, client->GetName());
|
||||
Say("Thank you for the %s, %s.", item2->Name, client->GetName());
|
||||
}
|
||||
else {
|
||||
Say("I can't use this %s!", item2->Name);
|
||||
@@ -6335,8 +6335,8 @@ void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, SkillType attack_skil
|
||||
|
||||
SendHPUpdate();
|
||||
|
||||
if(this == from) {
|
||||
return;
|
||||
if(this == from) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Aggro the bot's group members
|
||||
@@ -6539,7 +6539,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
||||
|
||||
//riposte
|
||||
bool slippery_attack = false; // Part of hack to allow riposte to become a miss, but still allow a Strikethrough chance (like on Live)
|
||||
if (damage == -3) {
|
||||
if (damage == -3) {
|
||||
if (FromRiposte) return false;
|
||||
else {
|
||||
if (Hand == SLOT_SECONDARY) {// Do we even have it & was attack with mainhand? If not, don't bother with other calculations
|
||||
@@ -6583,7 +6583,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
////// Send Attack Damage
|
||||
////// Send Attack Damage
|
||||
///////////////////////////////////////////////////////////
|
||||
other->Damage(this, damage, SPELL_UNKNOWN, skillinuse);
|
||||
|
||||
@@ -7192,8 +7192,8 @@ int16 Bot::GetBotFocusEffect(BotfocusType bottype, uint16 spell_id) {
|
||||
|
||||
int buff_tracker = -1;
|
||||
int buff_slot = 0;
|
||||
uint16 focusspellid = 0;
|
||||
uint16 focusspell_tracker = 0;
|
||||
uint16 focusspellid = 0;
|
||||
uint16 focusspell_tracker = 0;
|
||||
uint32 buff_max = GetMaxTotalSlots();
|
||||
for (buff_slot = 0; buff_slot < buff_max; buff_slot++) {
|
||||
focusspellid = buffs[buff_slot].spellid;
|
||||
@@ -7393,7 +7393,7 @@ int16 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel
|
||||
return 0;
|
||||
break;
|
||||
default:
|
||||
LogFile->write(EQEMuLog::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]);
|
||||
LogFile->write(EQEMuLog::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -7725,7 +7725,7 @@ int16 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel
|
||||
//this spits up a lot of garbage when calculating spell focuses
|
||||
//since they have all kinds of extra effects on them.
|
||||
default:
|
||||
LogFile->write(EQEMuLog::Normal, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]);
|
||||
LogFile->write(EQEMuLog::Normal, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -7785,13 +7785,13 @@ float Bot::GetProcChances(float &ProcBonus, float &ProcChance, uint16 weapon_spe
|
||||
bool Bot::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte)
|
||||
{
|
||||
/* solar: called when a mob is attacked, does the checks to see if it's a hit
|
||||
* and does other mitigation checks. 'this' is the mob being attacked.
|
||||
* and does other mitigation checks. 'this' is the mob being attacked.
|
||||
*
|
||||
* special return values:
|
||||
* -1 - block
|
||||
* -2 - parry
|
||||
* -3 - riposte
|
||||
* -4 - dodge
|
||||
* -1 - block
|
||||
* -2 - parry
|
||||
* -3 - riposte
|
||||
* -4 - dodge
|
||||
*
|
||||
*/
|
||||
if(GetAppearance() == eaDead)
|
||||
@@ -7824,7 +7824,7 @@ bool Bot::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte)
|
||||
if (CanRiposte && damage > 0 && CanThisClassRiposte() && !other->BehindMob(this, other->GetX(), other->GetY()))
|
||||
{
|
||||
riposte_chance = (100.0f + (float)defender->GetAABonuses().RiposteChance + (float)defender->GetSpellBonuses().RiposteChance + (float)defender->GetItemBonuses().RiposteChance) / 100.0f;
|
||||
skill = GetSkill(RIPOSTE);
|
||||
skill = GetSkill(RIPOSTE);
|
||||
|
||||
if (!ghit) { //if they are not using a garunteed hit discipline
|
||||
bonus = 2.0 + skill/60.0 + (GetDEX()/200);
|
||||
@@ -7927,7 +7927,7 @@ bool Bot::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte)
|
||||
if (damage > 0 && CanThisClassDodge() && !other->BehindMob(this, other->GetX(), other->GetY()))
|
||||
{
|
||||
dodge_chance = (100.0f + (float)defender->GetSpellBonuses().DodgeChance + (float)defender->GetItemBonuses().DodgeChance) / 100.0f;
|
||||
skill = GetSkill(DODGE);
|
||||
skill = GetSkill(DODGE);
|
||||
|
||||
if (!ghit) { //if they are not using a garunteed hit discipline
|
||||
bonus = 2.0 + skill/60.0 + (GetAGI()/200);
|
||||
@@ -7968,7 +7968,7 @@ int Bot::GetMonkHandToHandDamage(void)
|
||||
// Kaiyodo - Determine a monk's fist damage. Table data from www.monkly-business.com
|
||||
// saved as static array - this should speed this function up considerably
|
||||
static int damage[66] = {
|
||||
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
||||
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
||||
99, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7,
|
||||
8, 8, 8, 8, 8, 9, 9, 9, 9, 9,10,10,10,10,10,11,11,11,11,11,
|
||||
12,12,12,12,12,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,
|
||||
@@ -8127,7 +8127,7 @@ bool Bot::TryFinishingBlow(Mob *defender, SkillType skillinuse)
|
||||
}
|
||||
else
|
||||
{
|
||||
mlog(COMBAT__ATTACKS, "FAILED a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel());
|
||||
mlog(COMBAT__ATTACKS, "FAILED a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -8144,8 +8144,8 @@ void Bot::DoRiposte(Mob* defender) {
|
||||
|
||||
//double riposte
|
||||
int16 DoubleRipChance = defender->GetAABonuses().GiveDoubleRiposte[0] +
|
||||
defender->GetSpellBonuses().GiveDoubleRiposte[0] +
|
||||
defender->GetItemBonuses().GiveDoubleRiposte[0];
|
||||
defender->GetSpellBonuses().GiveDoubleRiposte[0] +
|
||||
defender->GetItemBonuses().GiveDoubleRiposte[0];
|
||||
|
||||
if(DoubleRipChance && (DoubleRipChance >= MakeRandomInt(0, 100))) {
|
||||
mlog(COMBAT__ATTACKS, "Preforming a double riposte (%d percent chance)", DoubleRipChance);
|
||||
@@ -8280,7 +8280,7 @@ void Bot::MeleeMitigation(Mob *attacker, int32 &damage, int32 minhit)
|
||||
{
|
||||
thac0 = thac0cap;
|
||||
}
|
||||
d -= 10.0 * (a_diff / thac0);
|
||||
d -= 10.0 * (a_diff / thac0);
|
||||
}
|
||||
else if(mit_roll > atk_roll)
|
||||
{
|
||||
@@ -8291,7 +8291,7 @@ void Bot::MeleeMitigation(Mob *attacker, int32 &damage, int32 minhit)
|
||||
{
|
||||
thac20 = thac20cap;
|
||||
}
|
||||
d += 10 * (m_diff / thac20);
|
||||
d += 10 * (m_diff / thac20);
|
||||
}
|
||||
|
||||
if(d < 0.0)
|
||||
@@ -8550,7 +8550,7 @@ void Bot::RogueBackstab(Mob* other, bool min_damage, int ReuseTime)
|
||||
|
||||
if(primaryweapondamage > 0){
|
||||
if(level > 25){
|
||||
max_hit = (((2*backstab_dmg) * GetDamageTable(BACKSTAB) / 100) * 10 * GetSkill(BACKSTAB) / 355) + ((level-25)/3) + 1;
|
||||
max_hit = (((2*backstab_dmg) * GetDamageTable(BACKSTAB) / 100) * 10 * GetSkill(BACKSTAB) / 355) + ((level-25)/3) + 1;
|
||||
hate = 20 * backstab_dmg * GetSkill(BACKSTAB) / 355;
|
||||
}
|
||||
else{
|
||||
@@ -8565,7 +8565,7 @@ void Bot::RogueBackstab(Mob* other, bool min_damage, int ReuseTime)
|
||||
}
|
||||
else
|
||||
{
|
||||
// Trumpcard: Replaced switch statement with formula calc. This will give minhit increases all the way to 65.
|
||||
// Trumpcard: Replaced switch statement with formula calc. This will give minhit increases all the way to 65.
|
||||
min_hit = (level * ( level*5 - 105)) / 100;
|
||||
}
|
||||
|
||||
@@ -8689,11 +8689,11 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
|
||||
if(level >= RuleI(Combat, NPCBashKickLevel)){
|
||||
bool canBash = false;
|
||||
if((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) // Racial Slam
|
||||
|| (m_inv.GetItem(SLOT_SECONDARY) && m_inv.GetItem(SLOT_SECONDARY)->GetItem()->ItemType == ItemTypeShield) //Using Shield
|
||||
|| (m_inv.GetItem(SLOT_SECONDARY) && m_inv.GetItem(SLOT_SECONDARY)->GetItem()->ItemType == ItemTypeShield) //Using Shield
|
||||
|| (m_inv.GetItem(SLOT_PRIMARY) && (m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HS
|
||||
|| m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HB
|
||||
|| m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HPierce)
|
||||
&& GetAA(aa2HandBash) >= 1)) { //Using 2 hand weapon, but has AA 2 Hand Bash
|
||||
&& GetAA(aa2HandBash) >= 1)) { //Using 2 hand weapon, but has AA 2 Hand Bash
|
||||
canBash = true;
|
||||
}
|
||||
|
||||
@@ -8716,11 +8716,11 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
|
||||
case PALADIN:
|
||||
if(level >= RuleI(Combat, NPCBashKickLevel)){
|
||||
if((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) // Racial Slam
|
||||
|| (m_inv.GetItem(SLOT_SECONDARY) && m_inv.GetItem(SLOT_SECONDARY)->GetItem()->ItemType == ItemTypeShield) //Using Shield
|
||||
|| (m_inv.GetItem(SLOT_SECONDARY) && m_inv.GetItem(SLOT_SECONDARY)->GetItem()->ItemType == ItemTypeShield) //Using Shield
|
||||
|| (m_inv.GetItem(SLOT_PRIMARY) && (m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HS
|
||||
|| m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HB
|
||||
|| m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HPierce)
|
||||
&& GetAA(aa2HandBash) >= 1)) { //Using 2 hand weapon, but has AA 2 Hand Bash
|
||||
&& GetAA(aa2HandBash) >= 1)) { //Using 2 hand weapon, but has AA 2 Hand Bash
|
||||
skill_to_use = BASH;
|
||||
}
|
||||
}
|
||||
@@ -8802,10 +8802,10 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
|
||||
int AtkRounds = 3;
|
||||
int skillmod = 0;
|
||||
|
||||
if(MaxSkill(FRENZY) > 0)
|
||||
skillmod = 100*GetSkill(FRENZY)/MaxSkill(FRENZY);
|
||||
if(MaxSkill(FRENZY) > 0)
|
||||
skillmod = 100*GetSkill(FRENZY)/MaxSkill(FRENZY);
|
||||
|
||||
int32 max_dmg = (26 + ((((GetLevel()-6) * 2)*skillmod)/100)) * ((100+RuleI(Combat, FrenzyBonus))/100);
|
||||
int32 max_dmg = (26 + ((((GetLevel()-6) * 2)*skillmod)/100)) * ((100+RuleI(Combat, FrenzyBonus))/100);
|
||||
int32 min_dmg = 0;
|
||||
DoAnim(anim2HSlashing);
|
||||
|
||||
@@ -9389,7 +9389,7 @@ void Bot::SetAttackTimer() {
|
||||
int speed = (int)((36 *(100+DelayMod)/100)*(100.0f+attack_speed)*PermaHaste);
|
||||
//if(speed < RuleI(Combat, MinHastedDelay) && IsClient()) //lower bound
|
||||
// speed = RuleI(Combat, MinHastedDelay);
|
||||
TimerToUse->SetAtTrigger(speed, true); // Hand to hand, non-monk 2/36
|
||||
TimerToUse->SetAtTrigger(speed, true); // Hand to hand, non-monk 2/36
|
||||
}
|
||||
} else {
|
||||
//we have a weapon, use its delay
|
||||
@@ -9436,8 +9436,8 @@ void Bot::SetAttackTimer() {
|
||||
int32 Bot::Additional_SpellDmg(uint16 spell_id, bool bufftick)
|
||||
{
|
||||
int32 spell_dmg = 0;
|
||||
spell_dmg += GetBotFocusEffect(BotfocusFF_Damage_Amount, spell_id);
|
||||
spell_dmg += GetBotFocusEffect(BotfocusSpellDamage, spell_id);
|
||||
spell_dmg += GetBotFocusEffect(BotfocusFF_Damage_Amount, spell_id);
|
||||
spell_dmg += GetBotFocusEffect(BotfocusSpellDamage, spell_id);
|
||||
|
||||
//For DOTs you need to apply the damage over the duration of the dot to each tick (this is how live did it)
|
||||
if (bufftick){
|
||||
@@ -9469,8 +9469,8 @@ int32 Bot::GetActSpellDamage(uint16 spell_id, int32 value) {
|
||||
if (tt == ST_UndeadAE || tt == ST_Undead || tt == ST_Summoned) {
|
||||
//undead/summoned spells
|
||||
modifier += GetBotFocusEffect(BotfocusImprovedUndeadDamage, spell_id);
|
||||
} else {
|
||||
//damage spells.
|
||||
} else {
|
||||
//damage spells.
|
||||
modifier += GetBotFocusEffect(BotfocusImprovedDamage, spell_id);
|
||||
modifier += GetBotFocusEffect(BotfocusSpellEffectiveness, spell_id);
|
||||
modifier += GetBotFocusEffect(BotfocusImprovedDamage2, spell_id);
|
||||
@@ -9483,7 +9483,7 @@ int32 Bot::GetActSpellDamage(uint16 spell_id, int32 value) {
|
||||
}
|
||||
|
||||
//This adds the extra damage from the AA Unholy Touch, 450 per level to the AA Improved Harm TOuch.
|
||||
if (spell_id == SPELL_IMP_HARM_TOUCH) { //Improved Harm Touch
|
||||
if (spell_id == SPELL_IMP_HARM_TOUCH) { //Improved Harm Touch
|
||||
value -= GetAA(aaUnholyTouch) * 450; //Unholy Touch
|
||||
}
|
||||
|
||||
@@ -9518,7 +9518,7 @@ int32 Bot::GetActSpellDamage(uint16 spell_id, int32 value) {
|
||||
ratio += RuleI(Spells, WizCritRatio);
|
||||
}
|
||||
if(aabonuses.SpellCritDmgIncrease > 0) // wizards get an additional bonus
|
||||
ratio += aabonuses.SpellCritDmgIncrease * 1.5; //108%, 115%, 124%, close to Graffe's 207%, 215%, & 225%
|
||||
ratio += aabonuses.SpellCritDmgIncrease * 1.5; //108%, 115%, 124%, close to Graffe's 207%, 215%, & 225%
|
||||
}
|
||||
|
||||
//Improved Harm Touch is a guaranteed crit if you have at least one level of SCF.
|
||||
@@ -9572,8 +9572,8 @@ int32 Bot::Additional_Heal(uint16 spell_id)
|
||||
{
|
||||
int32 heal_amt = 0;
|
||||
|
||||
heal_amt += GetBotFocusEffect(BotfocusAdditionalHeal, spell_id);
|
||||
heal_amt += GetBotFocusEffect(BotfocusAdditionalHeal2, spell_id);
|
||||
heal_amt += GetBotFocusEffect(BotfocusAdditionalHeal, spell_id);
|
||||
heal_amt += GetBotFocusEffect(BotfocusAdditionalHeal2, spell_id);
|
||||
|
||||
if (heal_amt){
|
||||
int duration = CalcBuffDuration(this, this, spell_id);
|
||||
@@ -9875,7 +9875,7 @@ bool Bot::SpellEffect(Mob* caster, uint16 spell_id, float partial) {
|
||||
|
||||
Result = Mob::SpellEffect(caster, spell_id, partial);
|
||||
|
||||
// Franck-add: If healed/doted, a bot must show its new HP to its leader
|
||||
// Franck-add: If healed/doted, a bot must show its new HP to its leader
|
||||
if(IsGrouped()) {
|
||||
Group *g = GetGroup();
|
||||
if(g) {
|
||||
@@ -11274,7 +11274,7 @@ bool Bot::IsGroupPrimaryHealer() {
|
||||
case RANGER:
|
||||
case BEASTLORD:
|
||||
{
|
||||
result = GroupHasPriestClass(g) ? false : true;
|
||||
result = GroupHasPriestClass(g) ? false : true;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -11309,7 +11309,7 @@ bool Bot::IsGroupPrimarySlower() {
|
||||
}
|
||||
case BEASTLORD:
|
||||
{
|
||||
result = (GroupHasShamanClass(g) || GroupHasEnchanterClass(g)) ? false : true;
|
||||
result = (GroupHasShamanClass(g) || GroupHasEnchanterClass(g)) ? false : true;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -11998,7 +11998,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
c->Message(0, "#bot taunt [on|off] - Turns taunt on/off for targeted bot");
|
||||
c->Message(0, "#bot stance [name] [stance (id)|list] - Sets/lists stance for named bot (Passive = 0, Balanced = 1, Efficient = 2, Reactive = 3, Aggressive = 4, Burn = 5, BurnAE = 6)");
|
||||
c->Message(0, "#bot groupmessages [on|off] [bot name|all] - Turns group messages on/off for named bot/all bots.");
|
||||
c->Message(0, "#bot defensive [bot name] - Causes warrior or knight bot to use defensive discipline / buff.");
|
||||
c->Message(0, "#bot defensive [bot name] - Causes warrior or knight bot to use defensive discipline / buff.");
|
||||
c->Message(0, "#bot healrotation help - Displays the commands available to manage BOT heal rotations.");
|
||||
// TODO:
|
||||
// c->Message(0, "#bot illusion <bot/client name or target> - Enchanter Bot cast an illusion buff spell on you or your target.");
|
||||
@@ -12094,9 +12094,9 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
MYSQL_ROW DataRow;
|
||||
|
||||
c->Message(0, "-----------------#bot armorcolor help-----------------------------");
|
||||
c->Message(0, "Armor: 17(Chest/Robe), 7(Arms), 9(Bracer), 12(Hands), 18(Legs), 19(Boots), 2(Helm)");
|
||||
c->Message(0, "Armor: 17(Chest/Robe), 7(Arms), 9(Bracer), 12(Hands), 18(Legs), 19(Boots), 2(Helm)");
|
||||
c->Message(0, "------------------------------------------------------------------");
|
||||
c->Message(0, "Color: [red] [green] [blue] (enter a number from 0-255 for each");
|
||||
c->Message(0, "Color: [red] [green] [blue] (enter a number from 0-255 for each");
|
||||
c->Message(0, "------------------------------------------------------------------");
|
||||
c->Message(0, "Example: #bot armorcolor 17 0 255 0 - this would make the chest bright green");
|
||||
return;
|
||||
@@ -12217,7 +12217,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
}
|
||||
|
||||
if(!strcasecmp(sep->arg[1], "help") && !strcasecmp(sep->arg[2], "create") ){
|
||||
c->Message(0, "Classes: 1(Warrior), 2(Cleric), 3(Paladin), 4(Ranger), 5(Sk), 6(Druid), 7(Monk), 8(Bard), 9(Rogue), 10(Shaman), 11(Necro), 12(Wiz), 13(Mag), 14(Ench), 15(Beast), 16(Bersek)");
|
||||
c->Message(0, "Classes: 1(Warrior), 2(Cleric), 3(Paladin), 4(Ranger), 5(Sk), 6(Druid), 7(Monk), 8(Bard), 9(Rogue), 10(Shaman), 11(Necro), 12(Wiz), 13(Mag), 14(Ench), 15(Beast), 16(Bersek)");
|
||||
c->Message(0, "------------------------------------------------------------------");
|
||||
c->Message(0, "Races: 1(Human), 2(Barb), 3(Erudit), 4(Wood elf), 5(High elf), 6(Dark elf), 7(Half elf), 8(Dwarf), 9(Troll), 10(Ogre), 11(Halfling), 12(Gnome), 128(Iksar), 130(Vah shir), 330(Froglok), 522(Drakkin)");
|
||||
c->Message(0, "------------------------------------------------------------------");
|
||||
@@ -12307,7 +12307,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
|
||||
if(bot && !listAll) {
|
||||
// Specific bot only
|
||||
if(bot->GetClass() != WARRIOR && bot->GetClass() != MONK && bot->GetClass() != BARD && bot->GetClass() != BERSERKER && bot->GetClass() != ROGUE)
|
||||
if(bot->GetClass() != WARRIOR && bot->GetClass() != MONK && bot->GetClass() != BARD && bot->GetClass() != BERSERKER && bot->GetClass() != ROGUE)
|
||||
c->Message(0, "Name: %s -- Class: %s -- Mana: %3.1f%%", bot->GetCleanName(), ClassIdToString(bot->GetClass()).c_str(), bot->GetManaRatio());
|
||||
}
|
||||
else {
|
||||
@@ -12318,7 +12318,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
for(std::list<Bot*>::iterator botsListItr = spawnedBots.begin(); botsListItr != spawnedBots.end(); botsListItr++) {
|
||||
Bot* tempBot = *botsListItr;
|
||||
if(tempBot) {
|
||||
if(tempBot->GetClass() != WARRIOR && tempBot->GetClass() != MONK && tempBot->GetClass() != BARD && tempBot->GetClass() != BERSERKER && tempBot->GetClass() != ROGUE)
|
||||
if(tempBot->GetClass() != WARRIOR && tempBot->GetClass() != MONK && tempBot->GetClass() != BARD && tempBot->GetClass() != BERSERKER && tempBot->GetClass() != ROGUE)
|
||||
c->Message(0, "Name: %s -- Class: %s -- Mana: %3.1f%%", tempBot->GetCleanName(), ClassIdToString(tempBot->GetClass()).c_str(), tempBot->GetManaRatio());
|
||||
}
|
||||
}
|
||||
@@ -12861,7 +12861,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
}
|
||||
}
|
||||
if(hasruneer) {
|
||||
if (c->GetLevel() <= 12) {
|
||||
if (c->GetLevel() <= 12) {
|
||||
runeer->Say("I need to be level 13 or higher for this...");
|
||||
}
|
||||
else if ((c->GetLevel() >= 13) && (c->GetLevel() <= 21)) {
|
||||
@@ -13002,7 +13002,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
}
|
||||
switch(CurerClass) {
|
||||
case CLERIC:
|
||||
if (!strcasecmp(sep->arg[2], "poison") && (c->GetLevel() >= 1)) {
|
||||
if (!strcasecmp(sep->arg[2], "poison") && (c->GetLevel() >= 1)) {
|
||||
Curer->Say("Trying to cure us of %s.", sep->arg[2]);
|
||||
Curer->CastToBot()->Bot_Command_Cure(1, Curer->GetLevel());
|
||||
}
|
||||
@@ -13030,7 +13030,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
break;
|
||||
|
||||
case SHAMAN:
|
||||
if (!strcasecmp(sep->arg[2], "poison") && (c->GetLevel() >= 2)) {
|
||||
if (!strcasecmp(sep->arg[2], "poison") && (c->GetLevel() >= 2)) {
|
||||
Curer->Say("Trying to cure us of %s.", sep->arg[2]);
|
||||
Curer->CastToBot()->Bot_Command_Cure(1, Curer->GetLevel());
|
||||
}
|
||||
@@ -13606,11 +13606,11 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if((hasevac) && (c->GetLevel() >= 18)) {
|
||||
if((hasevac) && (c->GetLevel() >= 18)) {
|
||||
evac->Say("Attempting to Evac you %s.", c->GetName());
|
||||
evac->CastToClient()->CastSpell(2183, c->GetID(), 1, -1, -1);
|
||||
}
|
||||
else if((hasevac) && (c->GetLevel() <= 17)) {
|
||||
else if((hasevac) && (c->GetLevel() <= 17)) {
|
||||
evac->Say("I'm not level 18 yet.", c->GetName());
|
||||
}
|
||||
return;
|
||||
@@ -13654,11 +13654,11 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
}
|
||||
switch(SowerClass) {
|
||||
case DRUID:
|
||||
if ((!strcasecmp(sep->arg[2], "regular")) && (zone->CanCastOutdoor()) && (c->GetLevel() >= 10) ) {
|
||||
if ((!strcasecmp(sep->arg[2], "regular")) && (zone->CanCastOutdoor()) && (c->GetLevel() >= 10) ) {
|
||||
Sower->Say("Casting sow...");
|
||||
Sower->CastSpell(278, c->GetID(), 1, -1, -1);
|
||||
}
|
||||
else if ((!strcasecmp(sep->arg[2], "regular")) && (zone->CanCastOutdoor()) && (c->GetLevel() <= 10) ) {
|
||||
else if ((!strcasecmp(sep->arg[2], "regular")) && (zone->CanCastOutdoor()) && (c->GetLevel() <= 10) ) {
|
||||
Sower->Say("I'm not level 10 yet.");
|
||||
}
|
||||
else if ((!strcasecmp(sep->arg[2], "wolf")) && zone->CanCastOutdoor() && (c->GetLevel() >= 20)) {
|
||||
@@ -13741,7 +13741,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
|
||||
|
||||
default:
|
||||
c->Message(15, "You must have a Druid, Shaman, Ranger, or Beastlord in your group.");
|
||||
c->Message(15, "You must have a Druid, Shaman, Ranger, or Beastlord in your group.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -13832,7 +13832,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
}
|
||||
switch(GaterClass) {
|
||||
case DRUID:
|
||||
if ((!strcasecmp(sep->arg[2], "karana")) && (c->GetLevel() >= 25) ) {
|
||||
if ((!strcasecmp(sep->arg[2], "karana")) && (c->GetLevel() >= 25) ) {
|
||||
Gater->Say("Casting Circle of Karana...");
|
||||
Gater->CastSpell(550, c->GetID(), 1, -1, -1);
|
||||
}
|
||||
@@ -13966,7 +13966,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
|
||||
case WIZARD:
|
||||
|
||||
if ((!strcasecmp(sep->arg[2], "commons")) && (c->GetLevel() >= 35) ) {
|
||||
if ((!strcasecmp(sep->arg[2], "commons")) && (c->GetLevel() >= 35) ) {
|
||||
Gater->Say("Casting Common Portal...");
|
||||
Gater->CastSpell(566, c->GetID(), 1, -1, -1);
|
||||
}
|
||||
@@ -14143,7 +14143,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
}
|
||||
switch(EndurerClass) {
|
||||
case DRUID:
|
||||
if (c->GetLevel() < 6) {
|
||||
if (c->GetLevel() < 6) {
|
||||
Endurer->Say("I'm not level 6 yet.");
|
||||
}
|
||||
else {
|
||||
@@ -14153,7 +14153,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
}
|
||||
break;
|
||||
case SHAMAN:
|
||||
if (c->GetLevel() < 12) {
|
||||
if (c->GetLevel() < 12) {
|
||||
Endurer->Say("I'm not level 12 yet.");
|
||||
}
|
||||
else {
|
||||
@@ -14162,7 +14162,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
}
|
||||
break;
|
||||
case RANGER:
|
||||
if (c->GetLevel() < 20) {
|
||||
if (c->GetLevel() < 20) {
|
||||
Endurer->Say("I'm not level 20 yet.");
|
||||
}
|
||||
else {
|
||||
@@ -14171,7 +14171,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
}
|
||||
break;
|
||||
case ENCHANTER:
|
||||
if (c->GetLevel() < 12) {
|
||||
if (c->GetLevel() < 12) {
|
||||
Endurer->Say("I'm not level 12 yet.");
|
||||
}
|
||||
else {
|
||||
@@ -14180,14 +14180,14 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
}
|
||||
break;
|
||||
case BEASTLORD:
|
||||
if (c->GetLevel() < 25) {
|
||||
if (c->GetLevel() < 25) {
|
||||
Endurer->Say("I'm not level 25 yet.");
|
||||
}
|
||||
}
|
||||
else {
|
||||
Endurer->Say("Casting Enduring Breath...");
|
||||
Endurer->CastSpell(86, c->GetID(), 1, -1, -1);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
c->Message(15, "You must have a Druid, Shaman, Ranger, Enchanter, or Beastlord in your group.");
|
||||
break;
|
||||
@@ -14240,21 +14240,21 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
}
|
||||
switch(InviserClass) {
|
||||
case ENCHANTER:
|
||||
if ((c->GetLevel() <= 14) && (!strcasecmp(sep->arg[2], "undead"))) {
|
||||
if ((c->GetLevel() <= 14) && (!strcasecmp(sep->arg[2], "undead"))) {
|
||||
Inviser->Say("I'm not level 14 yet.");
|
||||
}
|
||||
else if ((!c->IsInvisible(c)) && (!c->invisible_undead) && (c->GetLevel() >= 14) && (!strcasecmp(sep->arg[2], "undead"))) {
|
||||
Inviser->Say("Casting invis undead...");
|
||||
Inviser->CastSpell(235, c->GetID(), 1, -1, -1);
|
||||
}
|
||||
else if ((c->GetLevel() <= 4) && (!strcasecmp(sep->arg[2], "live"))) {
|
||||
else if ((c->GetLevel() <= 4) && (!strcasecmp(sep->arg[2], "live"))) {
|
||||
Inviser->Say("I'm not level 4 yet.");
|
||||
}
|
||||
else if ((!c->IsInvisible(c))&& (!c->invisible_undead) && (c->GetLevel() >= 4) && (!strcasecmp(sep->arg[2], "live"))) {
|
||||
Inviser->Say("Casting invisibilty...");
|
||||
Inviser->CastSpell(42, c->GetID(), 1, -1, -1);
|
||||
}
|
||||
else if ((c->GetLevel() <= 6) && (!strcasecmp(sep->arg[2], "see"))) {
|
||||
else if ((c->GetLevel() <= 6) && (!strcasecmp(sep->arg[2], "see"))) {
|
||||
Inviser->Say("I'm not level 6 yet.");
|
||||
}
|
||||
else if ((c->GetLevel() >= 6) && (!strcasecmp(sep->arg[2], "see"))) {
|
||||
@@ -14269,17 +14269,17 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
}
|
||||
break;
|
||||
case MAGICIAN:
|
||||
if (!strcasecmp(sep->arg[2], "undead")) {
|
||||
if (!strcasecmp(sep->arg[2], "undead")) {
|
||||
Inviser->Say("I don't have that spell.");
|
||||
}
|
||||
else if ((c->GetLevel() <= 8) && (!strcasecmp(sep->arg[2], "live"))) {
|
||||
else if ((c->GetLevel() <= 8) && (!strcasecmp(sep->arg[2], "live"))) {
|
||||
Inviser->Say("I'm not level 8 yet.");
|
||||
}
|
||||
else if ((!c->IsInvisible(c))&& (!c->invisible_undead) && (c->GetLevel() >= 8) && (!strcasecmp(sep->arg[2], "live"))) {
|
||||
Inviser->Say("Casting invisibilty...");
|
||||
Inviser->CastSpell(42, c->GetID(), 1, -1, -1);
|
||||
}
|
||||
else if ((c->GetLevel() <= 16) && (!strcasecmp(sep->arg[2], "see"))) {
|
||||
else if ((c->GetLevel() <= 16) && (!strcasecmp(sep->arg[2], "see"))) {
|
||||
Inviser->Say("I'm not level 16 yet.");
|
||||
}
|
||||
else if ((c->GetLevel() >= 16) && (!strcasecmp(sep->arg[2], "see"))) {
|
||||
@@ -14294,21 +14294,21 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
}
|
||||
break;
|
||||
case WIZARD:
|
||||
if ((c->GetLevel() <= 39) && (!strcasecmp(sep->arg[2], "undead"))) {
|
||||
if ((c->GetLevel() <= 39) && (!strcasecmp(sep->arg[2], "undead"))) {
|
||||
Inviser->Say("I'm not level 39 yet.");
|
||||
}
|
||||
else if ((!c->IsInvisible(c))&& (!c->invisible_undead) && (c->GetLevel() >= 39) && (!strcasecmp(sep->arg[2], "undead"))) {
|
||||
Inviser->Say("Casting invis undead...");
|
||||
Inviser->CastSpell(235, c->GetID(), 1, -1, -1);
|
||||
}
|
||||
else if ((c->GetLevel() <= 16) && (!strcasecmp(sep->arg[2], "live"))) {
|
||||
else if ((c->GetLevel() <= 16) && (!strcasecmp(sep->arg[2], "live"))) {
|
||||
Inviser->Say("I'm not level 16 yet.");
|
||||
}
|
||||
else if ((!c->IsInvisible(c))&& (!c->invisible_undead) && (c->GetLevel() >= 16) && (!strcasecmp(sep->arg[2], "live"))) {
|
||||
Inviser->Say("Casting invisibilty...");
|
||||
Inviser->CastSpell(42, c->GetID(), 1, -1, -1);
|
||||
}
|
||||
else if ((c->GetLevel() <= 4) && (!strcasecmp(sep->arg[2], "see"))) {
|
||||
else if ((c->GetLevel() <= 4) && (!strcasecmp(sep->arg[2], "see"))) {
|
||||
Inviser->Say("I'm not level 6 yet.");
|
||||
}
|
||||
else if ((c->GetLevel() >= 4) && (!strcasecmp(sep->arg[2], "see"))) {
|
||||
@@ -14341,10 +14341,10 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
}
|
||||
break;
|
||||
case DRUID:
|
||||
if (!strcasecmp(sep->arg[2], "undead")) {
|
||||
if (!strcasecmp(sep->arg[2], "undead")) {
|
||||
Inviser->Say("I don't have that spell...");
|
||||
}
|
||||
else if ((c->GetLevel() <= 4) && (!strcasecmp(sep->arg[2], "live"))) {
|
||||
else if ((c->GetLevel() <= 4) && (!strcasecmp(sep->arg[2], "live"))) {
|
||||
Inviser->Say("I'm not level 4 yet.");
|
||||
}
|
||||
else if ((!c->IsInvisible(c))&& (!c->invisible_undead) && (c->GetLevel() >= 18) && (!strcasecmp(sep->arg[2], "live"))) {
|
||||
@@ -14358,7 +14358,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
else if ((c->GetLevel() >= 4) && (!strcasecmp(sep->arg[2], "live")) && (!zone->CanCastOutdoor())) {
|
||||
Inviser->Say("I can't cast this spell indoors...");
|
||||
}
|
||||
else if ((c->GetLevel() <= 13) && (!strcasecmp(sep->arg[2], "see"))) {
|
||||
else if ((c->GetLevel() <= 13) && (!strcasecmp(sep->arg[2], "see"))) {
|
||||
Inviser->Say("I'm not level 13 yet.");
|
||||
}
|
||||
else if ((c->GetLevel() >= 13) && (!strcasecmp(sep->arg[2], "see"))) {
|
||||
@@ -14417,7 +14417,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
}
|
||||
switch(LeverClass) {
|
||||
case DRUID:
|
||||
if (c->GetLevel() <= 14) {
|
||||
if (c->GetLevel() <= 14) {
|
||||
Lever->Say("I'm not level 14 yet.");
|
||||
}
|
||||
else if (zone->CanCastOutdoor()) {
|
||||
@@ -14512,7 +14512,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
}
|
||||
switch(ResisterClass) {
|
||||
case CLERIC:
|
||||
if (!strcasecmp(sep->arg[2], "poison") && (c->GetLevel() >= 6)) {
|
||||
if (!strcasecmp(sep->arg[2], "poison") && (c->GetLevel() >= 6)) {
|
||||
Resister->Say("Casting poison protection...", sep->arg[2]);
|
||||
Resister->CastToBot()->Bot_Command_Resist(1, Resister->GetLevel());
|
||||
}
|
||||
@@ -14545,7 +14545,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
break;
|
||||
|
||||
case SHAMAN:
|
||||
if (!strcasecmp(sep->arg[2], "poison") && (c->GetLevel() >= 20)) {
|
||||
if (!strcasecmp(sep->arg[2], "poison") && (c->GetLevel() >= 20)) {
|
||||
Resister->Say("Casting poison protection...", sep->arg[2]);
|
||||
Resister->CastToBot()->Bot_Command_Resist(12, Resister->GetLevel());
|
||||
}
|
||||
@@ -15041,7 +15041,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(!strcasecmp(sep->arg[1], "botgroup") && !strcasecmp(sep->arg[2], "load")) {
|
||||
if(!strcasecmp(sep->arg[1], "botgroup") && !strcasecmp(sep->arg[2], "load")) {
|
||||
|
||||
// If client is grouped, check for aggro on each group member.
|
||||
Group *g = c->GetGroup();
|
||||
@@ -15053,7 +15053,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
// Fail if current group member is client and has aggro
|
||||
// OR has a popuplated hate list (assume bot).
|
||||
if((g->members[i]->IsClient() && g->members[i]->CastToClient()->GetAggroCount())
|
||||
|| g->members[i]->IsEngaged()) {
|
||||
|| g->members[i]->IsEngaged()) {
|
||||
c->Message(0, "You can't spawn bots while your group is engaged.");
|
||||
return;
|
||||
}
|
||||
@@ -15264,7 +15264,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
if(!strcasecmp(sep->arg[1], "haircolor") || !strcasecmp(sep->arg[1], "hair") || !strcasecmp(sep->arg[1], "beard") || !strcasecmp(sep->arg[1], "beardcolor") || !strcasecmp(sep->arg[1], "face")
|
||||
|| !strcasecmp(sep->arg[1], "eyes") || !strcasecmp(sep->arg[1], "heritage") || !strcasecmp(sep->arg[1], "tattoo") || !strcasecmp(sep->arg[1], "details")) {
|
||||
if(c->GetTarget() && c->GetTarget()->IsBot()) {
|
||||
if (sep->IsNumber(2)) {
|
||||
if (sep->IsNumber(2)) {
|
||||
if (c->GetTarget()->CastToBot()->GetBotOwnerCharacterID() == c->CharacterID()) {
|
||||
Bot *target = c->GetTarget()->CastToBot();
|
||||
uint16 Race = target->GetRace();
|
||||
@@ -15428,7 +15428,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
int stance = atoi(sep->arg[3]);
|
||||
|
||||
if(stance >= MaxStances || stance < 0){
|
||||
c->Message(0, "Usage #bot stance [name] [stance (id)] (Passive = 0, Balanced = 1, Efficient = 2, Reactive = 3, Aggressive = 4, Burn = 5, BurnAE = 6)");
|
||||
c->Message(0, "Usage #bot stance [name] [stance (id)] (Passive = 0, Balanced = 1, Efficient = 2, Reactive = 3, Aggressive = 4, Burn = 5, BurnAE = 6)");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
@@ -15482,7 +15482,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
}
|
||||
}
|
||||
else {
|
||||
c->Message(0, "Usage #bot stance [name] [stance (id)] (Passive = 0, Balanced = 1, Efficient = 2, Reactive = 3, Aggressive = 4, Burn = 5, BurnAE = 6)");
|
||||
c->Message(0, "Usage #bot stance [name] [stance (id)] (Passive = 0, Balanced = 1, Efficient = 2, Reactive = 3, Aggressive = 4, Burn = 5, BurnAE = 6)");
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -16100,7 +16100,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
Bot* tempBot = *botListItr;
|
||||
if(tempBot->GetInHealRotation() && tempBot->GetHealRotationLeader() == tempBot) {
|
||||
//list leaders and number of bots per rotation
|
||||
c->Message(0, "Bot Heal Rotation- Leader: %s, Number of Members: %i, Timer: %1.1f", tempBot->GetCleanName(), tempBot->GetNumHealRotationMembers(), (float)(tempBot->GetHealRotationTimer()/1000));
|
||||
c->Message(0, "Bot Heal Rotation- Leader: %s, Number of Members: %i, Timer: %1.1f", tempBot->GetCleanName(), tempBot->GetNumHealRotationMembers(), (float)(tempBot->GetHealRotationTimer()/1000));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16125,7 +16125,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
|
||||
//list leader and number of members
|
||||
c->Message(0, "Bot Heal Rotation- Leader: %s", leaderBot->GetCleanName());
|
||||
c->Message(0, "Bot Heal Rotation- Timer: %1.1f", ((float)leaderBot->GetHealRotationTimer()/1000.0f));
|
||||
c->Message(0, "Bot Heal Rotation- Timer: %1.1f", ((float)leaderBot->GetHealRotationTimer()/1000.0f));
|
||||
|
||||
for(list<Bot*>::iterator botListItr = botList.begin(); botListItr != botList.end(); botListItr++) {
|
||||
Bot* tempBot = *botListItr;
|
||||
@@ -16341,11 +16341,11 @@ bool EntityList::Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, fl
|
||||
if(caster->AICastSpell(g->members[i], 100, SpellType_Heal))
|
||||
return true;
|
||||
}
|
||||
else if((g->members[i]->GetClass() == WARRIOR || g->members[i]->GetClass() == PALADIN || g->members[i]->GetClass() == SHADOWKNIGHT) && g->members[i]->GetHPRatio() < 95) {
|
||||
else if((g->members[i]->GetClass() == WARRIOR || g->members[i]->GetClass() == PALADIN || g->members[i]->GetClass() == SHADOWKNIGHT) && g->members[i]->GetHPRatio() < 95) {
|
||||
if(caster->AICastSpell(g->members[i], 100, SpellType_Heal))
|
||||
return true;
|
||||
}
|
||||
else if(g->members[i]->GetClass() == ENCHANTER && g->members[i]->GetHPRatio() < 80) {
|
||||
else if(g->members[i]->GetClass() == ENCHANTER && g->members[i]->GetHPRatio() < 80) {
|
||||
if(caster->AICastSpell(g->members[i], 100, SpellType_Heal))
|
||||
return true;
|
||||
}
|
||||
@@ -16405,11 +16405,11 @@ bool EntityList::Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, fl
|
||||
if(caster->AICastSpell(g->members[i], 100, SpellType_Heal))
|
||||
return true;
|
||||
}
|
||||
else if((g->members[i]->GetClass() == WARRIOR || g->members[i]->GetClass() == PALADIN || g->members[i]->GetClass() == SHADOWKNIGHT) && g->members[i]->GetHPRatio() < hpRatioToHeal) {
|
||||
else if((g->members[i]->GetClass() == WARRIOR || g->members[i]->GetClass() == PALADIN || g->members[i]->GetClass() == SHADOWKNIGHT) && g->members[i]->GetHPRatio() < hpRatioToHeal) {
|
||||
if(caster->AICastSpell(g->members[i], 100, SpellType_Heal))
|
||||
return true;
|
||||
}
|
||||
else if(g->members[i]->GetClass() == ENCHANTER && g->members[i]->GetHPRatio() < hpRatioToHeal) {
|
||||
else if(g->members[i]->GetClass() == ENCHANTER && g->members[i]->GetHPRatio() < hpRatioToHeal) {
|
||||
if(caster->AICastSpell(g->members[i], 100, SpellType_Heal))
|
||||
return true;
|
||||
}
|
||||
@@ -16569,7 +16569,7 @@ void EntityList::AddBot(Bot *newBot, bool SendSpawnPacket, bool dontqueue) {
|
||||
safe_delete(ns);
|
||||
}
|
||||
|
||||
parse->EventNPC(EVENT_SPAWN, newBot, nullptr, "", 0);
|
||||
parse->EventNPC(EVENT_SPAWN, newBot, nullptr, "", 0);
|
||||
}
|
||||
|
||||
bot_list.push_back(newBot);
|
||||
@@ -16679,7 +16679,7 @@ void EntityList::ShowSpawnWindow(Client* client, int Distance, bool NamedOnly) {
|
||||
{
|
||||
if(iterator.GetData()->IsTrackable()) {
|
||||
Mob* cur_entity = iterator.GetData();
|
||||
int Extras = (cur_entity->IsBot() || cur_entity->IsPet() || cur_entity->IsFamiliar() || cur_entity->IsClient());
|
||||
int Extras = (cur_entity->IsBot() || cur_entity->IsPet() || cur_entity->IsFamiliar() || cur_entity->IsClient());
|
||||
const char *const MyArray[] = {
|
||||
"a_","an_","Innkeep_","Barkeep_",
|
||||
"Guard_","Merchant_","Lieutenant_",
|
||||
@@ -16712,20 +16712,20 @@ void EntityList::ShowSpawnWindow(Client* client, int Distance, bool NamedOnly) {
|
||||
"stone_","lava_","_",""
|
||||
};
|
||||
unsigned int MyArraySize;
|
||||
for ( MyArraySize = 0; true; MyArraySize++) { //Find empty string & get size
|
||||
if (!(*(MyArray[MyArraySize]))) break; //Checks for null char in 1st pos
|
||||
for ( MyArraySize = 0; true; MyArraySize++) { //Find empty string & get size
|
||||
if (!(*(MyArray[MyArraySize]))) break; //Checks for null char in 1st pos
|
||||
};
|
||||
if (NamedOnly) {
|
||||
bool ContinueFlag = false;
|
||||
const char *CurEntityName = cur_entity->GetName(); //Call function once
|
||||
for (int Index = 0; Index < MyArraySize; Index++) {
|
||||
if (!strncasecmp(CurEntityName, MyArray[Index], strlen(MyArray[Index])) || (Extras)) {
|
||||
iterator.Advance();
|
||||
ContinueFlag = true;
|
||||
break; //From Index for
|
||||
};
|
||||
};
|
||||
if (ContinueFlag) continue; //Moved here or would apply to Index for
|
||||
bool ContinueFlag = false;
|
||||
const char *CurEntityName = cur_entity->GetName(); //Call function once
|
||||
for (int Index = 0; Index < MyArraySize; Index++) {
|
||||
if (!strncasecmp(CurEntityName, MyArray[Index], strlen(MyArray[Index])) || (Extras)) {
|
||||
iterator.Advance();
|
||||
ContinueFlag = true;
|
||||
break; //From Index for
|
||||
};
|
||||
};
|
||||
if (ContinueFlag) continue; //Moved here or would apply to Index for
|
||||
};
|
||||
|
||||
CurrentCon = client->GetLevelCon(cur_entity->GetLevel());
|
||||
@@ -17018,12 +17018,12 @@ bool Bot::HasOrMayGetAggro() {
|
||||
Mob *topHate = GetTarget()->GetHateTop();
|
||||
|
||||
if(topHate == this)
|
||||
mayGetAggro = true; //I currently have aggro
|
||||
mayGetAggro = true; //I currently have aggro
|
||||
else {
|
||||
uint32 myHateAmt = GetTarget()->GetHateAmount(this);
|
||||
uint32 topHateAmt = GetTarget()->GetHateAmount(topHate);
|
||||
|
||||
if(myHateAmt > 0 && topHateAmt > 0 && (uint8)((myHateAmt/topHateAmt)*100) > 90) //I have 90% as much hate as top, next action may give me aggro
|
||||
if(myHateAmt > 0 && topHateAmt > 0 && (uint8)((myHateAmt/topHateAmt)*100) > 90) //I have 90% as much hate as top, next action may give me aggro
|
||||
mayGetAggro = true;
|
||||
}
|
||||
}
|
||||
@@ -17112,7 +17112,7 @@ bool Bot::UseDiscipline(uint32 spell_id, uint32 target) {
|
||||
|
||||
//make sure we can use it..
|
||||
if(!IsValidSpell(spell_id)) {
|
||||
Say("Not a valid spell");
|
||||
Say("Not a valid spell");
|
||||
return(false);
|
||||
}
|
||||
|
||||
@@ -17181,7 +17181,7 @@ bool Bot::AddHealRotationMember( Bot* healer ) {
|
||||
for(int i=0; i<3; i++){
|
||||
healer->ClearHealRotationMembers();
|
||||
healer->ClearHealRotationTargets();
|
||||
healer->AddHealRotationTarget(entity_list.GetMob(_healRotationTargets[i])); // add all targets..
|
||||
healer->AddHealRotationTarget(entity_list.GetMob(_healRotationTargets[i])); // add all targets..
|
||||
}
|
||||
healer->SetHealRotationTimer(tempBot->GetHealRotationTimer());
|
||||
healer->SetHealRotationLeader(this);
|
||||
@@ -17215,10 +17215,10 @@ bool Bot::AddHealRotationMember( Bot* healer ) {
|
||||
}
|
||||
|
||||
bool Bot::RemoveHealRotationMember( Bot* healer ) {
|
||||
if(healer && GetNumHealRotationMembers() > 0) {
|
||||
if(healer && GetNumHealRotationMembers() > 0) {
|
||||
Bot* leader = healer->GetHealRotationLeader();
|
||||
Bot* prevBot = healer->GetPrevHealRotationMember();
|
||||
Bot* nextBot = healer->GetNextHealRotationMember();
|
||||
Bot* prevBot = healer->GetPrevHealRotationMember();
|
||||
Bot* nextBot = healer->GetNextHealRotationMember();
|
||||
|
||||
if(healer == this) {
|
||||
if(nextBot != this) {
|
||||
@@ -17228,21 +17228,21 @@ bool Bot::RemoveHealRotationMember( Bot* healer ) {
|
||||
}
|
||||
|
||||
//remove healer from list
|
||||
healer->SetHealRotationTimer(0);
|
||||
healer->ClearHealRotationMembers();
|
||||
healer->SetHealRotationTimer(0);
|
||||
healer->ClearHealRotationMembers();
|
||||
healer->ClearHealRotationTargets();
|
||||
healer->ClearHealRotationLeader();
|
||||
healer->SetHasHealedThisCycle(false);
|
||||
healer->SetHealRotationActive(false);
|
||||
healer->SetInHealRotation(false);
|
||||
healer->SetInHealRotation(false);
|
||||
|
||||
if(prevBot && nextBot && GetNumHealRotationMembers() > 1) {
|
||||
//set previous rotation member's next member to new member
|
||||
prevBot->SetNextHealRotationMember(nextBot);
|
||||
if(prevBot && nextBot && GetNumHealRotationMembers() > 1) {
|
||||
//set previous rotation member's next member to new member
|
||||
prevBot->SetNextHealRotationMember(nextBot);
|
||||
|
||||
//set previous rotation member's next member to new member
|
||||
nextBot->SetPrevHealRotationMember(prevBot);
|
||||
}
|
||||
//set previous rotation member's next member to new member
|
||||
nextBot->SetPrevHealRotationMember(prevBot);
|
||||
}
|
||||
|
||||
//update rotation data
|
||||
list<Bot*> botList = GetBotsInHealRotation(leader);
|
||||
@@ -17351,7 +17351,7 @@ bool Bot::AddHealRotationTarget( Mob *target, int index ) {
|
||||
bool Bot::RemoveHealRotationTarget( Mob* target ) {
|
||||
int index = 0;
|
||||
bool removed = false;
|
||||
if(target) {
|
||||
if(target) {
|
||||
//notify all heal rotation members to remove target
|
||||
for(int i=0; i<MaxHealRotationTargets; i++){
|
||||
if(_healRotationTargets[i] == target->GetID()) {
|
||||
@@ -17392,17 +17392,17 @@ bool Bot::RemoveHealRotationTarget( int index ) {
|
||||
|
||||
void Bot::ClearHealRotationMembers() {
|
||||
_healRotationMemberPrev = 0; // No previous member
|
||||
_healRotationMemberNext = 0; // No next member
|
||||
_healRotationMemberNext = 0; // No next member
|
||||
}
|
||||
|
||||
void Bot::ClearHealRotationTargets() {
|
||||
for(int i=0; i<MaxHealRotationTargets; i++){
|
||||
_healRotationTargets[i] = 0;
|
||||
}
|
||||
for(int i=0; i<MaxHealRotationTargets; i++){
|
||||
_healRotationTargets[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Mob* Bot::GetHealRotationTarget( ) {
|
||||
Mob* tank = nullptr;
|
||||
Mob* tank = nullptr;
|
||||
Mob* first = nullptr;
|
||||
Mob* target = nullptr;
|
||||
int removeIndex = 0;
|
||||
@@ -17454,18 +17454,18 @@ Mob* Bot::GetHealRotationTarget( ) {
|
||||
if(tank)
|
||||
return tank;
|
||||
|
||||
return first;
|
||||
return first;
|
||||
}
|
||||
|
||||
Mob* Bot::GetHealRotationTarget( uint8 index ) {
|
||||
Mob* target = nullptr;
|
||||
Mob* target = nullptr;
|
||||
|
||||
if(_healRotationTargets[index] > 0) {
|
||||
//get target at specified index
|
||||
target = entity_list.GetMob(_healRotationTargets[index]);
|
||||
}
|
||||
|
||||
return target;
|
||||
return target;
|
||||
}
|
||||
|
||||
list<Bot*> Bot::GetBotsInHealRotation(Bot* rotationLeader) {
|
||||
|
||||
+31
-31
@@ -139,7 +139,7 @@ public:
|
||||
virtual void Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillType attack_skill);
|
||||
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false);
|
||||
virtual bool Attack(Mob* other, int Hand = 13, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false);
|
||||
virtual bool HasRaid() { return (GetRaid() ? true : false); }
|
||||
virtual bool HasRaid() { return (GetRaid() ? true : false); }
|
||||
virtual bool HasGroup() { return (GetGroup() ? true : false); }
|
||||
virtual Raid* GetRaid() { return entity_list.GetRaidByMob(this); }
|
||||
virtual Group* GetGroup() { return entity_list.GetGroupByMob(this); }
|
||||
@@ -166,7 +166,7 @@ public:
|
||||
void CalcBotStats(bool showtext = true);
|
||||
uint16 BotGetSpells(int spellslot) { return AIspells[spellslot].spellid; }
|
||||
uint16 BotGetSpellType(int spellslot) { return AIspells[spellslot].type; }
|
||||
uint16 BotGetSpellPriority(int spellslot) { return AIspells[spellslot].priority; }
|
||||
uint16 BotGetSpellPriority(int spellslot) { return AIspells[spellslot].priority; }
|
||||
virtual float GetProcChances(float &ProcBonus, float &ProcChance, uint16 weapon_speed, uint16 hand);
|
||||
virtual bool AvoidDamage(Mob* other, int32 &damage, bool CanRiposte);
|
||||
virtual int GetMonkHandToHandDamage(void);
|
||||
@@ -240,45 +240,45 @@ public:
|
||||
void ClearHealRotationLeader() { _healRotationLeader = 0; }
|
||||
void ClearHealRotationMembers();
|
||||
void ClearHealRotationTargets();
|
||||
inline virtual int16 GetMaxStat();
|
||||
inline virtual int16 GetMaxResist();
|
||||
inline virtual int16 GetMaxSTR();
|
||||
inline virtual int16 GetMaxSTA();
|
||||
inline virtual int16 GetMaxDEX();
|
||||
inline virtual int16 GetMaxAGI();
|
||||
inline virtual int16 GetMaxINT();
|
||||
inline virtual int16 GetMaxWIS();
|
||||
inline virtual int16 GetMaxCHA();
|
||||
inline virtual int16 GetMaxMR();
|
||||
inline virtual int16 GetMaxPR();
|
||||
inline virtual int16 GetMaxDR();
|
||||
inline virtual int16 GetMaxCR();
|
||||
inline virtual int16 GetMaxFR();
|
||||
inline virtual int16 GetMaxCorrup();
|
||||
int16 CalcATK();
|
||||
int16 CalcSTR();
|
||||
int16 CalcSTA();
|
||||
int16 CalcDEX();
|
||||
int16 CalcAGI();
|
||||
int16 CalcINT();
|
||||
int16 CalcWIS();
|
||||
int16 CalcCHA();
|
||||
inline virtual int16 GetMaxStat();
|
||||
inline virtual int16 GetMaxResist();
|
||||
inline virtual int16 GetMaxSTR();
|
||||
inline virtual int16 GetMaxSTA();
|
||||
inline virtual int16 GetMaxDEX();
|
||||
inline virtual int16 GetMaxAGI();
|
||||
inline virtual int16 GetMaxINT();
|
||||
inline virtual int16 GetMaxWIS();
|
||||
inline virtual int16 GetMaxCHA();
|
||||
inline virtual int16 GetMaxMR();
|
||||
inline virtual int16 GetMaxPR();
|
||||
inline virtual int16 GetMaxDR();
|
||||
inline virtual int16 GetMaxCR();
|
||||
inline virtual int16 GetMaxFR();
|
||||
inline virtual int16 GetMaxCorrup();
|
||||
int16 CalcATK();
|
||||
int16 CalcSTR();
|
||||
int16 CalcSTA();
|
||||
int16 CalcDEX();
|
||||
int16 CalcAGI();
|
||||
int16 CalcINT();
|
||||
int16 CalcWIS();
|
||||
int16 CalcCHA();
|
||||
int16 CalcMR();
|
||||
int16 CalcFR();
|
||||
int16 CalcDR();
|
||||
int16 CalcPR();
|
||||
int16 CalcCR();
|
||||
int16 CalcCorrup();
|
||||
int32 CalcHPRegenCap();
|
||||
int32 CalcManaRegenCap();
|
||||
int32 CalcHPRegenCap();
|
||||
int32 CalcManaRegenCap();
|
||||
int32 LevelRegen();
|
||||
int32 CalcHPRegen();
|
||||
int32 CalcManaRegen();
|
||||
uint32 CalcCurrentWeight();
|
||||
int GroupLeadershipAAHealthEnhancement();
|
||||
int GroupLeadershipAAManaEnhancement();
|
||||
int GroupLeadershipAAHealthEnhancement();
|
||||
int GroupLeadershipAAManaEnhancement();
|
||||
int GroupLeadershipAAHealthRegeneration();
|
||||
int GroupLeadershipAAOffenseEnhancement();
|
||||
int GroupLeadershipAAOffenseEnhancement();
|
||||
void CalcRestState();
|
||||
int32 CalcMaxEndurance(); //This calculates the maximum endurance we can have
|
||||
int32 CalcBaseEndurance(); //Calculates Base End
|
||||
@@ -519,7 +519,7 @@ public:
|
||||
|
||||
inline virtual int16 GetDelayDeath() const { return aabonuses.DelayDeath + spellbonuses.DelayDeath + itembonuses.DelayDeath; }
|
||||
|
||||
inline InspectMessage_Struct& GetInspectMessage() { return _botInspectMessage; }
|
||||
inline InspectMessage_Struct& GetInspectMessage() { return _botInspectMessage; }
|
||||
inline const InspectMessage_Struct& GetInspectMessage() const { return _botInspectMessage; }
|
||||
|
||||
// "SET" Class Methods
|
||||
|
||||
+191
-191
@@ -17,7 +17,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(tar->GetAppearance() == eaDead) {
|
||||
if((tar->IsClient() && tar->CastToClient()->GetFeigned()) || tar->IsBot()) {
|
||||
// do nothing
|
||||
@@ -45,10 +45,10 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
if(!checked_los) {
|
||||
if(!CheckLosFN(tar))
|
||||
break; //cannot see target... we assume that no spell is going to work since we will only be casting detrimental spells in this call
|
||||
|
||||
|
||||
checked_los = true;
|
||||
}
|
||||
|
||||
|
||||
//TODO
|
||||
//Check if single target or AoE mez is best
|
||||
//if (TARGETS ON MT IS => 3 THEN botSpell = AoEMez)
|
||||
@@ -67,17 +67,17 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
|
||||
if(!(!addMob->IsImmuneToSpell(botSpell.SpellId, this) && addMob->CanBuffStack(botSpell.SpellId, botLevel, true) >= 0))
|
||||
break;
|
||||
|
||||
|
||||
castedSpell = AIDoSpellCast(botSpell.SpellIndex, addMob, botSpell.ManaCost);
|
||||
|
||||
if(castedSpell) {
|
||||
char* gmsg = 0;
|
||||
|
||||
|
||||
MakeAnyLenString(&gmsg, "Attempting to mez %s.", addMob->GetCleanName());
|
||||
|
||||
if(gmsg && GetGroupMessagesOn())
|
||||
BotGroupSay(this, gmsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -86,7 +86,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
uint8 hpr = (uint8)tar->GetHPRatio();
|
||||
bool hasAggro = false;
|
||||
bool isPrimaryHealer = false;
|
||||
|
||||
|
||||
if(HasGroup()) {
|
||||
isPrimaryHealer = IsGroupPrimaryHealer();
|
||||
}
|
||||
@@ -192,12 +192,12 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
hpRatioToCast = isPrimaryHealer?100.0f:0.0f;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
//If we're at specified mana % or below, don't heal as hybrid
|
||||
if(tar->GetHPRatio() <= hpRatioToCast)
|
||||
botSpell = GetBestBotSpellForRegularSingleTargetHeal(this);
|
||||
}
|
||||
|
||||
|
||||
if(botSpell.SpellId == 0)
|
||||
botSpell = GetBestBotSpellForRegularSingleTargetHeal(this);
|
||||
|
||||
@@ -230,7 +230,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
// TODO: Replace this code with logic that calculates the delay based on number of clerics in rotation
|
||||
// and ignores heals for anyone except the main tank
|
||||
if(!IsHealOverTimeSpell(botSpell.SpellId)) {
|
||||
if(IsCompleteHealSpell(botSpell.SpellId)) {
|
||||
if(IsCompleteHealSpell(botSpell.SpellId)) {
|
||||
// Complete Heal 4 second rotation
|
||||
tar->SetDontHealMeBefore(Timer::GetCurrentTime() + 4000);
|
||||
}
|
||||
@@ -274,7 +274,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
if(!checked_los) {
|
||||
if(!CheckLosFN(tar))
|
||||
break; //cannot see target... we assume that no spell is going to work since we will only be casting detrimental spells in this call
|
||||
|
||||
|
||||
checked_los = true;
|
||||
}
|
||||
|
||||
@@ -289,9 +289,9 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
break;
|
||||
|
||||
uint32 TempDontRootMeBefore = tar->DontRootMeBefore();
|
||||
|
||||
|
||||
castedSpell = AIDoSpellCast(botSpell.SpellIndex, tar, botSpell.ManaCost, &TempDontRootMeBefore);
|
||||
|
||||
|
||||
if(TempDontRootMeBefore != tar->DontRootMeBefore())
|
||||
tar->SetDontRootMeBefore(TempDontRootMeBefore);
|
||||
}
|
||||
@@ -321,7 +321,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
|
||||
// Validate target
|
||||
|
||||
if(!((spells[selectedBotSpell.SpellId].targettype == ST_Target || spells[selectedBotSpell.SpellId].targettype == ST_Pet || tar == this ||
|
||||
if(!((spells[selectedBotSpell.SpellId].targettype == ST_Target || spells[selectedBotSpell.SpellId].targettype == ST_Pet || tar == this ||
|
||||
spells[selectedBotSpell.SpellId].targettype == ST_Group || spells[selectedBotSpell.SpellId].targettype == ST_GroupTeleport ||
|
||||
(botClass == BARD && spells[selectedBotSpell.SpellId].targettype == ST_AEBard))
|
||||
&& !tar->IsImmuneToSpell(selectedBotSpell.SpellId, this)
|
||||
@@ -340,7 +340,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
case ARCHETYPE_CASTER:
|
||||
//TODO: probably more caster specific spell effects in here
|
||||
if(IsEffectInSpell(selectedBotSpell.SpellId, SE_AttackSpeed) || IsEffectInSpell(selectedBotSpell.SpellId, SE_ATK) ||
|
||||
IsEffectInSpell(selectedBotSpell.SpellId, SE_STR) || IsEffectInSpell(selectedBotSpell.SpellId, SE_ReverseDS))
|
||||
IsEffectInSpell(selectedBotSpell.SpellId, SE_STR) || IsEffectInSpell(selectedBotSpell.SpellId, SE_ReverseDS))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -362,7 +362,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
if(botClass == ENCHANTER && IsEffectInSpell(selectedBotSpell.SpellId, SE_Rune))
|
||||
{
|
||||
float manaRatioToCast = 75.0f;
|
||||
|
||||
|
||||
switch(this->GetBotStance())
|
||||
{
|
||||
case BotStanceEfficient:
|
||||
@@ -381,7 +381,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
manaRatioToCast = 75.0f;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
//If we're at specified mana % or below, don't rune as enchanter
|
||||
if(this->GetManaRatio() <= manaRatioToCast)
|
||||
break;
|
||||
@@ -407,13 +407,13 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
case SpellType_Escape: {
|
||||
uint8 hpr = (uint8)GetHPRatio();
|
||||
bool mayGetAggro = false;
|
||||
|
||||
#ifdef IPC
|
||||
|
||||
#ifdef IPC
|
||||
if (hpr <= 5 || (IsNPC() && CastToNPC()->IsInteractive() && tar != this) )
|
||||
#else
|
||||
if(hpr > 15 && ((botClass == WIZARD) || (botClass == ENCHANTER) || (botClass == RANGER)))
|
||||
mayGetAggro = HasOrMayGetAggro(); //classes have hate reducing spells
|
||||
|
||||
mayGetAggro = HasOrMayGetAggro(); //classes have hate reducing spells
|
||||
|
||||
if (hpr <= 15 || mayGetAggro)
|
||||
#endif
|
||||
{
|
||||
@@ -421,10 +421,10 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
|
||||
if(botSpell.SpellId == 0)
|
||||
break;
|
||||
|
||||
|
||||
if(IsInvulnerabilitySpell(botSpell.SpellId))
|
||||
tar = this; //target self for invul type spells
|
||||
|
||||
tar = this; //target self for invul type spells
|
||||
|
||||
castedSpell = AIDoSpellCast(botSpell.SpellIndex, tar, botSpell.ManaCost);
|
||||
}
|
||||
break;
|
||||
@@ -435,14 +435,14 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
if(!checked_los) {
|
||||
if(!CheckLosFN(tar))
|
||||
break; //cannot see target... we assume that no spell is going to work since we will only be casting detrimental spells in this call
|
||||
|
||||
|
||||
checked_los = true;
|
||||
}
|
||||
|
||||
if(botClass == CLERIC || botClass == ENCHANTER)
|
||||
{
|
||||
float manaRatioToCast = 75.0f;
|
||||
|
||||
|
||||
switch(this->GetBotStance())
|
||||
{
|
||||
case BotStanceEfficient:
|
||||
@@ -463,7 +463,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
manaRatioToCast = 50.0f;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
//If we're at specified mana % or below, don't nuke as cleric or enchanter
|
||||
if(this->GetManaRatio() <= manaRatioToCast)
|
||||
break;
|
||||
@@ -479,7 +479,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
if(botClass == PALADIN || botClass == DRUID || botClass == CLERIC || botClass == ENCHANTER || botClass == WIZARD) {
|
||||
if(botSpell.SpellId == 0) {
|
||||
uint8 stunChance = (tar->IsCasting() ? 30: 15);
|
||||
|
||||
|
||||
if(botClass == PALADIN)
|
||||
stunChance = 50;
|
||||
|
||||
@@ -501,8 +501,8 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
|
||||
if(!(!tar->IsImmuneToSpell(botSpell.SpellId, this) && (tar->CanBuffStack(botSpell.SpellId, botLevel, true) >= 0)))
|
||||
break;
|
||||
|
||||
if(IsFearSpell(botSpell.SpellId)) {
|
||||
|
||||
if(IsFearSpell(botSpell.SpellId)) {
|
||||
// don't let fear cast if the npc isn't snared or rooted
|
||||
if(tar->GetSnaredAmount() == -1) {
|
||||
if(!tar->IsRooted())
|
||||
@@ -519,10 +519,10 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
if(!checked_los) {
|
||||
if(!CheckLosFN(tar))
|
||||
break; //cannot see target... we assume that no spell is going to work since we will only be casting detrimental spells in this call
|
||||
|
||||
|
||||
checked_los = true;
|
||||
}
|
||||
|
||||
|
||||
botSpell = GetFirstBotSpellBySpellType(this, iSpellTypes);
|
||||
|
||||
if(botSpell.SpellId == 0)
|
||||
@@ -546,13 +546,13 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
|
||||
if(botSpell.SpellId == 0)
|
||||
break;
|
||||
|
||||
|
||||
castedSpell = AIDoSpellCast(botSpell.SpellIndex, tar, botSpell.ManaCost);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SpellType_InCombatBuff: {
|
||||
|
||||
|
||||
if(botClass == SHAMAN) {
|
||||
checked_los = true;
|
||||
|
||||
@@ -572,7 +572,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
//short duration buffs or other buffs only to be cast during combat.
|
||||
if (IsSelfConversionSpell(selectedBotSpell.SpellId)) {
|
||||
if(GetManaRatio() > 90.0f || GetHPRatio() < 50.0f || GetHPRatio() < (GetManaRatio() + 10.0f))
|
||||
break; //don't cast if low hp, lots of mana, or if mana is higher than hps
|
||||
break; //don't cast if low hp, lots of mana, or if mana is higher than hps
|
||||
}
|
||||
|
||||
castedSpell = AIDoSpellCast(selectedBotSpell.SpellIndex, tar, selectedBotSpell.ManaCost);
|
||||
@@ -589,7 +589,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
if(!checked_los) {
|
||||
if(!CheckLosFN(tar))
|
||||
break; //cannot see target... we assume that no spell is going to work since we will only be casting detrimental spells in this call
|
||||
|
||||
|
||||
checked_los = true;
|
||||
}
|
||||
|
||||
@@ -610,7 +610,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
if(!checked_los) {
|
||||
if(!CheckLosFN(tar))
|
||||
break; //cannot see target... we assume that no spell is going to work since we will only be casting detrimental spells in this call
|
||||
|
||||
|
||||
checked_los = true;
|
||||
}
|
||||
|
||||
@@ -623,9 +623,9 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
break;
|
||||
|
||||
uint32 TempDontSnareMeBefore = tar->DontSnareMeBefore();
|
||||
|
||||
|
||||
castedSpell = AIDoSpellCast(botSpell.SpellIndex, tar, botSpell.ManaCost, &TempDontSnareMeBefore);
|
||||
|
||||
|
||||
if(TempDontSnareMeBefore != tar->DontSnareMeBefore())
|
||||
tar->SetDontSnareMeBefore(TempDontSnareMeBefore);
|
||||
}
|
||||
@@ -679,19 +679,19 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
if(!checked_los) {
|
||||
if(!CheckLosFN(tar))
|
||||
break; //cannot see target... we assume that no spell is going to work since we will only be casting detrimental spells in this call
|
||||
|
||||
|
||||
checked_los = true;
|
||||
}
|
||||
|
||||
|
||||
switch (botClass) {
|
||||
case ENCHANTER: {
|
||||
botSpell = GetBestBotSpellForMagicBasedSlow(this);
|
||||
break;
|
||||
}
|
||||
case SHAMAN:
|
||||
case SHAMAN:
|
||||
case BEASTLORD: {
|
||||
botSpell = GetBestBotSpellForDiseaseBasedSlow(this);
|
||||
|
||||
|
||||
if(botSpell.SpellId == 0 || ((tar->GetMR() - 50) < (tar->GetDR() + spells[botSpell.SpellId].ResistDiff)))
|
||||
botSpell = GetBestBotSpellForMagicBasedSlow(this);
|
||||
break;
|
||||
@@ -703,12 +703,12 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
|
||||
if(!(!tar->IsImmuneToSpell(botSpell.SpellId, this) && tar->CanBuffStack(botSpell.SpellId, botLevel, true) >= 0))
|
||||
break;
|
||||
|
||||
|
||||
castedSpell = AIDoSpellCast(botSpell.SpellIndex, tar, botSpell.ManaCost);
|
||||
|
||||
if(castedSpell) {
|
||||
char* gmsg = 0;
|
||||
|
||||
|
||||
MakeAnyLenString(&gmsg, "Attempting to slow %s.", tar->GetCleanName());
|
||||
|
||||
if(gmsg && GetGroupMessagesOn())
|
||||
@@ -723,10 +723,10 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
if(!checked_los) {
|
||||
if(!CheckLosFN(tar))
|
||||
break; //cannot see target... we assume that no spell is going to work since we will only be casting detrimental spells in this call
|
||||
|
||||
|
||||
checked_los = true;
|
||||
}
|
||||
|
||||
|
||||
botSpell = GetBestBotSpellForResistDebuff(this, tar);
|
||||
|
||||
if(botSpell.SpellId == 0)
|
||||
@@ -749,7 +749,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
|
||||
if(botSpell.SpellId == 0)
|
||||
break;
|
||||
|
||||
|
||||
uint32 TempDontCureMeBeforeTime = tar->DontCureMeBefore();
|
||||
|
||||
castedSpell = AIDoSpellCast(botSpell.SpellIndex, tar, botSpell.ManaCost, &TempDontCureMeBeforeTime);
|
||||
@@ -758,7 +758,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
||||
if(botClass != BARD) {
|
||||
if(IsGroupSpell(botSpell.SpellId)){
|
||||
Group *g;
|
||||
|
||||
|
||||
if(this->HasGroup()) {
|
||||
Group *g = this->GetGroup();
|
||||
|
||||
@@ -814,8 +814,8 @@ bool Bot::AIDoSpellCast(uint8 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgain
|
||||
float dist2 = 0;
|
||||
|
||||
if (AIspells[i].type & SpellType_Escape) {
|
||||
dist2 = 0;
|
||||
} else
|
||||
dist2 = 0;
|
||||
} else
|
||||
dist2 = DistNoRoot(*tar);
|
||||
|
||||
if (((((spells[AIspells[i].spellid].targettype==ST_GroupTeleport && AIspells[i].type==2)
|
||||
@@ -836,7 +836,7 @@ bool Bot::AIDoSpellCast(uint8 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgain
|
||||
SetMana(hasMana);
|
||||
extraMana = false;
|
||||
}
|
||||
else { //handle spell recast and recast timers
|
||||
else { //handle spell recast and recast timers
|
||||
if(GetClass() == BARD && IsGroupSpell(AIspells[i].spellid)) {
|
||||
AIspells[i].time_cancast = (spells[AIspells[i].spellid].recast_time > (spells[AIspells[i].spellid].buffduration * 6000)) ? Timer::GetCurrentTime() + spells[AIspells[i].spellid].recast_time : Timer::GetCurrentTime() + spells[AIspells[i].spellid].buffduration * 6000;
|
||||
//spellend_timer.Start(spells[AIspells[i].spellid].cast_time);
|
||||
@@ -853,14 +853,14 @@ bool Bot::AIDoSpellCast(uint8 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgain
|
||||
|
||||
bool Bot::AI_PursueCastCheck() {
|
||||
bool result = false;
|
||||
|
||||
|
||||
if (AIautocastspell_timer->Check(false)) {
|
||||
_ZP(Bot_AI_Process_pursue_cast);
|
||||
|
||||
|
||||
AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting.
|
||||
|
||||
|
||||
mlog(AI__SPELLS, "Bot Engaged (pursuing) autocast check triggered. Trying to cast offensive spells.");
|
||||
|
||||
|
||||
if(!AICastSpell(GetTarget(), 100, SpellType_Snare)) {
|
||||
if(!AICastSpell(GetTarget(), 100, SpellType_Lifetap)) {
|
||||
if(!AICastSpell(GetTarget(), 100, SpellType_Nuke)) {
|
||||
@@ -873,12 +873,12 @@ bool Bot::AI_PursueCastCheck() {
|
||||
}
|
||||
|
||||
result = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(!AIautocastspell_timer->Enabled())
|
||||
AIautocastspell_timer->Start(RandomTimer(100, 250), false);
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -892,10 +892,10 @@ bool Bot::AI_IdleCastCheck() {
|
||||
#endif
|
||||
AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting.
|
||||
|
||||
//Ok, IdleCastCheck depends of class.
|
||||
//Ok, IdleCastCheck depends of class.
|
||||
// Healers WITHOUT pets will check if a heal is needed before buffing.
|
||||
uint8 botClass = GetClass();
|
||||
|
||||
|
||||
if(botClass == CLERIC || botClass == PALADIN || botClass == RANGER) {
|
||||
if(!entity_list.Bot_AICheckCloseBeneficialSpells(this, 100, BotAISpellRange, SpellType_Cure)) {
|
||||
if (!AICastSpell(this, 100, SpellType_Heal)) {
|
||||
@@ -912,7 +912,7 @@ bool Bot::AI_IdleCastCheck() {
|
||||
result = true;
|
||||
}
|
||||
// Pets class will first cast their pet, then buffs
|
||||
else if(botClass == DRUID || botClass == MAGICIAN || botClass == SHADOWKNIGHT || botClass == SHAMAN || botClass == NECROMANCER || botClass == ENCHANTER || botClass == BEASTLORD || botClass == WIZARD) {
|
||||
else if(botClass == DRUID || botClass == MAGICIAN || botClass == SHADOWKNIGHT || botClass == SHAMAN || botClass == NECROMANCER || botClass == ENCHANTER || botClass == BEASTLORD || botClass == WIZARD) {
|
||||
if(!entity_list.Bot_AICheckCloseBeneficialSpells(this, 100, BotAISpellRange, SpellType_Cure)) {
|
||||
if (!AICastSpell(this, 100, SpellType_Pet)) {
|
||||
if (!AICastSpell(this, 100, SpellType_Heal)) {
|
||||
@@ -930,24 +930,24 @@ bool Bot::AI_IdleCastCheck() {
|
||||
}
|
||||
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
else if(botClass == BARD) {
|
||||
// bard bots
|
||||
if(!AICastSpell(this, 100, SpellType_Cure)) {
|
||||
if(!AICastSpell(this, 100, SpellType_Heal)) {
|
||||
if(!AICastSpell(this, 100, SpellType_Buff)) {
|
||||
//
|
||||
//
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
result = true;
|
||||
}
|
||||
|
||||
if(!AIautocastspell_timer->Enabled())
|
||||
AIautocastspell_timer->Start(RandomTimer(1000, 5000), false);
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1148,7 +1148,7 @@ bool Bot::AI_EngagedCastCheck() {
|
||||
failedToCast = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1172,7 +1172,7 @@ bool Bot::AIHealRotation(Mob* tar, bool useFastHeals) {
|
||||
|
||||
if(!AI_HasSpells())
|
||||
return false;
|
||||
|
||||
|
||||
if(tar->GetAppearance() == eaDead) {
|
||||
if((tar->IsClient() && tar->CastToClient()->GetFeigned()) || tar->IsBot()) {
|
||||
// do nothing
|
||||
@@ -1321,7 +1321,7 @@ std::list<BotSpell> Bot::GetBotSpellsBySpellType(Bot* botCaster, uint16 spellTyp
|
||||
|
||||
BotSpell Bot::GetFirstBotSpellBySpellType(Bot* botCaster, uint16 spellType) {
|
||||
BotSpell result;
|
||||
|
||||
|
||||
result.SpellId = 0;
|
||||
result.SpellIndex = 0;
|
||||
result.ManaCost = 0;
|
||||
@@ -1340,7 +1340,7 @@ BotSpell Bot::GetFirstBotSpellBySpellType(Bot* botCaster, uint16 spellType) {
|
||||
result.SpellId = botSpellList[i].spellid;
|
||||
result.SpellIndex = i;
|
||||
result.ManaCost = botSpellList[i].manacost;
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1351,7 +1351,7 @@ BotSpell Bot::GetFirstBotSpellBySpellType(Bot* botCaster, uint16 spellType) {
|
||||
|
||||
BotSpell Bot::GetBestBotSpellForFastHeal(Bot *botCaster) {
|
||||
BotSpell result;
|
||||
|
||||
|
||||
result.SpellId = 0;
|
||||
result.SpellIndex = 0;
|
||||
result.ManaCost = 0;
|
||||
@@ -1376,7 +1376,7 @@ BotSpell Bot::GetBestBotSpellForFastHeal(Bot *botCaster) {
|
||||
|
||||
BotSpell Bot::GetBestBotSpellForHealOverTime(Bot* botCaster) {
|
||||
BotSpell result;
|
||||
|
||||
|
||||
result.SpellId = 0;
|
||||
result.SpellIndex = 0;
|
||||
result.ManaCost = 0;
|
||||
@@ -1413,7 +1413,7 @@ BotSpell Bot::GetBestBotSpellForHealOverTime(Bot* botCaster) {
|
||||
|
||||
BotSpell Bot::GetBestBotSpellForPercentageHeal(Bot *botCaster) {
|
||||
BotSpell result;
|
||||
|
||||
|
||||
result.SpellId = 0;
|
||||
result.SpellIndex = 0;
|
||||
result.ManaCost = 0;
|
||||
@@ -1432,7 +1432,7 @@ BotSpell Bot::GetBestBotSpellForPercentageHeal(Bot *botCaster) {
|
||||
result.SpellId = botSpellList[i].spellid;
|
||||
result.SpellIndex = i;
|
||||
result.ManaCost = botSpellList[i].manacost;
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1443,7 +1443,7 @@ BotSpell Bot::GetBestBotSpellForPercentageHeal(Bot *botCaster) {
|
||||
|
||||
BotSpell Bot::GetBestBotSpellForRegularSingleTargetHeal(Bot* botCaster) {
|
||||
BotSpell result;
|
||||
|
||||
|
||||
result.SpellId = 0;
|
||||
result.SpellIndex = 0;
|
||||
result.ManaCost = 0;
|
||||
@@ -1468,7 +1468,7 @@ BotSpell Bot::GetBestBotSpellForRegularSingleTargetHeal(Bot* botCaster) {
|
||||
|
||||
BotSpell Bot::GetFirstBotSpellForSingleTargetHeal(Bot* botCaster) {
|
||||
BotSpell result;
|
||||
|
||||
|
||||
result.SpellId = 0;
|
||||
result.SpellIndex = 0;
|
||||
result.ManaCost = 0;
|
||||
@@ -1492,95 +1492,95 @@ BotSpell Bot::GetFirstBotSpellForSingleTargetHeal(Bot* botCaster) {
|
||||
}
|
||||
|
||||
BotSpell Bot::GetBestBotSpellForGroupHeal(Bot* botCaster) {
|
||||
BotSpell result;
|
||||
|
||||
result.SpellId = 0;
|
||||
result.SpellIndex = 0;
|
||||
result.ManaCost = 0;
|
||||
BotSpell result;
|
||||
|
||||
if(botCaster) {
|
||||
std::list<BotSpell> botSpellList = GetBotSpellsForSpellEffect(botCaster, SE_CurrentHP);
|
||||
result.SpellId = 0;
|
||||
result.SpellIndex = 0;
|
||||
result.ManaCost = 0;
|
||||
|
||||
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); botSpellListItr++) {
|
||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||
if(IsRegularGroupHealSpell(botSpellListItr->SpellId) && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) {
|
||||
result.SpellId = botSpellListItr->SpellId;
|
||||
result.SpellIndex = botSpellListItr->SpellIndex;
|
||||
result.ManaCost = botSpellListItr->ManaCost;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(botCaster) {
|
||||
std::list<BotSpell> botSpellList = GetBotSpellsForSpellEffect(botCaster, SE_CurrentHP);
|
||||
|
||||
return result;
|
||||
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); botSpellListItr++) {
|
||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||
if(IsRegularGroupHealSpell(botSpellListItr->SpellId) && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) {
|
||||
result.SpellId = botSpellListItr->SpellId;
|
||||
result.SpellIndex = botSpellListItr->SpellIndex;
|
||||
result.ManaCost = botSpellListItr->ManaCost;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
BotSpell Bot::GetBestBotSpellForGroupHealOverTime(Bot* botCaster) {
|
||||
BotSpell result;
|
||||
|
||||
result.SpellId = 0;
|
||||
result.SpellIndex = 0;
|
||||
result.ManaCost = 0;
|
||||
BotSpell result;
|
||||
|
||||
if(botCaster) {
|
||||
std::list<BotSpell> botHoTSpellList = GetBotSpellsForSpellEffect(botCaster, SE_HealOverTime);
|
||||
std::vector<AISpells_Struct> botSpellList = botCaster->GetBotSpells();
|
||||
result.SpellId = 0;
|
||||
result.SpellIndex = 0;
|
||||
result.ManaCost = 0;
|
||||
|
||||
for(std::list<BotSpell>::iterator botSpellListItr = botHoTSpellList.begin(); botSpellListItr != botHoTSpellList.end(); botSpellListItr++) {
|
||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||
if(IsGroupHealOverTimeSpell(botSpellListItr->SpellId)) {
|
||||
if(botCaster) {
|
||||
std::list<BotSpell> botHoTSpellList = GetBotSpellsForSpellEffect(botCaster, SE_HealOverTime);
|
||||
std::vector<AISpells_Struct> botSpellList = botCaster->GetBotSpells();
|
||||
|
||||
for (int i = botSpellList.size() - 1; i >= 0; i--) {
|
||||
if (botSpellList[i].spellid <= 0 || botSpellList[i].spellid >= SPDAT_RECORDS) {
|
||||
// this is both to quit early to save cpu and to avoid casting bad spells
|
||||
// Bad info from database can trigger this incorrectly, but that should be fixed in DB, not here
|
||||
continue;
|
||||
}
|
||||
for(std::list<BotSpell>::iterator botSpellListItr = botHoTSpellList.begin(); botSpellListItr != botHoTSpellList.end(); botSpellListItr++) {
|
||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||
if(IsGroupHealOverTimeSpell(botSpellListItr->SpellId)) {
|
||||
|
||||
if(botSpellList[i].spellid == botSpellListItr->SpellId && (botSpellList[i].type & SpellType_Heal) && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) {
|
||||
result.SpellId = botSpellListItr->SpellId;
|
||||
result.SpellIndex = botSpellListItr->SpellIndex;
|
||||
result.ManaCost = botSpellListItr->ManaCost;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
for (int i = botSpellList.size() - 1; i >= 0; i--) {
|
||||
if (botSpellList[i].spellid <= 0 || botSpellList[i].spellid >= SPDAT_RECORDS) {
|
||||
// this is both to quit early to save cpu and to avoid casting bad spells
|
||||
// Bad info from database can trigger this incorrectly, but that should be fixed in DB, not here
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
BotSpell Bot::GetBestBotSpellForGroupCompleteHeal(Bot* botCaster) {
|
||||
BotSpell result;
|
||||
|
||||
result.SpellId = 0;
|
||||
result.SpellIndex = 0;
|
||||
result.ManaCost = 0;
|
||||
|
||||
if(botCaster) {
|
||||
std::list<BotSpell> botSpellList = GetBotSpellsForSpellEffect(botCaster, SE_CompleteHeal);
|
||||
|
||||
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); botSpellListItr++) {
|
||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||
if(IsGroupCompleteHealSpell(botSpellListItr->SpellId) && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) {
|
||||
if(botSpellList[i].spellid == botSpellListItr->SpellId && (botSpellList[i].type & SpellType_Heal) && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) {
|
||||
result.SpellId = botSpellListItr->SpellId;
|
||||
result.SpellIndex = botSpellListItr->SpellIndex;
|
||||
result.ManaCost = botSpellListItr->ManaCost;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
BotSpell Bot::GetBestBotSpellForGroupCompleteHeal(Bot* botCaster) {
|
||||
BotSpell result;
|
||||
|
||||
result.SpellId = 0;
|
||||
result.SpellIndex = 0;
|
||||
result.ManaCost = 0;
|
||||
|
||||
if(botCaster) {
|
||||
std::list<BotSpell> botSpellList = GetBotSpellsForSpellEffect(botCaster, SE_CompleteHeal);
|
||||
|
||||
for(std::list<BotSpell>::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); botSpellListItr++) {
|
||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||
if(IsGroupCompleteHealSpell(botSpellListItr->SpellId) && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) {
|
||||
result.SpellId = botSpellListItr->SpellId;
|
||||
result.SpellIndex = botSpellListItr->SpellIndex;
|
||||
result.ManaCost = botSpellListItr->ManaCost;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
BotSpell Bot::GetBestBotSpellForMez(Bot* botCaster) {
|
||||
BotSpell result;
|
||||
|
||||
|
||||
result.SpellId = 0;
|
||||
result.SpellIndex = 0;
|
||||
result.ManaCost = 0;
|
||||
@@ -1594,7 +1594,7 @@ BotSpell Bot::GetBestBotSpellForMez(Bot* botCaster) {
|
||||
result.SpellId = botSpellListItr->SpellId;
|
||||
result.SpellIndex = botSpellListItr->SpellIndex;
|
||||
result.ManaCost = botSpellListItr->ManaCost;
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1605,7 +1605,7 @@ BotSpell Bot::GetBestBotSpellForMez(Bot* botCaster) {
|
||||
|
||||
BotSpell Bot::GetBestBotSpellForMagicBasedSlow(Bot* botCaster) {
|
||||
BotSpell result;
|
||||
|
||||
|
||||
result.SpellId = 0;
|
||||
result.SpellIndex = 0;
|
||||
result.ManaCost = 0;
|
||||
@@ -1619,7 +1619,7 @@ BotSpell Bot::GetBestBotSpellForMagicBasedSlow(Bot* botCaster) {
|
||||
result.SpellId = botSpellListItr->SpellId;
|
||||
result.SpellIndex = botSpellListItr->SpellIndex;
|
||||
result.ManaCost = botSpellListItr->ManaCost;
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1630,7 +1630,7 @@ BotSpell Bot::GetBestBotSpellForMagicBasedSlow(Bot* botCaster) {
|
||||
|
||||
BotSpell Bot::GetBestBotSpellForDiseaseBasedSlow(Bot* botCaster) {
|
||||
BotSpell result;
|
||||
|
||||
|
||||
result.SpellId = 0;
|
||||
result.SpellIndex = 0;
|
||||
result.ManaCost = 0;
|
||||
@@ -1644,7 +1644,7 @@ BotSpell Bot::GetBestBotSpellForDiseaseBasedSlow(Bot* botCaster) {
|
||||
result.SpellId = botSpellListItr->SpellId;
|
||||
result.SpellIndex = botSpellListItr->SpellIndex;
|
||||
result.ManaCost = botSpellListItr->ManaCost;
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1660,7 +1660,7 @@ Mob* Bot::GetFirstIncomingMobToMez(Bot* botCaster, BotSpell botSpell) {
|
||||
|
||||
std::list<NPC*> npc_list;
|
||||
entity_list.GetNPCList(npc_list);
|
||||
|
||||
|
||||
for(std::list<NPC*>::iterator itr = npc_list.begin(); itr != npc_list.end(); itr++) {
|
||||
NPC* npc = *itr;
|
||||
|
||||
@@ -1691,7 +1691,7 @@ Mob* Bot::GetFirstIncomingMobToMez(Bot* botCaster, BotSpell botSpell) {
|
||||
|
||||
BotSpell Bot::GetBestBotMagicianPetSpell(Bot *botCaster) {
|
||||
BotSpell result;
|
||||
|
||||
|
||||
result.SpellId = 0;
|
||||
result.SpellIndex = 0;
|
||||
result.ManaCost = 0;
|
||||
@@ -1753,7 +1753,7 @@ std::string Bot::GetBotMagicianPetType(Bot* botCaster) {
|
||||
else if(botCaster->GetLevel() < 30) {
|
||||
// Under level 30
|
||||
int counter = MakeRandomInt(0, 3);
|
||||
|
||||
|
||||
switch(counter) {
|
||||
case 0:
|
||||
result = std::string("SumWater");
|
||||
@@ -1775,7 +1775,7 @@ std::string Bot::GetBotMagicianPetType(Bot* botCaster) {
|
||||
else {
|
||||
// Over level 30
|
||||
int counter = MakeRandomInt(0, 4);
|
||||
|
||||
|
||||
switch(counter) {
|
||||
case 0:
|
||||
result = std::string("SumWater");
|
||||
@@ -1802,7 +1802,7 @@ std::string Bot::GetBotMagicianPetType(Bot* botCaster) {
|
||||
|
||||
BotSpell Bot::GetBestBotSpellForNukeByTargetType(Bot* botCaster, SpellTargetType targetType) {
|
||||
BotSpell result;
|
||||
|
||||
|
||||
result.SpellId = 0;
|
||||
result.SpellIndex = 0;
|
||||
result.ManaCost = 0;
|
||||
@@ -1816,7 +1816,7 @@ BotSpell Bot::GetBestBotSpellForNukeByTargetType(Bot* botCaster, SpellTargetType
|
||||
result.SpellId = botSpellListItr->SpellId;
|
||||
result.SpellIndex = botSpellListItr->SpellIndex;
|
||||
result.ManaCost = botSpellListItr->ManaCost;
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1855,7 +1855,7 @@ BotSpell Bot::GetBestBotSpellForStunByTargetType(Bot* botCaster, SpellTargetType
|
||||
|
||||
BotSpell Bot::GetBestBotWizardNukeSpellByTargetResists(Bot* botCaster, Mob* target) {
|
||||
BotSpell result;
|
||||
|
||||
|
||||
result.SpellId = 0;
|
||||
result.SpellIndex = 0;
|
||||
result.ManaCost = 0;
|
||||
@@ -1867,7 +1867,7 @@ BotSpell Bot::GetBestBotWizardNukeSpellByTargetResists(Bot* botCaster, Mob* targ
|
||||
|
||||
if((target->GetMR() > maxTargetResistValue) && (target->GetCR() > maxTargetResistValue) && (target->GetFR() > maxTargetResistValue))
|
||||
selectLureNuke = true;
|
||||
|
||||
|
||||
|
||||
std::list<BotSpell> botSpellList = GetBotSpellsForSpellEffectAndTargetType(botCaster, SE_CurrentHP, ST_Target);
|
||||
|
||||
@@ -1885,18 +1885,18 @@ BotSpell Bot::GetBestBotWizardNukeSpellByTargetResists(Bot* botCaster, Mob* targ
|
||||
spellSelected = true;
|
||||
}
|
||||
else if(IsPureNukeSpell(botSpellListItr->SpellId)) {
|
||||
if(((target->GetMR() < target->GetCR()) || (target->GetMR() < target->GetFR())) && (GetSpellResistType(botSpellListItr->SpellId) == RESIST_MAGIC)
|
||||
if(((target->GetMR() < target->GetCR()) || (target->GetMR() < target->GetFR())) && (GetSpellResistType(botSpellListItr->SpellId) == RESIST_MAGIC)
|
||||
&& (spells[botSpellListItr->SpellId].ResistDiff > lureResisValue))
|
||||
{
|
||||
spellSelected = true;
|
||||
}
|
||||
else if(((target->GetCR() < target->GetMR()) || (target->GetCR() < target->GetFR())) && (GetSpellResistType(botSpellListItr->SpellId) == RESIST_COLD)
|
||||
&& (spells[botSpellListItr->SpellId].ResistDiff > lureResisValue))
|
||||
else if(((target->GetCR() < target->GetMR()) || (target->GetCR() < target->GetFR())) && (GetSpellResistType(botSpellListItr->SpellId) == RESIST_COLD)
|
||||
&& (spells[botSpellListItr->SpellId].ResistDiff > lureResisValue))
|
||||
{
|
||||
spellSelected = true;
|
||||
}
|
||||
else if(((target->GetFR() < target->GetCR()) || (target->GetFR() < target->GetMR())) && (GetSpellResistType(botSpellListItr->SpellId) == RESIST_FIRE)
|
||||
&& (spells[botSpellListItr->SpellId].ResistDiff > lureResisValue))
|
||||
&& (spells[botSpellListItr->SpellId].ResistDiff > lureResisValue))
|
||||
{
|
||||
spellSelected = true;
|
||||
}
|
||||
@@ -1927,7 +1927,7 @@ BotSpell Bot::GetBestBotWizardNukeSpellByTargetResists(Bot* botCaster, Mob* targ
|
||||
|
||||
BotSpell Bot::GetDebuffBotSpell(Bot* botCaster, Mob *tar) {
|
||||
BotSpell result;
|
||||
|
||||
|
||||
result.SpellId = 0;
|
||||
result.SpellIndex = 0;
|
||||
result.ManaCost = 0;
|
||||
@@ -1945,14 +1945,14 @@ BotSpell Bot::GetDebuffBotSpell(Bot* botCaster, Mob *tar) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if(((botSpellList[i].type & SpellType_Debuff) || IsDebuffSpell(botSpellList[i].spellid))
|
||||
&& (!tar->IsImmuneToSpell(botSpellList[i].spellid, botCaster)
|
||||
&& tar->CanBuffStack(botSpellList[i].spellid, botCaster->GetLevel(), true) >= 0)
|
||||
if(((botSpellList[i].type & SpellType_Debuff) || IsDebuffSpell(botSpellList[i].spellid))
|
||||
&& (!tar->IsImmuneToSpell(botSpellList[i].spellid, botCaster)
|
||||
&& tar->CanBuffStack(botSpellList[i].spellid, botCaster->GetLevel(), true) >= 0)
|
||||
&& CheckSpellRecastTimers(botCaster, i)) {
|
||||
result.SpellId = botSpellList[i].spellid;
|
||||
result.SpellIndex = i;
|
||||
result.ManaCost = botSpellList[i].manacost;
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1963,14 +1963,14 @@ BotSpell Bot::GetDebuffBotSpell(Bot* botCaster, Mob *tar) {
|
||||
|
||||
BotSpell Bot::GetBestBotSpellForResistDebuff(Bot* botCaster, Mob *tar) {
|
||||
BotSpell result;
|
||||
|
||||
|
||||
result.SpellId = 0;
|
||||
result.SpellIndex = 0;
|
||||
result.ManaCost = 0;
|
||||
|
||||
|
||||
if(!tar)
|
||||
return result;
|
||||
|
||||
|
||||
int level_mod = (tar->GetLevel() - botCaster->GetLevel())* (tar->GetLevel() - botCaster->GetLevel()) / 2;
|
||||
if(tar->GetLevel() - botCaster->GetLevel() < 0)
|
||||
{
|
||||
@@ -1981,7 +1981,7 @@ BotSpell Bot::GetBestBotSpellForResistDebuff(Bot* botCaster, Mob *tar) {
|
||||
bool needsFireResistDebuff = (tar->GetFR() + level_mod) > 100 ? true: false;
|
||||
bool needsPoisonResistDebuff = (tar->GetPR() + level_mod) > 100 ? true: false;
|
||||
bool needsDiseaseResistDebuff = (tar->GetDR() + level_mod) > 100 ? true: false;
|
||||
|
||||
|
||||
if(botCaster && botCaster->AI_HasSpells()) {
|
||||
std::vector<AISpells_Struct> botSpellList = botCaster->GetBotSpells();
|
||||
|
||||
@@ -1992,19 +1992,19 @@ BotSpell Bot::GetBestBotSpellForResistDebuff(Bot* botCaster, Mob *tar) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if(((botSpellList[i].type & SpellType_Debuff) || IsResistDebuffSpell(botSpellList[i].spellid))
|
||||
&& ((needsMagicResistDebuff && (IsEffectInSpell(botSpellList[i].spellid, SE_ResistMagic)) || IsEffectInSpell(botSpellList[i].spellid, SE_ResistAll))
|
||||
if(((botSpellList[i].type & SpellType_Debuff) || IsResistDebuffSpell(botSpellList[i].spellid))
|
||||
&& ((needsMagicResistDebuff && (IsEffectInSpell(botSpellList[i].spellid, SE_ResistMagic)) || IsEffectInSpell(botSpellList[i].spellid, SE_ResistAll))
|
||||
|| (needsColdResistDebuff && (IsEffectInSpell(botSpellList[i].spellid, SE_ResistCold)) || IsEffectInSpell(botSpellList[i].spellid, SE_ResistAll))
|
||||
|| (needsFireResistDebuff && (IsEffectInSpell(botSpellList[i].spellid, SE_ResistFire)) || IsEffectInSpell(botSpellList[i].spellid, SE_ResistAll))
|
||||
|| (needsPoisonResistDebuff && (IsEffectInSpell(botSpellList[i].spellid, SE_ResistPoison)) || IsEffectInSpell(botSpellList[i].spellid, SE_ResistAll))
|
||||
|| (needsDiseaseResistDebuff && (IsEffectInSpell(botSpellList[i].spellid, SE_ResistDisease)) || IsEffectInSpell(botSpellList[i].spellid, SE_ResistAll)))
|
||||
&& (!tar->IsImmuneToSpell(botSpellList[i].spellid, botCaster)
|
||||
&& tar->CanBuffStack(botSpellList[i].spellid, botCaster->GetLevel(), true) >= 0)
|
||||
&& (!tar->IsImmuneToSpell(botSpellList[i].spellid, botCaster)
|
||||
&& tar->CanBuffStack(botSpellList[i].spellid, botCaster->GetLevel(), true) >= 0)
|
||||
&& CheckSpellRecastTimers(botCaster, i)) {
|
||||
result.SpellId = botSpellList[i].spellid;
|
||||
result.SpellIndex = i;
|
||||
result.ManaCost = botSpellList[i].manacost;
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2016,14 +2016,14 @@ BotSpell Bot::GetBestBotSpellForResistDebuff(Bot* botCaster, Mob *tar) {
|
||||
BotSpell Bot::GetBestBotSpellForCure(Bot* botCaster, Mob *tar) {
|
||||
BotSpell result;
|
||||
bool spellSelected = false;
|
||||
|
||||
|
||||
result.SpellId = 0;
|
||||
result.SpellIndex = 0;
|
||||
result.ManaCost = 0;
|
||||
|
||||
|
||||
if(!tar)
|
||||
return result;
|
||||
|
||||
|
||||
int countNeedsCured = 0;
|
||||
bool isPoisoned = tar->FindType(SE_PoisonCounter);
|
||||
bool isDiseased = tar->FindType(SE_DiseaseCounter);
|
||||
@@ -2032,7 +2032,7 @@ BotSpell Bot::GetBestBotSpellForCure(Bot* botCaster, Mob *tar) {
|
||||
|
||||
if(botCaster && botCaster->AI_HasSpells()) {
|
||||
std::list<BotSpell> cureList = GetBotSpellsBySpellType(botCaster, SpellType_Cure);
|
||||
|
||||
|
||||
if(tar->HasGroup()) {
|
||||
Group *g = tar->GetGroup();
|
||||
|
||||
@@ -2045,12 +2045,12 @@ BotSpell Bot::GetBestBotSpellForCure(Bot* botCaster, Mob *tar) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Check for group cure first
|
||||
if(countNeedsCured > 2) {
|
||||
for(list<BotSpell>::iterator itr = cureList.begin(); itr != cureList.end(); itr++) {
|
||||
BotSpell selectedBotSpell = *itr;
|
||||
|
||||
|
||||
if(IsGroupSpell(itr->SpellId) && CheckSpellRecastTimers(botCaster, itr->SpellIndex)) {
|
||||
if(selectedBotSpell.SpellId == 0)
|
||||
continue;
|
||||
@@ -2087,7 +2087,7 @@ BotSpell Bot::GetBestBotSpellForCure(Bot* botCaster, Mob *tar) {
|
||||
if(!spellSelected) {
|
||||
for(list<BotSpell>::iterator itr = cureList.begin(); itr != cureList.end(); itr++) {
|
||||
BotSpell selectedBotSpell = *itr;
|
||||
|
||||
|
||||
if(CheckSpellRecastTimers(botCaster, itr->SpellIndex)) {
|
||||
if(selectedBotSpell.SpellId == 0)
|
||||
continue;
|
||||
@@ -2142,9 +2142,9 @@ int32 Bot::GetSpellRecastTimer(Bot *caster, int timer_index) {
|
||||
|
||||
bool Bot::CheckSpellRecastTimers(Bot *caster, int SpellIndex) {
|
||||
if(caster) {
|
||||
if(caster->AIspells[SpellIndex].time_cancast < Timer::GetCurrentTime()) { //checks spell recast
|
||||
if(GetSpellRecastTimer(caster, spells[caster->AIspells[SpellIndex].spellid].EndurTimerIndex) < Timer::GetCurrentTime()) { //checks for spells on the same timer
|
||||
return true; //can cast spell
|
||||
if(caster->AIspells[SpellIndex].time_cancast < Timer::GetCurrentTime()) { //checks spell recast
|
||||
if(GetSpellRecastTimer(caster, spells[caster->AIspells[SpellIndex].spellid].EndurTimerIndex) < Timer::GetCurrentTime()) { //checks for spells on the same timer
|
||||
return true; //can cast spell
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2180,8 +2180,8 @@ uint32 Bot::GetDisciplineRemainingTime(Bot *caster, int timer_index) {
|
||||
|
||||
bool Bot::CheckDisciplineRecastTimers(Bot *caster, int timer_index) {
|
||||
if(caster) {
|
||||
if(GetDisciplineRecastTimer(caster, timer_index) < Timer::GetCurrentTime()) { //checks for spells on the same timer
|
||||
return true; //can cast spell
|
||||
if(GetDisciplineRecastTimer(caster, timer_index) < Timer::GetCurrentTime()) { //checks for spells on the same timer
|
||||
return true; //can cast spell
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -2195,17 +2195,17 @@ void Bot::CalcChanceToCast() {
|
||||
_spellCastingChances[i][j] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BotStanceType botStance = GetBotStance();
|
||||
uint8 botClass = GetClass();
|
||||
bool isPrimaryHealer = false;
|
||||
bool isPrimarySlower = false;
|
||||
|
||||
|
||||
if(HasGroup()) {
|
||||
isPrimaryHealer = IsGroupPrimaryHealer();
|
||||
isPrimarySlower = IsGroupPrimarySlower();
|
||||
}
|
||||
|
||||
|
||||
//Nuke
|
||||
switch(botClass)
|
||||
{
|
||||
@@ -3187,7 +3187,7 @@ uint8 Bot::GetChanceToCastBySpellType(uint16 spellType) {
|
||||
|
||||
if(GetBotStance() >= MaxStances)
|
||||
return 0;
|
||||
|
||||
|
||||
switch (spellType) {
|
||||
case SpellType_Nuke: {
|
||||
index = SpellType_NukeIndex;
|
||||
@@ -3217,7 +3217,7 @@ uint8 Bot::GetChanceToCastBySpellType(uint16 spellType) {
|
||||
index = SpellType_LifetapIndex;
|
||||
break;
|
||||
}
|
||||
case SpellType_Snare: {
|
||||
case SpellType_Snare: {
|
||||
index = SpellType_SnareIndex;
|
||||
break;
|
||||
}
|
||||
@@ -3257,7 +3257,7 @@ uint8 Bot::GetChanceToCastBySpellType(uint16 spellType) {
|
||||
|
||||
if(index >= MaxSpellTypes)
|
||||
return 0;
|
||||
|
||||
|
||||
chance = _spellCastingChances[botStance][index];
|
||||
|
||||
return chance;
|
||||
|
||||
+564
-566
File diff suppressed because it is too large
Load Diff
+154
-186
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2003 EQEMu Development Team (http://eqemulator.org)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2003 EQEMu Development Team (http://eqemulator.org)
|
||||
|
||||
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 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
|
||||
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.
|
||||
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
|
||||
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 CLIENT_H
|
||||
#define CLIENT_H
|
||||
@@ -61,10 +61,10 @@ extern TaskManager *taskmanager;
|
||||
class CLIENTPACKET
|
||||
{
|
||||
public:
|
||||
CLIENTPACKET();
|
||||
~CLIENTPACKET();
|
||||
EQApplicationPacket *app;
|
||||
bool ack_req;
|
||||
CLIENTPACKET();
|
||||
~CLIENTPACKET();
|
||||
EQApplicationPacket *app;
|
||||
bool ack_req;
|
||||
};
|
||||
|
||||
enum { //Type arguments to the Message* routines.
|
||||
@@ -129,7 +129,7 @@ enum {
|
||||
HideCorpseNPC = 5
|
||||
};
|
||||
|
||||
typedef enum
|
||||
typedef enum
|
||||
{
|
||||
Empty = 0,
|
||||
Auto = 1,
|
||||
@@ -167,8 +167,8 @@ struct XTarget_Struct
|
||||
uint16 ID;
|
||||
char Name[65];
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
const uint32 POPUPID_UPDATE_SHOWSTATSWINDOW = 1000000;
|
||||
|
||||
struct ClientReward
|
||||
@@ -189,13 +189,13 @@ public:
|
||||
#include "client_packet.h"
|
||||
|
||||
Client(EQStreamInterface * ieqs);
|
||||
~Client();
|
||||
~Client();
|
||||
|
||||
//abstract virtual function implementations requird by base abstract class
|
||||
virtual void Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillType attack_skill);
|
||||
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false);
|
||||
virtual bool Attack(Mob* other, int Hand = 13, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false);
|
||||
virtual bool HasRaid() { return (GetRaid() ? true : false); }
|
||||
virtual bool HasRaid() { return (GetRaid() ? true : false); }
|
||||
virtual bool HasGroup() { return (GetGroup() ? true : false); }
|
||||
virtual Raid* GetRaid() { return entity_list.GetRaidByClient(this); }
|
||||
virtual Group* GetGroup() { return entity_list.GetGroupByClient(this); }
|
||||
@@ -207,14 +207,14 @@ public:
|
||||
void AI_Process();
|
||||
void AI_SpellCast();
|
||||
void Trader_ShowItems();
|
||||
void Trader_CustomerBrowsing(Client *Customer);
|
||||
void Trader_CustomerBrowsing(Client *Customer);
|
||||
void Trader_EndTrader();
|
||||
void Trader_StartTrader();
|
||||
uint8 WithCustomer(uint16 NewCustomer);
|
||||
void KeyRingLoad();
|
||||
void KeyRingAdd(uint32 item_id);
|
||||
bool KeyRingCheck(uint32 item_id);
|
||||
void KeyRingList();
|
||||
void KeyRingList();
|
||||
virtual bool IsClient() const { return true; }
|
||||
virtual void DBAWComplete(uint8 workpt_b1, DBAsyncWork* dbaw);
|
||||
bool FinishConnState2(DBAsyncWork* dbaw);
|
||||
@@ -233,13 +233,13 @@ public:
|
||||
uint16 FindTraderItem(int32 SerialNumber,uint16 Quantity);
|
||||
ItemInst* FindTraderItemBySerialNumber(int32 SerialNumber);
|
||||
void FindAndNukeTraderItem(int32 item_id,uint16 quantity,Client* customer,uint16 traderslot);
|
||||
void NukeTraderItem(uint16 slot,int16 charges,uint16 quantity,Client* customer,uint16 traderslot, int uniqueid);
|
||||
void NukeTraderItem(uint16 slot,int16 charges,uint16 quantity,Client* customer,uint16 traderslot, int uniqueid);
|
||||
void ReturnTraderReq(const EQApplicationPacket* app,int16 traderitemcharges);
|
||||
void TradeRequestFailed(const EQApplicationPacket* app);
|
||||
void BuyTraderItem(TraderBuy_Struct* tbs,Client* trader,const EQApplicationPacket* app);
|
||||
void TraderUpdate(uint16 slot_id,uint32 trader_id);
|
||||
void FinishTrade(Mob* with, ServerPacket* qspack = nullptr, bool finalizer = false);
|
||||
void SendZonePoints();
|
||||
void SendZonePoints();
|
||||
|
||||
void SendBuyerResults(char *SearchQuery, uint32 SearchID);
|
||||
void ShowBuyLines(const EQApplicationPacket *app);
|
||||
@@ -248,7 +248,7 @@ public:
|
||||
void UpdateBuyLine(const EQApplicationPacket *app);
|
||||
void BuyerItemSearch(const EQApplicationPacket *app);
|
||||
void SetBuyerWelcomeMessage(const char* WelcomeMessage) { BuyerWelcomeMessage = WelcomeMessage; }
|
||||
const char* GetBuyerWelcomeMessage() { return BuyerWelcomeMessage.c_str(); }
|
||||
const char* GetBuyerWelcomeMessage() { return BuyerWelcomeMessage.c_str(); }
|
||||
|
||||
void FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho);
|
||||
virtual bool Process();
|
||||
@@ -260,7 +260,7 @@ public:
|
||||
void ChannelMessageSend(const char* from, const char* to, uint8 chan_num, uint8 language, const char* message, ...);
|
||||
void ChannelMessageSend(const char* from, const char* to, uint8 chan_num, uint8 language, uint8 lang_skill, const char* message, ...);
|
||||
void Message(uint32 type, const char* message, ...);
|
||||
void QuestJournalledMessage(const char *npcname, const char* message);
|
||||
void QuestJournalledMessage(const char *npcname, const char* message);
|
||||
void VoiceMacroReceived(uint32 Type, char *Target, uint32 MacroNumber);
|
||||
void SendSound();
|
||||
void LearnRecipe(uint32 recipeID);
|
||||
@@ -289,13 +289,13 @@ public:
|
||||
inline void Disconnect() { eqs->Close(); client_state = DISCONNECTED; }
|
||||
inline bool IsLD() const { return (bool) (client_state == CLIENT_LINKDEAD); }
|
||||
void WorldKick();
|
||||
inline uint8 GetAnon() const { return m_pp.anon; }
|
||||
inline uint8 GetAnon() const { return m_pp.anon; }
|
||||
inline PlayerProfile_Struct& GetPP() { return m_pp; }
|
||||
inline ExtendedProfile_Struct& GetEPP() { return m_epp; }
|
||||
inline Inventory& GetInv() { return m_inv; }
|
||||
inline const Inventory& GetInv() const { return m_inv; }
|
||||
inline PetInfo* GetPetInfo(uint16 pet) { return (pet==1)?&m_suspendedminion:&m_petinfo; }
|
||||
inline InspectMessage_Struct& GetInspectMessage() { return m_inspect_message; }
|
||||
inline InspectMessage_Struct& GetInspectMessage() { return m_inspect_message; }
|
||||
inline const InspectMessage_Struct& GetInspectMessage() const { return m_inspect_message; }
|
||||
|
||||
bool CheckAccess(int16 iDBLevel, int16 iDefaultLevel);
|
||||
@@ -323,7 +323,7 @@ public:
|
||||
inline void SetBaseClass(uint32 i) { m_pp.class_=i; }
|
||||
inline void SetBaseRace(uint32 i) { m_pp.race=i; }
|
||||
inline void SetBaseGender(uint32 i) { m_pp.gender=i; }
|
||||
inline void SetDeity(uint32 i) {m_pp.deity=i;deity=i;}
|
||||
inline void SetDeity(uint32 i) {m_pp.deity=i;deity=i;}
|
||||
|
||||
inline uint8 GetLevel2() const { return m_pp.level2; }
|
||||
inline uint16 GetBaseRace() const { return m_pp.race; }
|
||||
@@ -346,11 +346,11 @@ public:
|
||||
int32 CalcMaxMana();
|
||||
int32 CalcBaseMana();
|
||||
const int32& SetMana(int32 amount);
|
||||
int32 CalcManaRegenCap();
|
||||
int32 CalcManaRegenCap();
|
||||
|
||||
void ServerFilter(SetServerFilter_Struct* filter);
|
||||
void BulkSendTraderInventory(uint32 char_id);
|
||||
void SendSingleTraderItem(uint32 char_id, int uniqueid);
|
||||
void SendSingleTraderItem(uint32 char_id, int uniqueid);
|
||||
void BulkSendMerchantInventory(int merchant_id, int npcid);
|
||||
|
||||
inline uint8 GetLanguageSkill(uint16 n) const { return m_pp.languages[n]; }
|
||||
@@ -389,22 +389,22 @@ public:
|
||||
inline virtual int16 GetPR() const { return PR; }
|
||||
inline virtual int16 GetCR() const { return CR; }
|
||||
inline virtual int16 GetCorrup() const { return Corrup; }
|
||||
|
||||
|
||||
int16 GetMaxStat() const;
|
||||
int16 GetMaxResist() const;
|
||||
int16 GetMaxSTR() const;
|
||||
int16 GetMaxSTA() const;
|
||||
int16 GetMaxDEX() const;
|
||||
int16 GetMaxAGI() const;
|
||||
int16 GetMaxINT() const;
|
||||
int16 GetMaxWIS() const;
|
||||
int16 GetMaxCHA() const;
|
||||
int16 GetMaxMR() const;
|
||||
int16 GetMaxPR() const;
|
||||
int16 GetMaxDR() const;
|
||||
int16 GetMaxCR() const;
|
||||
int16 GetMaxFR() const;
|
||||
int16 GetMaxCorrup() const;
|
||||
int16 GetMaxSTR() const;
|
||||
int16 GetMaxSTA() const;
|
||||
int16 GetMaxDEX() const;
|
||||
int16 GetMaxAGI() const;
|
||||
int16 GetMaxINT() const;
|
||||
int16 GetMaxWIS() const;
|
||||
int16 GetMaxCHA() const;
|
||||
int16 GetMaxMR() const;
|
||||
int16 GetMaxPR() const;
|
||||
int16 GetMaxDR() const;
|
||||
int16 GetMaxCR() const;
|
||||
int16 GetMaxFR() const;
|
||||
int16 GetMaxCorrup() const;
|
||||
inline uint8 GetBaseSTR() const { return m_pp.STR; }
|
||||
inline uint8 GetBaseSTA() const { return m_pp.STA; }
|
||||
inline uint8 GetBaseCHA() const { return m_pp.CHA; }
|
||||
@@ -442,15 +442,15 @@ public:
|
||||
inline virtual int16 GetSpellDmg() const { return itembonuses.SpellDmg; }
|
||||
inline virtual int16 GetClair() const { return itembonuses.Clairvoyance; }
|
||||
inline virtual int16 GetDSMit() const { return itembonuses.DSMitigation; }
|
||||
|
||||
|
||||
inline virtual int16 GetSingMod() const { return itembonuses.singingMod; }
|
||||
inline virtual int16 GetBrassMod() const { return itembonuses.brassMod; }
|
||||
inline virtual int16 GetPercMod() const { return itembonuses.percussionMod; }
|
||||
inline virtual int16 GetStringMod() const { return itembonuses.stringedMod; }
|
||||
inline virtual int16 GetWindMod() const { return itembonuses.windMod; }
|
||||
|
||||
|
||||
inline virtual int16 GetDelayDeath() const { return aabonuses.DelayDeath + spellbonuses.DelayDeath + itembonuses.DelayDeath + 11; }
|
||||
|
||||
|
||||
int32 Additional_SpellDmg(uint16 spell_id, bool bufftick = false);
|
||||
int32 Additional_Heal(uint16 spell_id);
|
||||
float GetActSpellRange(uint16 spell_id, float range, bool IsBard = false);
|
||||
@@ -489,7 +489,7 @@ public:
|
||||
int32 CalcEnduranceRegen(); //Calculates endurance regen used in DoEnduranceRegen()
|
||||
int32 GetEndurance() const {return cur_end;} //This gets our current endurance
|
||||
int32 GetMaxEndurance() const {return max_end;} //This gets our endurance from the last CalcMaxEndurance() call
|
||||
int32 CalcEnduranceRegenCap();
|
||||
int32 CalcEnduranceRegenCap();
|
||||
int32 CalcHPRegenCap();
|
||||
inline uint8 GetEndurancePercent() { return (uint8)((float)cur_end / (float)max_end * 100.0f); }
|
||||
void SetEndurance(int32 newEnd); //This sets the current endurance to the new value
|
||||
@@ -502,8 +502,8 @@ public:
|
||||
//This gets the skill value of the item type equiped in the Primary Slot
|
||||
uint16 GetPrimarySkillValue();
|
||||
|
||||
bool Flurry();
|
||||
bool Rampage();
|
||||
bool Flurry();
|
||||
bool Rampage();
|
||||
void DurationRampage(uint32 duration);
|
||||
|
||||
inline uint32 GetEXP() const { return m_pp.exp; }
|
||||
@@ -526,17 +526,17 @@ public:
|
||||
void AddLeadershipEXP(uint32 group_exp, uint32 raid_exp);
|
||||
void SendLeadershipEXPUpdate();
|
||||
bool IsLeadershipEXPOn();
|
||||
inline int GetLeadershipAA(int AAID) { return m_pp.leader_abilities.ranks[AAID]; }
|
||||
inline int GetLeadershipAA(int AAID) { return m_pp.leader_abilities.ranks[AAID]; }
|
||||
int GroupLeadershipAAHealthEnhancement();
|
||||
int GroupLeadershipAAManaEnhancement();
|
||||
int GroupLeadershipAAHealthRegeneration();
|
||||
int GroupLeadershipAAOffenseEnhancement();
|
||||
void InspectBuffs(Client* Inspector, int Rank);
|
||||
uint32 GetRaidPoints() { return(m_pp.raid_leadership_points); }
|
||||
uint32 GetGroupPoints() { return(m_pp.group_leadership_points); }
|
||||
uint32 GetRaidEXP() { return(m_pp.raid_leadership_exp); }
|
||||
uint32 GetGroupEXP() { return(m_pp.group_leadership_exp); }
|
||||
uint32 GetTotalSecondsPlayed() { return(TotalSecondsPlayed); }
|
||||
uint32 GetRaidPoints() { return(m_pp.raid_leadership_points); }
|
||||
uint32 GetGroupPoints() { return(m_pp.group_leadership_points); }
|
||||
uint32 GetRaidEXP() { return(m_pp.raid_leadership_exp); }
|
||||
uint32 GetGroupEXP() { return(m_pp.group_leadership_exp); }
|
||||
uint32 GetTotalSecondsPlayed() { return(TotalSecondsPlayed); }
|
||||
virtual void SetLevel(uint8 set_level, bool command = false);
|
||||
void GoToBind(uint8 bindnum = 0);
|
||||
void GoToSafeCoords(uint16 zone_id, uint16 instance_id);
|
||||
@@ -561,14 +561,14 @@ public:
|
||||
inline const int32 GetInstanceID() const { return zone->GetInstanceID(); }
|
||||
|
||||
FACTION_VALUE GetReverseFactionCon(Mob* iOther);
|
||||
FACTION_VALUE GetFactionLevel(uint32 char_id, uint32 npc_id, uint32 p_race, uint32 p_class, uint32 p_deity, int32 pFaction, Mob* tnpc);
|
||||
FACTION_VALUE GetFactionLevel(uint32 char_id, uint32 npc_id, uint32 p_race, uint32 p_class, uint32 p_deity, int32 pFaction, Mob* tnpc);
|
||||
int32 GetCharacterFactionLevel(int32 faction_id);
|
||||
int32 GetModCharacterFactionLevel(int32 faction_id);
|
||||
int32 GetModCharacterFactionLevel(int32 faction_id);
|
||||
bool HatedByClass(uint32 p_race, uint32 p_class, uint32 p_deity, int32 pFaction);
|
||||
char* BuildFactionMessage(int32 tmpvalue, int32 faction_id, int32 totalvalue, uint8 temp);
|
||||
char* BuildFactionMessage(int32 tmpvalue, int32 faction_id, int32 totalvalue, uint8 temp);
|
||||
|
||||
void SetFactionLevel(uint32 char_id, uint32 npc_id, uint8 char_class, uint8 char_race, uint8 char_deity);
|
||||
void SetFactionLevel2(uint32 char_id, int32 faction_id, uint8 char_class, uint8 char_race, uint8 char_deity, int32 value, uint8 temp);
|
||||
void SetFactionLevel2(uint32 char_id, int32 faction_id, uint8 char_class, uint8 char_race, uint8 char_deity, int32 value, uint8 temp);
|
||||
int16 GetRawItemAC();
|
||||
uint16 GetCombinedAC_TEST();
|
||||
|
||||
@@ -592,7 +592,7 @@ public:
|
||||
void SendGuildChannel();
|
||||
void SendGuildSpawnAppearance();
|
||||
void SendGuildMembers();
|
||||
void SendGuildList();
|
||||
void SendGuildList();
|
||||
void SendGuildJoin(GuildJoin_Struct* gj);
|
||||
void RefreshGuildInfo();
|
||||
|
||||
@@ -602,7 +602,7 @@ public:
|
||||
void SendEnduranceUpdate();
|
||||
uint8 GetFace() const { return m_pp.face; }
|
||||
void WhoAll(Who_All_Struct* whom);
|
||||
void FriendsWho(char *FriendsString);
|
||||
void FriendsWho(char *FriendsString);
|
||||
|
||||
void Stun(int duration);
|
||||
void UnStun();
|
||||
@@ -639,7 +639,7 @@ public:
|
||||
void CheckSongSkillIncrease(uint16 spell_id);
|
||||
bool CheckIncreaseSkill(SkillType skillid, Mob *against_who, int chancemodi = 0);
|
||||
void CheckLanguageSkillIncrease(uint8 langid, uint8 TeacherSkill);
|
||||
void SetLanguageSkill(int langid, int value);
|
||||
void SetLanguageSkill(int langid, int value);
|
||||
void SetHoTT(uint32 mobid);
|
||||
void ShowSkillsWindow();
|
||||
void SendStatsWindow(Client* client, bool use_window);
|
||||
@@ -679,7 +679,7 @@ public:
|
||||
bool LootToStack(uint32 itemid);
|
||||
void SetFeigned(bool in_feigned);
|
||||
/// this cures timing issues cuz dead animation isn't done but server side feigning is?
|
||||
inline bool GetFeigned() const { return(feigned); }
|
||||
inline bool GetFeigned() const { return(feigned); }
|
||||
EQStreamInterface* Connection() { return eqs; }
|
||||
#ifdef PACKET_PROFILER
|
||||
void DumpPacketProfile() { if(eqs) eqs->DumpPacketProfile(); }
|
||||
@@ -713,22 +713,22 @@ public:
|
||||
inline PTimerList &GetPTimers() { return(p_timers); }
|
||||
|
||||
//AA Methods
|
||||
void SendAAList();
|
||||
void ResetAA();
|
||||
void SendAA(uint32 id, int seq=1);
|
||||
void SendPreviousAA(uint32 id, int seq=1);
|
||||
void BuyAA(AA_Action* action);
|
||||
void SendAAList();
|
||||
void ResetAA();
|
||||
void SendAA(uint32 id, int seq=1);
|
||||
void SendPreviousAA(uint32 id, int seq=1);
|
||||
void BuyAA(AA_Action* action);
|
||||
//this function is used by some AA stuff
|
||||
void MemorizeSpell(uint32 slot,uint32 spellid,uint32 scribing);
|
||||
void SetAATitle(const char *Title);
|
||||
void SetTitleSuffix(const char *txt);
|
||||
inline uint32 GetMaxAAXP(void) const { return max_AAXP; }
|
||||
inline uint32 GetAAXP() const { return m_pp.expAA; }
|
||||
inline uint32 GetAAXP() const { return m_pp.expAA; }
|
||||
void SendAAStats();
|
||||
void SendAATable();
|
||||
void SendAATimers();
|
||||
int GetAATimerID(aaID activate);
|
||||
int CalcAAReuseTimer(const AA_DBAction *caa);
|
||||
int GetAATimerID(aaID activate);
|
||||
int CalcAAReuseTimer(const AA_DBAction *caa);
|
||||
void ActivateAA(aaID activate);
|
||||
void SendAATimer(uint32 ability, uint32 begin, uint32 end);
|
||||
void EnableAAEffect(aaEffectType type, uint32 duration = 0);
|
||||
@@ -744,8 +744,8 @@ public:
|
||||
int16 acmod();
|
||||
|
||||
// Item methods
|
||||
uint32 NukeItem(uint32 itemnum, uint8 where_to_check =
|
||||
(invWhereWorn | invWherePersonal | invWhereBank | invWhereSharedBank | invWhereTrading | invWhereCursor));
|
||||
uint32 NukeItem(uint32 itemnum, uint8 where_to_check =
|
||||
(invWhereWorn | invWherePersonal | invWhereBank | invWhereSharedBank | invWhereTrading | invWhereCursor));
|
||||
void SetTint(int16 slot_id, uint32 color);
|
||||
void SetTint(int16 slot_id, Color_Struct& color);
|
||||
void SetMaterial(int16 slot_id, uint32 item_id);
|
||||
@@ -770,7 +770,7 @@ public:
|
||||
void SendLootItemInPacket(const ItemInst* inst, int16 slot_id);
|
||||
void SendItemPacket(int16 slot_id, const ItemInst* inst, ItemPacketType packet_type);
|
||||
bool IsValidSlot(uint32 slot);
|
||||
bool IsBankSlot(uint32 slot);
|
||||
bool IsBankSlot(uint32 slot);
|
||||
|
||||
inline bool IsTrader() const { return(Trader); }
|
||||
inline bool IsBuyer() const { return(Buyer); }
|
||||
@@ -786,14 +786,14 @@ public:
|
||||
bool CheckTradeLoreConflict(Client* other);
|
||||
void LinkDead();
|
||||
void Insight(uint32 t_id);
|
||||
bool CheckDoubleAttack(bool tripleAttack = false);
|
||||
bool CheckDoubleAttack(bool tripleAttack = false);
|
||||
|
||||
//remove charges/multiple objects from inventory:
|
||||
//bool DecreaseByType(uint32 type, uint8 amt);
|
||||
bool DecreaseByID(uint32 type, uint8 amt);
|
||||
uint8 SlotConvert2(uint8 slot); //Maybe not needed.
|
||||
void Escape(); //AA Escape
|
||||
void RemoveNoRent(bool client_update = true);
|
||||
void RemoveNoRent(bool client_update = true);
|
||||
void RemoveDuplicateLore(bool client_update = true);
|
||||
void MoveSlotNotAllowed(bool client_update = true);
|
||||
virtual void RangedAttack(Mob* other);
|
||||
@@ -819,9 +819,9 @@ public:
|
||||
void SendDisciplineUpdate();
|
||||
bool UseDiscipline(uint32 spell_id, uint32 target);
|
||||
|
||||
bool CheckTitle(int titleset);
|
||||
void EnableTitle(int titleset);
|
||||
void RemoveTitle(int titleset);
|
||||
bool CheckTitle(int titleset);
|
||||
void EnableTitle(int titleset);
|
||||
void RemoveTitle(int titleset);
|
||||
|
||||
#ifdef PACKET_UPDATE_MANAGER
|
||||
inline UpdateManager *GetUpdateManager() { return(&update_manager); }
|
||||
@@ -862,120 +862,87 @@ public:
|
||||
void SendWindow(uint32 PopupID, uint32 NegativeID, uint32 Buttons, const char *ButtonName0, const char *ButtonName1, uint32 Duration, int title_type, Client* target, const char *Title, const char *Text, ...);
|
||||
bool PendingTranslocate;
|
||||
time_t TranslocateTime;
|
||||
bool PendingSacrifice;
|
||||
string SacrificeCaster;
|
||||
struct Translocate_Struct PendingTranslocateData;
|
||||
void SendOPTranslocateConfirm(Mob *Caster, uint16 SpellID);
|
||||
bool PendingSacrifice;
|
||||
string SacrificeCaster;
|
||||
struct Translocate_Struct PendingTranslocateData;
|
||||
void SendOPTranslocateConfirm(Mob *Caster, uint16 SpellID);
|
||||
|
||||
// Task System Methods
|
||||
// Task System Methods
|
||||
void LoadClientTaskState();
|
||||
void RemoveClientTaskState();
|
||||
void SendTaskActivityComplete(int TaskID, int ActivityID, int TaskIndex, int TaskIncomplete=1);
|
||||
void SendTaskFailed(int TaskID, int TaskIndex);
|
||||
void SendTaskComplete(int TaskIndex);
|
||||
void SendTaskActivityComplete(int TaskID, int ActivityID, int TaskIndex, int TaskIncomplete=1);
|
||||
void SendTaskFailed(int TaskID, int TaskIndex);
|
||||
void SendTaskComplete(int TaskIndex);
|
||||
|
||||
inline void CancelTask(int TaskIndex) { if(taskstate) taskstate->CancelTask(this, TaskIndex); }
|
||||
|
||||
inline bool SaveTaskState()
|
||||
{ return (taskmanager ? taskmanager->SaveClientState(this, taskstate) : false); }
|
||||
inline bool SaveTaskState() { return (taskmanager ? taskmanager->SaveClientState(this, taskstate) : false); }
|
||||
|
||||
inline bool IsTaskStateLoaded() { return taskstate != nullptr; }
|
||||
|
||||
inline bool IsTaskActive(int TaskID)
|
||||
{ return (taskstate ? taskstate->IsTaskActive(TaskID) : false); }
|
||||
inline bool IsTaskActive(int TaskID) { return (taskstate ? taskstate->IsTaskActive(TaskID) : false); }
|
||||
|
||||
inline bool IsTaskActivityActive(int TaskID, int ActivityID)
|
||||
{ return (taskstate ? taskstate->IsTaskActivityActive(TaskID, ActivityID) : false); }
|
||||
inline bool IsTaskActivityActive(int TaskID, int ActivityID) { return (taskstate ? taskstate->IsTaskActivityActive(TaskID, ActivityID) : false); }
|
||||
|
||||
inline ActivityState GetTaskActivityState(int index, int ActivityID)
|
||||
{ return (taskstate ? taskstate->GetTaskActivityState(index, ActivityID) : ActivityHidden); }
|
||||
inline ActivityState GetTaskActivityState(int index, int ActivityID) { return (taskstate ? taskstate->GetTaskActivityState(index, ActivityID) : ActivityHidden); }
|
||||
|
||||
inline void UpdateTaskActivity(int TaskID, int ActivityID, int Count)
|
||||
{ if(taskstate) taskstate->UpdateTaskActivity(this, TaskID, ActivityID, Count); }
|
||||
inline void UpdateTaskActivity(int TaskID, int ActivityID, int Count) { if(taskstate) taskstate->UpdateTaskActivity(this, TaskID, ActivityID, Count); }
|
||||
|
||||
inline void ResetTaskActivity(int TaskID, int ActivityID)
|
||||
{ if(taskstate) taskstate->ResetTaskActivity(this, TaskID, ActivityID); }
|
||||
inline void ResetTaskActivity(int TaskID, int ActivityID) { if(taskstate) taskstate->ResetTaskActivity(this, TaskID, ActivityID); }
|
||||
|
||||
inline void UpdateTasksOnKill(int NPCTypeID)
|
||||
{ if(taskstate) taskstate->UpdateTasksOnKill(this, NPCTypeID); }
|
||||
inline void UpdateTasksOnKill(int NPCTypeID) { if(taskstate) taskstate->UpdateTasksOnKill(this, NPCTypeID); }
|
||||
|
||||
inline void UpdateTasksForItem(ActivityType Type, int ItemID, int Count=1)
|
||||
{ if(taskstate) taskstate->UpdateTasksForItem(this, Type, ItemID, Count); }
|
||||
inline void UpdateTasksForItem(ActivityType Type, int ItemID, int Count=1) { if(taskstate) taskstate->UpdateTasksForItem(this, Type, ItemID, Count); }
|
||||
|
||||
inline void UpdateTasksOnExplore(int ExploreID)
|
||||
{ if(taskstate) taskstate->UpdateTasksOnExplore(this, ExploreID); }
|
||||
inline void UpdateTasksOnExplore(int ExploreID) { if(taskstate) taskstate->UpdateTasksOnExplore(this, ExploreID); }
|
||||
|
||||
inline bool UpdateTasksOnSpeakWith(int NPCTypeID)
|
||||
{ if(taskstate) return taskstate->UpdateTasksOnSpeakWith(this, NPCTypeID); else return false; }
|
||||
inline bool UpdateTasksOnSpeakWith(int NPCTypeID) { if(taskstate) return taskstate->UpdateTasksOnSpeakWith(this, NPCTypeID); else return false; }
|
||||
|
||||
inline bool UpdateTasksOnDeliver(uint32 *Items, int Cash, int NPCTypeID)
|
||||
{ if(taskstate) return taskstate->UpdateTasksOnDeliver(this, Items, Cash, NPCTypeID); else return false; }
|
||||
inline bool UpdateTasksOnDeliver(uint32 *Items, int Cash, int NPCTypeID) { if(taskstate) return taskstate->UpdateTasksOnDeliver(this, Items, Cash, NPCTypeID); else return false; }
|
||||
|
||||
inline void TaskSetSelector(Mob *mob, int TaskSetID)
|
||||
{ if(taskmanager) taskmanager->TaskSetSelector(this, taskstate, mob, TaskSetID); }
|
||||
inline void TaskSetSelector(Mob *mob, int TaskSetID) { if(taskmanager) taskmanager->TaskSetSelector(this, taskstate, mob, TaskSetID); }
|
||||
|
||||
inline void EnableTask(int TaskCount, int *TaskList)
|
||||
{ if(taskstate) taskstate->EnableTask(CharacterID(), TaskCount, TaskList); }
|
||||
inline void EnableTask(int TaskCount, int *TaskList) { if(taskstate) taskstate->EnableTask(CharacterID(), TaskCount, TaskList); }
|
||||
|
||||
inline void DisableTask(int TaskCount, int *TaskList)
|
||||
{ if(taskstate) taskstate->DisableTask(CharacterID(), TaskCount, TaskList); }
|
||||
inline void DisableTask(int TaskCount, int *TaskList) { if(taskstate) taskstate->DisableTask(CharacterID(), TaskCount, TaskList); }
|
||||
|
||||
inline bool IsTaskEnabled(int TaskID)
|
||||
{ return (taskstate ? taskstate->IsTaskEnabled(TaskID) : false); }
|
||||
inline bool IsTaskEnabled(int TaskID) { return (taskstate ? taskstate->IsTaskEnabled(TaskID) : false); }
|
||||
|
||||
inline void ProcessTaskProximities(float X, float Y, float Z)
|
||||
{ if(taskstate) taskstate->ProcessTaskProximities(this, X, Y, Z); }
|
||||
inline void ProcessTaskProximities(float X, float Y, float Z) { if(taskstate) taskstate->ProcessTaskProximities(this, X, Y, Z); }
|
||||
|
||||
inline void AssignTask(int TaskID, int NPCID)
|
||||
{ if(taskstate) taskstate->AcceptNewTask(this, TaskID, NPCID); }
|
||||
inline void AssignTask(int TaskID, int NPCID) { if(taskstate) taskstate->AcceptNewTask(this, TaskID, NPCID); }
|
||||
|
||||
inline int ActiveSpeakTask(int NPCID)
|
||||
{ if(taskstate) return taskstate->ActiveSpeakTask(NPCID); else return 0; }
|
||||
inline int ActiveSpeakTask(int NPCID) { if(taskstate) return taskstate->ActiveSpeakTask(NPCID); else return 0; }
|
||||
|
||||
inline int ActiveSpeakActivity(int NPCID, int TaskID)
|
||||
{ if(taskstate) return taskstate->ActiveSpeakActivity(NPCID, TaskID); else return 0; }
|
||||
inline int ActiveSpeakActivity(int NPCID, int TaskID) { if(taskstate) return taskstate->ActiveSpeakActivity(NPCID, TaskID); else return 0; }
|
||||
|
||||
inline void FailTask(int TaskID)
|
||||
{ if(taskstate) taskstate->FailTask(this, TaskID); }
|
||||
inline void FailTask(int TaskID) { if(taskstate) taskstate->FailTask(this, TaskID); }
|
||||
|
||||
inline int TaskTimeLeft(int TaskID)
|
||||
{ return (taskstate ? taskstate->TaskTimeLeft(TaskID) : 0); }
|
||||
inline int TaskTimeLeft(int TaskID) { return (taskstate ? taskstate->TaskTimeLeft(TaskID) : 0); }
|
||||
|
||||
inline int EnabledTaskCount(int TaskSetID)
|
||||
{ return (taskstate ? taskstate->EnabledTaskCount(TaskSetID) : -1); }
|
||||
inline int EnabledTaskCount(int TaskSetID) { return (taskstate ? taskstate->EnabledTaskCount(TaskSetID) : -1); }
|
||||
|
||||
inline int IsTaskCompleted(int TaskID)
|
||||
{ return (taskstate ? taskstate->IsTaskCompleted(TaskID) : -1); }
|
||||
inline int IsTaskCompleted(int TaskID) { return (taskstate ? taskstate->IsTaskCompleted(TaskID) : -1); }
|
||||
|
||||
inline void ShowClientTasks()
|
||||
{ if(taskstate) taskstate->ShowClientTasks(this); }
|
||||
inline void ShowClientTasks() { if(taskstate) taskstate->ShowClientTasks(this); }
|
||||
|
||||
inline void CancelAllTasks()
|
||||
{ if(taskstate) taskstate->CancelAllTasks(this); }
|
||||
inline void CancelAllTasks() { if(taskstate) taskstate->CancelAllTasks(this); }
|
||||
|
||||
inline int GetActiveTaskCount()
|
||||
{ return (taskstate ? taskstate->GetActiveTaskCount() : 0); }
|
||||
inline int GetActiveTaskCount() { return (taskstate ? taskstate->GetActiveTaskCount() : 0); }
|
||||
|
||||
inline int GetActiveTaskID(int index)
|
||||
{ return (taskstate ? taskstate->GetActiveTaskID(index) : -1); }
|
||||
inline int GetActiveTaskID(int index) { return (taskstate ? taskstate->GetActiveTaskID(index) : -1); }
|
||||
|
||||
inline int GetTaskStartTime(int index)
|
||||
{ return (taskstate ? taskstate->GetTaskStartTime(index) : -1); }
|
||||
inline int GetTaskStartTime(int index) { return (taskstate ? taskstate->GetTaskStartTime(index) : -1); }
|
||||
|
||||
inline bool IsTaskActivityCompleted(int index, int ActivityID)
|
||||
{ return (taskstate ? taskstate->IsTaskActivityCompleted(index, ActivityID) : false); }
|
||||
inline bool IsTaskActivityCompleted(int index, int ActivityID) { return (taskstate ? taskstate->IsTaskActivityCompleted(index, ActivityID) : false); }
|
||||
|
||||
inline int GetTaskActivityDoneCount(int ClientTaskIndex, int ActivityID)
|
||||
{ return (taskstate ? taskstate->GetTaskActivityDoneCount(ClientTaskIndex, ActivityID) :0); }
|
||||
|
||||
inline int GetTaskActivityDoneCountFromTaskID(int TaskID, int ActivityID)
|
||||
{ return (taskstate ? taskstate->GetTaskActivityDoneCountFromTaskID(TaskID, ActivityID) :0); }
|
||||
inline int GetTaskActivityDoneCount(int ClientTaskIndex, int ActivityID) { return (taskstate ? taskstate->GetTaskActivityDoneCount(ClientTaskIndex, ActivityID) :0); }
|
||||
|
||||
inline int ActiveTasksInSet(int TaskSet)
|
||||
{ return (taskstate ? taskstate->ActiveTasksInSet(TaskSet) :0); }
|
||||
inline int GetTaskActivityDoneCountFromTaskID(int TaskID, int ActivityID) { return (taskstate ? taskstate->GetTaskActivityDoneCountFromTaskID(TaskID, ActivityID) :0); }
|
||||
|
||||
inline int CompletedTasksInSet(int TaskSet)
|
||||
{ return (taskstate ? taskstate->CompletedTasksInSet(TaskSet) :0); }
|
||||
inline int ActiveTasksInSet(int TaskSet) { return (taskstate ? taskstate->ActiveTasksInSet(TaskSet) :0); }
|
||||
|
||||
inline int CompletedTasksInSet(int TaskSet) { return (taskstate ? taskstate->CompletedTasksInSet(TaskSet) :0); }
|
||||
|
||||
inline const EQClientVersion GetClientVersion() const { return ClientVersion; }
|
||||
inline const uint32 GetClientVersionBit() const { return ClientVersionBit; }
|
||||
@@ -1128,7 +1095,7 @@ public:
|
||||
Timer* GetMercTimer() { return &merc_timer; };
|
||||
const char* GetRacePlural(Client* client);
|
||||
const char* GetClassPlural(Client* client);
|
||||
void SendWebLink(const char* website);
|
||||
void SendWebLink(const char* website);
|
||||
|
||||
bool StoreTurnInItems(Mob* with);
|
||||
void DuplicateLoreMessage(uint32 ItemID);
|
||||
@@ -1167,15 +1134,15 @@ protected:
|
||||
friend class Mob;
|
||||
void CalcItemBonuses(StatBonuses* newbon);
|
||||
void AddItemBonuses(const ItemInst *inst, StatBonuses* newbon, bool isAug = false, bool isTribute = false);
|
||||
int CalcRecommendedLevelBonus(uint8 level, uint8 reclevel, int basestat);
|
||||
int CalcRecommendedLevelBonus(uint8 level, uint8 reclevel, int basestat);
|
||||
void CalcEdibleBonuses(StatBonuses* newbon);
|
||||
void CalcAABonuses(StatBonuses* newbon);
|
||||
void ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon);
|
||||
void ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon);
|
||||
void MakeBuffFadePacket(uint16 spell_id, int slot_id, bool send_message = true);
|
||||
bool client_data_loaded;
|
||||
|
||||
int16 GetFocusEffect(focusType type, uint16 spell_id);
|
||||
int16 GetSympatheticFocusEffect(focusType type, uint16 spell_id);
|
||||
int16 GetSympatheticFocusEffect(focusType type, uint16 spell_id);
|
||||
|
||||
Mob* bind_sight_target;
|
||||
|
||||
@@ -1219,22 +1186,22 @@ private:
|
||||
|
||||
void HandleTraderPriceUpdate(const EQApplicationPacket *app);
|
||||
|
||||
int16 CalcAC();
|
||||
int16 GetACMit();
|
||||
int16 GetACAvoid();
|
||||
int16 CalcATK();
|
||||
int CalcHaste();
|
||||
int16 CalcAC();
|
||||
int16 GetACMit();
|
||||
int16 GetACAvoid();
|
||||
int16 CalcATK();
|
||||
int CalcHaste();
|
||||
|
||||
int16 CalcAlcoholPhysicalEffect();
|
||||
int16 CalcSTR();
|
||||
int16 CalcSTA();
|
||||
int16 CalcDEX();
|
||||
int16 CalcAGI();
|
||||
int16 CalcINT();
|
||||
int16 CalcWIS();
|
||||
int16 CalcCHA();
|
||||
int16 CalcAlcoholPhysicalEffect();
|
||||
int16 CalcSTR();
|
||||
int16 CalcSTA();
|
||||
int16 CalcDEX();
|
||||
int16 CalcAGI();
|
||||
int16 CalcINT();
|
||||
int16 CalcWIS();
|
||||
int16 CalcCHA();
|
||||
|
||||
int16 CalcMR();
|
||||
int16 CalcMR();
|
||||
int16 CalcFR();
|
||||
int16 CalcDR();
|
||||
int16 CalcPR();
|
||||
@@ -1253,13 +1220,13 @@ private:
|
||||
|
||||
uint32 pLastUpdate;
|
||||
uint32 pLastUpdateWZ;
|
||||
uint8 playeraction;
|
||||
uint8 playeraction;
|
||||
|
||||
EQStreamInterface* eqs;
|
||||
|
||||
uint32 ip;
|
||||
uint16 port;
|
||||
CLIENT_CONN_STATUS client_state;
|
||||
CLIENT_CONN_STATUS client_state;
|
||||
uint32 character_id;
|
||||
uint32 WID;
|
||||
uint32 account_id;
|
||||
@@ -1296,15 +1263,15 @@ private:
|
||||
uint16 BoatID;
|
||||
uint16 TrackingID;
|
||||
uint16 CustomerID;
|
||||
uint32 account_creation;
|
||||
uint32 account_creation;
|
||||
uint8 firstlogon;
|
||||
uint32 mercid; // current merc
|
||||
uint8 mercSlot; // selected merc slot
|
||||
uint32 mercid; // current merc
|
||||
uint8 mercSlot; // selected merc slot
|
||||
bool Trader;
|
||||
bool Buyer;
|
||||
string BuyerWelcomeMessage;
|
||||
bool AbilityTimer;
|
||||
int Haste; //precalced value
|
||||
int Haste; //precalced value
|
||||
|
||||
int32 max_end;
|
||||
int32 cur_end;
|
||||
@@ -1323,9 +1290,9 @@ private:
|
||||
|
||||
bool CanBeInZone();
|
||||
void SendLogoutPackets();
|
||||
bool AddPacket(const EQApplicationPacket *, bool);
|
||||
bool AddPacket(EQApplicationPacket**, bool);
|
||||
bool SendAllPackets();
|
||||
bool AddPacket(const EQApplicationPacket *, bool);
|
||||
bool AddPacket(EQApplicationPacket**, bool);
|
||||
bool SendAllPackets();
|
||||
LinkedList<CLIENTPACKET *> clientpackets;
|
||||
|
||||
//Zoning related stuff
|
||||
@@ -1391,7 +1358,7 @@ private:
|
||||
uint32 tribute_master_id;
|
||||
|
||||
FILE *SQL_log;
|
||||
uint32 max_AAXP;
|
||||
uint32 max_AAXP;
|
||||
uint32 staminacount;
|
||||
AA_Array* aa[MAX_PP_AA_ARRAY]; //this list contains pointers into our player profile
|
||||
map<uint32,uint8> aa_points;
|
||||
@@ -1404,7 +1371,7 @@ private:
|
||||
int32 last_reported_mana;
|
||||
int32 last_reported_endur;
|
||||
|
||||
unsigned int AggroCount; // How many mobs are aggro on us.
|
||||
unsigned int AggroCount; // How many mobs are aggro on us.
|
||||
|
||||
unsigned int RestRegenHP;
|
||||
unsigned int RestRegenMana;
|
||||
@@ -1431,7 +1398,7 @@ private:
|
||||
bool m_KnockBackExemption;
|
||||
bool m_PortExemption;
|
||||
bool m_SenseExemption;
|
||||
std::map<uint32, uint32> alternate_currency;
|
||||
std::map<uint32, uint32> alternate_currency;
|
||||
|
||||
//Connecting debug code.
|
||||
enum { //connecting states, used for debugging only
|
||||
@@ -1471,3 +1438,4 @@ private:
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+17
-17
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 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
|
||||
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
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "../common/debug.h"
|
||||
#include "../common/features.h"
|
||||
@@ -32,9 +32,9 @@ void ClientLogs::subscribe(EQEMuLog::LogIDs id, Client *c) {
|
||||
return;
|
||||
if(c == nullptr)
|
||||
return;
|
||||
|
||||
|
||||
//make sure they arnt allready subscribed.
|
||||
|
||||
|
||||
vector<Client *>::iterator cur,end;
|
||||
cur = entries[id].begin();
|
||||
end = entries[id].end();
|
||||
@@ -44,7 +44,7 @@ void ClientLogs::subscribe(EQEMuLog::LogIDs id, Client *c) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
printf("%s has been subscribed to %d\n", c->GetName(), id);
|
||||
entries[id].push_back(c);
|
||||
}
|
||||
@@ -54,7 +54,7 @@ void ClientLogs::unsubscribe(EQEMuLog::LogIDs id, Client *c) {
|
||||
return;
|
||||
if(c == nullptr)
|
||||
return;
|
||||
|
||||
|
||||
vector<Client *>::iterator cur,end;
|
||||
cur = entries[id].begin();
|
||||
end = entries[id].end();
|
||||
|
||||
+18
-20
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 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
|
||||
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
|
||||
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 CLIENT_LOGS_H
|
||||
@@ -39,19 +39,19 @@ public:
|
||||
static void EQEmuIO_buf(EQEMuLog::LogIDs id, const char *buf, uint8 size, uint32 count);
|
||||
static void EQEmuIO_fmt(EQEMuLog::LogIDs id, const char *fmt, va_list ap);
|
||||
static void EQEmuIO_pva(EQEMuLog::LogIDs id, const char *prefix, const char *fmt, va_list ap);
|
||||
|
||||
|
||||
void subscribe(EQEMuLog::LogIDs id, Client *c);
|
||||
void unsubscribe(EQEMuLog::LogIDs id, Client *c);
|
||||
void subscribeAll(Client *c);
|
||||
void unsubscribeAll(Client *c);
|
||||
void clear(); //unsubscribes everybody
|
||||
|
||||
|
||||
void msg(EQEMuLog::LogIDs id, const char *buf);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
vector<Client *> entries[EQEMuLog::MaxLogID];
|
||||
|
||||
|
||||
static char _buffer[MAX_CLIENT_LOG_MESSAGE_LENGTH+1];
|
||||
};
|
||||
|
||||
@@ -60,5 +60,3 @@ extern ClientLogs client_logs;
|
||||
#endif //CLIENT_LOGS
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
+132
-132
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2003 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2003 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
|
||||
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
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "../common/debug.h"
|
||||
#include "masterentity.h"
|
||||
@@ -39,9 +39,9 @@ int16 Client::GetMaxStat() const {
|
||||
return (RuleI(Character, StatCap));
|
||||
|
||||
int level = GetLevel();
|
||||
|
||||
|
||||
int16 base = 0;
|
||||
|
||||
|
||||
if (level < 61) {
|
||||
base = 255;
|
||||
}
|
||||
@@ -54,16 +54,16 @@ int16 Client::GetMaxStat() const {
|
||||
else {
|
||||
base = 330;
|
||||
}
|
||||
|
||||
|
||||
return(base);
|
||||
}
|
||||
|
||||
int16 Client::GetMaxResist() const
|
||||
int16 Client::GetMaxResist() const
|
||||
{
|
||||
int level = GetLevel();
|
||||
|
||||
int16 base = 500;
|
||||
|
||||
|
||||
if(level > 60)
|
||||
base += ((level - 60) * 5);
|
||||
|
||||
@@ -229,7 +229,7 @@ int32 Client::CalcHPRegenCap()
|
||||
int cap = RuleI(Character, ItemHealthRegenCap) + itembonuses.HeroicSTA/25;
|
||||
|
||||
cap += aabonuses.ItemHPRegenCap + spellbonuses.ItemHPRegenCap + itembonuses.ItemHPRegenCap;
|
||||
|
||||
|
||||
return (cap * RuleI(Character, HPRegenMultiplier) / 100);
|
||||
}
|
||||
|
||||
@@ -247,19 +247,19 @@ int32 Client::CalcMaxHP() {
|
||||
max_hp += spellbonuses.HP + aabonuses.HP;
|
||||
|
||||
max_hp += GroupLeadershipAAHealthEnhancement();
|
||||
|
||||
|
||||
max_hp += max_hp * (spellbonuses.MaxHPChange + itembonuses.MaxHPChange) / 10000;
|
||||
|
||||
|
||||
if (cur_hp > max_hp)
|
||||
cur_hp = max_hp;
|
||||
|
||||
|
||||
int hp_perc_cap = spellbonuses.HPPercCap;
|
||||
if(hp_perc_cap) {
|
||||
int curHP_cap = (max_hp * hp_perc_cap) / 100;
|
||||
if (cur_hp > curHP_cap)
|
||||
cur_hp = curHP_cap;
|
||||
}
|
||||
|
||||
|
||||
return max_hp;
|
||||
}
|
||||
|
||||
@@ -283,7 +283,7 @@ uint16 Mob::GetClassLevelFactor(){
|
||||
multiplier = 290;
|
||||
else if (mlevel < 70)
|
||||
multiplier = 300;
|
||||
else
|
||||
else
|
||||
multiplier = 311;
|
||||
break;
|
||||
}
|
||||
@@ -379,19 +379,19 @@ int32 Client::CalcBaseHP()
|
||||
SoDPost255 = 0;
|
||||
|
||||
int hp_factor = GetClassHPFactor();
|
||||
|
||||
|
||||
if (level < 41) {
|
||||
base_hp = (5 + (GetLevel() * hp_factor / 12) +
|
||||
base_hp = (5 + (GetLevel() * hp_factor / 12) +
|
||||
((NormalSTA - SoDPost255) * GetLevel() * hp_factor / 3600));
|
||||
}
|
||||
else if (level < 81) {
|
||||
base_hp = (5 + (40 * hp_factor / 12) + ((GetLevel() - 40) * hp_factor / 6) +
|
||||
((NormalSTA - SoDPost255) * hp_factor / 90) +
|
||||
base_hp = (5 + (40 * hp_factor / 12) + ((GetLevel() - 40) * hp_factor / 6) +
|
||||
((NormalSTA - SoDPost255) * hp_factor / 90) +
|
||||
((NormalSTA - SoDPost255) * (GetLevel() - 40) * hp_factor / 1800));
|
||||
}
|
||||
else {
|
||||
base_hp = (5 + (80 * hp_factor / 8) + ((GetLevel() - 80) * hp_factor / 10) +
|
||||
((NormalSTA - SoDPost255) * hp_factor / 90) +
|
||||
else {
|
||||
base_hp = (5 + (80 * hp_factor / 8) + ((GetLevel() - 80) * hp_factor / 10) +
|
||||
((NormalSTA - SoDPost255) * hp_factor / 90) +
|
||||
((NormalSTA - SoDPost255) * hp_factor / 45));
|
||||
}
|
||||
|
||||
@@ -405,7 +405,7 @@ int32 Client::CalcBaseHP()
|
||||
Post255 = (GetSTA()-255)/2;
|
||||
else
|
||||
Post255 = 0;
|
||||
|
||||
|
||||
base_hp = (5)+(GetLevel()*lm/10) + (((GetSTA()-Post255)*GetLevel()*lm/3000)) + ((Post255*GetLevel())*lm/6000);
|
||||
}
|
||||
return base_hp;
|
||||
@@ -420,7 +420,7 @@ uint32 Client::GetClassHPFactor() {
|
||||
// Base HP over level 80 is factor / 10
|
||||
// HP per STA point per level is factor / 30 for level 80+
|
||||
// HP per STA under level 40 is the level 80 HP Per STA / 120, and for over 40 it is / 60.
|
||||
|
||||
|
||||
switch(GetClass())
|
||||
{
|
||||
case DRUID:
|
||||
@@ -461,14 +461,14 @@ uint32 Client::GetClassHPFactor() {
|
||||
// This should return the combined AC of all the items the player is wearing.
|
||||
int16 Client::GetRawItemAC() {
|
||||
int16 Total = 0;
|
||||
|
||||
|
||||
for (int16 slot_id=0; slot_id<21; slot_id++) {
|
||||
const ItemInst* inst = m_inv[slot_id];
|
||||
if (inst && inst->IsType(ItemClassCommon)) {
|
||||
Total += inst->GetItem()->AC;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return Total;
|
||||
}
|
||||
|
||||
@@ -477,7 +477,7 @@ int16 Client::acmod() {
|
||||
int level = GetLevel();
|
||||
if(agility < 1 || level < 1)
|
||||
return(0);
|
||||
|
||||
|
||||
if (agility <=74){
|
||||
if (agility == 1)
|
||||
return -24;
|
||||
@@ -602,7 +602,7 @@ int16 Client::acmod() {
|
||||
return 27;
|
||||
else if (level <= 39)
|
||||
return 37;
|
||||
else
|
||||
else
|
||||
return 44;
|
||||
}
|
||||
else if (agility == 100 && level >= 7){
|
||||
@@ -872,7 +872,7 @@ int16 Client::CalcAC() {
|
||||
}
|
||||
int displayed = 0;
|
||||
displayed += ((avoidance+mitigation)*1000)/847; //natural AC
|
||||
|
||||
|
||||
//Iksar AC, untested
|
||||
if (GetRace() == IKSAR) {
|
||||
displayed += 12;
|
||||
@@ -883,20 +883,20 @@ int16 Client::CalcAC() {
|
||||
if (iksarlevel > 0)
|
||||
displayed += iksarlevel * 12 / 10;
|
||||
}
|
||||
|
||||
|
||||
// Shield AC bonus for HeroicSTR
|
||||
if(itembonuses.HeroicSTR) {
|
||||
bool equiped = CastToClient()->m_inv.GetItem(14);
|
||||
if(equiped) {
|
||||
uint8 shield = CastToClient()->m_inv.GetItem(14)->GetItem()->ItemType;
|
||||
if(shield == ItemTypeShield)
|
||||
if(shield == ItemTypeShield)
|
||||
displayed += itembonuses.HeroicSTR/2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//spell AC bonuses are added directly to natural total
|
||||
displayed += spellbonuses.AC;
|
||||
|
||||
|
||||
AC = displayed;
|
||||
return(AC);
|
||||
}
|
||||
@@ -907,19 +907,19 @@ int16 Client::GetACMit() {
|
||||
if (m_pp.class_ == WIZARD || m_pp.class_ == MAGICIAN || m_pp.class_ == NECROMANCER || m_pp.class_ == ENCHANTER) {
|
||||
mitigation = (GetSkill(DEFENSE) + itembonuses.HeroicAGI/10)/4 + (itembonuses.AC+1);
|
||||
mitigation -= 4;
|
||||
}
|
||||
}
|
||||
else {
|
||||
mitigation = (GetSkill(DEFENSE) + itembonuses.HeroicAGI/10)/3 + ((itembonuses.AC*4)/3);
|
||||
if(m_pp.class_ == MONK)
|
||||
mitigation += GetLevel() * 13/10; //the 13/10 might be wrong, but it is close...
|
||||
}
|
||||
|
||||
|
||||
// Shield AC bonus for HeroicSTR
|
||||
if(itembonuses.HeroicSTR) {
|
||||
bool equiped = CastToClient()->m_inv.GetItem(14);
|
||||
if(equiped) {
|
||||
uint8 shield = CastToClient()->m_inv.GetItem(14)->GetItem()->ItemType;
|
||||
if(shield == ItemTypeShield)
|
||||
if(shield == ItemTypeShield)
|
||||
mitigation += itembonuses.HeroicSTR/2;
|
||||
}
|
||||
}
|
||||
@@ -932,7 +932,7 @@ int16 Client::GetACAvoid() {
|
||||
int avoidance = (acmod() + ((GetSkill(DEFENSE) + itembonuses.HeroicAGI/10)*16)/9);
|
||||
if (avoidance < 0)
|
||||
avoidance = 0;
|
||||
|
||||
|
||||
return(avoidance*1000/847);
|
||||
}
|
||||
|
||||
@@ -940,7 +940,7 @@ int32 Client::CalcMaxMana()
|
||||
{
|
||||
switch(GetCasterClass())
|
||||
{
|
||||
case 'I':
|
||||
case 'I':
|
||||
case 'W': {
|
||||
max_mana = (CalcBaseMana() + itembonuses.Mana + spellbonuses.Mana + GroupLeadershipAAManaEnhancement());
|
||||
break;
|
||||
@@ -958,18 +958,18 @@ int32 Client::CalcMaxMana()
|
||||
if (max_mana < 0) {
|
||||
max_mana = 0;
|
||||
}
|
||||
|
||||
|
||||
if (cur_mana > max_mana) {
|
||||
cur_mana = max_mana;
|
||||
}
|
||||
|
||||
|
||||
int mana_perc_cap = spellbonuses.ManaPercCap;
|
||||
if(mana_perc_cap) {
|
||||
int curMana_cap = (max_mana * mana_perc_cap) / 100;
|
||||
if (cur_mana > curMana_cap)
|
||||
cur_mana = curMana_cap;
|
||||
}
|
||||
|
||||
|
||||
#if EQDEBUG >= 11
|
||||
LogFile->write(EQEMuLog::Debug, "Client::CalcMaxMana() called for %s - returning %d", GetName(), max_mana);
|
||||
#endif
|
||||
@@ -986,11 +986,11 @@ int32 Client::CalcBaseMana()
|
||||
int ConvertedWisInt = 0;
|
||||
switch(GetCasterClass())
|
||||
{
|
||||
case 'I':
|
||||
case 'I':
|
||||
WisInt = GetINT();
|
||||
|
||||
if (GetClientVersion() >= EQClientSoD && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
|
||||
|
||||
|
||||
if (WisInt > 100) {
|
||||
ConvertedWisInt = (((WisInt - 100) * 5 / 2) + 100);
|
||||
if (WisInt > 201) {
|
||||
@@ -1001,7 +1001,7 @@ int32 Client::CalcBaseMana()
|
||||
ConvertedWisInt = WisInt;
|
||||
}
|
||||
|
||||
if (GetLevel() < 41) {
|
||||
if (GetLevel() < 41) {
|
||||
wisint_mana = (GetLevel() * 75 * ConvertedWisInt / 1000);
|
||||
base_mana = (GetLevel() * 15);
|
||||
}
|
||||
@@ -1045,7 +1045,7 @@ int32 Client::CalcBaseMana()
|
||||
ConvertedWisInt = WisInt;
|
||||
}
|
||||
|
||||
if (GetLevel() < 41) {
|
||||
if (GetLevel() < 41) {
|
||||
wisint_mana = (GetLevel() * 75 * ConvertedWisInt / 1000);
|
||||
base_mana = (GetLevel() * 15);
|
||||
}
|
||||
@@ -1073,7 +1073,7 @@ int32 Client::CalcBaseMana()
|
||||
max_m = (((5 * (MindFactor + 200)) / 2) * 3 * GetLevel() / 100);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 'N': {
|
||||
max_m = 0;
|
||||
break;
|
||||
@@ -1091,11 +1091,11 @@ int32 Client::CalcBaseMana()
|
||||
return max_m;
|
||||
}
|
||||
|
||||
int32 Client::CalcBaseManaRegen()
|
||||
int32 Client::CalcBaseManaRegen()
|
||||
{
|
||||
uint8 clevel = GetLevel();
|
||||
int32 regen = 0;
|
||||
if (IsSitting() || (GetHorseId() != 0))
|
||||
if (IsSitting() || (GetHorseId() != 0))
|
||||
{
|
||||
if(HasSkill(MEDITATE))
|
||||
regen = (((GetSkill(MEDITATE) / 10) + (clevel - (clevel / 4))) / 4) + 4;
|
||||
@@ -1108,12 +1108,12 @@ int32 Client::CalcBaseManaRegen()
|
||||
return regen;
|
||||
}
|
||||
|
||||
int32 Client::CalcManaRegen()
|
||||
int32 Client::CalcManaRegen()
|
||||
{
|
||||
uint8 clevel = GetLevel();
|
||||
int32 regen = 0;
|
||||
//this should be changed so we dont med while camping, etc...
|
||||
if (IsSitting() || (GetHorseId() != 0))
|
||||
if (IsSitting() || (GetHorseId() != 0))
|
||||
{
|
||||
BuffFadeBySitModifier();
|
||||
if(HasSkill(MEDITATE)) {
|
||||
@@ -1129,7 +1129,7 @@ int32 Client::CalcManaRegen()
|
||||
this->medding = false;
|
||||
regen = 2 + spellbonuses.ManaRegen + itembonuses.ManaRegen;
|
||||
}
|
||||
|
||||
|
||||
//AAs
|
||||
regen += aabonuses.ManaRegen;
|
||||
|
||||
@@ -1141,10 +1141,10 @@ int32 Client::CalcManaRegenCap()
|
||||
int32 cap = RuleI(Character, ItemManaRegenCap) + aabonuses.ItemManaRegenCap;
|
||||
switch(GetCasterClass())
|
||||
{
|
||||
case 'I':
|
||||
case 'I':
|
||||
cap += (itembonuses.HeroicINT / 25);
|
||||
break;
|
||||
case 'W':
|
||||
case 'W':
|
||||
cap += (itembonuses.HeroicWIS / 25);
|
||||
break;
|
||||
}
|
||||
@@ -1225,39 +1225,39 @@ int16 Client::CalcAlcoholPhysicalEffect()
|
||||
|
||||
int16 Client::CalcSTR() {
|
||||
int16 val = m_pp.STR + itembonuses.STR + spellbonuses.STR + CalcAlcoholPhysicalEffect();
|
||||
|
||||
|
||||
int16 mod = aabonuses.STR;
|
||||
|
||||
|
||||
if(val>255 && GetLevel() <= 60)
|
||||
val = 255;
|
||||
STR = val + mod;
|
||||
|
||||
|
||||
if(STR < 1)
|
||||
STR = 1;
|
||||
|
||||
int m = GetMaxSTR();
|
||||
if(STR > m)
|
||||
STR = m;
|
||||
|
||||
|
||||
return(STR);
|
||||
}
|
||||
|
||||
int16 Client::CalcSTA() {
|
||||
int16 val = m_pp.STA + itembonuses.STA + spellbonuses.STA + CalcAlcoholPhysicalEffect();;
|
||||
|
||||
|
||||
int16 mod = aabonuses.STA;
|
||||
|
||||
|
||||
if(val>255 && GetLevel() <= 60)
|
||||
val = 255;
|
||||
STA = val + mod;
|
||||
|
||||
|
||||
if(STA < 1)
|
||||
STA = 1;
|
||||
|
||||
int m = GetMaxSTA();
|
||||
if(STA > m)
|
||||
STA = m;
|
||||
|
||||
|
||||
return(STA);
|
||||
}
|
||||
|
||||
@@ -1269,7 +1269,7 @@ int16 Client::CalcAGI() {
|
||||
val = 255;
|
||||
|
||||
int16 str = GetSTR();
|
||||
|
||||
|
||||
//Encumbered penalty
|
||||
if(weight > (str * 10)) {
|
||||
//AGI is halved when we double our weight, zeroed (defaults to 1) when we triple it. this includes AGI from AAs
|
||||
@@ -1285,26 +1285,26 @@ int16 Client::CalcAGI() {
|
||||
int m = GetMaxAGI();
|
||||
if(AGI > m)
|
||||
AGI = m;
|
||||
|
||||
|
||||
return(AGI);
|
||||
}
|
||||
|
||||
int16 Client::CalcDEX() {
|
||||
int16 val = m_pp.DEX + itembonuses.DEX + spellbonuses.DEX - CalcAlcoholPhysicalEffect();;
|
||||
|
||||
|
||||
int16 mod = aabonuses.DEX;
|
||||
|
||||
|
||||
if(val>255 && GetLevel() <= 60)
|
||||
val = 255;
|
||||
DEX = val + mod;
|
||||
|
||||
|
||||
if(DEX < 1)
|
||||
DEX = 1;
|
||||
|
||||
int m = GetMaxDEX();
|
||||
if(DEX > m)
|
||||
DEX = m;
|
||||
|
||||
|
||||
return(DEX);
|
||||
}
|
||||
|
||||
@@ -1312,14 +1312,14 @@ int16 Client::CalcINT() {
|
||||
int16 val = m_pp.INT + itembonuses.INT + spellbonuses.INT;
|
||||
|
||||
int16 mod = aabonuses.INT;
|
||||
|
||||
|
||||
if(val>255 && GetLevel() <= 60)
|
||||
val = 255;
|
||||
INT = val + mod;
|
||||
|
||||
|
||||
if(m_pp.intoxication)
|
||||
{
|
||||
int16 AlcINT = INT - (int16)((float)m_pp.intoxication / 200.0f * (float)INT) - 1;
|
||||
int16 AlcINT = INT - (int16)((float)m_pp.intoxication / 200.0f * (float)INT) - 1;
|
||||
|
||||
if((AlcINT < (int)(0.2 * INT)))
|
||||
INT = (int)(0.2f * (float)INT);
|
||||
@@ -1333,22 +1333,22 @@ int16 Client::CalcINT() {
|
||||
int m = GetMaxINT();
|
||||
if(INT > m)
|
||||
INT = m;
|
||||
|
||||
|
||||
return(INT);
|
||||
}
|
||||
|
||||
int16 Client::CalcWIS() {
|
||||
int16 val = m_pp.WIS + itembonuses.WIS + spellbonuses.WIS;
|
||||
|
||||
|
||||
int16 mod = aabonuses.WIS;
|
||||
|
||||
|
||||
if(val>255 && GetLevel() <= 60)
|
||||
val = 255;
|
||||
WIS = val + mod;
|
||||
|
||||
if(m_pp.intoxication)
|
||||
{
|
||||
int16 AlcWIS = WIS - (int16)((float)m_pp.intoxication / 200.0f * (float)WIS) - 1;
|
||||
int16 AlcWIS = WIS - (int16)((float)m_pp.intoxication / 200.0f * (float)WIS) - 1;
|
||||
|
||||
if((AlcWIS < (int)(0.2 * WIS)))
|
||||
WIS = (int)(0.2f * (float)WIS);
|
||||
@@ -1362,26 +1362,26 @@ int16 Client::CalcWIS() {
|
||||
int m = GetMaxWIS();
|
||||
if(WIS > m)
|
||||
WIS = m;
|
||||
|
||||
|
||||
return(WIS);
|
||||
}
|
||||
|
||||
int16 Client::CalcCHA() {
|
||||
int16 val = m_pp.CHA + itembonuses.CHA + spellbonuses.CHA;
|
||||
|
||||
|
||||
int16 mod = aabonuses.CHA;
|
||||
|
||||
|
||||
if(val>255 && GetLevel() <= 60)
|
||||
val = 255;
|
||||
CHA = val + mod;
|
||||
|
||||
|
||||
if(CHA < 1)
|
||||
CHA = 1;
|
||||
|
||||
int m = GetMaxCHA();
|
||||
if(CHA > m)
|
||||
CHA = m;
|
||||
|
||||
|
||||
return(CHA);
|
||||
}
|
||||
|
||||
@@ -1409,7 +1409,7 @@ int Client::CalcHaste() {
|
||||
} else {
|
||||
cap = RuleI(Character, HasteCap);
|
||||
}
|
||||
|
||||
|
||||
if(h > cap) h = cap;
|
||||
|
||||
h += spellbonuses.hastetype3;
|
||||
@@ -1419,14 +1419,14 @@ int Client::CalcHaste() {
|
||||
|
||||
if (spellbonuses.inhibitmelee){
|
||||
if (h >= 0)
|
||||
h -= spellbonuses.inhibitmelee;
|
||||
|
||||
else
|
||||
h -= spellbonuses.inhibitmelee;
|
||||
|
||||
else
|
||||
h -=((100+h)*spellbonuses.inhibitmelee/100);
|
||||
}
|
||||
|
||||
|
||||
Haste = h;
|
||||
return(Haste);
|
||||
return(Haste);
|
||||
}
|
||||
|
||||
//The AA multipliers are set to be 5, but were 2 on WR
|
||||
@@ -1487,12 +1487,12 @@ int16 Client::CalcMR()
|
||||
default:
|
||||
MR = 20;
|
||||
}
|
||||
|
||||
|
||||
MR += itembonuses.MR + spellbonuses.MR + aabonuses.MR;
|
||||
|
||||
|
||||
if(GetClass() == WARRIOR)
|
||||
MR += GetLevel() / 2;
|
||||
|
||||
|
||||
if(MR < 1)
|
||||
MR = 1;
|
||||
|
||||
@@ -1557,21 +1557,21 @@ int16 Client::CalcFR()
|
||||
default:
|
||||
FR = 20;
|
||||
}
|
||||
|
||||
|
||||
int c = GetClass();
|
||||
if(c == RANGER) {
|
||||
FR += 4;
|
||||
|
||||
|
||||
int l = GetLevel();
|
||||
if(l > 49)
|
||||
FR += l - 49;
|
||||
}
|
||||
|
||||
|
||||
FR += itembonuses.FR + spellbonuses.FR + aabonuses.FR;
|
||||
|
||||
|
||||
if(FR < 1)
|
||||
FR = 1;
|
||||
|
||||
|
||||
if(FR > GetMaxFR())
|
||||
FR = GetMaxFR();
|
||||
|
||||
@@ -1633,25 +1633,25 @@ int16 Client::CalcDR()
|
||||
default:
|
||||
DR = 15;
|
||||
}
|
||||
|
||||
|
||||
int c = GetClass();
|
||||
if(c == PALADIN) {
|
||||
DR += 8;
|
||||
|
||||
|
||||
int l = GetLevel();
|
||||
if(l > 49)
|
||||
DR += l - 49;
|
||||
|
||||
} else if(c == SHADOWKNIGHT) {
|
||||
DR += 4;
|
||||
|
||||
|
||||
int l = GetLevel();
|
||||
if(l > 49)
|
||||
DR += l - 49;
|
||||
}
|
||||
|
||||
|
||||
DR += itembonuses.DR + spellbonuses.DR + aabonuses.DR;
|
||||
|
||||
|
||||
if(DR < 1)
|
||||
DR = 1;
|
||||
|
||||
@@ -1716,25 +1716,25 @@ int16 Client::CalcPR()
|
||||
default:
|
||||
PR = 15;
|
||||
}
|
||||
|
||||
|
||||
int c = GetClass();
|
||||
if(c == ROGUE) {
|
||||
PR += 8;
|
||||
|
||||
|
||||
int l = GetLevel();
|
||||
if(l > 49)
|
||||
PR += l - 49;
|
||||
|
||||
} else if(c == SHADOWKNIGHT) {
|
||||
PR += 4;
|
||||
|
||||
|
||||
int l = GetLevel();
|
||||
if(l > 49)
|
||||
PR += l - 49;
|
||||
}
|
||||
|
||||
|
||||
PR += itembonuses.PR + spellbonuses.PR + aabonuses.PR;
|
||||
|
||||
|
||||
if(PR < 1)
|
||||
PR = 1;
|
||||
|
||||
@@ -1799,18 +1799,18 @@ int16 Client::CalcCR()
|
||||
default:
|
||||
CR = 25;
|
||||
}
|
||||
|
||||
|
||||
int c = GetClass();
|
||||
if(c == RANGER) {
|
||||
CR += 4;
|
||||
|
||||
|
||||
int l = GetLevel();
|
||||
if(l > 49)
|
||||
CR += l - 49;
|
||||
}
|
||||
|
||||
|
||||
CR += itembonuses.CR + spellbonuses.CR + aabonuses.CR;
|
||||
|
||||
|
||||
if(CR < 1)
|
||||
CR = 1;
|
||||
|
||||
@@ -1823,7 +1823,7 @@ int16 Client::CalcCR()
|
||||
int16 Client::CalcCorrup()
|
||||
{
|
||||
Corrup = GetBaseCorrup() + itembonuses.Corrup + spellbonuses.Corrup + aabonuses.Corrup;
|
||||
|
||||
|
||||
if(Corrup > GetMaxCorrup())
|
||||
Corrup = GetMaxCorrup();
|
||||
|
||||
@@ -1838,13 +1838,13 @@ int16 Client::CalcATK() {
|
||||
uint16 Mob::GetInstrumentMod(uint16 spell_id) const {
|
||||
if(GetClass() != BARD)
|
||||
return(10);
|
||||
|
||||
|
||||
uint16 effectmod = 10;
|
||||
|
||||
|
||||
//this should never use spell modifiers...
|
||||
//if a spell grants better modifers, they are copied into the item mods
|
||||
//because the spells are supposed to act just like having the intrument.
|
||||
|
||||
|
||||
//item mods are in 10ths of percent increases
|
||||
switch(spells[spell_id].skill) {
|
||||
case PERCUSSION_INSTRUMENTS:
|
||||
@@ -1899,7 +1899,7 @@ uint16 Mob::GetInstrumentMod(uint16 spell_id) const {
|
||||
effectmod = 10;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if(spells[spell_id].skill == SINGING)
|
||||
{
|
||||
effectmod += 2*GetAA(aaSingingMastery);
|
||||
@@ -1916,24 +1916,24 @@ uint16 Mob::GetInstrumentMod(uint16 spell_id) const {
|
||||
|
||||
if(effectmod < 10)
|
||||
effectmod = 10;
|
||||
|
||||
|
||||
_log(SPELLS__BARDS, "%s::GetInstrumentMod() spell=%d mod=%d\n", GetName(), spell_id, effectmod);
|
||||
|
||||
|
||||
return(effectmod);
|
||||
}
|
||||
|
||||
void Client::CalcMaxEndurance()
|
||||
{
|
||||
max_end = CalcBaseEndurance() + spellbonuses.Endurance + itembonuses.Endurance;
|
||||
|
||||
|
||||
if (max_end < 0) {
|
||||
max_end = 0;
|
||||
}
|
||||
|
||||
|
||||
if (cur_end > max_end) {
|
||||
cur_end = max_end;
|
||||
}
|
||||
|
||||
|
||||
int end_perc_cap = spellbonuses.EndPercCap;
|
||||
if(end_perc_cap) {
|
||||
int curEnd_cap = (max_end * end_perc_cap) / 100;
|
||||
@@ -1966,7 +1966,7 @@ int32 Client::CalcBaseEndurance()
|
||||
ConvertedStats = Stats;
|
||||
}
|
||||
|
||||
if (GetLevel() < 41) {
|
||||
if (GetLevel() < 41) {
|
||||
sta_end = (GetLevel() * 75 * ConvertedStats / 1000);
|
||||
base_endurance = (GetLevel() * 15);
|
||||
}
|
||||
@@ -1988,24 +1988,24 @@ int32 Client::CalcBaseEndurance()
|
||||
int at_most_800 = Stats;
|
||||
if(at_most_800 > 800)
|
||||
at_most_800 = 800;
|
||||
|
||||
|
||||
int Bonus400to800 = 0;
|
||||
int HalfBonus400to800 = 0;
|
||||
int Bonus800plus = 0;
|
||||
int HalfBonus800plus = 0;
|
||||
|
||||
|
||||
int BonusUpto800 = int( at_most_800 / 4 ) ;
|
||||
if(Stats > 400) {
|
||||
Bonus400to800 = int( (at_most_800 - 400) / 4 );
|
||||
HalfBonus400to800 = int( max( ( at_most_800 - 400 ), 0 ) / 8 );
|
||||
|
||||
|
||||
if(Stats > 800) {
|
||||
Bonus800plus = int( (Stats - 800) / 8 ) * 2;
|
||||
HalfBonus800plus = int( (Stats - 800) / 16 );
|
||||
}
|
||||
}
|
||||
int bonus_sum = BonusUpto800 + Bonus400to800 + HalfBonus400to800 + Bonus800plus + HalfBonus800plus;
|
||||
|
||||
|
||||
base_end = LevelBase;
|
||||
|
||||
//take all of the sums from above, then multiply by level*0.075
|
||||
@@ -2023,7 +2023,7 @@ int32 Client::CalcEnduranceRegen() {
|
||||
|
||||
int32 Client::CalcEnduranceRegenCap() {
|
||||
int cap = (RuleI(Character, ItemEnduranceRegenCap) + itembonuses.HeroicSTR/25 + itembonuses.HeroicDEX/25 + itembonuses.HeroicAGI/25 + itembonuses.HeroicSTA/25);
|
||||
|
||||
|
||||
return (cap * RuleI(Character, EnduranceRegenMultiplier) / 100);
|
||||
}
|
||||
|
||||
|
||||
+603
-603
File diff suppressed because it is too large
Load Diff
@@ -223,12 +223,12 @@
|
||||
void Handle_OP_AutoFire(const EQApplicationPacket *app);
|
||||
void Handle_OP_Rewind(const EQApplicationPacket *app);
|
||||
void Handle_OP_RaidCommand(const EQApplicationPacket *app);
|
||||
void Handle_OP_Translocate(const EQApplicationPacket *app);
|
||||
void Handle_OP_Sacrifice(const EQApplicationPacket *app);
|
||||
void Handle_OP_Translocate(const EQApplicationPacket *app);
|
||||
void Handle_OP_Sacrifice(const EQApplicationPacket *app);
|
||||
void Handle_OP_AcceptNewTask(const EQApplicationPacket *app);
|
||||
void Handle_OP_CancelTask(const EQApplicationPacket *app);
|
||||
void Handle_OP_TaskHistoryRequest(const EQApplicationPacket *app);
|
||||
void Handle_OP_KeyRing(const EQApplicationPacket *app);
|
||||
void Handle_OP_KeyRing(const EQApplicationPacket *app);
|
||||
void Handle_OP_FriendsWho(const EQApplicationPacket *app);
|
||||
void Handle_OP_Bandolier(const EQApplicationPacket *app);
|
||||
void Handle_OP_PopupResponse(const EQApplicationPacket *app);
|
||||
@@ -247,7 +247,7 @@
|
||||
void Handle_OP_PVPLeaderBoardDetailsRequest(const EQApplicationPacket *app);
|
||||
void Handle_OP_AdventureMerchantSell(const EQApplicationPacket *app);
|
||||
void Handle_OP_AdventureStatsRequest(const EQApplicationPacket *app);
|
||||
void Handle_OP_AdventureLeaderboardRequest(const EQApplicationPacket *app);
|
||||
void Handle_OP_AdventureLeaderboardRequest(const EQApplicationPacket *app);
|
||||
void Handle_OP_RespawnWindow(const EQApplicationPacket *app);
|
||||
void Handle_OP_GroupUpdate(const EQApplicationPacket *app);
|
||||
void Handle_OP_SetStartCity(const EQApplicationPacket *app);
|
||||
|
||||
+135
-135
@@ -1,20 +1,20 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2003 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2003 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
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
client_process.cpp:
|
||||
Handles client login sequence and packets sent from client to zone
|
||||
*/
|
||||
@@ -36,7 +36,7 @@
|
||||
#define vsnprintf _vsnprintf
|
||||
#endif
|
||||
#define strncasecmp _strnicmp
|
||||
#define strcasecmp _stricmp
|
||||
#define strcasecmp _stricmp
|
||||
#else
|
||||
#include <pthread.h>
|
||||
#include <sys/socket.h>
|
||||
@@ -83,11 +83,11 @@ bool Client::Process() {
|
||||
|
||||
if(Connected() || IsLD())
|
||||
{
|
||||
// try to send all packets that weren't sent before
|
||||
// try to send all packets that weren't sent before
|
||||
if(!IsLD() && zoneinpacket_timer.Check()){
|
||||
SendAllPackets();
|
||||
}
|
||||
|
||||
|
||||
#ifdef PACKET_UPDATE_MANAGER
|
||||
update_manager.Process();
|
||||
#endif
|
||||
@@ -146,12 +146,12 @@ bool Client::Process() {
|
||||
if(RespawnFromHoverTimer.Check())
|
||||
HandleRespawnFromHover(0);
|
||||
}
|
||||
|
||||
|
||||
if(IsTracking() && (GetClientVersion() >= EQClientSoD) && TrackingTimer.Check())
|
||||
DoTracking();
|
||||
|
||||
if(hpupdate_timer.Check())
|
||||
SendHPUpdate();
|
||||
SendHPUpdate();
|
||||
|
||||
if(mana_timer.Check())
|
||||
SendManaUpdatePacket();
|
||||
@@ -163,7 +163,7 @@ bool Client::Process() {
|
||||
m_pp.y = m_pp.binds[0].y;
|
||||
m_pp.z = m_pp.binds[0].z;
|
||||
Save();
|
||||
|
||||
|
||||
Group *mygroup = GetGroup();
|
||||
if (mygroup) // && zone.GetZoneID() != m_pp.binds[0].zoneId
|
||||
{
|
||||
@@ -177,7 +177,7 @@ bool Client::Process() {
|
||||
}
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
||||
if(charm_update_timer.Check())
|
||||
{
|
||||
CalcItemScale();
|
||||
@@ -212,12 +212,12 @@ bool Client::Process() {
|
||||
}
|
||||
instalog = true;
|
||||
}
|
||||
|
||||
|
||||
if (IsStunned() && stunned_timer.Check()) {
|
||||
this->stunned = false;
|
||||
this->stunned_timer.Disable();
|
||||
}
|
||||
|
||||
|
||||
if(!m_CheatDetectMoved)
|
||||
{
|
||||
m_TimeSinceLastPositionCheck = Timer::GetCurrentTime();
|
||||
@@ -232,7 +232,7 @@ bool Client::Process() {
|
||||
} else {
|
||||
song_target = entity_list.GetMob(bardsong_target_id);
|
||||
}
|
||||
|
||||
|
||||
if (song_target == nullptr) {
|
||||
InterruptSpell(SONG_ENDS_ABRUPTLY, 0x121, bardsong);
|
||||
} else {
|
||||
@@ -253,12 +253,12 @@ bool Client::Process() {
|
||||
CheckMercSuspendTimer();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(IsAIControlled())
|
||||
AI_Process();
|
||||
|
||||
|
||||
if (bindwound_timer.Check() && bindwound_target != 0) {
|
||||
BindWound(bindwound_target, false);
|
||||
BindWound(bindwound_target, false);
|
||||
}
|
||||
|
||||
if(KarmaUpdateTimer)
|
||||
@@ -277,7 +277,7 @@ bool Client::Process() {
|
||||
qGlobals->PurgeExpiredGlobals();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool may_use_attacks = false;
|
||||
/*
|
||||
Things which prevent us from attacking:
|
||||
@@ -290,11 +290,11 @@ bool Client::Process() {
|
||||
*/
|
||||
if(auto_attack) {
|
||||
if(!IsAIControlled() && !dead
|
||||
&& !(spellend_timer.Enabled() && (spells[casting_spell_id].classes[7] < 1 && spells[casting_spell_id].classes[7] > 65))
|
||||
&& !(spellend_timer.Enabled() && (spells[casting_spell_id].classes[7] < 1 && spells[casting_spell_id].classes[7] > 65))
|
||||
&& !IsStunned() && !IsFeared() && !IsMezzed() && GetAppearance() != eaDead && !IsMeleeDisabled()
|
||||
)
|
||||
may_use_attacks = true;
|
||||
|
||||
|
||||
if(may_use_attacks && ranged_timer.Enabled()) {
|
||||
//if the range timer is enabled, we need to consider it
|
||||
if(!ranged_timer.Check(false)) {
|
||||
@@ -342,13 +342,13 @@ bool Client::Process() {
|
||||
}
|
||||
else
|
||||
ranged_timer.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Mob *auto_attack_target = GetTarget();
|
||||
if (auto_attack && auto_attack_target != nullptr && may_use_attacks && attack_timer.Check())
|
||||
if (auto_attack && auto_attack_target != nullptr && may_use_attacks && attack_timer.Check())
|
||||
{
|
||||
//check if change
|
||||
//only check on primary attack.. sorry offhand you gotta wait!
|
||||
@@ -390,18 +390,18 @@ bool Client::Process() {
|
||||
los_status = false;
|
||||
}
|
||||
|
||||
if (!CombatRange(auto_attack_target))
|
||||
if (!CombatRange(auto_attack_target))
|
||||
{
|
||||
//duplicate message not wanting to see it.
|
||||
//Message_StringID(MT_TooFarAway,TARGET_TOO_FAR);
|
||||
}
|
||||
else if (auto_attack_target == this)
|
||||
else if (auto_attack_target == this)
|
||||
{
|
||||
Message_StringID(MT_TooFarAway,TRY_ATTACKING_SOMEONE);
|
||||
}
|
||||
else if (!los_status)
|
||||
{
|
||||
//you can't see your target
|
||||
//you can't see your target
|
||||
}
|
||||
else if (auto_attack_target->GetHP() > -10) // -10 so we can watch people bleed in PvP
|
||||
{
|
||||
@@ -409,14 +409,14 @@ bool Client::Process() {
|
||||
{
|
||||
entity_list.AEAttack(this, 30);
|
||||
} else {
|
||||
Attack(auto_attack_target, 13); // Kaiyodo - added attacking hand to arguments
|
||||
Attack(auto_attack_target, 13); // Kaiyodo - added attacking hand to arguments
|
||||
}
|
||||
ItemInst *wpn = GetInv().GetItem(SLOT_PRIMARY);
|
||||
TryWeaponProc(wpn, auto_attack_target, 13);
|
||||
|
||||
|
||||
bool tripleAttackSuccess = false;
|
||||
if( auto_attack_target && CanThisClassDoubleAttack() ) {
|
||||
|
||||
|
||||
CheckIncreaseSkill(DOUBLE_ATTACK, auto_attack_target, -10);
|
||||
if(CheckDoubleAttack()) {
|
||||
//should we allow rampage on double attack?
|
||||
@@ -426,42 +426,42 @@ bool Client::Process() {
|
||||
Attack(auto_attack_target, 13, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//triple attack: rangers, monks, warriors, berserkers over level 60
|
||||
if((((GetClass() == MONK || GetClass() == WARRIOR || GetClass() == RANGER || GetClass() == BERSERKER)
|
||||
&& GetLevel() >= 60) || SpecAttacks[SPECATK_TRIPLE])
|
||||
&& CheckDoubleAttack(true))
|
||||
&& CheckDoubleAttack(true))
|
||||
{
|
||||
tripleAttackSuccess = true;
|
||||
Attack(auto_attack_target, 13, false);
|
||||
}
|
||||
|
||||
|
||||
//quad attack, does this belong here??
|
||||
if(SpecAttacks[SPECATK_QUAD] && CheckDoubleAttack(true))
|
||||
if(SpecAttacks[SPECATK_QUAD] && CheckDoubleAttack(true))
|
||||
{
|
||||
Attack(auto_attack_target, 13, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Live AA - Flurry, Rapid Strikes ect (Flurry does not require Triple Attack).
|
||||
int16 flurrychance = aabonuses.FlurryChance + spellbonuses.FlurryChance + itembonuses.FlurryChance;
|
||||
|
||||
if (auto_attack_target && flurrychance)
|
||||
{
|
||||
if(MakeRandomInt(0, 100) < flurrychance)
|
||||
if(MakeRandomInt(0, 100) < flurrychance)
|
||||
{
|
||||
Message_StringID(MT_NPCFlurry, 128);
|
||||
Attack(auto_attack_target, 13, false);
|
||||
Attack(auto_attack_target, 13, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int16 ExtraAttackChanceBonus = spellbonuses.ExtraAttackChance + itembonuses.ExtraAttackChance + aabonuses.ExtraAttackChance;
|
||||
|
||||
if (auto_attack_target && ExtraAttackChanceBonus) {
|
||||
ItemInst *wpn = GetInv().GetItem(SLOT_PRIMARY);
|
||||
if(wpn){
|
||||
if(wpn->GetItem()->ItemType == ItemType2HS ||
|
||||
if(wpn->GetItem()->ItemType == ItemType2HS ||
|
||||
wpn->GetItem()->ItemType == ItemType2HB ||
|
||||
wpn->GetItem()->ItemType == ItemType2HPierce )
|
||||
{
|
||||
@@ -474,7 +474,7 @@ bool Client::Process() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (GetClass() == WARRIOR || GetClass() == BERSERKER) {
|
||||
if(!dead && !berserk && this->GetHPRatio() < 30) {
|
||||
entity_list.MessageClose_StringID(this, false, 200, 0, BERSERK_START, GetName());
|
||||
@@ -485,10 +485,10 @@ bool Client::Process() {
|
||||
this->berserk = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(auto_attack && may_use_attacks && auto_attack_target != nullptr
|
||||
&& CanThisClassDualWield() && attack_dw_timer.Check())
|
||||
{
|
||||
&& CanThisClassDualWield() && attack_dw_timer.Check())
|
||||
{
|
||||
// Range check
|
||||
if(!CombatRange(auto_attack_target)) {
|
||||
// this is a duplicate message don't use it.
|
||||
@@ -500,11 +500,11 @@ bool Client::Process() {
|
||||
}
|
||||
else if (!los_status)
|
||||
{
|
||||
//you can't see your target
|
||||
//you can't see your target
|
||||
}
|
||||
else if(auto_attack_target->GetHP() > -10) {
|
||||
float DualWieldProbability = 0.0f;
|
||||
|
||||
|
||||
int16 Ambidexterity = aabonuses.Ambidexterity + spellbonuses.Ambidexterity + itembonuses.Ambidexterity;
|
||||
DualWieldProbability = (GetSkill(DUAL_WIELD) + GetLevel() + Ambidexterity) / 400.0f; // 78.0 max
|
||||
int16 DWBonus = spellbonuses.DualWieldChance + itembonuses.DualWieldChance;
|
||||
@@ -520,7 +520,7 @@ bool Client::Process() {
|
||||
}
|
||||
ItemInst *wpn = GetInv().GetItem(SLOT_SECONDARY);
|
||||
TryWeaponProc(wpn, auto_attack_target, 14);
|
||||
|
||||
|
||||
if( CanThisClassDoubleAttack() && CheckDoubleAttack()) {
|
||||
if(CheckAAEffect(aaEffectRampage)) {
|
||||
entity_list.AEAttack(this, 30, 14);
|
||||
@@ -532,7 +532,7 @@ bool Client::Process() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
adverrorinfo = 2;
|
||||
if (position_timer.Check()) {
|
||||
if (IsAIControlled())
|
||||
@@ -548,7 +548,7 @@ bool Client::Process() {
|
||||
SendPosUpdate(2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Send a position packet every 8 seconds - if not done, other clients
|
||||
// see this char disappear after 10-12 seconds of inactivity
|
||||
if (position_timer_counter >= 36) { // Approx. 4 ticks per second
|
||||
@@ -562,7 +562,7 @@ bool Client::Process() {
|
||||
position_timer_counter++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(HasVirus()) {
|
||||
if(viral_timer.Check()) {
|
||||
viral_timer_counter++;
|
||||
@@ -577,7 +577,7 @@ bool Client::Process() {
|
||||
if(viral_timer_counter > 999)
|
||||
viral_timer_counter = 0;
|
||||
}
|
||||
|
||||
|
||||
if(spellbonuses.GravityEffect == 1) {
|
||||
if(gravity_timer.Check())
|
||||
DoGravityEffect();
|
||||
@@ -608,7 +608,7 @@ bool Client::Process() {
|
||||
shield_timer.Disable();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
adverrorinfo = 3;
|
||||
SpellProcess();
|
||||
adverrorinfo = 4;
|
||||
@@ -627,15 +627,15 @@ bool Client::Process() {
|
||||
DoEnduranceRegen();
|
||||
BuffProcess();
|
||||
DoStaminaUpdate();
|
||||
|
||||
|
||||
if(tribute_timer.Check()) {
|
||||
ToggleTribute(true); //re-activate the tribute.
|
||||
}
|
||||
|
||||
|
||||
if (fishing_timer.Check()) {
|
||||
GoFish();
|
||||
}
|
||||
|
||||
|
||||
if (autosave_timer.Check()) {
|
||||
Save(0);
|
||||
}
|
||||
@@ -652,27 +652,27 @@ bool Client::Process() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (client_state == CLIENT_KICKED) {
|
||||
Save();
|
||||
OnDisconnect(true);
|
||||
cout << "Client disconnected (cs=k): " << GetName() << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (client_state == DISCONNECTED) {
|
||||
OnDisconnect(true);
|
||||
cout << "Client disconnected (cs=d): " << GetName() << endl;
|
||||
database.SetMQDetectionFlag(this->AccountName(), GetName(), "/MQInstantCamp: Possible instant camp disconnect.", zone->GetShortName());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (client_state == CLIENT_ERROR) {
|
||||
OnDisconnect(true);
|
||||
cout << "Client disconnected (cs=e): " << GetName() << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (client_state != CLIENT_LINKDEAD && !eqs->CheckState(ESTABLISHED)) {
|
||||
OnDisconnect(true);
|
||||
cout << "Client linkdead: " << name << endl;
|
||||
@@ -696,14 +696,14 @@ bool Client::Process() {
|
||||
|
||||
/************ Get all packets from packet manager out queue and process them ************/
|
||||
adverrorinfo = 5;
|
||||
|
||||
|
||||
EQApplicationPacket *app = 0;
|
||||
// if(eqs->GetState()==CLOSING && eqs->CheckActive())
|
||||
if(eqs->CheckState(CLOSING))
|
||||
{
|
||||
//eqs->Close();
|
||||
//return false;
|
||||
//handled below
|
||||
//handled below
|
||||
} else {
|
||||
while(ret && (app = (EQApplicationPacket *)eqs->PopPacket())) {
|
||||
if(app)
|
||||
@@ -711,7 +711,7 @@ bool Client::Process() {
|
||||
safe_delete(app);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef REVERSE_AGGRO
|
||||
//At this point, we are still connected, everything important has taken
|
||||
//place, now check to see if anybody wants to aggro us.
|
||||
@@ -719,8 +719,8 @@ bool Client::Process() {
|
||||
if(ret && !GetFeigned() && scanarea_timer.Check()) {
|
||||
entity_list.CheckClientAggro(this);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
if (client_state != CLIENT_LINKDEAD && (client_state == CLIENT_ERROR || client_state == DISCONNECTED || client_state == CLIENT_KICKED || !eqs->CheckState(ESTABLISHED))) {
|
||||
//client logged out or errored out
|
||||
//ResetTrade();
|
||||
@@ -747,7 +747,7 @@ bool Client::Process() {
|
||||
entity_list.MessageGroup(this,true,15,"%s left the zone.",GetName());
|
||||
mygroup->MemberZoned(this);
|
||||
}
|
||||
|
||||
|
||||
adverrorinfo = 813;
|
||||
}
|
||||
Raid *myraid = entity_list.GetRaidByClient(this);
|
||||
@@ -778,7 +778,7 @@ bool Client::Process() {
|
||||
entity_list.ClearZoneFeignAggro(this);
|
||||
Message(0,"Your enemies have forgotten you!");
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -793,7 +793,7 @@ void Client::OnDisconnect(bool hard_disconnect) {
|
||||
MyRaid->MemberZoned(this);
|
||||
|
||||
if(this->IsClient()){
|
||||
if(parse->PlayerHasQuestSub("EVENT_DISCONNECT")) {
|
||||
if(parse->PlayerHasQuestSub("EVENT_DISCONNECT")) {
|
||||
parse->EventPlayer(EVENT_DISCONNECT, this, "", 0);
|
||||
}
|
||||
}
|
||||
@@ -819,10 +819,10 @@ void Client::OnDisconnect(bool hard_disconnect) {
|
||||
|
||||
//remove ourself from all proximities
|
||||
ClearAllProximities();
|
||||
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_LogoutReply);
|
||||
FastQueuePacket(&outapp);
|
||||
|
||||
|
||||
Disconnect();
|
||||
}
|
||||
|
||||
@@ -851,7 +851,7 @@ void Client::BulkSendInventoryItems() {
|
||||
|
||||
// Where are cursor buffer items processed? They need to be validated as well... -U
|
||||
|
||||
bool deletenorent = database.NoRentExpired(GetName());
|
||||
bool deletenorent = database.NoRentExpired(GetName());
|
||||
if(deletenorent){ RemoveNoRent(false); } //client was offline for more than 30 minutes, delete no rent items
|
||||
|
||||
RemoveDuplicateLore(false);
|
||||
@@ -893,7 +893,7 @@ void Client::BulkSendInventoryItems() {
|
||||
}
|
||||
|
||||
// Power Source
|
||||
if(GetClientVersion() >= EQClientSoF) {
|
||||
if(GetClientVersion() >= EQClientSoF) {
|
||||
const ItemInst* inst = m_inv[9999];
|
||||
if(inst) {
|
||||
string packet = inst->Serialize(9999);
|
||||
@@ -957,7 +957,7 @@ void Client::BulkSendInventoryItems()
|
||||
SendItemPacket(slot_id, inst, ItemPacketCharInventory);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Shared Bank items
|
||||
for (slot_id=2500; slot_id<=2501; slot_id++) {
|
||||
const ItemInst* inst = m_inv[slot_id];
|
||||
@@ -965,10 +965,10 @@ void Client::BulkSendInventoryItems()
|
||||
SendItemPacket(slot_id, inst, ItemPacketCharInventory);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// LINKDEAD TRADE ITEMS
|
||||
// If player went LD during a trade, they have items in the trade inventory
|
||||
// slots. These items are now being put into their inventory (then queue up on cursor)
|
||||
// slots. These items are now being put into their inventory (then queue up on cursor)
|
||||
for (int16 trade_slot_id=3000; trade_slot_id<=3007; trade_slot_id++) {
|
||||
const ItemInst* inst = m_inv[slot_id];
|
||||
if (inst) {
|
||||
@@ -982,7 +982,7 @@ void Client::BulkSendInventoryItems()
|
||||
|
||||
void Client::BulkSendMerchantInventory(int merchant_id, int npcid) {
|
||||
const Item_Struct* handyitem = nullptr;
|
||||
uint32 numItemSlots=80; //The max number of items passed in the transaction.
|
||||
uint32 numItemSlots=80; //The max number of items passed in the transaction.
|
||||
const Item_Struct *item;
|
||||
std::list<MerchantList> merlist = zone->merchanttable[merchant_id];
|
||||
std::list<MerchantList>::const_iterator itr;
|
||||
@@ -1000,17 +1000,17 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) {
|
||||
uint8 handychance = 0;
|
||||
for(itr = merlist.begin();itr != merlist.end() && i<numItemSlots;itr++){
|
||||
MerchantList ml = *itr;
|
||||
if(GetLevel() < ml.level_required) {
|
||||
continue;
|
||||
}
|
||||
if(GetLevel() < ml.level_required) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int32 fac = merch ? merch->GetPrimaryFaction() : 0;
|
||||
if(fac != 0 && GetModCharacterFactionLevel(fac) < ml.faction_required) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int32 fac = merch ? merch->GetPrimaryFaction() : 0;
|
||||
if(fac != 0 && GetModCharacterFactionLevel(fac) < ml.faction_required) {
|
||||
continue;
|
||||
}
|
||||
|
||||
handychance = MakeRandomInt(0, merlist.size() + tmp_merlist.size() - 1 );
|
||||
|
||||
|
||||
item = database.GetItem(ml.item);
|
||||
if(item) {
|
||||
if(handychance==0)
|
||||
@@ -1099,17 +1099,17 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) {
|
||||
break;
|
||||
default:
|
||||
greet_id=MERCHANT_HANDY_ITEM4;
|
||||
}
|
||||
}
|
||||
sprintf(handy_id,"%i",greet_id);
|
||||
|
||||
|
||||
if(greet_id!=MERCHANT_GREETING)
|
||||
Message_StringID(10,GENERIC_STRINGID_SAY,merch->GetCleanName(),handy_id,this->GetName(),handyitem->Name);
|
||||
else
|
||||
else
|
||||
Message_StringID(10,GENERIC_STRINGID_SAY,merch->GetCleanName(),handy_id,this->GetName());
|
||||
|
||||
|
||||
merch->CastToNPC()->FaceTarget(this->CastToMob());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// safe_delete_array(cpi);
|
||||
}
|
||||
|
||||
@@ -1149,12 +1149,12 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I
|
||||
|
||||
if (Action == 1)
|
||||
{
|
||||
// Mark the corpse as rezzed in the database, just in case the corpse has buried, or the zone the
|
||||
// Mark the corpse as rezzed in the database, just in case the corpse has buried, or the zone the
|
||||
// corpse is in has shutdown since the rez spell was cast.
|
||||
database.MarkCorpseAsRezzed(PendingRezzDBID);
|
||||
_log(SPELLS__REZ, "Player %s got a %i Rezz, spellid %i in zone%i, instance id %i",
|
||||
this->name, (uint16)spells[SpellID].base[0],
|
||||
SpellID, ZoneID, InstanceID);
|
||||
_log(SPELLS__REZ, "Player %s got a %i Rezz, spellid %i in zone%i, instance id %i",
|
||||
this->name, (uint16)spells[SpellID].base[0],
|
||||
SpellID, ZoneID, InstanceID);
|
||||
|
||||
this->BuffFadeAll();
|
||||
int SpellEffectDescNum = GetSpellEffectDescNum(SpellID);
|
||||
@@ -1168,16 +1168,16 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I
|
||||
SetMana(GetMaxMana());
|
||||
SetHP(GetMaxHP());
|
||||
}
|
||||
if(spells[SpellID].base[0] < 100 && spells[SpellID].base[0] > 0 && PendingRezzXP > 0)
|
||||
if(spells[SpellID].base[0] < 100 && spells[SpellID].base[0] > 0 && PendingRezzXP > 0)
|
||||
{
|
||||
SetEXP(((int)(GetEXP()+((float)((PendingRezzXP / 100) * spells[SpellID].base[0])))),
|
||||
GetAAXP(),true);
|
||||
GetAAXP(),true);
|
||||
}
|
||||
else if (spells[SpellID].base[0] == 100 && PendingRezzXP > 0) {
|
||||
SetEXP((GetEXP() + PendingRezzXP), GetAAXP(), true);
|
||||
}
|
||||
|
||||
//Was sending the packet back to initiate client zone...
|
||||
//Was sending the packet back to initiate client zone...
|
||||
//but that could be abusable, so lets go through proper channels
|
||||
MovePC(ZoneID, InstanceID, x, y, z, GetHeading(), 0, ZoneSolicited);
|
||||
entity_list.RefreshClientXTargets(this);
|
||||
@@ -1206,9 +1206,9 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app)
|
||||
DumpPacket(app);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const MemorizeSpell_Struct* memspell = (const MemorizeSpell_Struct*) app->pBuffer;
|
||||
|
||||
|
||||
if(!IsValidSpell(memspell->spell_id))
|
||||
{
|
||||
Message(13, "Unexpected error: spell id out of range");
|
||||
@@ -1235,13 +1235,13 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app)
|
||||
if(inst && inst->IsType(ItemClassCommon))
|
||||
{
|
||||
const Item_Struct* item = inst->GetItem();
|
||||
|
||||
|
||||
if(item && item->Scroll.Effect == (int32)(memspell->spell_id))
|
||||
{
|
||||
ScribeSpell(memspell->spell_id, memspell->slot);
|
||||
DeleteItemInInventory(SLOT_CURSOR, 1, true);
|
||||
}
|
||||
else
|
||||
else
|
||||
Message(0,"Scribing spell: inst exists but item does not or spell ids do not match.");
|
||||
}
|
||||
else
|
||||
@@ -1333,7 +1333,7 @@ void Client::OPMoveCoin(const EQApplicationPacket* app)
|
||||
{
|
||||
case -1: // destroy
|
||||
{
|
||||
// I don't think you can move coin from the void,
|
||||
// I don't think you can move coin from the void,
|
||||
// but need to check this
|
||||
break;
|
||||
}
|
||||
@@ -1374,7 +1374,7 @@ void Client::OPMoveCoin(const EQApplicationPacket* app)
|
||||
if(!banker || distance > USE_NPC_RANGE2)
|
||||
{
|
||||
char *hacked_string = nullptr;
|
||||
MakeAnyLenString(&hacked_string, "Player tried to make use of a banker(coin move) but %s is non-existant or too far away (%u units).",
|
||||
MakeAnyLenString(&hacked_string, "Player tried to make use of a banker(coin move) but %s is non-existant or too far away (%u units).",
|
||||
banker ? banker->GetName() : "UNKNOWN NPC", distance);
|
||||
database.SetMQDetectionFlag(AccountName(), GetName(), hacked_string, zone->GetShortName());
|
||||
safe_delete_array(hacked_string);
|
||||
@@ -1406,7 +1406,7 @@ void Client::OPMoveCoin(const EQApplicationPacket* app)
|
||||
if(!banker || distance > USE_NPC_RANGE2)
|
||||
{
|
||||
char *hacked_string = nullptr;
|
||||
MakeAnyLenString(&hacked_string, "Player tried to make use of a banker(shared coin move) but %s is non-existant or too far away (%u units).",
|
||||
MakeAnyLenString(&hacked_string, "Player tried to make use of a banker(shared coin move) but %s is non-existant or too far away (%u units).",
|
||||
banker ? banker->GetName() : "UNKNOWN NPC", distance);
|
||||
database.SetMQDetectionFlag(AccountName(), GetName(), hacked_string, zone->GetShortName());
|
||||
safe_delete_array(hacked_string);
|
||||
@@ -1462,7 +1462,7 @@ void Client::OPMoveCoin(const EQApplicationPacket* app)
|
||||
if(!banker || distance > USE_NPC_RANGE2)
|
||||
{
|
||||
char *hacked_string = nullptr;
|
||||
MakeAnyLenString(&hacked_string, "Player tried to make use of a banker(coin move) but %s is non-existant or too far away (%u units).",
|
||||
MakeAnyLenString(&hacked_string, "Player tried to make use of a banker(coin move) but %s is non-existant or too far away (%u units).",
|
||||
banker ? banker->GetName() : "UNKNOWN NPC", distance);
|
||||
database.SetMQDetectionFlag(AccountName(), GetName(), hacked_string, zone->GetShortName());
|
||||
safe_delete_array(hacked_string);
|
||||
@@ -1506,7 +1506,7 @@ void Client::OPMoveCoin(const EQApplicationPacket* app)
|
||||
if(!banker || distance > USE_NPC_RANGE2)
|
||||
{
|
||||
char *hacked_string = nullptr;
|
||||
MakeAnyLenString(&hacked_string, "Player tried to make use of a banker(shared coin move) but %s is non-existant or too far away (%u units).",
|
||||
MakeAnyLenString(&hacked_string, "Player tried to make use of a banker(shared coin move) but %s is non-existant or too far away (%u units).",
|
||||
banker ? banker->GetName() : "UNKNOWN NPC", distance);
|
||||
database.SetMQDetectionFlag(AccountName(), GetName(), hacked_string, zone->GetShortName());
|
||||
safe_delete_array(hacked_string);
|
||||
@@ -1539,7 +1539,7 @@ void Client::OPMoveCoin(const EQApplicationPacket* app)
|
||||
// now we should have a from_bucket, a to_bucket, an amount_to_take
|
||||
// and an amount_to_add
|
||||
|
||||
// now we actually take it from the from bucket. if there's an error
|
||||
// now we actually take it from the from bucket. if there's an error
|
||||
// with the destination slot, they lose their money
|
||||
*from_bucket -= amount_to_take;
|
||||
// why are intentionally inducing a crash here rather than letting the code attempt to stumble on?
|
||||
@@ -1555,7 +1555,7 @@ void Client::OPMoveCoin(const EQApplicationPacket* app)
|
||||
{
|
||||
if (to_bucket == &m_pp.platinum_shared || from_bucket == &m_pp.platinum_shared)
|
||||
{
|
||||
if (from_bucket == &m_pp.platinum_shared)
|
||||
if (from_bucket == &m_pp.platinum_shared)
|
||||
amount_to_add = 0 - amount_to_take;
|
||||
|
||||
database.SetSharedPlatinum(AccountID(),amount_to_add);
|
||||
@@ -1572,7 +1572,7 @@ void Client::OPMoveCoin(const EQApplicationPacket* app)
|
||||
Mob* with = trade->With();
|
||||
if (with)
|
||||
with->trade->state = Trading;
|
||||
|
||||
|
||||
Client* recipient = trader->CastToClient();
|
||||
recipient->Message(15, "%s adds some coins to the trade.", GetName());
|
||||
recipient->Message(15, "The total trade is: %i PP, %i GP, %i SP, %i CP",
|
||||
@@ -1604,27 +1604,27 @@ void Client::OPGMTraining(const EQApplicationPacket *app)
|
||||
|
||||
if(!pTrainer || !pTrainer->IsNPC() || pTrainer->GetClass() < WARRIORGM || pTrainer->GetClass() > BERSERKERGM)
|
||||
return;
|
||||
|
||||
|
||||
//you can only use your own trainer, client enforces this, but why trust it
|
||||
int trains_class = pTrainer->GetClass() - (WARRIORGM - WARRIOR);
|
||||
if(GetClass() != trains_class)
|
||||
return;
|
||||
|
||||
|
||||
//you have to be somewhat close to a trainer to be properly using them
|
||||
if(DistNoRoot(*pTrainer) > USE_NPC_RANGE2)
|
||||
return;
|
||||
|
||||
SkillType sk;
|
||||
for (sk = _1H_BLUNT; sk <= HIGHEST_SKILL; sk = (SkillType)(sk+1)) {
|
||||
SkillType sk;
|
||||
for (sk = _1H_BLUNT; sk <= HIGHEST_SKILL; sk = (SkillType)(sk+1)) {
|
||||
if(sk == TINKERING && GetRace() != GNOME) {
|
||||
gmtrain->skills[sk] = 0; //Non gnomes can't tinker!
|
||||
} else {
|
||||
gmtrain->skills[sk] = GetMaxSkillAfterSpecializationRules(sk, MaxSkill(sk, GetClass(), RuleI(Character, MaxLevel)));
|
||||
gmtrain->skills[sk] = GetMaxSkillAfterSpecializationRules(sk, MaxSkill(sk, GetClass(), RuleI(Character, MaxLevel)));
|
||||
//this is the highest level that the trainer can train you to, this is enforced clientside so we can't just
|
||||
//Set it to 1 with CanHaveSkill or you wont be able to train past 1.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
uchar ending[]={0x34,0x87,0x8a,0x3F,0x01
|
||||
,0xC9,0xC9,0xC9,0xC9,0xC9,0xC9,0xC9,0xC9,0xC9,0xC9,0xC9,0xC9,0xC9,0xC9,0xC9,0xC9
|
||||
,0xC9,0xC9,0xC9,0xC9,0xC9,0xC9,0xC9,0xC9,0xC9,0xC9,0xC9,0xC9,0xC9,0xC9,0xC9,0xC9
|
||||
@@ -1649,7 +1649,7 @@ void Client::OPGMEndTraining(const EQApplicationPacket *app)
|
||||
Mob* pTrainer = entity_list.GetMob(p->npcid);
|
||||
if(!pTrainer || !pTrainer->IsNPC() || pTrainer->GetClass() < WARRIORGM || pTrainer->GetClass() > BERSERKERGM)
|
||||
return;
|
||||
|
||||
|
||||
//you can only use your own trainer, client enforces this, but why trust it
|
||||
int trains_class = pTrainer->GetClass() - (WARRIORGM - WARRIOR);
|
||||
if(GetClass() != trains_class)
|
||||
@@ -1658,7 +1658,7 @@ void Client::OPGMEndTraining(const EQApplicationPacket *app)
|
||||
//you have to be somewhat close to a trainer to be properly using them
|
||||
if(DistNoRoot(*pTrainer) > USE_NPC_RANGE2)
|
||||
return;
|
||||
|
||||
|
||||
// goodbye message
|
||||
if (pTrainer->IsNPC())
|
||||
{
|
||||
@@ -1759,7 +1759,7 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
int MaxSkillValue = MaxSkill(skill);
|
||||
if (skilllevel >= MaxSkillValue)
|
||||
{
|
||||
@@ -1767,7 +1767,7 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app)
|
||||
Message_StringID(13, MORE_SKILLED_THAN_I, pTrainer->GetCleanName());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(gmskill->skill_id >= SPECIALIZE_ABJURE && gmskill->skill_id <= SPECIALIZE_EVOCATION)
|
||||
{
|
||||
int MaxSpecSkill = GetMaxSkillAfterSpecializationRules(skill, MaxSkillValue);
|
||||
@@ -1886,16 +1886,16 @@ void Client::DoHPRegen() {
|
||||
void Client::DoManaRegen() {
|
||||
if (GetMana() >= max_mana)
|
||||
return;
|
||||
|
||||
|
||||
SetMana(GetMana() + CalcManaRegen() + RestRegenMana);
|
||||
SendManaUpdatePacket();
|
||||
}
|
||||
|
||||
|
||||
void Client::DoStaminaUpdate() {
|
||||
void Client::DoStaminaUpdate() {
|
||||
if(!stamina_timer.Check())
|
||||
return;
|
||||
|
||||
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_Stamina, sizeof(Stamina_Struct));
|
||||
Stamina_Struct* sta = (Stamina_Struct*)outapp->pBuffer;
|
||||
|
||||
@@ -1948,7 +1948,7 @@ void Client::DoEnduranceUpkeep() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(upkeep_sum != 0)
|
||||
SetEndurance(GetEndurance() - upkeep_sum);
|
||||
}
|
||||
@@ -1982,7 +1982,7 @@ void Client::CalcRestState() {
|
||||
RestRegenHP = (GetMaxHP() * RuleI(Character, RestRegenPercent) / 100);
|
||||
|
||||
RestRegenMana = (GetMaxMana() * RuleI(Character, RestRegenPercent) / 100);
|
||||
|
||||
|
||||
if(RuleB(Character, RestRegenEndurance))
|
||||
RestRegenEndurance = (GetMaxEndurance() * RuleI(Character, RestRegenPercent) / 100);
|
||||
}
|
||||
@@ -2066,7 +2066,7 @@ void Client::HandleRespawnFromHover(uint32 Option)
|
||||
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_ZonePlayerToBind, sizeof(ZonePlayerToBind_Struct) + 10);
|
||||
ZonePlayerToBind_Struct* gmg = (ZonePlayerToBind_Struct*) outapp->pBuffer;
|
||||
|
||||
|
||||
gmg->bind_zone_id = zone->GetZoneID();
|
||||
gmg->bind_instance_id = zone->GetInstanceID();
|
||||
gmg->x = GetX();
|
||||
@@ -2083,7 +2083,7 @@ void Client::HandleRespawnFromHover(uint32 Option)
|
||||
|
||||
if (corpse && corpse->IsCorpse()) {
|
||||
_log(SPELLS__REZ, "Hover Rez in zone %s for corpse %s",
|
||||
zone->GetShortName(), PendingRezzCorpseName.c_str());
|
||||
zone->GetShortName(), PendingRezzCorpseName.c_str());
|
||||
|
||||
_log(SPELLS__REZ, "Found corpse. Marking corpse as rezzed.");
|
||||
|
||||
@@ -2101,7 +2101,7 @@ void Client::HandleRespawnFromHover(uint32 Option)
|
||||
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_ZonePlayerToBind, sizeof(ZonePlayerToBind_Struct) + 14);
|
||||
ZonePlayerToBind_Struct* gmg = (ZonePlayerToBind_Struct*) outapp->pBuffer;
|
||||
|
||||
|
||||
gmg->bind_zone_id = m_pp.binds[0].zoneId;
|
||||
gmg->x = m_pp.binds[0].x;
|
||||
gmg->y = m_pp.binds[0].y;
|
||||
@@ -2133,7 +2133,7 @@ void Client::HandleRespawnFromHover(uint32 Option)
|
||||
if(g)
|
||||
g->MemberZoned(this);
|
||||
}
|
||||
|
||||
|
||||
Raid* r = entity_list.GetRaidByClient(this);
|
||||
|
||||
if(r)
|
||||
@@ -2142,9 +2142,9 @@ void Client::HandleRespawnFromHover(uint32 Option)
|
||||
m_pp.zone_id = m_pp.binds[0].zoneId;
|
||||
m_pp.zoneInstance = 0;
|
||||
database.MoveCharacterToZone(this->CharacterID(), database.GetZoneName(m_pp.zone_id));
|
||||
|
||||
|
||||
Save();
|
||||
|
||||
|
||||
GoToDeath();
|
||||
}
|
||||
}
|
||||
@@ -2161,7 +2161,7 @@ void Client::ClearHover()
|
||||
|
||||
sze->player.spawn.NPC = 0;
|
||||
sze->player.spawn.z += 6; //arbitrary lift, seems to help spawning under zone.
|
||||
|
||||
|
||||
entity_list.QueueClients(this, outapp, false);
|
||||
safe_delete(outapp);
|
||||
|
||||
@@ -2302,7 +2302,7 @@ void Client::HandleLFGuildResponse(ServerPacket *pack)
|
||||
|
||||
LFGuild_GuildToggle_Struct *gts = (LFGuild_GuildToggle_Struct *)outapp->pBuffer;
|
||||
gts->Command = 1;
|
||||
strcpy(gts->Comment, Comments);
|
||||
strcpy(gts->Comment, Comments);
|
||||
gts->FromLevel = FromLevel;
|
||||
gts->ToLevel = ToLevel;
|
||||
gts->Classes = Classes;
|
||||
@@ -2348,7 +2348,7 @@ void Client::SendGuildLFGuildStatus()
|
||||
pack->WriteUInt32(QSG_LFGuild);
|
||||
pack->WriteUInt32(QSG_LFGuild_RequestGuildInfo);
|
||||
pack->WriteString(guild_mgr.GetGuildName(GuildID()));
|
||||
|
||||
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
|
||||
+761
-755
File diff suppressed because it is too large
Load Diff
+19
-19
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
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
|
||||
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
|
||||
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
|
||||
*/
|
||||
|
||||
|
||||
@@ -32,12 +32,12 @@ typedef void (*CmdFuncPtr)(Client *,const Seperator *);
|
||||
// this is a command list item
|
||||
/*struct cl_struct
|
||||
{
|
||||
char *command[CMDALIASES]; // the command(s)
|
||||
char *desc; // description of command
|
||||
CmdFuncPtr function; // the function to call
|
||||
int access; // the required 'status' level
|
||||
|
||||
struct cl_struct *next; // linked list
|
||||
char *command[CMDALIASES]; // the command(s)
|
||||
char *desc; // description of command
|
||||
CmdFuncPtr function; // the function to call
|
||||
int access; // the required 'status' level
|
||||
|
||||
struct cl_struct *next; // linked list
|
||||
};
|
||||
|
||||
extern struct cl_struct *commandlist; // the head of the list
|
||||
|
||||
+122
-122
@@ -66,7 +66,7 @@ typedef enum { //focus types
|
||||
focusTwincast,
|
||||
focusSympatheticProc,
|
||||
focusSpellDamage,
|
||||
focusFF_Damage_Amount,
|
||||
focusFF_Damage_Amount,
|
||||
focusSpellDurByTic,
|
||||
focusSwarmPetDuration,
|
||||
focusReduceRecastTime,
|
||||
@@ -156,16 +156,16 @@ struct Buffs_Struct {
|
||||
uint16 spellid;
|
||||
uint8 casterlevel;
|
||||
uint16 casterid; // Maybe change this to a pointer sometime, but gotta make sure it's 0'd when it no longer points to anything
|
||||
char caster_name[64];
|
||||
int32 ticsremaining;
|
||||
uint32 counters;
|
||||
char caster_name[64];
|
||||
int32 ticsremaining;
|
||||
uint32 counters;
|
||||
uint32 numhits; //the number of physical hits this buff can take before it fades away, lots of druid armor spells take advantage of this mixed with powerful effects
|
||||
uint32 melee_rune;
|
||||
uint32 magic_rune;
|
||||
uint8 deathSaveSuccessChance;
|
||||
uint8 deathsaveCasterAARank;
|
||||
bool persistant_buff;
|
||||
bool client; //True if the caster is a client
|
||||
bool persistant_buff;
|
||||
bool client; //True if the caster is a client
|
||||
bool UpdateClient;
|
||||
};
|
||||
|
||||
@@ -224,14 +224,14 @@ struct StatBonuses {
|
||||
DmgShieldType DamageShieldType;
|
||||
int SpellDamageShield;
|
||||
int SpellShield;
|
||||
int ReverseDamageShield; // this is damage done to the mob when it attacks
|
||||
int ReverseDamageShield; // this is damage done to the mob when it attacks
|
||||
uint16 ReverseDamageShieldSpellID;
|
||||
DmgShieldType ReverseDamageShieldType;
|
||||
int movementspeed;
|
||||
int16 haste;
|
||||
int16 hastetype2;
|
||||
int16 hastetype3;
|
||||
int16 inhibitmelee;
|
||||
int16 inhibitmelee;
|
||||
float AggroRange; // when calculate just replace original value with this
|
||||
float AssistRange;
|
||||
int16 skillmod[HIGHEST_SKILL+1];
|
||||
@@ -245,65 +245,65 @@ struct StatBonuses {
|
||||
int8 hatemod;
|
||||
int32 EnduranceReduction;
|
||||
|
||||
int16 StrikeThrough; // PoP: Strike Through %
|
||||
int16 MeleeMitigation; //i = Shielding
|
||||
int16 CriticalHitChance[HIGHEST_SKILL+2]; //i
|
||||
int16 CriticalSpellChance; //i
|
||||
int16 SpellCritDmgIncrease; //i
|
||||
int16 DotCritDmgIncrease; //i
|
||||
int16 CriticalHealChance; //i
|
||||
int16 CriticalHealOverTime; //i
|
||||
int16 CriticalDoTChance; //i
|
||||
int16 CrippBlowChance; //
|
||||
int16 AvoidMeleeChance; //AvoidMeleeChance/10 == % chance i = Avoidance
|
||||
int16 RiposteChance; //i
|
||||
int16 DodgeChance; //i
|
||||
int16 ParryChance; //i
|
||||
int16 DualWieldChance; //i
|
||||
int16 DoubleAttackChance; //i
|
||||
int16 TripleAttackChance; //i
|
||||
int16 ResistSpellChance; //i
|
||||
int16 ResistFearChance; //i
|
||||
bool Fearless; //i
|
||||
bool IsFeared; //i
|
||||
int16 StunResist; //i
|
||||
int16 MeleeSkillCheck; //i
|
||||
uint8 MeleeSkillCheckSkill;
|
||||
int16 HitChance; //HitChance/15 == % increase i = Accuracy (Item: Accuracy)
|
||||
int16 HitChanceEffect[HIGHEST_SKILL+2]; //Spell effect Chance to Hit, straight percent increase
|
||||
int16 DamageModifier[HIGHEST_SKILL+2]; //i
|
||||
int16 MinDamageModifier[HIGHEST_SKILL+2]; //i
|
||||
int16 ProcChance; // ProcChance/10 == % increase i = CombatEffects
|
||||
int16 ExtraAttackChance;
|
||||
int16 StrikeThrough; // PoP: Strike Through %
|
||||
int16 MeleeMitigation; //i = Shielding
|
||||
int16 CriticalHitChance[HIGHEST_SKILL+2]; //i
|
||||
int16 CriticalSpellChance; //i
|
||||
int16 SpellCritDmgIncrease; //i
|
||||
int16 DotCritDmgIncrease; //i
|
||||
int16 CriticalHealChance; //i
|
||||
int16 CriticalHealOverTime; //i
|
||||
int16 CriticalDoTChance; //i
|
||||
int16 CrippBlowChance; //
|
||||
int16 AvoidMeleeChance; //AvoidMeleeChance/10 == % chance i = Avoidance
|
||||
int16 RiposteChance; //i
|
||||
int16 DodgeChance; //i
|
||||
int16 ParryChance; //i
|
||||
int16 DualWieldChance; //i
|
||||
int16 DoubleAttackChance; //i
|
||||
int16 TripleAttackChance; //i
|
||||
int16 ResistSpellChance; //i
|
||||
int16 ResistFearChance; //i
|
||||
bool Fearless; //i
|
||||
bool IsFeared; //i
|
||||
int16 StunResist; //i
|
||||
int16 MeleeSkillCheck; //i
|
||||
uint8 MeleeSkillCheckSkill;
|
||||
int16 HitChance; //HitChance/15 == % increase i = Accuracy (Item: Accuracy)
|
||||
int16 HitChanceEffect[HIGHEST_SKILL+2]; //Spell effect Chance to Hit, straight percent increase
|
||||
int16 DamageModifier[HIGHEST_SKILL+2]; //i
|
||||
int16 MinDamageModifier[HIGHEST_SKILL+2]; //i
|
||||
int16 ProcChance; // ProcChance/10 == % increase i = CombatEffects
|
||||
int16 ExtraAttackChance;
|
||||
int16 DoTShielding;
|
||||
int16 DivineSaveChance[2]; // Second Chance (base1 = chance, base2 = spell on trigger)
|
||||
uint16 DeathSave[4]; // Death Pact [0](value = 1 partial 2 = full) [1]=slot [2]=LvLimit [3]=HealAmt
|
||||
int16 FlurryChance;
|
||||
int16 DivineSaveChance[2]; // Second Chance (base1 = chance, base2 = spell on trigger)
|
||||
uint16 DeathSave[4]; // Death Pact [0](value = 1 partial 2 = full) [1]=slot [2]=LvLimit [3]=HealAmt
|
||||
int16 FlurryChance;
|
||||
int16 Accuracy[HIGHEST_SKILL+2]; //Accuracy/15 == % increase [Spell Effect: Accuracy)
|
||||
int16 HundredHands; //extra haste, stacks with all other haste i
|
||||
int16 HundredHands; //extra haste, stacks with all other haste i
|
||||
int8 MeleeLifetap; //i
|
||||
int16 HealRate; // Spell effect that influences effectiveness of heals
|
||||
int16 MaxHPChange; // Spell Effect
|
||||
int16 SkillDmgTaken[HIGHEST_SKILL+2]; // All Skills + -1
|
||||
int32 HealAmt; // Item Effect
|
||||
int32 SpellDmg; // Item Effect
|
||||
int32 Clairvoyance; // Item Effect
|
||||
int16 DSMitigation; // Item Effect
|
||||
int16 DSMitigationOffHand; // Lowers damage shield from off hand attacks.
|
||||
uint32 SpellTriggers[MAX_SPELL_TRIGGER]; // Innate/Spell/Item Spells that trigger when you cast
|
||||
uint32 SpellOnKill[MAX_SPELL_TRIGGER*3]; // Chance to proc after killing a mob
|
||||
uint32 SpellOnDeath[MAX_SPELL_TRIGGER*2]; // Chance to have effect cast when you die
|
||||
int16 CritDmgMob[HIGHEST_SKILL+2]; // All Skills + -1
|
||||
int16 SkillReuseTime[HIGHEST_SKILL+1]; // Reduces skill timers
|
||||
int16 SkillDamageAmount[HIGHEST_SKILL+2]; // All Skills + -1
|
||||
int16 TwoHandBluntBlock; // chance to block when wielding two hand blunt weapon
|
||||
uint16 ItemManaRegenCap; // Increases the amount of mana you have can over the cap(aa effect)
|
||||
int16 GravityEffect; // Indictor of spell effect
|
||||
int16 HealRate; // Spell effect that influences effectiveness of heals
|
||||
int16 MaxHPChange; // Spell Effect
|
||||
int16 SkillDmgTaken[HIGHEST_SKILL+2]; // All Skills + -1
|
||||
int32 HealAmt; // Item Effect
|
||||
int32 SpellDmg; // Item Effect
|
||||
int32 Clairvoyance; // Item Effect
|
||||
int16 DSMitigation; // Item Effect
|
||||
int16 DSMitigationOffHand; // Lowers damage shield from off hand attacks.
|
||||
uint32 SpellTriggers[MAX_SPELL_TRIGGER]; // Innate/Spell/Item Spells that trigger when you cast
|
||||
uint32 SpellOnKill[MAX_SPELL_TRIGGER*3]; // Chance to proc after killing a mob
|
||||
uint32 SpellOnDeath[MAX_SPELL_TRIGGER*2]; // Chance to have effect cast when you die
|
||||
int16 CritDmgMob[HIGHEST_SKILL+2]; // All Skills + -1
|
||||
int16 SkillReuseTime[HIGHEST_SKILL+1]; // Reduces skill timers
|
||||
int16 SkillDamageAmount[HIGHEST_SKILL+2]; // All Skills + -1
|
||||
int16 TwoHandBluntBlock; // chance to block when wielding two hand blunt weapon
|
||||
uint16 ItemManaRegenCap; // Increases the amount of mana you have can over the cap(aa effect)
|
||||
int16 GravityEffect; // Indictor of spell effect
|
||||
bool AntiGate; // spell effect that prevents gating
|
||||
bool MagicWeapon; // spell effect that makes weapon magical
|
||||
int16 IncreaseBlockChance; // overall block chance modifier
|
||||
uint16 PersistantCasting; // chance to continue casting through a stun
|
||||
int XPRateMod; //i
|
||||
int XPRateMod; //i
|
||||
int HPPercCap; //Spell effect that limits you to being healed/regening beyond a % of your max
|
||||
int ManaPercCap; // ^^
|
||||
int EndPercCap; // ^^
|
||||
@@ -311,22 +311,22 @@ struct StatBonuses {
|
||||
//uint16 BlockSpellEffect[EFFECT_COUNT]; // Prevents spells with certain effects from landing on you *no longer used
|
||||
bool ImmuneToFlee; // Bypass the fleeing flag
|
||||
uint16 VoiceGraft; // Stores the ID of the mob with which to talk through
|
||||
uint16 SpellProcChance; // chance to proc from sympathetic spell effects
|
||||
uint16 SpellProcChance; // chance to proc from sympathetic spell effects
|
||||
uint16 CharmBreakChance; // chance to break charm
|
||||
int16 SongRange; // increases range of beneficial bard songs
|
||||
uint16 HPToManaConvert; // Uses HP to cast spells at specific conversion
|
||||
uint16 FocusEffects[HIGHEST_FOCUS+1]; // Stores the focus effectid for each focustype you have.
|
||||
int16 SongRange; // increases range of beneficial bard songs
|
||||
uint16 HPToManaConvert; // Uses HP to cast spells at specific conversion
|
||||
uint16 FocusEffects[HIGHEST_FOCUS+1]; // Stores the focus effectid for each focustype you have.
|
||||
bool NegateEffects; // Check if you contain a buff with negate effect. (only spellbonuses)
|
||||
int16 SkillDamageAmount2[HIGHEST_SKILL+2]; // Adds skill specific damage
|
||||
uint16 NegateAttacks[2]; // 0 = bool HasEffect 1 = Buff Slot
|
||||
int16 SkillDamageAmount2[HIGHEST_SKILL+2]; // Adds skill specific damage
|
||||
uint16 NegateAttacks[2]; // 0 = bool HasEffect 1 = Buff Slot
|
||||
uint16 MitigateMeleeRune[2]; // 0 = Mitigation value 1 = Buff Slot
|
||||
uint16 MitigateSpellRune[2]; // 0 = Mitigation value 1 = Buff Slot
|
||||
uint16 ManaAbsorbPercentDamage[2]; // 0 = Mitigation value 1 = Buff Slot
|
||||
int16 ShieldBlock; // Chance to Shield Block
|
||||
int16 BlockBehind; // Chance to Block Behind (with our without shield)
|
||||
int16 ShieldBlock; // Chance to Shield Block
|
||||
int16 BlockBehind; // Chance to Block Behind (with our without shield)
|
||||
//bool AbsorbMagicAtt; // Magic Rune *Need to be implemented for NegateEffect
|
||||
//bool MeleeRune; // Melee Rune *Need to be implemented for NegateEffect
|
||||
|
||||
|
||||
// AAs
|
||||
int8 Packrat; //weight reduction for items, 1 point = 10%
|
||||
uint8 BuffSlotIncrease; // Increases number of available buff slots
|
||||
@@ -336,51 +336,51 @@ struct StatBonuses {
|
||||
int16 DoubleSpecialAttack; // Chance to to perform a double special attack (ie flying kick 2x)
|
||||
int16 SpecialAttackKBProc[2]; // Chance to to do a knockback from special attacks. (0 = chance 1 = Skill)
|
||||
uint8 FrontalStunResist; // Chance to resist a frontal stun
|
||||
int16 BindWound; // Increase amount of HP by percent.
|
||||
int16 MaxBindWound; // Increase max amount of HP you can bind wound.
|
||||
int16 ChannelChanceSpells; // Modify chance to channel a spell.
|
||||
int16 ChannelChanceItems; // Modify chance to channel a items.
|
||||
uint8 SeeInvis; // See Invs.
|
||||
int16 BindWound; // Increase amount of HP by percent.
|
||||
int16 MaxBindWound; // Increase max amount of HP you can bind wound.
|
||||
int16 ChannelChanceSpells; // Modify chance to channel a spell.
|
||||
int16 ChannelChanceItems; // Modify chance to channel a items.
|
||||
uint8 SeeInvis; // See Invs.
|
||||
uint8 TripleBackstab; // Chance to triple backstab
|
||||
bool FrontalBackstabMinDmg; // Allow frontal backstabs for min damage
|
||||
uint8 FrontalBackstabChance; // Chance to backstab from the front for full damage
|
||||
uint8 FrontalBackstabChance; // Chance to backstab from the front for full damage
|
||||
uint8 ConsumeProjectile; // Chance to not consume arrow.
|
||||
uint8 ForageAdditionalItems; // Chance to forage another item.
|
||||
uint8 SalvageChance; // Chance to salvage a tradeskill components on fail.
|
||||
uint16 ArcheryDamageModifier; // Increase Archery Damage by percent
|
||||
uint8 ForageAdditionalItems; // Chance to forage another item.
|
||||
uint8 SalvageChance; // Chance to salvage a tradeskill components on fail.
|
||||
uint16 ArcheryDamageModifier; // Increase Archery Damage by percent
|
||||
bool SecondaryDmgInc; // Allow off hand weapon to recieve damage bonus.
|
||||
uint16 GiveDoubleAttack; // Allow classes to double attack with a specified chance.
|
||||
int16 SlayUndead[2]; // Allow classes to do extra damage verse undead.(base1 = rate, base2 = damage mod)
|
||||
int16 PetCriticalHit; // Allow pets to critical hit with % value.
|
||||
int16 PetCriticalHit; // Allow pets to critical hit with % value.
|
||||
int16 PetAvoidance; // Pet avoidance chance.
|
||||
int16 CombatStability; // Melee damage mitigation.
|
||||
int16 GiveDoubleRiposte[3]; // 0=Regular Chance, 1=Skill Attack Chance, 2=Skill
|
||||
int16 CombatStability; // Melee damage mitigation.
|
||||
int16 GiveDoubleRiposte[3]; // 0=Regular Chance, 1=Skill Attack Chance, 2=Skill
|
||||
uint16 RaiseSkillCap[2]; // Raise a specific skill cap (1 = value, 2=skill)
|
||||
int16 Ambidexterity; // Increase chance to duel wield by adding bonus 'skill'.
|
||||
int16 PetMaxHP; // Increase the max hp of your pet.
|
||||
int16 PetFlurry; // Chance for pet to flurry.
|
||||
int16 Ambidexterity; // Increase chance to duel wield by adding bonus 'skill'.
|
||||
int16 PetMaxHP; // Increase the max hp of your pet.
|
||||
int16 PetFlurry; // Chance for pet to flurry.
|
||||
uint8 MasteryofPast; // Can not fizzle spells below this level specified in value.
|
||||
bool GivePetGroupTarget; // All pets to recieve group buffs. (Pet Affinity)
|
||||
int16 RootBreakChance; // Chance root will break;
|
||||
int16 UnfailingDivinity; // Improves chance that DI will fire + increase partial heal.
|
||||
int16 ItemHPRegenCap; // Increase item regen cap.
|
||||
int16 SEResist[MAX_RESISTABLE_EFFECTS*2]; // Resist chance by specific spell effects.
|
||||
int16 OffhandRiposteFail; // chance for opponent to fail riposte with offhand attack.
|
||||
int16 UnfailingDivinity; // Improves chance that DI will fire + increase partial heal.
|
||||
int16 ItemHPRegenCap; // Increase item regen cap.
|
||||
int16 SEResist[MAX_RESISTABLE_EFFECTS*2]; // Resist chance by specific spell effects.
|
||||
int16 OffhandRiposteFail; // chance for opponent to fail riposte with offhand attack.
|
||||
int16 ItemATKCap; // Raise item attack cap
|
||||
int32 FinishingBlow[2]; // Chance to do a finishing blow for specified damage amount.
|
||||
int32 FinishingBlow[2]; // Chance to do a finishing blow for specified damage amount.
|
||||
uint16 FinishingBlowLvl[2]; // Sets max level an NPC can be affected by FB. (base1 = lv, base2= ???)
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16 spellID;
|
||||
uint16 chance;
|
||||
uint16 base_spellID;
|
||||
uint16 spellID;
|
||||
uint16 chance;
|
||||
uint16 base_spellID;
|
||||
} tProc;
|
||||
|
||||
struct Shielders_Struct {
|
||||
uint32 shielder_id;
|
||||
uint16 shielder_bonus;
|
||||
uint32 shielder_id;
|
||||
uint16 shielder_bonus;
|
||||
};
|
||||
|
||||
//eventually turn this into a typedef and
|
||||
@@ -426,7 +426,7 @@ typedef enum {
|
||||
|
||||
struct MercType {
|
||||
uint32 Type;
|
||||
uint32 ClientVersion;
|
||||
uint32 ClientVersion;
|
||||
};
|
||||
|
||||
struct MercData {
|
||||
@@ -444,44 +444,44 @@ class Mob;
|
||||
class Trade
|
||||
{
|
||||
public:
|
||||
Trade(Mob* in_owner);
|
||||
virtual ~Trade();
|
||||
Trade(Mob* in_owner);
|
||||
virtual ~Trade();
|
||||
|
||||
void Reset();
|
||||
void SetTradeCash(uint32 in_pp, uint32 in_gp, uint32 in_sp, uint32 in_cp);
|
||||
void Reset();
|
||||
void SetTradeCash(uint32 in_pp, uint32 in_gp, uint32 in_sp, uint32 in_cp);
|
||||
|
||||
// Initiate a trade with another mob
|
||||
// Also puts other mob into trader mode with this mob
|
||||
void Start(uint32 mob_id, bool initiate_with=true);
|
||||
// Initiate a trade with another mob
|
||||
// Also puts other mob into trader mode with this mob
|
||||
void Start(uint32 mob_id, bool initiate_with=true);
|
||||
|
||||
// Mob the owner is trading with
|
||||
Mob* With();
|
||||
// Mob the owner is trading with
|
||||
Mob* With();
|
||||
|
||||
// Add item from cursor slot to trade bucket (automatically does bag data too)
|
||||
void AddEntity(uint16 from_slot_id, uint16 trade_slot_id);
|
||||
// Add item from cursor slot to trade bucket (automatically does bag data too)
|
||||
void AddEntity(uint16 from_slot_id, uint16 trade_slot_id);
|
||||
|
||||
// Audit trade
|
||||
void LogTrade();
|
||||
// Audit trade
|
||||
void LogTrade();
|
||||
|
||||
// Debug only method
|
||||
#if (EQDEBUG >= 9)
|
||||
void DumpTrade();
|
||||
#endif
|
||||
// Debug only method
|
||||
#if (EQDEBUG >= 9)
|
||||
void DumpTrade();
|
||||
#endif
|
||||
|
||||
public:
|
||||
// Object state
|
||||
TradeState state;
|
||||
int32 pp;
|
||||
int32 gp;
|
||||
int32 sp;
|
||||
int32 cp;
|
||||
// Object state
|
||||
TradeState state;
|
||||
int32 pp;
|
||||
int32 gp;
|
||||
int32 sp;
|
||||
int32 cp;
|
||||
|
||||
private:
|
||||
// Send item data for trade item to other person involved in trade
|
||||
void SendItemData(const ItemInst* inst, int16 dest_slot_id);
|
||||
// Send item data for trade item to other person involved in trade
|
||||
void SendItemData(const ItemInst* inst, int16 dest_slot_id);
|
||||
|
||||
uint32 with_id;
|
||||
Mob* owner;
|
||||
uint32 with_id;
|
||||
Mob* owner;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+72
-71
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
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 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
|
||||
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.
|
||||
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
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "../common/debug.h"
|
||||
#include <iostream>
|
||||
@@ -38,7 +38,7 @@ extern EntityList entity_list;
|
||||
extern WorldServer worldserver;
|
||||
|
||||
Doors::Doors(const Door* door)
|
||||
: close_timer(5000)
|
||||
: close_timer(5000)
|
||||
{
|
||||
db_id = door->db_id;
|
||||
door_id = door->door_id;
|
||||
@@ -76,7 +76,7 @@ Doors::Doors(const Door* door)
|
||||
}
|
||||
|
||||
Doors::Doors(const char *dmodel, float dx, float dy, float dz, float dheading, uint8 dopentype, uint16 dsize)
|
||||
: close_timer(5000)
|
||||
: close_timer(5000)
|
||||
{
|
||||
db_id = database.GetDoorsCountPlusOne(zone->GetShortName(), zone->GetInstanceVersion());
|
||||
door_id = database.GetDoorsDBCountPlusOne(zone->GetShortName(), zone->GetInstanceVersion());
|
||||
@@ -120,8 +120,8 @@ Doors::~Doors()
|
||||
|
||||
bool Doors::Process()
|
||||
{
|
||||
if(close_timer.Enabled() && close_timer.Check() && IsDoorOpen())
|
||||
{
|
||||
if(close_timer.Enabled() && close_timer.Check() && IsDoorOpen())
|
||||
{
|
||||
if (opentype == 40 || GetTriggerType() == 1)
|
||||
{
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_MoveDoor, sizeof(MoveDoor_Struct));
|
||||
@@ -135,7 +135,7 @@ bool Doors::Process()
|
||||
triggered=false;
|
||||
close_timer.Disable();
|
||||
SetOpenState(false);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger)
|
||||
_log(DOORS__INFO, " incline %d, opentype %d, lockpick %d, key %d, nokeyring %d, trigger %d type %d, param %d", incline, opentype, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param);
|
||||
_log(DOORS__INFO, " size %d, invert %d, dest: %s (%.4f,%.4f,%.4f @%.4f)", size, invert_state, dest_zone, dest_x, dest_y, dest_z, dest_heading);
|
||||
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_MoveDoor, sizeof(MoveDoor_Struct));
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_MoveDoor, sizeof(MoveDoor_Struct));
|
||||
MoveDoor_Struct* md = (MoveDoor_Struct*)outapp->pBuffer;
|
||||
md->doorid = door_id;
|
||||
/////////////////////////////////////////////////////////////////
|
||||
@@ -224,7 +224,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// guild doors
|
||||
if(((keyneeded == 0) && (GetLockpick() == 0) && (guild_id == 0)) ||
|
||||
(IsDoorOpen() && (opentype == 58)) ||
|
||||
@@ -260,7 +260,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger)
|
||||
}
|
||||
// a key is required or the door is locked but can be picked or both
|
||||
sender->Message(4, "This is locked..."); // debug spam - should probably go
|
||||
if(sender->GetGM()) // GM can always open locks - should probably be changed to require a key
|
||||
if(sender->GetGM()) // GM can always open locks - should probably be changed to require a key
|
||||
{
|
||||
sender->Message_StringID(4,DOORS_GM);
|
||||
if(!IsDoorOpen() || (opentype == 58))
|
||||
@@ -345,15 +345,15 @@ void Doors::HandleClick(Client* sender, uint8 trigger)
|
||||
playerkey = keyneeded;
|
||||
sender->Message(4, "You got it open!"); // more debug spam
|
||||
if(!IsDoorOpen() || (opentype == 58))
|
||||
{
|
||||
{
|
||||
md->action = invert_state == 0 ? OPEN_DOOR : OPEN_INVDOOR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
md->action = invert_state == 0 ? CLOSE_DOOR : CLOSE_INVDOOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
sender->Message_StringID(4, DOORS_LOCKED);
|
||||
safe_delete(outapp);
|
||||
@@ -361,7 +361,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
entity_list.QueueClients(sender, outapp, false);
|
||||
if(!IsDoorOpen() || (opentype == 58))
|
||||
{
|
||||
@@ -413,14 +413,14 @@ void Doors::HandleClick(Client* sender, uint8 trigger)
|
||||
}
|
||||
}
|
||||
|
||||
if(((opentype == 57) || (opentype == 58)) && (strncmp(dest_zone, "NONE", strlen("NONE")) != 0))
|
||||
{ // Teleport door!
|
||||
if (( strncmp(dest_zone,zone_name,strlen(zone_name)) == 0) && (!keyneeded))
|
||||
if(((opentype == 57) || (opentype == 58)) && (strncmp(dest_zone, "NONE", strlen("NONE")) != 0))
|
||||
{ // Teleport door!
|
||||
if (( strncmp(dest_zone,zone_name,strlen(zone_name)) == 0) && (!keyneeded))
|
||||
{
|
||||
if(!keepoffkeyring)
|
||||
{
|
||||
sender->KeyRingAdd(playerkey);
|
||||
}
|
||||
}
|
||||
sender->MovePC(zone->GetZoneID(), zone->GetInstanceID(), dest_x, dest_y, dest_z, dest_heading);
|
||||
}
|
||||
else if (( !IsDoorOpen() || opentype == 58 ) && (keyneeded && ((keyneeded == playerkey) || sender->GetGM())))
|
||||
@@ -428,7 +428,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger)
|
||||
if(!keepoffkeyring)
|
||||
{
|
||||
sender->KeyRingAdd(playerkey);
|
||||
}
|
||||
}
|
||||
if(database.GetZoneID(dest_zone) == zone->GetZoneID())
|
||||
{
|
||||
sender->MovePC(zone->GetZoneID(), zone->GetInstanceID(), dest_x, dest_y, dest_z, dest_heading);
|
||||
@@ -438,7 +438,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger)
|
||||
sender->MovePC(database.GetZoneID(dest_zone), dest_instance_id, dest_x, dest_y, dest_z, dest_heading);
|
||||
}
|
||||
}
|
||||
if (( !IsDoorOpen() || opentype == 58 ) && (!keyneeded))
|
||||
if (( !IsDoorOpen() || opentype == 58 ) && (!keyneeded))
|
||||
{
|
||||
if(database.GetZoneID(dest_zone) == zone->GetZoneID())
|
||||
{
|
||||
@@ -558,23 +558,23 @@ void Doors::ToggleState(Mob *sender)
|
||||
}
|
||||
|
||||
void Doors::DumpDoor(){
|
||||
LogFile->write(EQEMuLog::Debug,
|
||||
"db_id:%i door_id:%i zone_name:%s door_name:%s pos_x:%f pos_y:%f pos_z:%f heading:%f",
|
||||
db_id, door_id, zone_name, door_name, pos_x, pos_y, pos_z, heading);
|
||||
LogFile->write(EQEMuLog::Debug,
|
||||
LogFile->write(EQEMuLog::Debug,
|
||||
"db_id:%i door_id:%i zone_name:%s door_name:%s pos_x:%f pos_y:%f pos_z:%f heading:%f",
|
||||
db_id, door_id, zone_name, door_name, pos_x, pos_y, pos_z, heading);
|
||||
LogFile->write(EQEMuLog::Debug,
|
||||
"opentype:%i guild_id:%i lockpick:%i keyitem:%i nokeyring:%i trigger_door:%i trigger_type:%i door_param:%i open:%s",
|
||||
opentype, guild_id, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param, (isopen) ? "open":"closed");
|
||||
LogFile->write(EQEMuLog::Debug,
|
||||
"dest_zone:%s dest_x:%f dest_y:%f dest_z:%f dest_heading:%f",
|
||||
dest_zone, dest_x, dest_y, dest_z, dest_heading);
|
||||
opentype, guild_id, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param, (isopen) ? "open":"closed");
|
||||
LogFile->write(EQEMuLog::Debug,
|
||||
"dest_zone:%s dest_x:%f dest_y:%f dest_z:%f dest_heading:%f",
|
||||
dest_zone, dest_x, dest_y, dest_z, dest_heading);
|
||||
}
|
||||
|
||||
int32 ZoneDatabase::GetDoorsCount(uint32* oMaxID, const char *zone_name, int16 version) {
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
char *query = 0;
|
||||
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
query = new char[256];
|
||||
sprintf(query, "SELECT MAX(id), count(*) FROM doors WHERE zone='%s' AND (version=%u OR version=-1)", zone_name, version);
|
||||
if (RunQuery(query, strlen(query), errbuf, &result)) {
|
||||
@@ -604,11 +604,11 @@ int32 ZoneDatabase::GetDoorsCount(uint32* oMaxID, const char *zone_name, int16 v
|
||||
|
||||
int32 ZoneDatabase::GetDoorsCountPlusOne(const char *zone_name, int16 version) {
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
char *query = 0;
|
||||
uint32 oMaxID = 0;
|
||||
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
query = new char[256];
|
||||
sprintf(query, "SELECT MAX(id) FROM doors WHERE zone='%s' AND version=%u", zone_name, version);
|
||||
if (RunQuery(query, strlen(query), errbuf, &result)) {
|
||||
@@ -635,11 +635,11 @@ int32 ZoneDatabase::GetDoorsCountPlusOne(const char *zone_name, int16 version) {
|
||||
|
||||
int32 ZoneDatabase::GetDoorsDBCountPlusOne(const char *zone_name, int16 version) {
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
char *query = 0;
|
||||
uint32 oMaxID = 0;
|
||||
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
query = new char[256];
|
||||
sprintf(query, "SELECT MAX(doorid) FROM doors WHERE zone='%s' AND (version=%u OR version=-1)", zone_name, version);
|
||||
if (RunQuery(query, strlen(query), errbuf, &result)) {
|
||||
@@ -667,9 +667,9 @@ int32 ZoneDatabase::GetDoorsDBCountPlusOne(const char *zone_name, int16 version)
|
||||
bool ZoneDatabase::LoadDoors(int32 iDoorCount, Door *into, const char *zone_name, int16 version) {
|
||||
LogFile->write(EQEMuLog::Status, "Loading Doors from database...");
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
char *query = 0;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
|
||||
// Door tmpDoor;
|
||||
MakeAnyLenString(&query, "SELECT id,doorid,zone,name,pos_x,pos_y,pos_z,heading,"
|
||||
@@ -700,12 +700,12 @@ bool ZoneDatabase::LoadDoors(int32 iDoorCount, Door *into, const char *zone_name
|
||||
into[r].nokeyring = atoi(row[12]);
|
||||
into[r].trigger_door = atoi(row[13]);
|
||||
into[r].trigger_type = atoi(row[14]);
|
||||
strn0cpy(into[r].dest_zone, row[15], 32);
|
||||
strn0cpy(into[r].dest_zone, row[15], 32);
|
||||
into[r].dest_instance_id = atoi(row[16]);
|
||||
into[r].dest_x = (float) atof(row[17]);
|
||||
into[r].dest_y = (float) atof(row[18]);
|
||||
into[r].dest_z = (float) atof(row[19]);
|
||||
into[r].dest_heading = (float) atof(row[20]);
|
||||
into[r].dest_x = (float) atof(row[17]);
|
||||
into[r].dest_y = (float) atof(row[18]);
|
||||
into[r].dest_z = (float) atof(row[19]);
|
||||
into[r].dest_heading = (float) atof(row[20]);
|
||||
into[r].door_param=atoi(row[21]);
|
||||
into[r].invert_state=atoi(row[22]);
|
||||
into[r].incline=atoi(row[23]);
|
||||
@@ -736,45 +736,45 @@ void Doors::SetLocation(float x, float y, float z)
|
||||
|
||||
void Doors::SetX(float in) {
|
||||
entity_list.DespawnAllDoors();
|
||||
pos_x = in;
|
||||
pos_x = in;
|
||||
entity_list.RespawnAllDoors();
|
||||
}
|
||||
void Doors::SetY(float in) {
|
||||
void Doors::SetY(float in) {
|
||||
entity_list.DespawnAllDoors();
|
||||
pos_y = in;
|
||||
pos_y = in;
|
||||
entity_list.RespawnAllDoors();
|
||||
}
|
||||
void Doors::SetZ(float in) {
|
||||
void Doors::SetZ(float in) {
|
||||
entity_list.DespawnAllDoors();
|
||||
pos_z = in;
|
||||
pos_z = in;
|
||||
entity_list.RespawnAllDoors();
|
||||
}
|
||||
void Doors::SetHeading(float in) {
|
||||
void Doors::SetHeading(float in) {
|
||||
entity_list.DespawnAllDoors();
|
||||
heading = in;
|
||||
heading = in;
|
||||
entity_list.RespawnAllDoors();
|
||||
}
|
||||
|
||||
void Doors::SetIncline(int in) {
|
||||
void Doors::SetIncline(int in) {
|
||||
entity_list.DespawnAllDoors();
|
||||
incline = in;
|
||||
incline = in;
|
||||
entity_list.RespawnAllDoors();
|
||||
}
|
||||
|
||||
void Doors::SetOpenType(uint8 in) {
|
||||
void Doors::SetOpenType(uint8 in) {
|
||||
entity_list.DespawnAllDoors();
|
||||
opentype = in;
|
||||
opentype = in;
|
||||
entity_list.RespawnAllDoors();
|
||||
}
|
||||
|
||||
void Doors::SetDoorName(char* name) {
|
||||
void Doors::SetDoorName(char* name) {
|
||||
entity_list.DespawnAllDoors();
|
||||
memset(door_name, 0, sizeof(door_name));
|
||||
strncpy(door_name, name, sizeof(door_name));
|
||||
memset(door_name, 0, sizeof(door_name));
|
||||
strncpy(door_name, name, sizeof(door_name));
|
||||
entity_list.RespawnAllDoors();
|
||||
}
|
||||
|
||||
void Doors::SetSize(uint16 in) {
|
||||
void Doors::SetSize(uint16 in) {
|
||||
entity_list.DespawnAllDoors();
|
||||
size = in;
|
||||
entity_list.RespawnAllDoors();
|
||||
@@ -788,3 +788,4 @@ void Doors::CreateDatabaseEntry()
|
||||
}
|
||||
database.InsertDoor(GetDoorDBID(), GetDoorID(), GetDoorName(), GetX(), GetY(), GetZ(), GetHeading(), GetOpenType(), GetGuildID(), GetLockpick(), GetKeyItem(), GetDoorParam(), GetInvertState(), GetIncline(), GetSize());
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -36,19 +36,19 @@ public:
|
||||
|
||||
uint8 GetTriggerDoorID() { return trigger_door; }
|
||||
uint8 GetTriggerType() { return trigger_type; }
|
||||
|
||||
|
||||
uint32 GetKeyItem() { return keyitem; }
|
||||
void SetKeyItem(uint32 in) { keyitem = in; }
|
||||
uint8 GetNoKeyring() { return nokeyring; }
|
||||
void SetNoKeyring(uint8 in) { nokeyring = in; }
|
||||
uint16 GetLockpick() { return lockpick; }
|
||||
void SetLockpick(uint16 in) { lockpick = in; }
|
||||
uint16 GetLockpick() { return lockpick; }
|
||||
void SetLockpick(uint16 in) { lockpick = in; }
|
||||
uint16 GetSize() { return size; }
|
||||
void SetGuildID(uint32 guild_id) { this->guild_id = guild_id; }
|
||||
|
||||
uint32 GetEntityID() { return entity_id; }
|
||||
void SetEntityID(uint32 entity) { entity_id = entity; }
|
||||
|
||||
|
||||
void DumpDoor();
|
||||
float GetDestX() { return dest_x; }
|
||||
float GetDestY() { return dest_y; }
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
|
||||
uint8 IsLDoNDoor() { return is_ldon_door; }
|
||||
uint32 GetClientVersionMask() { return client_version_mask; }
|
||||
|
||||
|
||||
void NPCOpen(NPC* sender, bool alt_mode=false);
|
||||
void ForceOpen(Mob *sender, bool alt_mode=false);
|
||||
void ForceClose(Mob *sender, bool alt_mode=false);
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
void CreateDatabaseEntry();
|
||||
|
||||
private:
|
||||
|
||||
|
||||
uint32 db_id;
|
||||
uint8 door_id;
|
||||
char zone_name[32];
|
||||
|
||||
+111
-111
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2003 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2003 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
|
||||
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
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "../common/debug.h"
|
||||
#include "masterentity.h"
|
||||
@@ -35,16 +35,16 @@ float Client::GetActSpellRange(uint16 spell_id, float range, bool IsBard)
|
||||
float extrange = 100;
|
||||
|
||||
extrange += GetFocusEffect(focusRange, spell_id);
|
||||
|
||||
|
||||
return (range * extrange) / 100;
|
||||
}
|
||||
|
||||
|
||||
int32 Client::Additional_SpellDmg(uint16 spell_id, bool bufftick)
|
||||
int32 Client::Additional_SpellDmg(uint16 spell_id, bool bufftick)
|
||||
{
|
||||
int32 spell_dmg = 0;
|
||||
spell_dmg += GetFocusEffect(focusFF_Damage_Amount, spell_id);
|
||||
spell_dmg += GetFocusEffect(focusSpellDamage, spell_id);
|
||||
spell_dmg += GetFocusEffect(focusFF_Damage_Amount, spell_id);
|
||||
spell_dmg += GetFocusEffect(focusSpellDamage, spell_id);
|
||||
|
||||
//For DOTs you need to apply the damage over the duration of the dot to each tick (this is how live did it)
|
||||
if (bufftick){
|
||||
@@ -61,7 +61,7 @@ int32 Client::Additional_SpellDmg(uint16 spell_id, bool bufftick)
|
||||
//Direct Damage is checked in Mob::SpellEffect [spell_effects.cpp]
|
||||
//DoT Damage is checked in Mob::DoBuffTic [spell_effects.cpp] (This was added for npcs in that routine)
|
||||
int32 NPC::GetActSpellDamage(uint16 spell_id, int32 value) {
|
||||
|
||||
|
||||
int32 modifier = 100;
|
||||
|
||||
modifier += SpellFocusDMG;
|
||||
@@ -75,7 +75,7 @@ int32 Client::GetActSpellDamage(uint16 spell_id, int32 value) {
|
||||
// modifier: modifier to damage (from spells & focus effects?)
|
||||
// ratio: % of the modifier to apply (from AAs & natural bonus?)
|
||||
// chance: critital chance %
|
||||
|
||||
|
||||
int32 modifier = 100;
|
||||
int16 spell_dmg = 0;
|
||||
|
||||
@@ -83,32 +83,32 @@ int32 Client::GetActSpellDamage(uint16 spell_id, int32 value) {
|
||||
//Dunno if this makes sense:
|
||||
if (spells[spell_id].resisttype > 0)
|
||||
modifier += GetFocusEffect((focusType)(0-spells[spell_id].resisttype), spell_id);
|
||||
|
||||
|
||||
|
||||
|
||||
int tt = spells[spell_id].targettype;
|
||||
if (tt == ST_UndeadAE || tt == ST_Undead || tt == ST_Summoned) {
|
||||
//undead/summoned spells
|
||||
modifier += GetFocusEffect(focusImprovedUndeadDamage, spell_id);
|
||||
} else {
|
||||
//damage spells.
|
||||
} else {
|
||||
//damage spells.
|
||||
modifier += GetFocusEffect(focusImprovedDamage, spell_id);
|
||||
modifier += GetFocusEffect(focusSpellEffectiveness, spell_id);
|
||||
modifier += GetFocusEffect(focusImprovedDamage2, spell_id);
|
||||
}
|
||||
|
||||
|
||||
// Need to scale HT damage differently after level 40! It no longer scales by the constant value in the spell file. It scales differently, instead of 10 more damage per level, it does 30 more damage per level. So we multiply the level minus 40 times 20 if they are over level 40.
|
||||
if ( spell_id == SPELL_HARM_TOUCH || spell_id == SPELL_HARM_TOUCH2 || spell_id == SPELL_IMP_HARM_TOUCH ) {
|
||||
if (this->GetLevel() > 40)
|
||||
value -= (this->GetLevel() - 40) * 20;
|
||||
value -= (this->GetLevel() - 40) * 20;
|
||||
}
|
||||
|
||||
//This adds the extra damage from the AA Unholy Touch, 450 per level to the AA Improved Harm TOuch.
|
||||
if (spell_id == SPELL_IMP_HARM_TOUCH) { //Improved Harm Touch
|
||||
if (spell_id == SPELL_IMP_HARM_TOUCH) { //Improved Harm Touch
|
||||
value -= GetAA(aaUnholyTouch) * 450; //Unholy Touch
|
||||
}
|
||||
|
||||
|
||||
// This adds the extra damage for the AA's Consumption of the Soul and Improved Consumption of the Soul, 200 per level to the AA Leech Curse for Shadowknights.
|
||||
if (spell_id == SPELL_LEECH_TOUCH) { //Leech Touch
|
||||
if (spell_id == SPELL_LEECH_TOUCH) { //Leech Touch
|
||||
value -= GetAA(aaConsumptionoftheSoul) * 200; //Consumption of the Soul
|
||||
value -= GetAA(aaImprovedConsumptionofSoul) * 200; //Improved Consumption of the Soul
|
||||
}
|
||||
@@ -122,7 +122,7 @@ int32 Client::GetActSpellDamage(uint16 spell_id, int32 value) {
|
||||
if(spell_dmg > -value)
|
||||
spell_dmg = -value;
|
||||
}
|
||||
|
||||
|
||||
// Spell-based SpellDmg adds directly but it restricted by focuses.
|
||||
spell_dmg += Additional_SpellDmg(spell_id);
|
||||
|
||||
@@ -138,14 +138,14 @@ int32 Client::GetActSpellDamage(uint16 spell_id, int32 value) {
|
||||
ratio += RuleI(Spells, WizCritRatio);
|
||||
}
|
||||
if(aabonuses.SpellCritDmgIncrease > 0) // wizards get an additional bonus
|
||||
ratio += aabonuses.SpellCritDmgIncrease * 1.5; //108%, 115%, 124%, close to Graffe's 207%, 215%, & 225%
|
||||
ratio += aabonuses.SpellCritDmgIncrease * 1.5; //108%, 115%, 124%, close to Graffe's 207%, 215%, & 225%
|
||||
}
|
||||
|
||||
|
||||
//Improved Harm Touch is a guaranteed crit if you have at least one level of SCF.
|
||||
if (spell_id == SPELL_IMP_HARM_TOUCH) {
|
||||
if ( (GetAA(aaSpellCastingFury) > 0) && (GetAA(aaUnholyTouch) > 0) )
|
||||
chance = 100;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
//Handled in aa_effects will focus spells from 'spellgroup=99'. (SK life tap from buff procs)
|
||||
@@ -172,19 +172,19 @@ int32 Client::GetActSpellDamage(uint16 spell_id, int32 value) {
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
if (chance > 0) {
|
||||
mlog(SPELLS__CRITS, "Attempting spell crit. Spell: %s (%d), Value: %d, Modifier: %d, Chance: %d, Ratio: %d", spells[spell_id].name, spell_id, value, modifier, chance, ratio);
|
||||
if(MakeRandomInt(0,100) <= chance) {
|
||||
modifier += modifier*ratio/100;
|
||||
spell_dmg *= 2;
|
||||
mlog(SPELLS__CRITS, "Spell crit successful. Final damage modifier: %d, Final Damage: %d", modifier, (value * modifier / 100) - spell_dmg);
|
||||
entity_list.MessageClose(this, false, 100, MT_SpellCrits, "%s delivers a critical blast! (%d)", GetName(), (-value * modifier / 100) + spell_dmg);
|
||||
} else
|
||||
entity_list.MessageClose(this, false, 100, MT_SpellCrits, "%s delivers a critical blast! (%d)", GetName(), (-value * modifier / 100) + spell_dmg);
|
||||
} else
|
||||
mlog(SPELLS__CRITS, "Spell crit failed. Final Damage Modifier: %d, Final Damage: %d", modifier, (value * modifier / 100) - spell_dmg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return ((value * modifier / 100) - spell_dmg);
|
||||
}
|
||||
|
||||
@@ -199,19 +199,19 @@ int32 Client::GetActDoTDamage(uint16 spell_id, int32 value) {
|
||||
critChance += itembonuses.CriticalDoTChance + spellbonuses.CriticalDoTChance + aabonuses.CriticalDoTChance;
|
||||
ratio += itembonuses.DotCritDmgIncrease + spellbonuses.DotCritDmgIncrease + aabonuses.DotCritDmgIncrease;
|
||||
spell_dmg += Additional_SpellDmg(spell_id,true);
|
||||
|
||||
|
||||
// since DOTs are the Necromancer forte, give an innate bonus (Kayen: Is this a real bonus?)
|
||||
// however, no chance to crit unless they've trained atleast one level in the AA first
|
||||
if (GetClass() == NECROMANCER && critChance > 0)
|
||||
critChance += 5;
|
||||
|
||||
|
||||
if (critChance > 0){
|
||||
if (MakeRandomInt(0, 99) < critChance){
|
||||
modifier += modifier*ratio/100;
|
||||
return (((value*modifier/100)-spell_dmg)*2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return ((value*modifier/100)-spell_dmg);
|
||||
|
||||
}
|
||||
@@ -221,29 +221,29 @@ int32 NPC::GetActSpellHealing(uint16 spell_id, int32 value) {
|
||||
|
||||
int32 modifier = 100;
|
||||
modifier += SpellFocusHeal;
|
||||
|
||||
|
||||
// Check for buffs that affect the healrate of the target
|
||||
if(this->GetTarget())
|
||||
{
|
||||
value += value * GetHealRate(spell_id) / 100;
|
||||
value += value * GetHealRate(spell_id) / 100;
|
||||
}
|
||||
|
||||
return (value * modifier / 100);
|
||||
}
|
||||
|
||||
int32 Client::Additional_Heal(uint16 spell_id)
|
||||
int32 Client::Additional_Heal(uint16 spell_id)
|
||||
{
|
||||
int32 heal_amt = 0;
|
||||
|
||||
heal_amt += GetFocusEffect(focusAdditionalHeal, spell_id);
|
||||
heal_amt += GetFocusEffect(focusAdditionalHeal2, spell_id);
|
||||
heal_amt += GetFocusEffect(focusAdditionalHeal, spell_id);
|
||||
heal_amt += GetFocusEffect(focusAdditionalHeal2, spell_id);
|
||||
|
||||
if (heal_amt){
|
||||
int duration = CalcBuffDuration(this, this, spell_id);
|
||||
if (duration > 0)
|
||||
return heal_amt /= duration;
|
||||
}
|
||||
|
||||
|
||||
return heal_amt;
|
||||
}
|
||||
|
||||
@@ -255,9 +255,9 @@ int32 Client::GetActSpellHealing(uint16 spell_id, int32 value) {
|
||||
modifier += GetFocusEffect(focusSpellEffectiveness, spell_id);
|
||||
heal_amt += Additional_Heal(spell_id);
|
||||
int chance = 0;
|
||||
|
||||
// Instant Heals
|
||||
if(spells[spell_id].buffduration < 1)
|
||||
|
||||
// Instant Heals
|
||||
if(spells[spell_id].buffduration < 1)
|
||||
{
|
||||
// Formula = HealAmt * (casttime + recastime) / 7; Cant trigger off spell less than 5 levels below and cant heal more than the spell itself.
|
||||
if(this->itembonuses.HealAmt && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5) {
|
||||
@@ -271,22 +271,22 @@ int32 Client::GetActSpellHealing(uint16 spell_id, int32 value) {
|
||||
value += value * GetHealRate(spell_id) / 100;
|
||||
chance += GetCriticalHealRate(spell_id);
|
||||
}
|
||||
|
||||
|
||||
//Live AA - Healing Gift, Theft of Life
|
||||
chance += itembonuses.CriticalHealChance + spellbonuses.CriticalHealChance + aabonuses.CriticalHealChance;
|
||||
|
||||
|
||||
if(MakeRandomInt(0,99) < chance) {
|
||||
entity_list.MessageClose(this, false, 100, MT_SpellCrits, "%s performs an exceptional heal! (%d)", GetName(), ((value * modifier / 50) + heal_amt*2));
|
||||
entity_list.MessageClose(this, false, 100, MT_SpellCrits, "%s performs an exceptional heal! (%d)", GetName(), ((value * modifier / 50) + heal_amt*2));
|
||||
return ((value * modifier / 50) + heal_amt*2);
|
||||
}
|
||||
else{
|
||||
return ((value * modifier / 100) + heal_amt);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Hots
|
||||
else {
|
||||
chance += itembonuses.CriticalHealChance + spellbonuses.CriticalHealChance + aabonuses.CriticalHealChance;
|
||||
if(MakeRandomInt(0,99) < chance)
|
||||
if(MakeRandomInt(0,99) < chance)
|
||||
return ((value * modifier / 50) + heal_amt*2);
|
||||
}
|
||||
return ((value * modifier / 100) + heal_amt);
|
||||
@@ -301,10 +301,10 @@ int32 Client::GetActSpellCost(uint16 spell_id, int32 cost)
|
||||
// Doesnt generate mana, so best case is a free spell
|
||||
if(mana_back > cost)
|
||||
mana_back = cost;
|
||||
|
||||
|
||||
cost -= mana_back;
|
||||
}
|
||||
|
||||
|
||||
// This formula was derived from the following resource:
|
||||
// http://www.eqsummoners.com/eq1/specialization-library.html
|
||||
// WildcardX
|
||||
@@ -373,14 +373,14 @@ int32 Client::GetActSpellCost(uint16 spell_id, int32 cost)
|
||||
for (int buffSlot = 0; buffSlot < buff_max; buffSlot++) {
|
||||
if (buffs[buffSlot].spellid == 0 || buffs[buffSlot].spellid >= SPDAT_RECORDS)
|
||||
continue;
|
||||
|
||||
|
||||
if(IsEffectInSpell(buffs[buffSlot].spellid, SE_ReduceManaCost)) {
|
||||
if(CalcFocusEffect(focusManaCost, buffs[buffSlot].spellid, spell_id) == 100)
|
||||
cost = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(cost < 0)
|
||||
cost = 0;
|
||||
|
||||
@@ -393,7 +393,7 @@ int32 Client::GetActSpellDuration(uint16 spell_id, int32 duration)
|
||||
increase += GetFocusEffect(focusSpellDuration, spell_id);
|
||||
int tic_inc = 0;
|
||||
tic_inc = GetFocusEffect(focusSpellDurByTic, spell_id);
|
||||
|
||||
|
||||
if(IsBeneficialSpell(spell_id))
|
||||
{
|
||||
switch(GetAA(aaSpellCastingReinforcement)) {
|
||||
@@ -414,7 +414,7 @@ int32 Client::GetActSpellDuration(uint16 spell_id, int32 duration)
|
||||
if(IsMezSpell(spell_id)) {
|
||||
tic_inc += GetAA(aaMesmerizationMastery);
|
||||
}
|
||||
|
||||
|
||||
return (((duration * increase) / 100) + tic_inc);
|
||||
}
|
||||
|
||||
@@ -426,23 +426,23 @@ int32 Client::GetActSpellCasttime(uint16 spell_id, int32 casttime)
|
||||
//this function loops through the effects of spell_id many times
|
||||
//could easily be consolidated.
|
||||
|
||||
if (GetLevel() >= 51 && casttime >= 3000 && !BeneficialSpell(spell_id)
|
||||
&& (GetClass() == SHADOWKNIGHT || GetClass() == RANGER
|
||||
if (GetLevel() >= 51 && casttime >= 3000 && !BeneficialSpell(spell_id)
|
||||
&& (GetClass() == SHADOWKNIGHT || GetClass() == RANGER
|
||||
|| GetClass() == PALADIN || GetClass() == BEASTLORD ))
|
||||
cast_reducer += (GetLevel()-50)*3;
|
||||
|
||||
|
||||
//LIVE AA SpellCastingDeftness, QuickBuff, QuickSummoning, QuickEvacuation, QuickDamage
|
||||
|
||||
|
||||
if (cast_reducer > RuleI(Spells, MaxCastTimeReduction))
|
||||
cast_reducer = RuleI(Spells, MaxCastTimeReduction);
|
||||
|
||||
cast_reducer = RuleI(Spells, MaxCastTimeReduction);
|
||||
|
||||
casttime = (casttime*(100 - cast_reducer)/100);
|
||||
|
||||
|
||||
return casttime;
|
||||
}
|
||||
|
||||
bool Client::TrainDiscipline(uint32 itemid) {
|
||||
|
||||
|
||||
//get the item info
|
||||
const Item_Struct *item = database.GetItem(itemid);
|
||||
if(item == nullptr) {
|
||||
@@ -450,14 +450,14 @@ bool Client::TrainDiscipline(uint32 itemid) {
|
||||
LogFile->write(EQEMuLog::Error, "Unable to find turned in tome id %lu\n", (unsigned long)itemid);
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
||||
if(item->ItemClass != ItemClassCommon || item->ItemType != ItemTypeSpell) {
|
||||
Message(13, "Invalid item type, you cannot learn from this item.");
|
||||
//summon them the item back...
|
||||
SummonItem(itemid);
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
||||
//Need a way to determine the difference between a spell and a tome
|
||||
//so they cant turn in a spell and get it as a discipline
|
||||
//this is kinda a hack:
|
||||
@@ -481,7 +481,7 @@ bool Client::TrainDiscipline(uint32 itemid) {
|
||||
SummonItem(itemid);
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
||||
int myclass = GetClass();
|
||||
if(myclass == WIZARD || myclass == ENCHANTER || myclass == MAGICIAN || myclass == NECROMANCER) {
|
||||
Message(13, "Your class cannot learn from this tome.");
|
||||
@@ -489,7 +489,7 @@ bool Client::TrainDiscipline(uint32 itemid) {
|
||||
SummonItem(itemid);
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
||||
//make sure we can train this...
|
||||
//can we use the item?
|
||||
uint32 cbit = 1 << (myclass-1);
|
||||
@@ -499,13 +499,13 @@ bool Client::TrainDiscipline(uint32 itemid) {
|
||||
SummonItem(itemid);
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
||||
uint32 spell_id = item->Scroll.Effect;
|
||||
if(!IsValidSpell(spell_id)) {
|
||||
Message(13, "This tome contains invalid knowledge.");
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
||||
//can we use the spell?
|
||||
const SPDat_Spell_Struct &spell = spells[spell_id];
|
||||
uint8 level_to_use = spell.classes[myclass - 1];
|
||||
@@ -515,14 +515,14 @@ bool Client::TrainDiscipline(uint32 itemid) {
|
||||
SummonItem(itemid);
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
||||
if(level_to_use > GetLevel()) {
|
||||
Message(13, "You must be at least level %d to learn this discipline.", level_to_use);
|
||||
//summon them the item back...
|
||||
SummonItem(itemid);
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
||||
//add it to PP.
|
||||
int r;
|
||||
for(r = 0; r < MAX_PP_DISCIPLINES; r++) {
|
||||
@@ -544,7 +544,7 @@ bool Client::TrainDiscipline(uint32 itemid) {
|
||||
|
||||
void Client::SendDisciplineUpdate() {
|
||||
//this dosent seem to work right now
|
||||
|
||||
|
||||
EQApplicationPacket app(OP_DisciplineUpdate, sizeof(Disciplines_Struct));
|
||||
Disciplines_Struct *d = (Disciplines_Struct*)app.pBuffer;
|
||||
//dunno why I dont just send the one from m_pp
|
||||
@@ -559,7 +559,7 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) {
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
||||
//make sure we have the spell...
|
||||
int r;
|
||||
for(r = 0; r < MAX_PP_DISCIPLINES; r++) {
|
||||
@@ -579,13 +579,13 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) {
|
||||
Message(0, "You can use this discipline in %d minutes %d seconds.", ((remain)/60), (remain%60));
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
||||
//make sure we can use it..
|
||||
if(!IsValidSpell(spell_id)) {
|
||||
Message(13, "This tome contains invalid knowledge.");
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
||||
//can we use the spell?
|
||||
const SPDat_Spell_Struct &spell = spells[spell_id];
|
||||
uint8 level_to_use = spell.classes[GetClass() - 1];
|
||||
@@ -594,27 +594,27 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) {
|
||||
//should summon them a new one...
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
||||
if(level_to_use > GetLevel()) {
|
||||
Message_StringID(13, DISC_LEVEL_USE_ERROR);
|
||||
//should summon them a new one...
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
||||
if(GetEndurance() > spell.EndurCost) {
|
||||
SetEndurance(GetEndurance() - spell.EndurCost);
|
||||
} else {
|
||||
Message(11, "You are too fatigued to use this skill right now.");
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
||||
if(spell.recast_time > 0)
|
||||
{
|
||||
uint32 reduced_recast = spell.recast_time / 1000;
|
||||
reduced_recast -= CastToClient()->GetFocusEffect(focusReduceRecastTime, spell_id);
|
||||
if(reduced_recast < 0)
|
||||
reduced_recast = 0;
|
||||
|
||||
|
||||
CastSpell(spell_id, target, DISCIPLINE_SPELL_SLOT, -1, -1, 0, -1, (uint32)DiscTimer, reduced_recast);
|
||||
if(spells[spell_id].EndurTimerIndex < MAX_DISCIPLINE_TIMERS)
|
||||
{
|
||||
@@ -624,7 +624,7 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) {
|
||||
dts->Duration = reduced_recast;
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -635,13 +635,13 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) {
|
||||
|
||||
void EntityList::AETaunt(Client* taunter, float range) {
|
||||
LinkedListIterator<NPC*> iterator(npc_list);
|
||||
|
||||
|
||||
if(range == 0) {
|
||||
range = 100; //arbitrary default...
|
||||
}
|
||||
|
||||
|
||||
range = range * range;
|
||||
|
||||
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements())
|
||||
{
|
||||
@@ -652,7 +652,7 @@ void EntityList::AETaunt(Client* taunter, float range) {
|
||||
if (zdiff < 10
|
||||
&& taunter->IsAttackAllowed(them)
|
||||
&& taunter->DistNoRootNoZ(*them) <= range) {
|
||||
|
||||
|
||||
if (taunter->CheckLosFN(them)) {
|
||||
taunter->Taunt(them, true);
|
||||
}
|
||||
@@ -668,15 +668,15 @@ void EntityList::AESpell(Mob *caster, Mob *center, uint16 spell_id, bool affect_
|
||||
{
|
||||
LinkedListIterator<Mob*> iterator(mob_list);
|
||||
Mob *curmob;
|
||||
|
||||
|
||||
float dist = caster->GetAOERange(spell_id);
|
||||
float dist2 = dist * dist;
|
||||
|
||||
|
||||
bool bad = IsDetrimentalSpell(spell_id);
|
||||
bool isnpc = caster->IsNPC();
|
||||
const int MAX_TARGETS_ALLOWED = 4;
|
||||
int iCounter = 0;
|
||||
|
||||
|
||||
for(iterator.Reset(); iterator.MoreElements(); iterator.Advance())
|
||||
{
|
||||
curmob = iterator.GetData();
|
||||
@@ -717,7 +717,7 @@ void EntityList::AESpell(Mob *caster, Mob *center, uint16 spell_id, bool affect_
|
||||
}
|
||||
|
||||
//if we get here... cast the spell.
|
||||
if(IsTargetableAESpell(spell_id) && bad)
|
||||
if(IsTargetableAESpell(spell_id) && bad)
|
||||
{
|
||||
if(iCounter < MAX_TARGETS_ALLOWED)
|
||||
{
|
||||
@@ -731,17 +731,17 @@ void EntityList::AESpell(Mob *caster, Mob *center, uint16 spell_id, bool affect_
|
||||
|
||||
if(!isnpc) //npcs are not target limited...
|
||||
iCounter++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EntityList::MassGroupBuff(Mob *caster, Mob *center, uint16 spell_id, bool affect_caster)
|
||||
{
|
||||
LinkedListIterator<Mob*> iterator(mob_list);
|
||||
Mob *curmob;
|
||||
|
||||
|
||||
float dist = caster->GetAOERange(spell_id);
|
||||
float dist2 = dist * dist;
|
||||
|
||||
|
||||
bool bad = IsDetrimentalSpell(spell_id);
|
||||
|
||||
for(iterator.Reset(); iterator.MoreElements(); iterator.Advance())
|
||||
@@ -771,13 +771,13 @@ void EntityList::MassGroupBuff(Mob *caster, Mob *center, uint16 spell_id, bool a
|
||||
}
|
||||
}
|
||||
|
||||
if(bad)
|
||||
if(bad)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
caster->SpellOnTarget(spell_id, curmob);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// solar: causes caster to hit every mob within dist range of center with
|
||||
@@ -787,13 +787,13 @@ void EntityList::AEBardPulse(Mob *caster, Mob *center, uint16 spell_id, bool aff
|
||||
{
|
||||
LinkedListIterator<Mob*> iterator(mob_list);
|
||||
Mob *curmob;
|
||||
|
||||
|
||||
float dist = caster->GetAOERange(spell_id);
|
||||
float dist2 = dist * dist;
|
||||
|
||||
|
||||
bool bad = IsDetrimentalSpell(spell_id);
|
||||
bool isnpc = caster->IsNPC();
|
||||
|
||||
|
||||
for(iterator.Reset(); iterator.MoreElements(); iterator.Advance())
|
||||
{
|
||||
curmob = iterator.GetData();
|
||||
@@ -839,28 +839,28 @@ void EntityList::AEBardPulse(Mob *caster, Mob *center, uint16 spell_id, bool aff
|
||||
//Dook- Rampage and stuff for clients.
|
||||
//NPCs handle it differently in Mob::Rampage
|
||||
void EntityList::AEAttack(Mob *attacker, float dist, int Hand, int count, bool IsFromSpell) {
|
||||
//Dook- Will need tweaking, currently no pets or players or horses
|
||||
LinkedListIterator<Mob*> iterator(mob_list);
|
||||
Mob *curmob;
|
||||
|
||||
//Dook- Will need tweaking, currently no pets or players or horses
|
||||
LinkedListIterator<Mob*> iterator(mob_list);
|
||||
Mob *curmob;
|
||||
|
||||
float dist2 = dist * dist;
|
||||
|
||||
|
||||
int hit = 0;
|
||||
|
||||
for(iterator.Reset(); iterator.MoreElements(); iterator.Advance()) {
|
||||
curmob = iterator.GetData();
|
||||
|
||||
for(iterator.Reset(); iterator.MoreElements(); iterator.Advance()) {
|
||||
curmob = iterator.GetData();
|
||||
if(curmob->IsNPC()
|
||||
&& curmob != attacker //this is not needed unless NPCs can use this
|
||||
&&(attacker->IsAttackAllowed(curmob))
|
||||
&& curmob->GetRace() != 216 && curmob->GetRace() != 472 /* dont attack horses */
|
||||
&& (curmob->DistNoRoot(*attacker) <= dist2)
|
||||
) {
|
||||
attacker->Attack(curmob, Hand, false, false, IsFromSpell);
|
||||
attacker->Attack(curmob, Hand, false, false, IsFromSpell);
|
||||
hit++;
|
||||
if(count != 0 && hit >= count)
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -63,7 +63,7 @@ const char *QuestEventSubroutines[_LargestEventID] = {
|
||||
"EVENT_TASK_FAIL",
|
||||
"EVENT_AGGRO_SAY",
|
||||
"EVENT_PLAYER_PICKUP",
|
||||
"EVENT_POPUP_RESPONSE",
|
||||
"EVENT_POPUPRESPONSE",
|
||||
"EVENT_PROXIMITY_SAY",
|
||||
"EVENT_CAST",
|
||||
"EVENT_SCALE_CALC",
|
||||
@@ -1204,7 +1204,7 @@ void PerlembParser::ExportEventVariables(std::string &package_name, QuestEventID
|
||||
break;
|
||||
}
|
||||
|
||||
case EVENT_POPUP_RESPONSE:{
|
||||
case EVENT_POPUPRESPONSE:{
|
||||
ExportVar(package_name.c_str(), "popupid", data);
|
||||
break;
|
||||
}
|
||||
|
||||
+28
-28
@@ -17,7 +17,7 @@ Eglin
|
||||
#include <string.h>
|
||||
|
||||
//headers from the Perl distribution
|
||||
#include <EXTERN.h>
|
||||
#include <EXTERN.h>
|
||||
#define WIN32IO_IS_STDIO
|
||||
|
||||
#ifndef WIN32
|
||||
@@ -29,10 +29,10 @@ extern "C" { //the perl headers dont do this for us...
|
||||
};
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
#define snprintf _snprintf
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
//perl defines these macros and dosent clean them up, lazy bastards. -- I hate them too!
|
||||
//perl defines these macros and dosent clean them up, lazy bastards. -- I hate them too!
|
||||
#ifdef Copy
|
||||
#undef Copy
|
||||
#endif
|
||||
@@ -69,30 +69,30 @@ private:
|
||||
eval(buffer);
|
||||
return get_sv("scratch::temp", false);
|
||||
}
|
||||
|
||||
|
||||
//install a perl func
|
||||
void init_eval_file(void);
|
||||
|
||||
|
||||
bool in_use; //true if perl is executing
|
||||
protected:
|
||||
//the embedded interpreter
|
||||
PerlInterpreter * my_perl;
|
||||
|
||||
|
||||
void DoInit();
|
||||
|
||||
|
||||
public:
|
||||
Embperl(void); //This can throw errors! Buyer beware
|
||||
Embperl(void); //This can throw errors! Buyer beware
|
||||
~Embperl(void);
|
||||
|
||||
|
||||
void Reinit();
|
||||
|
||||
|
||||
//return the last error msg
|
||||
std::string lasterr(void) const { return errmsg;};
|
||||
//evaluate an expression. throws string errors on fail
|
||||
void eval(const char * code);
|
||||
//execute a subroutine. throws lasterr on failure
|
||||
//execute a subroutine. throws lasterr on failure
|
||||
void dosub(const char * subname, const std::vector<std::string> * args = nullptr, int mode = G_SCALAR|G_DISCARD|G_EVAL);
|
||||
|
||||
|
||||
//Access to perl variables
|
||||
//all varnames here should be of the form package::name
|
||||
//returns the contents of the perl variable named in varname as a c int
|
||||
@@ -104,7 +104,7 @@ public:
|
||||
SV * temp = my_get_sv(varname);
|
||||
return std::string(SvPV_nolen(temp),SvLEN(temp));
|
||||
}
|
||||
|
||||
|
||||
//put an integer into a perl varable
|
||||
void seti(const char *varname, int val) const {
|
||||
SV *t = get_sv(varname, true);
|
||||
@@ -130,28 +130,28 @@ public:
|
||||
HV *hv = get_hv(varname, TRUE);
|
||||
hv_clear(hv);
|
||||
|
||||
// Iterate through key-value pairs, storing them in hash
|
||||
for (it = vals.begin(); it != vals.end(); it++)
|
||||
{
|
||||
int keylen = static_cast<int>(it->first.length());
|
||||
|
||||
SV *val = newSVpv(it->second.c_str(), it->second.length());
|
||||
|
||||
// If val was not added to hash, reset reference count
|
||||
if (hv_store(hv, it->first.c_str(), keylen, val, 0) == nullptr)
|
||||
val->sv_refcnt = 0;
|
||||
}
|
||||
// Iterate through key-value pairs, storing them in hash
|
||||
for (it = vals.begin(); it != vals.end(); it++)
|
||||
{
|
||||
int keylen = static_cast<int>(it->first.length());
|
||||
|
||||
SV *val = newSVpv(it->second.c_str(), it->second.length());
|
||||
|
||||
// If val was not added to hash, reset reference count
|
||||
if (hv_store(hv, it->first.c_str(), keylen, val, 0) == nullptr)
|
||||
val->sv_refcnt = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//loads a file and compiles it into our interpreter (assuming it hasn't already been read in)
|
||||
//idea borrowed from perlembed
|
||||
void eval_file(const char * packagename, const char * filename);
|
||||
|
||||
|
||||
inline bool InUse() const { return(in_use); }
|
||||
|
||||
|
||||
//check to see if a sub exists in package
|
||||
bool SubExists(const char *package, const char *sub);
|
||||
|
||||
|
||||
//check to see if a variable exists in package
|
||||
bool VarExists(const char *package, const char *var);
|
||||
};
|
||||
|
||||
+6
-6
@@ -1,8 +1,8 @@
|
||||
#ifndef EMBXS_H
|
||||
#define EMBXS_H
|
||||
#ifndef EMBXS_H
|
||||
#define EMBXS_H
|
||||
|
||||
//headers from the Perl distribution
|
||||
#include <EXTERN.h>
|
||||
#include <EXTERN.h>
|
||||
#define WIN32IO_IS_STDIO
|
||||
|
||||
#ifndef WIN32
|
||||
@@ -14,7 +14,7 @@ extern "C" { //the perl headers dont do this for us...
|
||||
};
|
||||
#endif
|
||||
|
||||
const char *getItemName(unsigned itemid);
|
||||
XS(XS_qc_getItemName); /* prototype to pass -Wmissing-prototypes */
|
||||
EXTERN_C XS(boot_qc); /* prototype to pass -Wmissing-prototypes */
|
||||
const char *getItemName(unsigned itemid);
|
||||
XS(XS_qc_getItemName); /* prototype to pass -Wmissing-prototypes */
|
||||
EXTERN_C XS(boot_qc); /* prototype to pass -Wmissing-prototypes */
|
||||
#endif // EMBXS_H
|
||||
|
||||
+431
-431
File diff suppressed because it is too large
Load Diff
+72
-72
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2003 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2003 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 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
|
||||
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.
|
||||
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
|
||||
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 ENTITY_H
|
||||
#define ENTITY_H
|
||||
@@ -81,29 +81,29 @@ public:
|
||||
virtual bool IsTrap() const { return false; }
|
||||
virtual bool IsBeacon() const { return false; }
|
||||
|
||||
virtual bool Process() { return false; }
|
||||
virtual bool Process() { return false; }
|
||||
virtual bool Save() { return true; }
|
||||
virtual void Depop(bool StartSpawnTimer = false) {}
|
||||
|
||||
Client* CastToClient();
|
||||
NPC* CastToNPC();
|
||||
Mob* CastToMob();
|
||||
Merc* CastToMerc();
|
||||
NPC* CastToNPC();
|
||||
Mob* CastToMob();
|
||||
Merc* CastToMerc();
|
||||
Corpse* CastToCorpse();
|
||||
Object* CastToObject();
|
||||
Doors* CastToDoors();
|
||||
Trap* CastToTrap();
|
||||
Beacon* CastToBeacon();
|
||||
|
||||
|
||||
const Client* CastToClient() const;
|
||||
const NPC* CastToNPC() const;
|
||||
const Mob* CastToMob() const;
|
||||
const Merc* CastToMerc() const;
|
||||
const NPC* CastToNPC() const;
|
||||
const Mob* CastToMob() const;
|
||||
const Merc* CastToMerc() const;
|
||||
const Corpse* CastToCorpse() const;
|
||||
const Object* CastToObject() const;
|
||||
const Object* CastToObject() const;
|
||||
// const Group* CastToGroup() const;
|
||||
const Doors* CastToDoors() const;
|
||||
const Trap* CastToTrap() const;
|
||||
const Trap* CastToTrap() const;
|
||||
const Beacon* CastToBeacon() const;
|
||||
|
||||
inline const uint16& GetID() const { return id; }
|
||||
@@ -130,7 +130,7 @@ class EntityList
|
||||
public:
|
||||
EntityList();
|
||||
~EntityList();
|
||||
|
||||
|
||||
Entity* GetID(uint16 id);
|
||||
Mob* GetMob(uint16 id);
|
||||
inline Mob* GetMobID(uint16 id) { return(GetMob(id)); } //for perl
|
||||
@@ -140,7 +140,7 @@ public:
|
||||
NPC* GetNPCByID(uint16 id);
|
||||
NPC* GetNPCByNPCTypeID(uint32 npc_id);
|
||||
Merc* GetMercByID(uint16 id);
|
||||
Client* GetClientByName(const char *name);
|
||||
Client* GetClientByName(const char *name);
|
||||
Client* GetClientByAccID(uint32 accid);
|
||||
Client* GetClientByID(uint16 id);
|
||||
Client* GetClientByCharID(uint32 iCharID);
|
||||
@@ -149,8 +149,8 @@ public:
|
||||
Client* GetRandomClient(float x, float y, float z, float Distance, Client *ExcludeClient = nullptr);
|
||||
Group* GetGroupByMob(Mob* mob);
|
||||
Group* GetGroupByClient(Client* client);
|
||||
Group* GetGroupByID(uint32 id);
|
||||
Group* GetGroupByLeaderName(char* leader);
|
||||
Group* GetGroupByID(uint32 id);
|
||||
Group* GetGroupByLeaderName(char* leader);
|
||||
Raid* GetRaidByMob(Mob* mob);
|
||||
Raid* GetRaidByClient(Client* client);
|
||||
Raid* GetRaidByID(uint32 id);
|
||||
@@ -174,12 +174,12 @@ public:
|
||||
int RezzAllCorpsesByCharID(uint32 charid);
|
||||
bool IsMobInZone(Mob *who);
|
||||
void ClearClientPetitionQueue();
|
||||
bool CanAddHateForMob(Mob *p);
|
||||
void SendGuildMOTD(uint32 guild_id);
|
||||
void SendGuildSpawnAppearance(uint32 guild_id);
|
||||
void SendGuildMembers(uint32 guild_id);
|
||||
void RefreshAllGuildInfo(uint32 guild_id);
|
||||
void SendGuildList();
|
||||
bool CanAddHateForMob(Mob *p);
|
||||
void SendGuildMOTD(uint32 guild_id);
|
||||
void SendGuildSpawnAppearance(uint32 guild_id);
|
||||
void SendGuildMembers(uint32 guild_id);
|
||||
void RefreshAllGuildInfo(uint32 guild_id);
|
||||
void SendGuildList();
|
||||
// void SendGuildJoin(GuildJoin_Struct* gj);
|
||||
// Check group list for nullptr entries
|
||||
void CheckGroupList (const char *fname, const int fline);
|
||||
@@ -198,17 +198,17 @@ public:
|
||||
Object* FindObject(uint32 object_id);
|
||||
Object* FindNearbyObject(float x, float y, float z, float radius);
|
||||
bool MakeDoorSpawnPacket(EQApplicationPacket* app, Client *client);
|
||||
bool MakeTrackPacket(Client* client);
|
||||
void SendTraders(Client* client);
|
||||
void AddClient(Client*);
|
||||
void AddNPC(NPC*, bool SendSpawnPacket = true, bool dontqueue = false);
|
||||
bool MakeTrackPacket(Client* client);
|
||||
void SendTraders(Client* client);
|
||||
void AddClient(Client*);
|
||||
void AddNPC(NPC*, bool SendSpawnPacket = true, bool dontqueue = false);
|
||||
void AddMerc(Merc*, bool SendSpawnPacket = true, bool dontqueue = false);
|
||||
void AddCorpse(Corpse* pc, uint32 in_id = 0xFFFFFFFF);
|
||||
void AddObject(Object*, bool SendSpawnPacket = true);
|
||||
void AddGroup(Group*);
|
||||
void AddGroup(Group*, uint32 id);
|
||||
void AddObject(Object*, bool SendSpawnPacket = true);
|
||||
void AddGroup(Group*);
|
||||
void AddGroup(Group*, uint32 id);
|
||||
void AddRaid(Raid *raid);
|
||||
void AddRaid(Raid*, uint32 id);
|
||||
void AddRaid(Raid*, uint32 id);
|
||||
void AddDoor(Doors* door);
|
||||
void AddTrap(Trap* trap);
|
||||
void AddBeacon(Beacon *beacon);
|
||||
@@ -251,7 +251,7 @@ public:
|
||||
// Entity* GetEntityGroup(uint32 id);
|
||||
Entity* GetEntityTrap(uint16 id);
|
||||
Entity* GetEntityBeacon(uint16 id);
|
||||
|
||||
|
||||
void DescribeAggro(Client *towho, NPC *from_who, float dist, bool verbose);
|
||||
|
||||
void Message(uint32 to_guilddbid, uint32 type, const char* message, ...);
|
||||
@@ -260,53 +260,53 @@ public:
|
||||
void Message_StringID(Mob *sender, bool skipsender, uint32 type, uint32 string_id, const char* message1=0,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0);
|
||||
void MessageClose_StringID(Mob *sender, bool skipsender, float dist, uint32 type, uint32 string_id, const char* message1=0,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0);
|
||||
void ChannelMessageFromWorld(const char* from, const char* to, uint8 chan_num, uint32 guilddbid, uint8 language, const char* message);
|
||||
void ChannelMessage(Mob* from, uint8 chan_num, uint8 language, const char* message, ...);
|
||||
void ChannelMessage(Mob* from, uint8 chan_num, uint8 language, uint8 lang_skill, const char* message, ...);
|
||||
void ChannelMessage(Mob* from, uint8 chan_num, uint8 language, const char* message, ...);
|
||||
void ChannelMessage(Mob* from, uint8 chan_num, uint8 language, uint8 lang_skill, const char* message, ...);
|
||||
void ChannelMessageSend(Mob* to, uint8 chan_num, uint8 language, const char* message, ...);
|
||||
void SendZoneSpawns(Client*);
|
||||
void SendZoneSpawns(Client*);
|
||||
void SendZonePVPUpdates(Client *);
|
||||
void SendZoneSpawnsBulk(Client* client);
|
||||
void Save();
|
||||
void SendZoneCorpses(Client*);
|
||||
void SendZoneCorpsesBulk(Client*);
|
||||
void SendZoneObjects(Client* client);
|
||||
void Save();
|
||||
void SendZoneCorpses(Client*);
|
||||
void SendZoneCorpsesBulk(Client*);
|
||||
void SendZoneObjects(Client* client);
|
||||
void SendZoneAppearance(Client *c);
|
||||
void SendNimbusEffects(Client *c);
|
||||
void SendUntargetable(Client *c);
|
||||
void SendUntargetable(Client *c);
|
||||
void DuelMessage(Mob* winner, Mob* loser, bool flee);
|
||||
void QuestJournalledSayClose(Mob *sender, Client *QuestIntiator, float dist, const char* mobname, const char* message);
|
||||
void QuestJournalledSayClose(Mob *sender, Client *QuestIntiator, float dist, const char* mobname, const char* message);
|
||||
void GroupMessage(uint32 gid, const char *from, const char *message);
|
||||
void ExpeditionWarning(uint32 minutes_left);
|
||||
|
||||
void RemoveFromTargets(Mob* mob, bool RemoveFromXTargets = false);
|
||||
void RemoveFromXTargets(Mob* mob);
|
||||
void RemoveFromAutoXTargets(Mob* mob);
|
||||
void ReplaceWithTarget(Mob* pOldMob, Mob*pNewTarget);
|
||||
void RemoveFromTargets(Mob* mob, bool RemoveFromXTargets = false);
|
||||
void RemoveFromXTargets(Mob* mob);
|
||||
void RemoveFromAutoXTargets(Mob* mob);
|
||||
void ReplaceWithTarget(Mob* pOldMob, Mob*pNewTarget);
|
||||
void QueueCloseClients(Mob* sender, const EQApplicationPacket* app, bool ignore_sender=false, float dist=200, Mob* SkipThisMob = 0, bool ackreq = true,eqFilterType filter=FilterNone);
|
||||
void QueueClients(Mob* sender, const EQApplicationPacket* app, bool ignore_sender=false, bool ackreq = true);
|
||||
void QueueClients(Mob* sender, const EQApplicationPacket* app, bool ignore_sender=false, bool ackreq = true);
|
||||
void QueueClientsStatus(Mob* sender, const EQApplicationPacket* app, bool ignore_sender = false, uint8 minstatus = 0, uint8 maxstatus = 0);
|
||||
void QueueClientsGuild(Mob* sender, const EQApplicationPacket* app, bool ignore_sender = false, uint32 guildeqid = 0);
|
||||
void QueueClientsGuildBankItemUpdate(const GuildBankItemUpdate_Struct *gbius, uint32 GuildID);
|
||||
void QueueClientsByTarget(Mob* sender, const EQApplicationPacket* app, bool iSendToSender = true, Mob* SkipThisMob = 0, bool ackreq = true,
|
||||
bool HoTT = true, uint32 ClientVersionBits = 0xFFFFFFFF);
|
||||
bool HoTT = true, uint32 ClientVersionBits = 0xFFFFFFFF);
|
||||
|
||||
void QueueClientsByXTarget(Mob* sender, const EQApplicationPacket* app, bool iSendToSender = true);
|
||||
void QueueToGroupsForNPCHealthAA(Mob* sender, const EQApplicationPacket* app);
|
||||
void QueueManaged(Mob* sender, const EQApplicationPacket* app, bool ignore_sender=false, bool ackreq = true);
|
||||
void QueueManaged(Mob* sender, const EQApplicationPacket* app, bool ignore_sender=false, bool ackreq = true);
|
||||
|
||||
void AEAttack(Mob *attacker, float dist, int Hand = 13, int count = 0, bool IsFromSpell = false);
|
||||
void AETaunt(Client *caster, float range = 0);
|
||||
void AESpell(Mob *caster, Mob *center, uint16 spell_id, bool affect_caster = true, int16 resist_adjust = 0);
|
||||
void MassGroupBuff(Mob *caster, Mob *center, uint16 spell_id, bool affect_caster = true);
|
||||
void AEBardPulse(Mob *caster, Mob *center, uint16 spell_id, bool affect_caster = true);
|
||||
|
||||
void RadialSetLogging(Mob *around, bool enabled, bool clients, bool non_clients, float range = 0);
|
||||
|
||||
void RadialSetLogging(Mob *around, bool enabled, bool clients, bool non_clients, float range = 0);
|
||||
|
||||
//trap stuff
|
||||
Mob* GetTrapTrigger(Trap* trap);
|
||||
void SendAlarm(Trap* trap, Mob* currenttarget, uint8 kos);
|
||||
Trap* FindNearbyTrap(Mob* searcher, float max_dist);
|
||||
|
||||
|
||||
void AddHealAggro(Mob* target, Mob* caster, uint16 thedam);
|
||||
Mob* FindDefenseNPC(uint32 npcid);
|
||||
void OpenDoorsNear(NPC* opener);
|
||||
@@ -317,7 +317,7 @@ public:
|
||||
void SignalMobsByNPCID(uint32 npc_type, int signal_id);
|
||||
void CountNPC(uint32* NPCCount, uint32* NPCLootCount, uint32* gmspawntype_count);
|
||||
void DoZoneDump(ZSDump_Spawn2* spawn2dump, ZSDump_NPC* npcdump, ZSDump_NPC_Loot* npclootdump, NPCType* gmspawntype_dump);
|
||||
void RemoveEntity(uint16 id);
|
||||
void RemoveEntity(uint16 id);
|
||||
void SendPetitionToAdmins(Petition* pet);
|
||||
void SendPetitionToAdmins();
|
||||
void AddLootToNPCS(uint32 item_id, uint32 count);
|
||||
@@ -334,19 +334,19 @@ public:
|
||||
void Evade(Mob *who);
|
||||
void UpdateHoTT(Mob* target);
|
||||
|
||||
void Process();
|
||||
void Process();
|
||||
void ClearAggro(Mob* targ);
|
||||
void ClearFeignAggro(Mob* targ);
|
||||
void ClearZoneFeignAggro(Client* targ);
|
||||
void AggroZone(Mob* who, int hate = 0);
|
||||
|
||||
|
||||
bool Fighting(Mob* targ);
|
||||
void RemoveFromHateLists(Mob* mob, bool settoone = false);
|
||||
void RemoveFromHateLists(Mob* mob, bool settoone = false);
|
||||
void RemoveDebuffs(Mob* caster);
|
||||
|
||||
|
||||
void MessageGroup(Mob* sender, bool skipclose, uint32 type, const char* message, ...);
|
||||
|
||||
|
||||
void LimitAddNPC(NPC *npc);
|
||||
void LimitRemoveNPC(NPC *npc);
|
||||
bool LimitCheckType(uint32 npc_type, int count);
|
||||
@@ -371,8 +371,8 @@ public:
|
||||
void SendGroupLeave(uint32 gid, const char *name);
|
||||
void SendGroupJoin(uint32 gid, const char *name);
|
||||
|
||||
void SaveAllClientsTaskState();
|
||||
void ReloadAllClientsTaskState(int TaskID=0);
|
||||
void SaveAllClientsTaskState();
|
||||
void ReloadAllClientsTaskState(int TaskID=0);
|
||||
|
||||
uint16 CreateGroundObject(uint32 itemid, float x, float y, float z, float heading, uint32 decay_time = 300000);
|
||||
uint16 CreateGroundObjectFromModel(const char *model, float x, float y, float z, float heading, uint8 type = 0x00, uint32 decay_time = 0);
|
||||
@@ -399,7 +399,7 @@ public:
|
||||
|
||||
void DepopAll(int NPCTypeID, bool StartSpawnTimer = true);
|
||||
|
||||
uint16 GetFreeID();
|
||||
uint16 GetFreeID();
|
||||
void RefreshAutoXTargets(Client *c);
|
||||
void RefreshClientXTargets(Client *c);
|
||||
|
||||
@@ -410,11 +410,11 @@ protected:
|
||||
private:
|
||||
void AddToSpawnQueue(uint16 entityid, NewSpawn_Struct** app);
|
||||
void CheckSpawnQueue();
|
||||
|
||||
|
||||
//used for limiting spawns
|
||||
class SpawnLimitRecord { public: uint32 spawngroup_id; uint32 npc_type; };
|
||||
map<uint16, SpawnLimitRecord> npc_limit_list; //entity id -> npc type
|
||||
|
||||
|
||||
uint32 tsFirstSpawnOnQueue; // timestamp that the top spawn on the spawnqueue was added, should be 0xFFFFFFFF if queue is empty
|
||||
uint32 NumSpawnsOnQueue;
|
||||
LinkedList<NewSpawn_Struct*> SpawnQueue;
|
||||
@@ -444,8 +444,8 @@ private:
|
||||
Bot* GetBotByBotName(std::string botName);
|
||||
list<Bot*> GetBotsByBotOwnerCharacterID(uint32 botOwnerCharacterID);
|
||||
|
||||
bool Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, float iRange, uint16 iSpellTypes); // TODO: Evaluate this closesly in hopes to eliminate
|
||||
void ShowSpawnWindow(Client* client, int Distance, bool NamedOnly); // TODO: Implement ShowSpawnWindow in the bot class but it needs entity list stuff
|
||||
bool Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, float iRange, uint16 iSpellTypes); // TODO: Evaluate this closesly in hopes to eliminate
|
||||
void ShowSpawnWindow(Client* client, int Distance, bool NamedOnly); // TODO: Implement ShowSpawnWindow in the bot class but it needs entity list stuff
|
||||
private:
|
||||
std::list<Bot*> bot_list;
|
||||
#endif
|
||||
@@ -455,7 +455,7 @@ class BulkZoneSpawnPacket {
|
||||
public:
|
||||
BulkZoneSpawnPacket(Client* iSendTo, uint32 iMaxSpawnsPerPacket); // 0 = send zonewide
|
||||
virtual ~BulkZoneSpawnPacket();
|
||||
|
||||
|
||||
bool AddSpawn(NewSpawn_Struct* ns);
|
||||
void SendBuffer(); // Sends the buffer and cleans up everything - can safely re-use the object after this function call (no need to free and do another new)
|
||||
private:
|
||||
|
||||
+17
-16
@@ -1,19 +1,19 @@
|
||||
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA */
|
||||
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA */
|
||||
|
||||
/* Error messages for mysql clients */
|
||||
/* error messages for the demon is in share/language/errmsg.sys */
|
||||
@@ -57,3 +57,4 @@ extern const char *client_errors[]; /* Error messages */
|
||||
#define CR_NAMEDPIPESETSTATE_ERROR 2018
|
||||
#define CR_CANT_READ_CHARSET 2019
|
||||
#define CR_NET_PACKET_TOO_LARGE 2020
|
||||
|
||||
|
||||
+2
-2
@@ -32,11 +32,11 @@ typedef enum {
|
||||
EVENT_TASK_FAIL,
|
||||
EVENT_AGGRO_SAY,
|
||||
EVENT_PLAYER_PICKUP,
|
||||
EVENT_POPUP_RESPONSE,
|
||||
EVENT_POPUPRESPONSE,
|
||||
EVENT_PROXIMITY_SAY,
|
||||
EVENT_CAST,
|
||||
EVENT_SCALE_CALC,
|
||||
EVENT_ITEM_ENTERZONE,
|
||||
EVENT_ITEM_ENTERZONE,
|
||||
EVENT_TARGET_CHANGE, //target selected, target changed, or target removed
|
||||
EVENT_HATE_LIST,
|
||||
EVENT_SPELL_EFFECT_CLIENT,
|
||||
|
||||
+147
-147
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2003 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2003 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
|
||||
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
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "../common/debug.h"
|
||||
#include "../common/features.h"
|
||||
@@ -52,10 +52,10 @@ void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) {
|
||||
|
||||
if(!resexp && (XPRate != 0))
|
||||
add_exp = static_cast<uint32>(in_add_exp * (static_cast<float>(XPRate) / 100.0f));
|
||||
|
||||
|
||||
if (m_epp.perAA<0 || m_epp.perAA>100)
|
||||
m_epp.perAA=0; // stop exploit with sanity check
|
||||
|
||||
|
||||
uint32 add_aaxp;
|
||||
if(resexp) {
|
||||
add_aaxp = 0;
|
||||
@@ -65,7 +65,7 @@ void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) {
|
||||
add_aaxp = add_exp * m_epp.perAA / 100;
|
||||
//take that ammount away from regular exp
|
||||
add_exp -= add_aaxp;
|
||||
|
||||
|
||||
float totalmod = 1.0;
|
||||
float zemmod = 1.0;
|
||||
//get modifiers
|
||||
@@ -94,7 +94,7 @@ void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) {
|
||||
}
|
||||
|
||||
add_exp = uint32(float(add_exp) * totalmod * zemmod);
|
||||
|
||||
|
||||
if(RuleB(Character,UseXPConScaling))
|
||||
{
|
||||
if (conlevel != 0xFF && !resexp) {
|
||||
@@ -134,7 +134,7 @@ void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) {
|
||||
if(GetGroup())
|
||||
{
|
||||
if((m_pp.group_leadership_points < MaxBankedGroupLeadershipPoints(GetLevel()))
|
||||
&& (RuleI(Character, KillsPerGroupLeadershipAA) > 0))
|
||||
&& (RuleI(Character, KillsPerGroupLeadershipAA) > 0))
|
||||
{
|
||||
AddLeadershipEXP(GROUP_EXP_PER_POINT / RuleI(Character, KillsPerGroupLeadershipAA), 0);
|
||||
Message_StringID(MT_Leadership, GAIN_GROUP_LEADERSHIP_EXP);
|
||||
@@ -145,7 +145,7 @@ void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) {
|
||||
else
|
||||
{
|
||||
if((m_pp.raid_leadership_points < MaxBankedRaidLeadershipPoints(GetLevel()))
|
||||
&& (RuleI(Character, KillsPerRaidLeadershipAA) > 0))
|
||||
&& (RuleI(Character, KillsPerRaidLeadershipAA) > 0))
|
||||
{
|
||||
AddLeadershipEXP(0, RAID_EXP_PER_POINT / RuleI(Character, KillsPerRaidLeadershipAA));
|
||||
Message_StringID(MT_Leadership, GAIN_RAID_LEADERSHIP_EXP);
|
||||
@@ -163,7 +163,7 @@ void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) {
|
||||
aatotalmod *= zone->newzone_data.zone_exp_multiplier;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if(RuleB(Character,UseRaceClassExpBonuses))
|
||||
{
|
||||
@@ -190,7 +190,7 @@ void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) {
|
||||
aaexp += had_aaexp;
|
||||
if(aaexp < had_aaexp)
|
||||
aaexp = had_aaexp; //watch for wrap
|
||||
|
||||
|
||||
SetEXP(exp, aaexp, resexp);
|
||||
}
|
||||
|
||||
@@ -202,8 +202,8 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) {
|
||||
Message(13, "Error in Client::SetEXP. EXP not set.");
|
||||
return; // Must be invalid class/race
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if ((set_exp + set_aaxp) > (m_pp.exp+m_pp.expAA)) {
|
||||
if (isrezzexp)
|
||||
this->Message_StringID(MT_Experience, REZ_REGAIN);
|
||||
@@ -219,7 +219,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) {
|
||||
else if((set_exp + set_aaxp) < (m_pp.exp+m_pp.expAA)){ //only loss message if you lose exp, no message if you gained/lost nothing.
|
||||
Message(15, "You have lost experience.");
|
||||
}
|
||||
|
||||
|
||||
//check_level represents the level we should be when we have
|
||||
//this ammount of exp (once these loops complete)
|
||||
uint16 check_level = GetLevel()+1;
|
||||
@@ -245,40 +245,40 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) {
|
||||
}
|
||||
check_level--;
|
||||
|
||||
|
||||
|
||||
//see if we gained any AAs
|
||||
if (set_aaxp >= max_AAXP) {
|
||||
/*
|
||||
Note: AA exp is stored differently than normal exp.
|
||||
Exp points are only stored in m_pp.expAA until you
|
||||
gain a full AA point, once you gain it, a point is
|
||||
Exp points are only stored in m_pp.expAA until you
|
||||
gain a full AA point, once you gain it, a point is
|
||||
added to m_pp.aapoints and the ammount needed to gain
|
||||
that point is subtracted from m_pp.expAA
|
||||
|
||||
|
||||
then, once they spend an AA point, it is subtracted from
|
||||
m_pp.aapoints. In theory it then goes into m_pp.aapoints_spent,
|
||||
but im not sure if we have that in the right spot.
|
||||
*/
|
||||
//record how many points we have
|
||||
uint32 last_unspentAA = m_pp.aapoints;
|
||||
|
||||
|
||||
//figure out how many AA points we get from the exp were setting
|
||||
m_pp.aapoints = set_aaxp / max_AAXP;
|
||||
_log(CLIENT__EXP, "Calculating additional AA Points from AAXP for %s: %u / %u = %.1f points", this->GetCleanName(), set_aaxp, max_AAXP, (float)set_aaxp / (float)max_AAXP);
|
||||
|
||||
|
||||
//get remainder exp points, set in PP below
|
||||
set_aaxp = set_aaxp - (max_AAXP * m_pp.aapoints);
|
||||
|
||||
|
||||
//add in how many points we had
|
||||
m_pp.aapoints += last_unspentAA;
|
||||
//set_aaxp = m_pp.expAA % max_AAXP;
|
||||
|
||||
|
||||
//figure out how many points were actually gained
|
||||
/*uint32 gained = m_pp.aapoints - last_unspentAA;*/ //unused
|
||||
|
||||
|
||||
//Message(15, "You have gained %d skill points!!", m_pp.aapoints - last_unspentAA);
|
||||
char val1[20]={0};
|
||||
Message_StringID(MT_Experience, GAIN_ABILITY_POINT,ConvertArray(m_pp.aapoints, val1),m_pp.aapoints == 1 ? "" : "(s)"); //You have gained an ability point! You now have %1 ability point%2.
|
||||
Message_StringID(MT_Experience, GAIN_ABILITY_POINT,ConvertArray(m_pp.aapoints, val1),m_pp.aapoints == 1 ? "" : "(s)"); //You have gained an ability point! You now have %1 ability point%2.
|
||||
//Message(15, "You now have %d skill points available to spend.", m_pp.aapoints);
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) {
|
||||
|
||||
if(maxlevel <= 1)
|
||||
maxlevel = RuleI(Character, MaxLevel) + 1;
|
||||
|
||||
|
||||
if(check_level > maxlevel) {
|
||||
check_level = maxlevel;
|
||||
|
||||
@@ -299,7 +299,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) {
|
||||
set_exp = GetEXPForLevel(maxlevel);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(RuleB(Character, PerCharacterQglobalMaxLevel)){
|
||||
uint32 MaxLevel = GetCharMaxLevelFromQGlobal();
|
||||
if(MaxLevel){
|
||||
@@ -307,7 +307,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) {
|
||||
uint32 expneeded = GetEXPForLevel(MaxLevel);
|
||||
if(set_exp > expneeded)
|
||||
{
|
||||
set_exp = expneeded;
|
||||
set_exp = expneeded;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -328,20 +328,20 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) {
|
||||
Message(15, "Welcome to level %i!", check_level);
|
||||
SetLevel(check_level);
|
||||
}
|
||||
|
||||
|
||||
//If were at max level then stop gaining experience if we make it to the cap
|
||||
if(GetLevel() == maxlevel - 1){
|
||||
uint32 expneeded = GetEXPForLevel(maxlevel);
|
||||
if(set_exp > expneeded)
|
||||
{
|
||||
set_exp = expneeded;
|
||||
set_exp = expneeded;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//set the client's EXP and AAEXP
|
||||
m_pp.exp = set_exp;
|
||||
m_pp.expAA = set_aaxp;
|
||||
|
||||
|
||||
if (GetLevel() < 51) {
|
||||
m_epp.perAA = 0; // turn off aa exp if they drop below 51
|
||||
} else
|
||||
@@ -358,7 +358,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) {
|
||||
eu->exp = (uint32)(330.0f * tmpxp);
|
||||
FastQueuePacket(&outapp);
|
||||
}
|
||||
|
||||
|
||||
if (admin>=100 && GetGM()) {
|
||||
char val1[20]={0};
|
||||
char val2[20]={0};
|
||||
@@ -370,77 +370,77 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) {
|
||||
|
||||
void Client::SetLevel(uint8 set_level, bool command)
|
||||
{
|
||||
if (GetEXPForLevel(set_level) == 0xFFFFFFFF) {
|
||||
LogFile->write(EQEMuLog::Error,"Client::SetLevel() GetEXPForLevel(%i) = 0xFFFFFFFF", set_level);
|
||||
return;
|
||||
}
|
||||
if (GetEXPForLevel(set_level) == 0xFFFFFFFF) {
|
||||
LogFile->write(EQEMuLog::Error,"Client::SetLevel() GetEXPForLevel(%i) = 0xFFFFFFFF", set_level);
|
||||
return;
|
||||
}
|
||||
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_LevelUpdate, sizeof(LevelUpdate_Struct));
|
||||
LevelUpdate_Struct* lu = (LevelUpdate_Struct*)outapp->pBuffer;
|
||||
lu->level = set_level;
|
||||
if(m_pp.level2 != 0)
|
||||
lu->level_old = m_pp.level2;
|
||||
else
|
||||
lu->level_old = level;
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_LevelUpdate, sizeof(LevelUpdate_Struct));
|
||||
LevelUpdate_Struct* lu = (LevelUpdate_Struct*)outapp->pBuffer;
|
||||
lu->level = set_level;
|
||||
if(m_pp.level2 != 0)
|
||||
lu->level_old = m_pp.level2;
|
||||
else
|
||||
lu->level_old = level;
|
||||
|
||||
level = set_level;
|
||||
level = set_level;
|
||||
|
||||
if(IsRaidGrouped())
|
||||
{
|
||||
Raid *r = this->GetRaid();
|
||||
if(r){
|
||||
r->UpdateLevel(GetName(), set_level);
|
||||
}
|
||||
}
|
||||
if(set_level > m_pp.level2)
|
||||
{
|
||||
if(m_pp.level2 == 0)
|
||||
m_pp.points += 5;
|
||||
else
|
||||
m_pp.points += (5 * (set_level - m_pp.level2));
|
||||
if(IsRaidGrouped())
|
||||
{
|
||||
Raid *r = this->GetRaid();
|
||||
if(r){
|
||||
r->UpdateLevel(GetName(), set_level);
|
||||
}
|
||||
}
|
||||
if(set_level > m_pp.level2)
|
||||
{
|
||||
if(m_pp.level2 == 0)
|
||||
m_pp.points += 5;
|
||||
else
|
||||
m_pp.points += (5 * (set_level - m_pp.level2));
|
||||
|
||||
m_pp.level2 = set_level;
|
||||
}
|
||||
if(set_level > m_pp.level) {
|
||||
parse->EventPlayer(EVENT_LEVEL_UP, this, "", 0);
|
||||
}
|
||||
m_pp.level2 = set_level;
|
||||
}
|
||||
if(set_level > m_pp.level) {
|
||||
parse->EventPlayer(EVENT_LEVEL_UP, this, "", 0);
|
||||
}
|
||||
|
||||
m_pp.level = set_level;
|
||||
if (command){
|
||||
m_pp.exp = GetEXPForLevel(set_level);
|
||||
Message(15, "Welcome to level %i!", set_level);
|
||||
lu->exp = 0;
|
||||
}
|
||||
else {
|
||||
float tmpxp = (float) ( (float) m_pp.exp - GetEXPForLevel( GetLevel() )) /
|
||||
( (float) GetEXPForLevel(GetLevel()+1) - GetEXPForLevel(GetLevel()));
|
||||
lu->exp = (uint32)(330.0f * tmpxp);
|
||||
}
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
this->SendAppearancePacket(AT_WhoLevel, set_level); // who level change
|
||||
m_pp.level = set_level;
|
||||
if (command){
|
||||
m_pp.exp = GetEXPForLevel(set_level);
|
||||
Message(15, "Welcome to level %i!", set_level);
|
||||
lu->exp = 0;
|
||||
}
|
||||
else {
|
||||
float tmpxp = (float) ( (float) m_pp.exp - GetEXPForLevel( GetLevel() )) /
|
||||
( (float) GetEXPForLevel(GetLevel()+1) - GetEXPForLevel(GetLevel()));
|
||||
lu->exp = (uint32)(330.0f * tmpxp);
|
||||
}
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
this->SendAppearancePacket(AT_WhoLevel, set_level); // who level change
|
||||
|
||||
LogFile->write(EQEMuLog::Normal,"Setting Level for %s to %i", GetName(), set_level);
|
||||
|
||||
CalcBonuses();
|
||||
if(!RuleB(Character, HealOnLevel))
|
||||
{
|
||||
int mhp = CalcMaxHP();
|
||||
if(GetHP() > mhp)
|
||||
SetHP(mhp);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetHP(CalcMaxHP()); // Why not, lets give them a free heal
|
||||
}
|
||||
|
||||
CalcBonuses();
|
||||
if(!RuleB(Character, HealOnLevel))
|
||||
{
|
||||
int mhp = CalcMaxHP();
|
||||
if(GetHP() > mhp)
|
||||
SetHP(mhp);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetHP(CalcMaxHP()); // Why not, lets give them a free heal
|
||||
}
|
||||
|
||||
DoTributeUpdate();
|
||||
SendHPUpdate();
|
||||
SetMana(CalcMaxMana());
|
||||
UpdateWho();
|
||||
SendHPUpdate();
|
||||
SetMana(CalcMaxMana());
|
||||
UpdateWho();
|
||||
if(GetMerc())
|
||||
UpdateMercLevel();
|
||||
Save();
|
||||
Save();
|
||||
}
|
||||
|
||||
// Note: The client calculates exp separately, we cant change this function
|
||||
@@ -480,11 +480,11 @@ uint32 Client::GetEXPForLevel(uint16 check_level)
|
||||
mod = 3.0;
|
||||
else
|
||||
mod = 3.1;
|
||||
|
||||
|
||||
float base = (check_levelm1)*(check_levelm1)*(check_levelm1);
|
||||
|
||||
mod *= 1000;
|
||||
|
||||
|
||||
return(uint32(base * mod));
|
||||
}
|
||||
|
||||
@@ -507,25 +507,25 @@ void Client::AddLevelBasedExp(uint8 exp_percentage, uint8 max_level) {
|
||||
|
||||
void Group::SplitExp(uint32 exp, Mob* other) {
|
||||
if( other->CastToNPC()->MerchantType != 0 ) // Ensure NPC isn't a merchant
|
||||
return;
|
||||
return;
|
||||
|
||||
if(other->GetOwner() && other->GetOwner()->IsClient()) // Ensure owner isn't pc
|
||||
return;
|
||||
|
||||
unsigned int i;
|
||||
uint32 groupexp = exp;
|
||||
uint8 membercount = 0;
|
||||
|
||||
unsigned int i;
|
||||
uint32 groupexp = exp;
|
||||
uint8 membercount = 0;
|
||||
uint8 maxlevel = 1;
|
||||
|
||||
for (i = 0; i < MAX_GROUP_MEMBERS; i++) {
|
||||
if (members[i] != nullptr) {
|
||||
if(members[i]->GetLevel() > maxlevel)
|
||||
maxlevel = members[i]->GetLevel();
|
||||
|
||||
for (i = 0; i < MAX_GROUP_MEMBERS; i++) {
|
||||
if (members[i] != nullptr) {
|
||||
if(members[i]->GetLevel() > maxlevel)
|
||||
maxlevel = members[i]->GetLevel();
|
||||
|
||||
membercount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
float groupmod;
|
||||
if (membercount == 2)
|
||||
groupmod = 1.2;
|
||||
@@ -545,25 +545,25 @@ void Group::SplitExp(uint32 exp, Mob* other) {
|
||||
int conlevel = Mob::GetLevelCon(maxlevel, other->GetLevel());
|
||||
if(conlevel == CON_GREEN)
|
||||
return; //no exp for greenies...
|
||||
|
||||
if (membercount == 0)
|
||||
return;
|
||||
|
||||
for (i = 0; i < MAX_GROUP_MEMBERS; i++) {
|
||||
if (membercount == 0)
|
||||
return;
|
||||
|
||||
for (i = 0; i < MAX_GROUP_MEMBERS; i++) {
|
||||
if (members[i] != nullptr && members[i]->IsClient()) // If Group Member is Client
|
||||
{
|
||||
Client *cmember = members[i]->CastToClient();
|
||||
// add exp + exp cap
|
||||
// add exp + exp cap
|
||||
int16 diff = cmember->GetLevel() - maxlevel;
|
||||
int16 maxdiff = -(cmember->GetLevel()*15/10 - cmember->GetLevel());
|
||||
if(maxdiff > -5)
|
||||
maxdiff = -5;
|
||||
if (diff >= (maxdiff)) { /*Instead of person who killed the mob, the person who has the highest level in the group*/
|
||||
if (diff >= (maxdiff)) { /*Instead of person who killed the mob, the person who has the highest level in the group*/
|
||||
uint32 tmp = (cmember->GetLevel()+3) * (cmember->GetLevel()+3) * 75 * 35 / 10;
|
||||
uint32 tmp2 = groupexp / membercount;
|
||||
cmember->AddEXP( tmp < tmp2 ? tmp : tmp2, conlevel );
|
||||
}
|
||||
}
|
||||
cmember->AddEXP( tmp < tmp2 ? tmp : tmp2, conlevel );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -574,17 +574,17 @@ void Raid::SplitExp(uint32 exp, Mob* other) {
|
||||
if(other->GetOwner() && other->GetOwner()->IsClient()) // Ensure owner isn't pc
|
||||
return;
|
||||
|
||||
uint32 groupexp = exp;
|
||||
uint8 membercount = 0;
|
||||
uint32 groupexp = exp;
|
||||
uint8 membercount = 0;
|
||||
uint8 maxlevel = 1;
|
||||
|
||||
for (int i = 0; i < MAX_RAID_MEMBERS; i++) {
|
||||
if (members[i].member != nullptr) {
|
||||
if(members[i].member->GetLevel() > maxlevel)
|
||||
maxlevel = members[i].member->GetLevel();
|
||||
for (int i = 0; i < MAX_RAID_MEMBERS; i++) {
|
||||
if (members[i].member != nullptr) {
|
||||
if(members[i].member->GetLevel() > maxlevel)
|
||||
maxlevel = members[i].member->GetLevel();
|
||||
|
||||
membercount++;
|
||||
}
|
||||
membercount++;
|
||||
}
|
||||
}
|
||||
|
||||
groupexp = (uint32)((float)groupexp * (1.0f-(RuleR(Character, RaidExpMultiplier))));
|
||||
@@ -593,24 +593,24 @@ void Raid::SplitExp(uint32 exp, Mob* other) {
|
||||
if(conlevel == CON_GREEN)
|
||||
return; //no exp for greenies...
|
||||
|
||||
if (membercount == 0)
|
||||
return;
|
||||
if (membercount == 0)
|
||||
return;
|
||||
|
||||
for (unsigned int x = 0; x < MAX_RAID_MEMBERS; x++) {
|
||||
for (unsigned int x = 0; x < MAX_RAID_MEMBERS; x++) {
|
||||
if (members[x].member != nullptr) // If Group Member is Client
|
||||
{
|
||||
Client *cmember = members[x].member;
|
||||
// add exp + exp cap
|
||||
// add exp + exp cap
|
||||
int16 diff = cmember->GetLevel() - maxlevel;
|
||||
int16 maxdiff = -(cmember->GetLevel()*15/10 - cmember->GetLevel());
|
||||
if(maxdiff > -5)
|
||||
maxdiff = -5;
|
||||
if (diff >= (maxdiff)) { /*Instead of person who killed the mob, the person who has the highest level in the group*/
|
||||
if (diff >= (maxdiff)) { /*Instead of person who killed the mob, the person who has the highest level in the group*/
|
||||
uint32 tmp = (cmember->GetLevel()+3) * (cmember->GetLevel()+3) * 75 * 35 / 10;
|
||||
uint32 tmp2 = (groupexp / membercount) + 1;
|
||||
cmember->AddEXP( tmp < tmp2 ? tmp : tmp2, conlevel );
|
||||
}
|
||||
}
|
||||
cmember->AddEXP( tmp < tmp2 ? tmp : tmp2, conlevel );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -625,10 +625,10 @@ void Client::SetLeadershipEXP(uint32 group_exp, uint32 raid_exp) {
|
||||
m_pp.raid_leadership_points++;
|
||||
Message_StringID(MT_Leadership, GAIN_RAID_LEADERSHIP_POINT);
|
||||
}
|
||||
|
||||
|
||||
m_pp.group_leadership_exp = group_exp;
|
||||
m_pp.raid_leadership_exp = raid_exp;
|
||||
|
||||
|
||||
SendLeadershipEXPUpdate();
|
||||
}
|
||||
|
||||
@@ -639,12 +639,12 @@ void Client::AddLeadershipEXP(uint32 group_exp, uint32 raid_exp) {
|
||||
void Client::SendLeadershipEXPUpdate() {
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_LeadershipExpUpdate, sizeof(LeadershipExpUpdate_Struct));
|
||||
LeadershipExpUpdate_Struct* eu = (LeadershipExpUpdate_Struct *) outapp->pBuffer;
|
||||
|
||||
|
||||
eu->group_leadership_exp = m_pp.group_leadership_exp;
|
||||
eu->group_leadership_points = m_pp.group_leadership_points;
|
||||
eu->raid_leadership_exp = m_pp.raid_leadership_exp;
|
||||
eu->raid_leadership_points = m_pp.raid_leadership_points;
|
||||
|
||||
|
||||
FastQueuePacket(&outapp);
|
||||
}
|
||||
|
||||
@@ -672,5 +672,5 @@ uint32 Client::GetCharMaxLevelFromQGlobal() {
|
||||
++gcount;
|
||||
}
|
||||
|
||||
return false; // Default is false
|
||||
return false; // Default is false
|
||||
}
|
||||
|
||||
+106
-106
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2006 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2006 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
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
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "../common/debug.h"
|
||||
@@ -43,7 +43,7 @@ void Mob::CheckFlee() {
|
||||
//if were allready fleeing, dont need to check more...
|
||||
if(flee_mode && curfp)
|
||||
return;
|
||||
|
||||
|
||||
//dont bother if we are immune to fleeing
|
||||
if(SpecAttacks[IMMUNE_FLEEING] || spellbonuses.ImmuneToFlee)
|
||||
return;
|
||||
@@ -51,12 +51,12 @@ void Mob::CheckFlee() {
|
||||
if(!flee_timer.Check())
|
||||
return; //only do all this stuff every little while, since
|
||||
//its not essential that we start running RIGHT away
|
||||
|
||||
|
||||
//see if were possibly hurt enough
|
||||
float ratio = GetHPRatio();
|
||||
if(ratio >= RuleI(Combat, FleeHPRatio))
|
||||
return;
|
||||
|
||||
|
||||
//we might be hurt enough, check con now..
|
||||
Mob *hate_top = GetHateTop();
|
||||
if(!hate_top) {
|
||||
@@ -64,14 +64,14 @@ void Mob::CheckFlee() {
|
||||
StartFleeing();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
float other_ratio = hate_top->GetHPRatio();
|
||||
if(other_ratio < 20) {
|
||||
//our hate top is almost dead too... stay and fight
|
||||
return;
|
||||
}
|
||||
|
||||
//base our flee ratio on our con. this is how the
|
||||
|
||||
//base our flee ratio on our con. this is how the
|
||||
//attacker sees the mob, since this is all we can observe
|
||||
uint32 con = GetLevelCon(hate_top->GetLevel(), GetLevel());
|
||||
float run_ratio;
|
||||
@@ -92,9 +92,9 @@ void Mob::CheckFlee() {
|
||||
}
|
||||
if(ratio < run_ratio)
|
||||
{
|
||||
if( RuleB(Combat, FleeIfNotAlone)
|
||||
|| ( !RuleB(Combat, FleeIfNotAlone)
|
||||
&& (entity_list.GetHatedCount(hate_top, this) == 0)))
|
||||
if (RuleB(Combat, FleeIfNotAlone) ||
|
||||
(!RuleB(Combat, FleeIfNotAlone) &&
|
||||
(entity_list.GetHatedCount(hate_top, this) == 0)))
|
||||
StartFleeing();
|
||||
|
||||
}
|
||||
@@ -103,8 +103,8 @@ void Mob::CheckFlee() {
|
||||
|
||||
void Mob::ProcessFlee() {
|
||||
|
||||
//Stop fleeing if effect is applied after they start to run.
|
||||
//When ImmuneToFlee effect fades it will turn fear back on and check if it can still flee.
|
||||
//Stop fleeing if effect is applied after they start to run.
|
||||
//When ImmuneToFlee effect fades it will turn fear back on and check if it can still flee.
|
||||
if(flee_mode && (SpecAttacks[IMMUNE_FLEEING] || spellbonuses.ImmuneToFlee) && !spellbonuses.IsFeared){
|
||||
curfp = false;
|
||||
return;
|
||||
@@ -113,11 +113,11 @@ void Mob::ProcessFlee() {
|
||||
//see if we are still dying, if so, do nothing
|
||||
if(GetHPRatio() < (float)RuleI(Combat, FleeHPRatio))
|
||||
return;
|
||||
|
||||
|
||||
//we are not dying anymore... see what we do next
|
||||
|
||||
|
||||
flee_mode = false;
|
||||
|
||||
|
||||
//see if we are legitimately feared now
|
||||
if(!spellbonuses.IsFeared) {
|
||||
//not feared... were done...
|
||||
@@ -127,10 +127,10 @@ void Mob::ProcessFlee() {
|
||||
}
|
||||
|
||||
float Mob::GetFearSpeed() {
|
||||
if(flee_mode) {
|
||||
//we know ratio < FLEE_HP_RATIO
|
||||
float speed = GetRunspeed();
|
||||
float ratio = GetHPRatio();
|
||||
if(flee_mode) {
|
||||
//we know ratio < FLEE_HP_RATIO
|
||||
float speed = GetRunspeed();
|
||||
float ratio = GetHPRatio();
|
||||
|
||||
// mob's movement will halt with a decent snare at HP specified by rule.
|
||||
if (ratio <= RuleI(Combat, FleeSnareHPRatio) && GetSnaredAmount() > 40) {
|
||||
@@ -140,11 +140,11 @@ float Mob::GetFearSpeed() {
|
||||
if (ratio < FLEE_HP_MINSPEED)
|
||||
ratio = FLEE_HP_MINSPEED;
|
||||
|
||||
speed = speed * 0.5 * ratio / 100;
|
||||
|
||||
return(speed);
|
||||
}
|
||||
return(GetRunspeed());
|
||||
speed = speed * 0.5 * ratio / 100;
|
||||
|
||||
return(speed);
|
||||
}
|
||||
return(GetRunspeed());
|
||||
}
|
||||
|
||||
void Mob::CalculateNewFearpoint()
|
||||
@@ -152,7 +152,7 @@ void Mob::CalculateNewFearpoint()
|
||||
if(RuleB(Pathing, Fear) && zone->pathing)
|
||||
{
|
||||
int Node = zone->pathing->GetRandomPathNode();
|
||||
|
||||
|
||||
VERTEX Loc = zone->pathing->GetPathNodeCoordinates(Node);
|
||||
|
||||
++Loc.z;
|
||||
@@ -218,15 +218,15 @@ void Mob::CalculateNewFearpoint()
|
||||
safe_delete(fear_path_state);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
flee_mode = flee;
|
||||
|
||||
|
||||
//fear dosent work without at least maps
|
||||
if(zone->zonemap == nullptr) {
|
||||
fear_state = fearStateStuck;
|
||||
return; //just stand there
|
||||
}
|
||||
|
||||
|
||||
//if we are allready feared, and we are on a fear grid..
|
||||
//then just stay happy on the grid...
|
||||
if(fear_path_state != nullptr) {
|
||||
@@ -236,22 +236,22 @@ void Mob::CalculateNewFearpoint()
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//try to run straight away from the caster
|
||||
VERTEX hit, fear_vector;
|
||||
if(FearTryStraight(caster, duration, flee, hit, fear_vector)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//OK, so if we just run, we are going to hit something...
|
||||
//now we have to think a little more.
|
||||
|
||||
|
||||
//first, try to find a fear node that we can see.
|
||||
if(zone->pathing != nullptr) {
|
||||
fear_path_state = new MobFearState();
|
||||
if(zone->pathing->FindNearestFear(fear_path_state, GetX(), GetY(), GetZ())) {
|
||||
#ifdef FEAR_PATHING_DEBUG
|
||||
LogFile->write(EQEMuLog::Debug, "Fear Pathing Start: found path, moving from (%.2f, %.2f, %.2f) to path node (%.2f, %.2f, %.2f)",
|
||||
LogFile->write(EQEMuLog::Debug, "Fear Pathing Start: found path, moving from (%.2f, %.2f, %.2f) to path node (%.2f, %.2f, %.2f)",
|
||||
GetX(), GetY(), GetZ(), fear_path_state->x, fear_path_state->y, fear_path_state->z);
|
||||
#endif
|
||||
//we found a fear node... were on our way..
|
||||
@@ -261,16 +261,16 @@ void Mob::CalculateNewFearpoint()
|
||||
fear_state = fearStateGrid;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//we have failed to find a path, so we dont need this..
|
||||
safe_delete(fear_path_state);
|
||||
}
|
||||
|
||||
|
||||
//if we cannot just run, and we cannot see any paths, then
|
||||
//we will give one last ditch effort to find a legit path. We
|
||||
//will run as far as we can away from the player, and hope we
|
||||
//we will give one last ditch effort to find a legit path. We
|
||||
//will run as far as we can away from the player, and hope we
|
||||
//can see a path from there if not, we will start breaking rules
|
||||
|
||||
|
||||
#ifdef FEAR_PATHING_DEBUG
|
||||
LogFile->write(EQEMuLog::Debug, "Fear Pathing Start: Hope run from (%.2f, %.2f, %.2f), hit at (%.2f, %.2f, %.2f)",
|
||||
GetX(), GetY(), GetZ(), hit.x, hit.y, hit.z);
|
||||
@@ -286,7 +286,7 @@ bool Mob::FearTryStraight(Mob *caster, uint32 duration, bool flee, VERTEX &hit,
|
||||
//gotta have somebody to run from
|
||||
if(caster == nullptr)
|
||||
return(false);
|
||||
|
||||
|
||||
//our goal is to run along this vector...
|
||||
fear_vector.x = GetX() - caster->GetX();
|
||||
fear_vector.y = GetY() - caster->GetY();
|
||||
@@ -294,22 +294,22 @@ bool Mob::FearTryStraight(Mob *caster, uint32 duration, bool flee, VERTEX &hit,
|
||||
float mag = sqrtf(fear_vector.x*fear_vector.x + fear_vector.y*fear_vector.y);
|
||||
fear_vector.x /= mag;
|
||||
fear_vector.y /= mag;
|
||||
|
||||
|
||||
//now see if we can just run without hitting anything...
|
||||
VERTEX start, end;
|
||||
start.x = GetX();
|
||||
start.y = GetY();
|
||||
start.z = GetZ() + 5.0; //raise up a little over small bumps
|
||||
|
||||
|
||||
//distance moved per movement tic.
|
||||
float distance = NPC_SPEED_MULTIPLIER * GetFearSpeed();
|
||||
//times number of movement tics in the spell.
|
||||
distance *= float(duration) / float(AImovement_duration);
|
||||
|
||||
|
||||
end.x = start.x + fear_vector.x * distance;
|
||||
end.y = start.y + fear_vector.y * distance;
|
||||
end.z = start.z;
|
||||
|
||||
|
||||
if(!zone->zonemap->LineIntersectsZone(start, end, 0.5, &hit, nullptr)) {
|
||||
#ifdef FEAR_PATHING_DEBUG
|
||||
LogFile->write(EQEMuLog::Debug, "Fear Pathing Start: can run entire vector from (%.2f, %.2f, %.2f) to (%.2f, %.2f, %.2f)",
|
||||
@@ -322,7 +322,7 @@ bool Mob::FearTryStraight(Mob *caster, uint32 duration, bool flee, VERTEX &hit,
|
||||
fear_state = fearStateRunningForever;
|
||||
return(true); //were done, nothing difficult needed.
|
||||
}
|
||||
|
||||
|
||||
return(false);
|
||||
}
|
||||
|
||||
@@ -331,19 +331,19 @@ void Mob::CalculateFearPosition() {
|
||||
if(zone->zonemap == nullptr || fear_state == fearStateStuck) {
|
||||
return; //just stand there
|
||||
}
|
||||
|
||||
|
||||
//This is the entire movement section, right here:
|
||||
if (cur_wp_x != GetX() && cur_wp_y != GetY()) {
|
||||
// not at waypoint yet, so keep moving
|
||||
CalculateNewPosition2(cur_wp_x, cur_wp_y, cur_wp_z, GetFearSpeed(), true);
|
||||
CalculateNewPosition2(cur_wp_x, cur_wp_y, cur_wp_z, GetFearSpeed(), true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//we have reached our waypoint, now what?
|
||||
//figure out a new waypoint to run at...
|
||||
|
||||
|
||||
if(fear_state == fearStateRunningForever) {
|
||||
if(flee_mode) {
|
||||
//a fleeing mob may run away again
|
||||
@@ -362,7 +362,7 @@ void Mob::CalculateFearPosition() {
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
//first see if we are on a path. if so our life is easy
|
||||
if(fear_state == fearStateGrid && fear_path_state) {
|
||||
//assume that we have zone->pathing since we got to this state.
|
||||
@@ -373,18 +373,18 @@ void Mob::CalculateFearPosition() {
|
||||
return;
|
||||
}
|
||||
#ifdef FEAR_PATHING_DEBUG
|
||||
LogFile->write(EQEMuLog::Debug, "Fear Pathing: on path, moving from (%.2f, %.2f, %.2f) to path node (%.2f, %.2f, %.2f)",
|
||||
LogFile->write(EQEMuLog::Debug, "Fear Pathing: on path, moving from (%.2f, %.2f, %.2f) to path node (%.2f, %.2f, %.2f)",
|
||||
GetX(), GetY(), GetZ(), fear_path_state->x, fear_path_state->y, fear_path_state->z);
|
||||
#endif
|
||||
//we found a fear node... were on our way..
|
||||
cur_wp_x = fear_path_state->x;
|
||||
cur_wp_y = fear_path_state->y;
|
||||
cur_wp_z = fear_path_state->z;
|
||||
|
||||
|
||||
CalculateNewPosition2(cur_wp_x, cur_wp_y, cur_wp_z, GetFearSpeed(), true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//the only valid state left is fearStateRunning, where we try to
|
||||
//find a grid once we reach our waypoint, which we have..
|
||||
if(fear_state != fearStateRunning) {
|
||||
@@ -393,14 +393,14 @@ void Mob::CalculateFearPosition() {
|
||||
fear_state = fearStateStuck;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//we wanted to try to find a waypoint now, so lets try..
|
||||
if(zone->pathing != nullptr) {
|
||||
fear_path_state = new MobFearState();
|
||||
|
||||
|
||||
if(zone->pathing->FindNearestFear(fear_path_state, GetX(), GetY(), GetZ())) {
|
||||
#ifdef FEAR_PATHING_DEBUG
|
||||
LogFile->write(EQEMuLog::Debug, "Fear Pathing: ran to find path, moving from (%.2f, %.2f, %.2f) to path node (%.2f, %.2f, %.2f)",
|
||||
LogFile->write(EQEMuLog::Debug, "Fear Pathing: ran to find path, moving from (%.2f, %.2f, %.2f) to path node (%.2f, %.2f, %.2f)",
|
||||
GetX(), GetY(), GetZ(), fear_path_state->x, fear_path_state->y, fear_path_state->z);
|
||||
#endif
|
||||
//we found a fear node... were on our way..
|
||||
@@ -411,10 +411,10 @@ void Mob::CalculateFearPosition() {
|
||||
CalculateNewPosition2(cur_wp_x, cur_wp_y, cur_wp_z, GetFearSpeed(), true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//if we get here... all valid methods have failed
|
||||
|
||||
#ifdef FORCE_FEAR_TO_RUN
|
||||
#ifdef FORCE_FEAR_TO_RUN
|
||||
//ok, now we start making shit up
|
||||
|
||||
//for now, we will limit our bullshitting to ignoring LOS
|
||||
@@ -422,7 +422,7 @@ void Mob::CalculateFearPosition() {
|
||||
//do not force a path if we are fleeing
|
||||
if(!flee_mode && zone->pathing->FindNearestFear(fear_path_state, GetX(), GetY(), GetZ(), false)) {
|
||||
#ifdef FEAR_PATHING_DEBUG
|
||||
LogFile->write(EQEMuLog::Debug, "Fear Pathing: Bullshit Path from (%.2f, %.2f, %.2f) to path node (%.2f, %.2f, %.2f)",
|
||||
LogFile->write(EQEMuLog::Debug, "Fear Pathing: Bullshit Path from (%.2f, %.2f, %.2f) to path node (%.2f, %.2f, %.2f)",
|
||||
GetX(), GetY(), GetZ(), fear_path_state->x, fear_path_state->y, fear_path_state->z);
|
||||
#endif
|
||||
//we found a fear node... were on our way..
|
||||
@@ -434,11 +434,11 @@ void Mob::CalculateFearPosition() {
|
||||
return;
|
||||
}
|
||||
#endif //FORCE_FEAR_TO_RUN
|
||||
|
||||
|
||||
//we have failed to find a path once again, so we dont need this..
|
||||
safe_delete(fear_path_state);
|
||||
}
|
||||
|
||||
|
||||
//if we get HERE... then NOTHING worked... just stick
|
||||
fear_state = fearStateStuck;
|
||||
|
||||
@@ -447,20 +447,20 @@ void Mob::CalculateFearPosition() {
|
||||
|
||||
//I dont wanna get rid of this right now because it was a lot of hard
|
||||
//work to write... but it dosent work reliably, so oh well..
|
||||
#ifdef OLD_FEAR_PATHING
|
||||
#ifdef OLD_FEAR_PATHING
|
||||
/*
|
||||
The idea...
|
||||
|
||||
|
||||
try to run along fear vector.
|
||||
If we can see along it, run
|
||||
otherwise, try to walk up a hill along the same vector
|
||||
then try to move along a wall along largest component of FV
|
||||
if cant move, change stae to stuck.
|
||||
|
||||
|
||||
once we know a place to run, use the waypoint code to do it
|
||||
then if combat ends, we will reach the waypoint and
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
/*
|
||||
//first try our original fear vector again...
|
||||
@@ -468,11 +468,11 @@ void Mob::CalculateFearPosition() {
|
||||
start.x = GetX() - fear_vector.x * 0.4;
|
||||
start.y = GetY() - fear_vector.y * 0.4;
|
||||
start.z = GetZ() + 6.0; //raise up a little over small bumps
|
||||
|
||||
|
||||
end.x = start.x + fear_vector.x * 10;
|
||||
end.y = start.y + fear_vector.y * 10;
|
||||
end.z = start.z;
|
||||
|
||||
|
||||
if(!zone->zonemap->LineIntersectsZone(start, end, 0.5, &normalhit, nullptr)) {
|
||||
#ifdef FEAR_PATHING_DEBUG
|
||||
LogFile->write(EQEMuLog::Debug, "Fear Pathing: From (%.2f, %.2f, %.2f) normal run to (%.2f, %.2f, %.2f)",
|
||||
@@ -482,23 +482,23 @@ void Mob::CalculateFearPosition() {
|
||||
cur_wp_x = end.x;
|
||||
cur_wp_y = end.y;
|
||||
cur_wp_z = end.z - 6.0;
|
||||
CalculateNewPosition2(cur_wp_x, cur_wp_y, cur_wp_z, GetRunspeed(), true);
|
||||
CalculateNewPosition2(cur_wp_x, cur_wp_y, cur_wp_z, GetRunspeed(), true);
|
||||
return;
|
||||
}
|
||||
//see if we can make ANY useful progress along that vector
|
||||
|
||||
|
||||
//first, adjust normalhit to back up a little bit
|
||||
//so we dont run through the wall
|
||||
normalhit.x -= 0.4 * fear_vector.x;
|
||||
normalhit.y -= 0.4 * fear_vector.y;
|
||||
|
||||
|
||||
float xd = normalhit.x - start.x;
|
||||
if(xd < 0)
|
||||
xd = 0 - xd;
|
||||
float yd = normalhit.y - start.y;
|
||||
if(yd < 0)
|
||||
yd = 0 - yd;
|
||||
|
||||
|
||||
//this 2 is arbitrary
|
||||
if((xd+yd) > 2.0) {
|
||||
#ifdef FEAR_PATHING_DEBUG
|
||||
@@ -508,38 +508,38 @@ void Mob::CalculateFearPosition() {
|
||||
cur_wp_x = normalhit.x;
|
||||
cur_wp_y = normalhit.y;
|
||||
cur_wp_z = GetZ();
|
||||
|
||||
|
||||
//try and fix up the Z coord if possible
|
||||
//not sure if this is worth it, since it prolly isnt up much
|
||||
|
||||
|
||||
NodeRef c = zone->zonemap->SeekNode(zone->zonemap->GetRoot(), end.x, end.y);
|
||||
if(c != NODE_NONE) {
|
||||
cur_wp_z = zone->zonemap->FindBestZ(c, end, &hit, nullptr);
|
||||
if(cur_wp_z < start.z)
|
||||
cur_wp_z = end.z; //revert on error
|
||||
}
|
||||
|
||||
CalculateNewPosition2(cur_wp_x, cur_wp_y, cur_wp_z, GetRunspeed(), true);
|
||||
|
||||
CalculateNewPosition2(cur_wp_x, cur_wp_y, cur_wp_z, GetRunspeed(), true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
#ifdef FEAR_PATHING_DEBUG
|
||||
LogFile->write(EQEMuLog::Debug, "Fear Pathing: From (%.2f, %.2f, %.2f) normal hit at (%.2f, %.2f, %.2f)",
|
||||
GetX(), GetY(), GetZ(), normalhit.x, normalhit.y, normalhit.z);
|
||||
#endif
|
||||
|
||||
|
||||
//if we get here, we cannot run along our normal vector...
|
||||
//try up hill first
|
||||
|
||||
|
||||
/*
|
||||
while this uphill stuff works great in outdoor zones,
|
||||
it totally breaks dungeons...
|
||||
|
||||
|
||||
float speed = GetRunspeed();
|
||||
end.x = start.x + fear_vector.x * speed;
|
||||
end.y = start.y + fear_vector.y * speed;
|
||||
end.z = start.z + speed + speed;
|
||||
|
||||
|
||||
if(!zone->zonemap->LineIntersectsZone(start, end, 0.5, &hit, nullptr)) {
|
||||
#ifdef FEAR_PATHING_DEBUG
|
||||
LogFile->write(EQEMuLog::Debug, "Fear Pathing: From (%.2f, %.2f, %.2f) up hill run to (%.2f, %.2f, %.2f)",
|
||||
@@ -549,19 +549,19 @@ void Mob::CalculateFearPosition() {
|
||||
cur_wp_x = end.x - 0.4 * fear_vector.x;
|
||||
cur_wp_y = end.y - 0.4 * fear_vector.y;
|
||||
cur_wp_z = end.z;
|
||||
|
||||
|
||||
//try and fix up the Z coord if possible
|
||||
//not sure if this is worth it, since it prolly isnt up much
|
||||
|
||||
|
||||
NodeRef c = zone->zonemap->SeekNode(zone->zonemap->GetRoot(), end.x, end.y);
|
||||
if(c != NODE_NONE) {
|
||||
cur_wp_z = zone->zonemap->FindBestZ(c, end, &hit, nullptr);
|
||||
if(cur_wp_z < start.z)
|
||||
cur_wp_z = end.z; //revert on error
|
||||
}
|
||||
|
||||
|
||||
CalculateNewPosition2(cur_wp_x, cur_wp_y, cur_wp_z, GetRunspeed(), true);
|
||||
|
||||
|
||||
CalculateNewPosition2(cur_wp_x, cur_wp_y, cur_wp_z, GetRunspeed(), true);
|
||||
return;
|
||||
}
|
||||
*/
|
||||
@@ -578,7 +578,7 @@ void Mob::CalculateFearPosition() {
|
||||
end.y = start.y + fear_vector.y * 3;
|
||||
}
|
||||
end.z = start.z + 3; //a little lift as always
|
||||
|
||||
|
||||
if(!zone->zonemap->LineIntersectsZone(start, end, 0.5, &hit, nullptr)) {
|
||||
#ifdef FEAR_PATHING_DEBUG
|
||||
LogFile->write(EQEMuLog::Debug, "Fear Pathing: From (%.2f, %.2f, %.2f) strafe 1 to (%.2f, %.2f, %.2f)",
|
||||
@@ -588,10 +588,10 @@ void Mob::CalculateFearPosition() {
|
||||
cur_wp_x = end.x - 0.4 * fear_vector.x;
|
||||
cur_wp_y = end.y - 0.4 * fear_vector.y;
|
||||
cur_wp_z = end.z - 3;
|
||||
CalculateNewPosition2(cur_wp_x, cur_wp_y, cur_wp_z, GetRunspeed(), true);
|
||||
CalculateNewPosition2(cur_wp_x, cur_wp_y, cur_wp_z, GetRunspeed(), true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//now the other...
|
||||
if(fear_vector.x < fear_vector.y) {
|
||||
end.x = start.x + fear_vector.x * 3;
|
||||
@@ -601,7 +601,7 @@ void Mob::CalculateFearPosition() {
|
||||
end.y = start.y + fear_vector.y * 3;
|
||||
}
|
||||
end.z = start.z + 3; //a little lift as always
|
||||
|
||||
|
||||
if(!zone->zonemap->LineIntersectsZone(start, end, 0.5, &hit, nullptr)) {
|
||||
#ifdef FEAR_PATHING_DEBUG
|
||||
LogFile->write(EQEMuLog::Debug, "Fear Pathing: From (%.2f, %.2f, %.2f) strafe 2 to (%.2f, %.2f, %.2f)",
|
||||
@@ -611,13 +611,13 @@ void Mob::CalculateFearPosition() {
|
||||
cur_wp_x = end.x - 0.4 * fear_vector.x;
|
||||
cur_wp_y = end.y - 0.4 * fear_vector.y;
|
||||
cur_wp_z = end.z - 3;
|
||||
CalculateNewPosition2(cur_wp_x, cur_wp_y, cur_wp_z, GetRunspeed(), true);
|
||||
CalculateNewPosition2(cur_wp_x, cur_wp_y, cur_wp_z, GetRunspeed(), true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//if we get here... we have wasted enough CPU cycles
|
||||
//just call it quits on fear pathing...
|
||||
|
||||
|
||||
//send them to normalhit and then stop
|
||||
cur_wp_x = normalhit.x;
|
||||
cur_wp_y = normalhit.y;
|
||||
|
||||
+89
-88
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
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
|
||||
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
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "../common/debug.h"
|
||||
#include <iostream>
|
||||
@@ -86,32 +86,32 @@ CREATE TABLE fishing (
|
||||
// This allows EqEmu to have zone specific foraging - BoB
|
||||
uint32 ZoneDatabase::GetZoneForage(uint32 ZoneID, uint8 skill) {
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
|
||||
char *query = 0;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
|
||||
uint8 index = 0;
|
||||
uint32 item[FORAGE_ITEM_LIMIT];
|
||||
uint32 chance[FORAGE_ITEM_LIMIT];
|
||||
uint32 ret;
|
||||
|
||||
for (int c=0; c < FORAGE_ITEM_LIMIT; c++) {
|
||||
|
||||
for (int c=0; c < FORAGE_ITEM_LIMIT; c++) {
|
||||
item[c] = 0;
|
||||
}
|
||||
|
||||
|
||||
uint32 chancepool = 0;
|
||||
|
||||
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT itemid,chance FROM forage WHERE zoneid= '%i' and level <= '%i' LIMIT %i", ZoneID, skill, FORAGE_ITEM_LIMIT), errbuf, &result))
|
||||
{
|
||||
safe_delete_array(query);
|
||||
while ((row = mysql_fetch_row(result)) && (index < FORAGE_ITEM_LIMIT)) {
|
||||
while ((row = mysql_fetch_row(result)) && (index < FORAGE_ITEM_LIMIT)) {
|
||||
item[index] = atoi(row[0]);
|
||||
chance[index] = atoi(row[1])+chancepool;
|
||||
LogFile->write(EQEMuLog::Error, "Possible Forage: %d with a %d chance", item[index], chance[index]);
|
||||
chancepool = chance[index];
|
||||
index++;
|
||||
}
|
||||
|
||||
|
||||
mysql_free_result(result);
|
||||
}
|
||||
else {
|
||||
@@ -119,14 +119,14 @@ LogFile->write(EQEMuLog::Error, "Possible Forage: %d with a %d chance", item[ind
|
||||
safe_delete_array(query);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if(chancepool == 0 || index < 1)
|
||||
return(0);
|
||||
|
||||
|
||||
if(index == 1) {
|
||||
return(item[0]);
|
||||
}
|
||||
|
||||
|
||||
ret = 0;
|
||||
|
||||
uint32 rindex = MakeRandomInt(1, chancepool);
|
||||
@@ -137,17 +137,17 @@ LogFile->write(EQEMuLog::Error, "Possible Forage: %d with a %d chance", item[ind
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint32 ZoneDatabase::GetZoneFishing(uint32 ZoneID, uint8 skill, uint32 &npc_id, uint8 &npc_chance)
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
|
||||
char *query = 0;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
|
||||
uint8 index = 0;
|
||||
uint32 item[50];
|
||||
uint32 chance[50];
|
||||
@@ -155,25 +155,25 @@ uint32 ZoneDatabase::GetZoneFishing(uint32 ZoneID, uint8 skill, uint32 &npc_id,
|
||||
uint32 npc_chances[50];
|
||||
uint32 chancepool = 0;
|
||||
uint32 ret = 0;
|
||||
|
||||
for (int c=0; c<50; c++) {
|
||||
|
||||
for (int c=0; c<50; c++) {
|
||||
item[c]=0;
|
||||
chance[c]=0;
|
||||
}
|
||||
|
||||
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT itemid,chance,npc_id,npc_chance FROM fishing WHERE (zoneid= '%i' || zoneid = 0) and skill_level <= '%i'",ZoneID, skill ), errbuf, &result))
|
||||
{
|
||||
safe_delete_array(query);
|
||||
while ((row = mysql_fetch_row(result))&&(index<50)) {
|
||||
while ((row = mysql_fetch_row(result))&&(index<50)) {
|
||||
item[index] = atoi(row[0]);
|
||||
chance[index] = atoi(row[1])+chancepool;
|
||||
chancepool = chance[index];
|
||||
|
||||
|
||||
npc_ids[index] = atoi(row[2]);
|
||||
npc_chances[index] = atoi(row[3]);
|
||||
index++;
|
||||
}
|
||||
|
||||
|
||||
mysql_free_result(result);
|
||||
}
|
||||
else {
|
||||
@@ -181,7 +181,7 @@ uint32 ZoneDatabase::GetZoneFishing(uint32 ZoneID, uint8 skill, uint32 &npc_id,
|
||||
safe_delete_array(query);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
npc_id = 0;
|
||||
npc_chance = 0;
|
||||
if (index>0) {
|
||||
@@ -199,7 +199,7 @@ uint32 ZoneDatabase::GetZoneFishing(uint32 ZoneID, uint8 skill, uint32 &npc_id,
|
||||
} else {
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -234,10 +234,10 @@ bool Client::CanFish() {
|
||||
|
||||
HeadingDegrees = (int) ((GetHeading()*360)/256);
|
||||
HeadingDegrees = HeadingDegrees % 360;
|
||||
|
||||
|
||||
RodX = x_pos + RodLength * sin(HeadingDegrees * M_PI/180.0f);
|
||||
RodY = y_pos + RodLength * cos(HeadingDegrees * M_PI/180.0f);
|
||||
|
||||
|
||||
// Do BestZ to find where the line hanging from the rod intersects the water (if it is water).
|
||||
// and go 1 unit into the water.
|
||||
VERTEX dest;
|
||||
@@ -286,16 +286,16 @@ void Client::GoFish()
|
||||
13019, // Fresh Fish
|
||||
13076, // Fish Scales
|
||||
13076, // Fish Scales
|
||||
7007, // Rusty Dagger
|
||||
7007, // Rusty Dagger
|
||||
7007 // Rusty Dagger
|
||||
|
||||
7007, // Rusty Dagger
|
||||
7007 // Rusty Dagger
|
||||
|
||||
};
|
||||
|
||||
|
||||
//success formula is not researched at all
|
||||
|
||||
|
||||
int fishing_skill = GetSkill(FISHING); //will take into account skill bonuses on pole & bait
|
||||
|
||||
|
||||
//make sure we still have a fishing pole on:
|
||||
int32 bslot = m_inv.HasItemByUse(ItemTypeFishingBait, 1, invWhereWorn|invWherePersonal);
|
||||
const ItemInst* Bait = nullptr;
|
||||
@@ -306,21 +306,21 @@ void Client::GoFish()
|
||||
if(bslot >= IDX_INV && Bait->GetItem()->SkillModType == FISHING) {
|
||||
fishing_skill += Bait->GetItem()->SkillModValue;
|
||||
}
|
||||
|
||||
|
||||
if (fishing_skill > 100)
|
||||
{
|
||||
fishing_skill = 100+((fishing_skill-100)/2);
|
||||
}
|
||||
|
||||
|
||||
if (MakeRandomInt(0,175) < fishing_skill) {
|
||||
uint32 food_id = 0;
|
||||
|
||||
|
||||
//25% chance to fish an item.
|
||||
if (MakeRandomInt(0, 399) <= fishing_skill ) {
|
||||
if (MakeRandomInt(0, 399) <= fishing_skill ) {
|
||||
uint32 npc_id = 0;
|
||||
uint8 npc_chance = 0;
|
||||
food_id = database.GetZoneFishing(m_pp.zone_id, fishing_skill, npc_id, npc_chance);
|
||||
|
||||
|
||||
//check for add NPC
|
||||
if(npc_chance > 0 && npc_id) {
|
||||
if(npc_chance < MakeRandomInt(0, 99)) {
|
||||
@@ -328,31 +328,31 @@ void Client::GoFish()
|
||||
if(tmp != nullptr) {
|
||||
NPC* npc = new NPC(tmp, nullptr, GetX()+3, GetY(), GetZ(), GetHeading(), FlyMode3);
|
||||
npc->AddLootTable();
|
||||
|
||||
|
||||
npc->AddToHateList(this, 1, 0, false); //no help yelling
|
||||
|
||||
|
||||
entity_list.AddNPC(npc);
|
||||
|
||||
|
||||
Message(MT_Emote, "You fish up a little more than you bargained for...");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//consume bait, should we always consume bait on success?
|
||||
DeleteItemInInventory(bslot, 1, true); //do we need client update?
|
||||
|
||||
|
||||
if(food_id == 0) {
|
||||
int index = MakeRandomInt(0, MAX_COMMON_FISH_IDS-1);
|
||||
food_id = common_fish_ids[index];
|
||||
}
|
||||
|
||||
|
||||
const Item_Struct* food_item = database.GetItem(food_id);
|
||||
|
||||
|
||||
Message_StringID(MT_Skills, FISHING_SUCCESS);
|
||||
const ItemInst* inst = database.CreateItem(food_item, 1);
|
||||
if(inst != nullptr) {
|
||||
if(CheckLoreConflict(inst->GetItem()))
|
||||
if(CheckLoreConflict(inst->GetItem()))
|
||||
{
|
||||
this->Message_StringID(0,DUP_LORE);
|
||||
}
|
||||
@@ -366,7 +366,7 @@ void Client::GoFish()
|
||||
safe_delete(inst);
|
||||
}
|
||||
|
||||
parse->EventPlayer(EVENT_FISH_SUCCESS, this, "", inst != nullptr ? inst->GetItem()->ID : 0);
|
||||
parse->EventPlayer(EVENT_FISH_SUCCESS, this, "", inst != nullptr ? inst->GetItem()->ID : 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -382,9 +382,9 @@ void Client::GoFish()
|
||||
Message_StringID(MT_Skills, FISHING_FAILED); //You didn't catch anything.
|
||||
}
|
||||
|
||||
parse->EventPlayer(EVENT_FISH_FAILURE, this, "", 0);
|
||||
parse->EventPlayer(EVENT_FISH_FAILURE, this, "", 0);
|
||||
}
|
||||
|
||||
|
||||
//chance to break fishing pole...
|
||||
//this is potentially exploitable in that they can fish
|
||||
//and then swap out items in primary slot... too lazy to fix right now
|
||||
@@ -401,9 +401,9 @@ void Client::GoFish()
|
||||
}
|
||||
|
||||
void Client::ForageItem(bool guarantee) {
|
||||
|
||||
|
||||
int skill_level = GetSkill(FORAGE);
|
||||
|
||||
|
||||
//be wary of the string ids in switch below when changing this.
|
||||
uint32 common_food_ids[MAX_COMMON_FOOD_IDS] = {
|
||||
13046, // Fruit
|
||||
@@ -415,23 +415,23 @@ void Client::ForageItem(bool guarantee) {
|
||||
14905, // mushroom
|
||||
13106 // Fishing Grubs
|
||||
};
|
||||
|
||||
|
||||
// these may need to be fine tuned, I am just guessing here
|
||||
if (guarantee || MakeRandomInt(0,199) < skill_level) {
|
||||
uint32 foragedfood = 0;
|
||||
uint32 stringid = FORAGE_NOEAT;
|
||||
|
||||
|
||||
if (MakeRandomInt(0,99) <= 25) {
|
||||
foragedfood = database.GetZoneForage(m_pp.zone_id, skill_level);
|
||||
}
|
||||
|
||||
|
||||
//not an else in case theres no DB food
|
||||
if(foragedfood == 0) {
|
||||
uint8 index = 0;
|
||||
index = MakeRandomInt(0, MAX_COMMON_FOOD_IDS-1);
|
||||
foragedfood = common_food_ids[index];
|
||||
}
|
||||
|
||||
|
||||
const Item_Struct* food_item = database.GetItem(foragedfood);
|
||||
|
||||
if(!food_item) {
|
||||
@@ -439,17 +439,17 @@ void Client::ForageItem(bool guarantee) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(foragedfood == 13106)
|
||||
if(foragedfood == 13106)
|
||||
stringid = FORAGE_GRUBS;
|
||||
else
|
||||
switch(food_item->ItemType) {
|
||||
|
||||
case ItemTypeFood:
|
||||
case ItemTypeFood:
|
||||
stringid = FORAGE_FOOD;
|
||||
break;
|
||||
|
||||
case ItemTypeDrink:
|
||||
if(strstr(food_item->Name, "ater"))
|
||||
|
||||
case ItemTypeDrink:
|
||||
if(strstr(food_item->Name, "ater"))
|
||||
stringid = FORAGE_WATER;
|
||||
else
|
||||
stringid = FORAGE_DRINK;
|
||||
@@ -457,12 +457,12 @@ void Client::ForageItem(bool guarantee) {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Message_StringID(MT_Skills, stringid);
|
||||
const ItemInst* inst = database.CreateItem(food_item, 1);
|
||||
if(inst != nullptr) {
|
||||
// check to make sure it isn't a foraged lore item
|
||||
if(CheckLoreConflict(inst->GetItem()))
|
||||
if(CheckLoreConflict(inst->GetItem()))
|
||||
{
|
||||
this->Message_StringID(0,DUP_LORE);
|
||||
}
|
||||
@@ -474,20 +474,21 @@ void Client::ForageItem(bool guarantee) {
|
||||
}
|
||||
safe_delete(inst);
|
||||
}
|
||||
|
||||
parse->EventPlayer(EVENT_FORAGE_SUCCESS, this, "", inst != nullptr ? inst->GetItem()->ID : 0);
|
||||
|
||||
int ChanceSecondForage = aabonuses.ForageAdditionalItems + itembonuses.ForageAdditionalItems + spellbonuses.ForageAdditionalItems;
|
||||
if(!guarantee && MakeRandomInt(0,99) < ChanceSecondForage) {
|
||||
this->Message_StringID(MT_Skills, FORAGE_MASTERY);
|
||||
this->ForageItem(true);
|
||||
}
|
||||
|
||||
parse->EventPlayer(EVENT_FORAGE_SUCCESS, this, "", inst != nullptr ? inst->GetItem()->ID : 0);
|
||||
|
||||
int ChanceSecondForage = aabonuses.ForageAdditionalItems + itembonuses.ForageAdditionalItems + spellbonuses.ForageAdditionalItems;
|
||||
if(!guarantee && MakeRandomInt(0,99) < ChanceSecondForage) {
|
||||
this->Message_StringID(MT_Skills, FORAGE_MASTERY);
|
||||
this->ForageItem(true);
|
||||
}
|
||||
|
||||
} else {
|
||||
Message_StringID(MT_Skills, FORAGE_FAILED);
|
||||
parse->EventPlayer(EVENT_FORAGE_FAILURE, this, "", 0);
|
||||
}
|
||||
|
||||
parse->EventPlayer(EVENT_FORAGE_FAILURE, this, "", 0);
|
||||
}
|
||||
|
||||
CheckIncreaseSkill(FORAGE, nullptr, 5);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
+11
-11
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
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 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
|
||||
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.
|
||||
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
|
||||
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 FORAGE_H
|
||||
|
||||
+324
-324
File diff suppressed because it is too large
Load Diff
+15
-15
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
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 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
|
||||
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.
|
||||
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
|
||||
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 GROUPS_H
|
||||
#define GROUPS_H
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
GroupIDConsumer() { id = 0; }
|
||||
GroupIDConsumer(uint32 gid) { id = gid; }
|
||||
inline const uint32 GetID() const { return id; }
|
||||
|
||||
|
||||
protected:
|
||||
friend class EntityList;
|
||||
//use of this function is highly discouraged
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
Group(Mob* leader);
|
||||
Group(uint32 gid);
|
||||
~Group();
|
||||
|
||||
|
||||
bool AddMember(Mob* newmember, const char* NewMemberName = nullptr, uint32 CharacterID = 0);
|
||||
void AddMember(const char* NewMemberName);
|
||||
void SendUpdate(uint32 type,Mob* member);
|
||||
@@ -125,13 +125,13 @@ public:
|
||||
void SetNPCMarker(const char *NewNPCMarkerName);
|
||||
void UnMarkNPC(uint16 ID);
|
||||
void SendMarkedNPCsToMember(Client *c, bool Clear = false);
|
||||
inline int GetLeadershipAA(int AAID) { return LeaderAbilities.ranks[AAID]; }
|
||||
inline int GetLeadershipAA(int AAID) { return LeaderAbilities.ranks[AAID]; }
|
||||
void ClearAllNPCMarks();
|
||||
void QueueHPPacketsForNPCHealthAA(Mob* sender, const EQApplicationPacket* app);
|
||||
void ChangeLeader(Mob* newleader);
|
||||
const char *GetClientNameByIndex(uint8 index);
|
||||
void UpdateXTargetMarkedNPC(uint32 Number, Mob *m);
|
||||
|
||||
|
||||
Mob* members[MAX_GROUP_MEMBERS];
|
||||
char membername[MAX_GROUP_MEMBERS][64];
|
||||
uint8 MemberRoles[MAX_GROUP_MEMBERS];
|
||||
|
||||
+41
-41
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2003 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2003 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
|
||||
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
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "../common/debug.h"
|
||||
#include "masterentity.h"
|
||||
@@ -53,7 +53,7 @@ void Client::SendGuildMOTD(bool GetGuildMOTDReply) {
|
||||
GuildMOTD_Struct *motd = (GuildMOTD_Struct *) outapp->pBuffer;
|
||||
motd->unknown0 = 0;
|
||||
strn0cpy(motd->name, m_pp.name, 64);
|
||||
|
||||
|
||||
if(IsInAGuild()) {
|
||||
if(!guild_mgr.GetGuildMOTD(GuildID(), motd->motd, motd->setby_name)) {
|
||||
motd->setby_name[0] = '\0';
|
||||
@@ -63,12 +63,12 @@ void Client::SendGuildMOTD(bool GetGuildMOTDReply) {
|
||||
//we have to send them an empty MOTD anywyas.
|
||||
motd->motd[0] = '\0'; //just to be sure
|
||||
motd->setby_name[0] = '\0'; //just to be sure
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
mlog(GUILDS__OUT_PACKETS, "Sending OP_GuildMOTD of length %d", outapp->size);
|
||||
mpkt(GUILDS__OUT_PACKET_TRACE, outapp);
|
||||
|
||||
|
||||
FastQueuePacket(&outapp);
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ void Client::SendGuildSpawnAppearance() {
|
||||
SendAppearancePacket(AT_GuildID, GuildID());
|
||||
SendAppearancePacket(AT_GuildRank, rank);
|
||||
}
|
||||
|
||||
|
||||
UpdateWho();
|
||||
}
|
||||
|
||||
@@ -134,17 +134,17 @@ void Client::SendGuildList() {
|
||||
EQApplicationPacket *outapp;
|
||||
// outapp = new EQApplicationPacket(OP_ZoneGuildList);
|
||||
outapp = new EQApplicationPacket(OP_GuildsList);
|
||||
|
||||
|
||||
//ask the guild manager to build us a nice guild list packet
|
||||
outapp->pBuffer = guild_mgr.MakeGuildList(/*GetName()*/"", outapp->size);
|
||||
if(outapp->pBuffer == nullptr) {
|
||||
mlog(GUILDS__ERROR, "Unable to make guild list!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
mlog(GUILDS__OUT_PACKETS, "Sending OP_ZoneGuildList of length %d", outapp->size);
|
||||
// mpkt(GUILDS__OUT_PACKET_TRACE, outapp);
|
||||
|
||||
|
||||
FastQueuePacket(&outapp);
|
||||
}
|
||||
|
||||
@@ -154,15 +154,15 @@ void Client::SendGuildMembers() {
|
||||
uint8 *data = guild_mgr.MakeGuildMembers(GuildID(), GetName(), len);
|
||||
if(data == nullptr)
|
||||
return; //invalid guild, shouldent happen.
|
||||
|
||||
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_GuildMemberList);
|
||||
outapp->size = len;
|
||||
outapp->pBuffer = data;
|
||||
data = nullptr;
|
||||
|
||||
|
||||
mlog(GUILDS__OUT_PACKETS, "Sending OP_GuildMemberList of length %d", outapp->size);
|
||||
mpkt(GUILDS__OUT_PACKET_TRACE, outapp);
|
||||
|
||||
|
||||
FastQueuePacket(&outapp);
|
||||
|
||||
ServerPacket* pack = new ServerPacket(ServerOP_RequestOnlineGuildMembers, sizeof(ServerRequestOnlineGuildMembers_Struct));
|
||||
@@ -189,13 +189,13 @@ void Client::RefreshGuildInfo()
|
||||
guild_id = GUILD_NONE;
|
||||
|
||||
bool WasBanker = GuildBanker;
|
||||
|
||||
|
||||
CharGuildInfo info;
|
||||
if(!guild_mgr.GetCharInfo(CharacterID(), info)) {
|
||||
mlog(GUILDS__ERROR, "Unable to obtain guild char info for %s (%d)", GetName(), CharacterID());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
guildrank = info.rank;
|
||||
guild_id = info.guild_id;
|
||||
GuildBanker = info.banker || guild_mgr.IsGuildLeader(GuildID(), CharacterID());
|
||||
@@ -223,7 +223,7 @@ void Client::RefreshGuildInfo()
|
||||
GuildBanks->SendGuildBank(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SendGuildSpawnAppearance();
|
||||
}
|
||||
|
||||
@@ -274,10 +274,10 @@ void EntityList::RefreshAllGuildInfo(uint32 guild_id) {
|
||||
void EntityList::SendGuildMembers(uint32 guild_id) {
|
||||
if(guild_id == GUILD_NONE)
|
||||
return;
|
||||
|
||||
|
||||
//this could be optimized a bit to only build the member's packet once
|
||||
//and then keep swapping out the name in the packet on each send.
|
||||
|
||||
|
||||
LinkedListIterator<Client*> iterator(client_list);
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements()) {
|
||||
@@ -308,19 +308,19 @@ void Client::SendGuildJoin(GuildJoin_Struct* gj){
|
||||
strcpy(outgj->name, gj->name);
|
||||
outgj->rank = gj->rank;
|
||||
outgj->zoneid = gj->zoneid;
|
||||
|
||||
|
||||
mlog(GUILDS__OUT_PACKETS, "Sending OP_GuildManageAdd for join of length %d", outapp->size);
|
||||
mpkt(GUILDS__OUT_PACKET_TRACE, outapp);
|
||||
|
||||
|
||||
FastQueuePacket(&outapp);
|
||||
|
||||
|
||||
// SendGuildMembers(gj->guild_id, true);
|
||||
}
|
||||
|
||||
/*
|
||||
void EntityList::SendGuildJoin(GuildJoin_Struct* gj){
|
||||
LinkedListIterator<Client*> iterator(client_list);
|
||||
|
||||
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements())
|
||||
{
|
||||
@@ -382,15 +382,15 @@ bool ZoneDatabase::CheckGuildDoor(uint8 doorid,uint16 guild_id,const char* zone)
|
||||
MYSQL_ROW row;
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
MYSQL_RES *result;
|
||||
if (!RunQuery(query, MakeAnyLenString(&query,
|
||||
"SELECT guild FROM doors where doorid=%i AND zone='%s'",
|
||||
MYSQL_RES *result;
|
||||
if (!RunQuery(query, MakeAnyLenString(&query,
|
||||
"SELECT guild FROM doors where doorid=%i AND zone='%s'",
|
||||
doorid-128, zone), errbuf, &result))
|
||||
{
|
||||
LogFile->write(EQEMuLog::Error, "Error in CheckGuildDoor query '%s': %s", query, errbuf);
|
||||
safe_delete_array(query);
|
||||
return false;
|
||||
} else {
|
||||
} else {
|
||||
if (mysql_num_rows(result) == 1) {
|
||||
row = mysql_fetch_row(result);
|
||||
if (atoi(row[0]) == guild_id)
|
||||
@@ -403,7 +403,7 @@ bool ZoneDatabase::CheckGuildDoor(uint8 doorid,uint16 guild_id,const char* zone)
|
||||
mysql_free_result(result);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// code below will never be reached
|
||||
mysql_free_result(result);
|
||||
return false;
|
||||
@@ -418,7 +418,7 @@ bool ZoneDatabase::SetGuildDoor(uint8 doorid,uint16 guild_id, const char* zone)
|
||||
uint32 affected_rows = 0;
|
||||
if (doorid > 127)
|
||||
doorid = doorid - 128;
|
||||
if (!RunQuery(query, MakeAnyLenString(&query,
|
||||
if (!RunQuery(query, MakeAnyLenString(&query,
|
||||
"UPDATE doors SET guild = %i WHERE (doorid=%i) AND (zone='%s')",
|
||||
guild_id, doorid, zone), errbuf, 0,&affected_rows))
|
||||
{
|
||||
@@ -426,9 +426,9 @@ bool ZoneDatabase::SetGuildDoor(uint8 doorid,uint16 guild_id, const char* zone)
|
||||
safe_delete_array(query);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
safe_delete_array(query);
|
||||
|
||||
|
||||
return(affected_rows > 0);
|
||||
}
|
||||
|
||||
|
||||
+99
-98
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2006 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2006 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
This program is 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
|
||||
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.
|
||||
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
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "../common/debug.h"
|
||||
#include "guild_mgr.h"
|
||||
@@ -98,7 +98,7 @@ void ZoneGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, b
|
||||
void ZoneGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uint32 charid) {
|
||||
if(guild_id == 0) {
|
||||
_log(GUILDS__REFRESH, "Guild lookup for char %d when sending char refresh.", charid);
|
||||
|
||||
|
||||
CharGuildInfo gci;
|
||||
if(!GetCharInfo(charid, gci)) {
|
||||
guild_id = GUILD_NONE;
|
||||
@@ -106,9 +106,9 @@ void ZoneGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uin
|
||||
guild_id = gci.guild_id;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_log(GUILDS__REFRESH, "Sending char refresh for %d from guild %d to world", charid, guild_id);
|
||||
|
||||
|
||||
ServerPacket* pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct));
|
||||
ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer;
|
||||
s->guild_id = guild_id;
|
||||
@@ -138,7 +138,7 @@ void ZoneGuildManager::SendRankUpdate(uint32 CharID)
|
||||
|
||||
safe_delete(pack);
|
||||
}
|
||||
|
||||
|
||||
void ZoneGuildManager::SendGuildDelete(uint32 guild_id) {
|
||||
_log(GUILDS__REFRESH, "Sending guild delete for guild %d to world", guild_id);
|
||||
ServerPacket* pack = new ServerPacket(ServerOP_DeleteGuild, sizeof(ServerGuildID_Struct));
|
||||
@@ -151,7 +151,7 @@ void ZoneGuildManager::SendGuildDelete(uint32 guild_id) {
|
||||
//makes a guild member list packet (internal format), returns ownership of the buffer.
|
||||
uint8 *ZoneGuildManager::MakeGuildMembers(uint32 guild_id, const char *prefix_name, uint32 &length) {
|
||||
uint8 *retbuffer;
|
||||
|
||||
|
||||
//hack because we dont have the "remove from guild" packet right now.
|
||||
if(guild_id == GUILD_NONE) {
|
||||
length = sizeof(Internal_GuildMembers_Struct);
|
||||
@@ -163,11 +163,11 @@ uint8 *ZoneGuildManager::MakeGuildMembers(uint32 guild_id, const char *prefix_na
|
||||
gms->note_length = 0;
|
||||
return(retbuffer);
|
||||
}
|
||||
|
||||
|
||||
vector<CharGuildInfo *> members;
|
||||
if(!GetEntireGuild(guild_id, members))
|
||||
return(nullptr);
|
||||
|
||||
|
||||
//figure out the actual packet length.
|
||||
uint32 fixed_length = sizeof(Internal_GuildMembers_Struct) + members.size()*sizeof(Internal_GuildMemberEntry_Struct);
|
||||
vector<CharGuildInfo *>::iterator cur, end;
|
||||
@@ -181,32 +181,32 @@ uint8 *ZoneGuildManager::MakeGuildMembers(uint32 guild_id, const char *prefix_na
|
||||
name_len += ci->char_name.length();
|
||||
note_len += ci->public_note.length();
|
||||
}
|
||||
|
||||
|
||||
//calc total length.
|
||||
length = fixed_length + name_len + note_len + members.size()*2; //string data + null terminators
|
||||
|
||||
|
||||
//make our nice buffer
|
||||
retbuffer = new uint8[length];
|
||||
|
||||
|
||||
Internal_GuildMembers_Struct *gms = (Internal_GuildMembers_Struct *) retbuffer;
|
||||
|
||||
|
||||
//fill in the global header
|
||||
strcpy(gms->player_name, prefix_name);
|
||||
gms->count = members.size();
|
||||
gms->name_length = name_len;
|
||||
gms->note_length = note_len;
|
||||
|
||||
|
||||
char *name_buf = (char *) ( retbuffer + fixed_length );
|
||||
char *note_buf = (char *) ( name_buf + name_len + members.size() );
|
||||
|
||||
|
||||
//fill in each member's entry.
|
||||
Internal_GuildMemberEntry_Struct *e = gms->member;
|
||||
|
||||
|
||||
cur = members.begin();
|
||||
end = members.end();
|
||||
for(; cur != end; cur++) {
|
||||
ci = *cur;
|
||||
|
||||
|
||||
//the order we set things here must match the struct
|
||||
|
||||
//nice helper macro
|
||||
@@ -215,7 +215,7 @@ uint8 *ZoneGuildManager::MakeGuildMembers(uint32 guild_id, const char *prefix_na
|
||||
field += str.length() + 1
|
||||
#define PutField(field) \
|
||||
e->field = ci->field
|
||||
|
||||
|
||||
SlideStructString( name_buf, ci->char_name );
|
||||
PutField(level);
|
||||
e->banker = ci->banker + (ci->alt * 2); // low bit is banker flag, next bit is 'alt' flag.
|
||||
@@ -230,12 +230,12 @@ uint8 *ZoneGuildManager::MakeGuildMembers(uint32 guild_id, const char *prefix_na
|
||||
e->zone_id = 0; // Flag them as offline (zoneid 0) as world will update us with their online status afterwards.
|
||||
#undef SlideStructString
|
||||
#undef PutFieldN
|
||||
|
||||
|
||||
delete *cur;
|
||||
|
||||
|
||||
e++;
|
||||
}
|
||||
|
||||
|
||||
return(retbuffer);
|
||||
}
|
||||
|
||||
@@ -266,15 +266,15 @@ void ZoneGuildManager::DescribeGuild(Client *c, uint32 guild_id) const {
|
||||
c->Message(0, "Guild %d not found.", guild_id);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const GuildInfo *info = res->second;
|
||||
|
||||
|
||||
c->Message(0, "Guild info DB# %i <%s>", guild_id, info->name.c_str());
|
||||
|
||||
|
||||
char leadername[64];
|
||||
database.GetCharName(info->leader_char_id, leadername);
|
||||
c->Message(0, "Guild Leader: %s", leadername);
|
||||
|
||||
|
||||
char permbuffer[256];
|
||||
uint8 i;
|
||||
for (i = 0; i <= GUILD_MAX_RANK; i++) {
|
||||
@@ -282,14 +282,14 @@ void ZoneGuildManager::DescribeGuild(Client *c, uint32 guild_id) const {
|
||||
uint8 r;
|
||||
for(r = 0; r < _MaxGuildAction; r++)
|
||||
permptr += sprintf(permptr, " %s: %c", GuildActionNames[r], info->ranks[i].permissions[r]?'Y':'N');
|
||||
|
||||
|
||||
c->Message(0, "Rank %i: %s", i, info->ranks[i].name.c_str());
|
||||
c->Message(0, "Permissions: %s", permbuffer);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//in theory, we could get a pile of unused entries in this array, but only if
|
||||
//in theory, we could get a pile of unused entries in this array, but only if
|
||||
//we had a malicious client sending controlled packets, plus its like 10 bytes per entry.
|
||||
void ZoneGuildManager::RecordInvite(uint32 char_id, uint32 guild_id, uint8 rank) {
|
||||
m_inviteQueue[char_id] = pair<uint32, uint8>(guild_id, rank);
|
||||
@@ -318,50 +318,50 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
|
||||
return;
|
||||
}
|
||||
ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer;
|
||||
|
||||
|
||||
_log(GUILDS__REFRESH, "Received guild refresh from world for %d, changes: name=%d, motd=%d, rank=%d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change);
|
||||
|
||||
|
||||
//reload all the guild details from the database.
|
||||
RefreshGuild(s->guild_id);
|
||||
|
||||
|
||||
if(s->motd_change) {
|
||||
//resend guild MOTD to all guild members in this zone.
|
||||
entity_list.SendGuildMOTD(s->guild_id);
|
||||
}
|
||||
|
||||
|
||||
if(s->name_change) {
|
||||
//until we figure out the guild update packet, we resend the whole guild list.
|
||||
entity_list.SendGuildList();
|
||||
}
|
||||
|
||||
|
||||
if(s->rank_change) {
|
||||
//we need to send spawn appearance packets for all members of this guild in the zone, to everybody.
|
||||
entity_list.SendGuildSpawnAppearance(s->guild_id);
|
||||
}
|
||||
|
||||
|
||||
if(s->relation_change) {
|
||||
//unknown until we implement guild relations.
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case ServerOP_GuildCharRefresh: {
|
||||
if(pack->size != sizeof(ServerGuildCharRefresh_Struct)) {
|
||||
_log(GUILDS__ERROR, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct));
|
||||
return;
|
||||
}
|
||||
ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer;
|
||||
|
||||
|
||||
_log(GUILDS__REFRESH, "Received guild member refresh from world for char %d from guild %d", s->char_id, s->guild_id);
|
||||
|
||||
|
||||
Client *c = entity_list.GetClientByCharID(s->char_id);
|
||||
|
||||
|
||||
if(c != nullptr) {
|
||||
//this reloads the char's guild info from the database and sends appearance updates
|
||||
c->RefreshGuildInfo();
|
||||
}
|
||||
|
||||
|
||||
//it would be nice if we had the packet to send just a one-person update
|
||||
if(s->guild_id == GUILD_NONE) {
|
||||
if(c != nullptr)
|
||||
@@ -369,18 +369,18 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
|
||||
} else {
|
||||
entity_list.SendGuildMembers(s->guild_id); //even send GUILD_NONE (empty)
|
||||
}
|
||||
|
||||
|
||||
if(s->old_guild_id != 0 && s->old_guild_id != GUILD_NONE && s->old_guild_id != s->guild_id)
|
||||
entity_list.SendGuildMembers(s->old_guild_id);
|
||||
else if(c != nullptr && s->guild_id != GUILD_NONE) {
|
||||
//char is in zone, and has changed into a new guild, send MOTD.
|
||||
c->SendGuildMOTD();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case ServerOP_GuildRankUpdate:
|
||||
{
|
||||
if(ZoneLoaded)
|
||||
@@ -388,13 +388,13 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
|
||||
if(pack->size != sizeof(ServerGuildRankUpdate_Struct))
|
||||
{
|
||||
_log(GUILDS__ERROR, "Received ServerOP_RankUpdate of incorrect size %d, expected %d",
|
||||
pack->size, sizeof(ServerGuildRankUpdate_Struct));
|
||||
pack->size, sizeof(ServerGuildRankUpdate_Struct));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
ServerGuildRankUpdate_Struct *sgrus = (ServerGuildRankUpdate_Struct*)pack->pBuffer;
|
||||
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_SetGuildRank, sizeof(GuildSetRank_Struct));
|
||||
|
||||
GuildSetRank_Struct *gsrs = (GuildSetRank_Struct*)outapp->pBuffer;
|
||||
@@ -417,26 +417,26 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
|
||||
return;
|
||||
}
|
||||
ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer;
|
||||
|
||||
|
||||
_log(GUILDS__REFRESH, "Received guild delete from world for guild %d", s->guild_id);
|
||||
|
||||
|
||||
//clear all the guild tags.
|
||||
entity_list.RefreshAllGuildInfo(s->guild_id);
|
||||
|
||||
|
||||
//remove the guild data from the local guild manager
|
||||
guild_mgr.LocalDeleteGuild(s->guild_id);
|
||||
|
||||
|
||||
//if we stop forcing guild list to send on guild create, we need to do this:
|
||||
//in the case that we delete a guild and add a new one.
|
||||
//entity_list.SendGuildList();
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case ServerOP_GuildMemberUpdate:
|
||||
{
|
||||
ServerGuildMemberUpdate_Struct *sgmus = (ServerGuildMemberUpdate_Struct*)pack->pBuffer;
|
||||
|
||||
|
||||
if(ZoneLoaded)
|
||||
{
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GuildMemberUpdate, sizeof(GuildMemberUpdate_Struct));
|
||||
@@ -461,9 +461,9 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
|
||||
char *Buffer = (char *)pack->pBuffer;
|
||||
|
||||
uint32 FromID = VARSTRUCT_DECODE_TYPE(uint32, Buffer);
|
||||
uint32 Count = VARSTRUCT_DECODE_TYPE(uint32, Buffer);
|
||||
uint32 Count = VARSTRUCT_DECODE_TYPE(uint32, Buffer);
|
||||
Client *c = entity_list.GetClientByCharID(FromID);
|
||||
|
||||
|
||||
if (!c || !c->IsInAGuild())
|
||||
{
|
||||
_log(GUILDS__ERROR,"Invalid Client or not in guild. ID=%i", FromID);
|
||||
@@ -489,7 +489,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ServerOP_LFGuildUpdate:
|
||||
{
|
||||
if(ZoneLoaded)
|
||||
@@ -507,7 +507,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
|
||||
TimeZone = pack->ReadUInt32();
|
||||
TimePosted = pack->ReadUInt32();
|
||||
Toggle = pack->ReadUInt32();
|
||||
|
||||
|
||||
uint32 GuildID = GetGuildIDByName(GuildName);
|
||||
|
||||
if(GuildID == GUILD_NONE)
|
||||
@@ -517,7 +517,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
|
||||
|
||||
LFGuild_GuildToggle_Struct *gts = (LFGuild_GuildToggle_Struct *)outapp->pBuffer;
|
||||
gts->Command = 1;
|
||||
strcpy(gts->Comment, Comments);
|
||||
strcpy(gts->Comment, Comments);
|
||||
gts->FromLevel = FromLevel;
|
||||
gts->ToLevel = ToLevel;
|
||||
gts->Classes = Classes;
|
||||
@@ -552,7 +552,7 @@ void ZoneGuildManager::RequestOnlineGuildMembers(uint32 FromID, uint32 GuildID)
|
||||
{
|
||||
ServerPacket* pack = new ServerPacket(ServerOP_RequestOnlineGuildMembers, sizeof(ServerRequestOnlineGuildMembers_Struct));
|
||||
ServerRequestOnlineGuildMembers_Struct *srogm = (ServerRequestOnlineGuildMembers_Struct*)pack->pBuffer;
|
||||
|
||||
|
||||
srogm->FromID = FromID;
|
||||
srogm->GuildID = GuildID;
|
||||
worldserver.SendPacket(pack);
|
||||
@@ -618,7 +618,7 @@ GuildApproval* ZoneGuildManager::FindGuildByIDApproval(uint32 refid)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
GuildApproval* ZoneGuildManager::FindGuildByOwnerApproval(Client* owner)
|
||||
{
|
||||
LinkedListIterator<GuildApproval*> iterator(list);
|
||||
@@ -647,7 +647,7 @@ GuildBankManager::~GuildBankManager()
|
||||
|
||||
bool GuildBankManager::Load(uint32 GuildID)
|
||||
{
|
||||
const char *LoadQuery = "SELECT `area`, `slot`, `itemid`, `qty`, `donator`, `permissions`, `whofor` from `guild_bank` "
|
||||
const char *LoadQuery = "SELECT `area`, `slot`, `itemid`, `qty`, `donator`, `permissions`, `whofor` from `guild_bank` "
|
||||
"WHERE `guildid` = %i";
|
||||
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
@@ -779,20 +779,20 @@ void GuildBankManager::SendGuildBank(Client *c)
|
||||
continue;
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GuildBank, sizeof(GuildBankItemUpdate_Struct));
|
||||
|
||||
|
||||
GuildBankItemUpdate_Struct *gbius = (GuildBankItemUpdate_Struct*)outapp->pBuffer;
|
||||
|
||||
if(!Item->Stackable)
|
||||
gbius->Init(GuildBankItemUpdate, 1, i, GuildBankDepositArea, 1, Item->ID, Item->Icon, 1,
|
||||
(*Iterator)->Items.DepositArea[i].Permissions, 0, 0);
|
||||
(*Iterator)->Items.DepositArea[i].Permissions, 0, 0);
|
||||
else
|
||||
{
|
||||
if((*Iterator)->Items.DepositArea[i].Quantity == Item->StackSize)
|
||||
gbius->Init(GuildBankItemUpdate, 1, i, GuildBankDepositArea, 1, Item->ID, Item->Icon,
|
||||
(*Iterator)->Items.DepositArea[i].Quantity, (*Iterator)->Items.DepositArea[i].Permissions, 0, 0);
|
||||
(*Iterator)->Items.DepositArea[i].Quantity, (*Iterator)->Items.DepositArea[i].Permissions, 0, 0);
|
||||
else
|
||||
gbius->Init(GuildBankItemUpdate, 1, i, GuildBankDepositArea, 1, Item->ID, Item->Icon,
|
||||
(*Iterator)->Items.DepositArea[i].Quantity, (*Iterator)->Items.DepositArea[i].Permissions, 1, 0);
|
||||
(*Iterator)->Items.DepositArea[i].Quantity, (*Iterator)->Items.DepositArea[i].Permissions, 1, 0);
|
||||
}
|
||||
|
||||
strn0cpy(gbius->ItemName, Item->Name, sizeof(gbius->ItemName));
|
||||
@@ -804,7 +804,7 @@ void GuildBankManager::SendGuildBank(Client *c)
|
||||
c->FastQueuePacket(&outapp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for(int i = 0; i < GUILD_BANK_MAIN_AREA_SIZE; ++i)
|
||||
{
|
||||
if((*Iterator)->Items.MainArea[i].ItemID > 0)
|
||||
@@ -817,20 +817,20 @@ void GuildBankManager::SendGuildBank(Client *c)
|
||||
bool Useable = Item->IsEquipable(c->GetBaseRace(), c->GetBaseClass());
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GuildBank, sizeof(GuildBankItemUpdate_Struct));
|
||||
|
||||
|
||||
GuildBankItemUpdate_Struct *gbius = (GuildBankItemUpdate_Struct*)outapp->pBuffer;
|
||||
|
||||
if(!Item->Stackable)
|
||||
gbius->Init(GuildBankItemUpdate, 1, i, GuildBankMainArea, 1, Item->ID, Item->Icon, 1,
|
||||
(*Iterator)->Items.MainArea[i].Permissions, 0, Useable);
|
||||
(*Iterator)->Items.MainArea[i].Permissions, 0, Useable);
|
||||
else
|
||||
{
|
||||
if((*Iterator)->Items.MainArea[i].Quantity == Item->StackSize)
|
||||
gbius->Init(GuildBankItemUpdate, 1, i, GuildBankMainArea, 1, Item->ID, Item->Icon,
|
||||
(*Iterator)->Items.MainArea[i].Quantity, (*Iterator)->Items.MainArea[i].Permissions, 0, Useable);
|
||||
(*Iterator)->Items.MainArea[i].Quantity, (*Iterator)->Items.MainArea[i].Permissions, 0, Useable);
|
||||
else
|
||||
gbius->Init(GuildBankItemUpdate, 1, i, GuildBankMainArea, 1, Item->ID, Item->Icon,
|
||||
(*Iterator)->Items.MainArea[i].Quantity, (*Iterator)->Items.MainArea[i].Permissions, 1, Useable);
|
||||
(*Iterator)->Items.MainArea[i].Quantity, (*Iterator)->Items.MainArea[i].Permissions, 1, Useable);
|
||||
}
|
||||
|
||||
strn0cpy(gbius->ItemName, Item->Name, sizeof(gbius->ItemName));
|
||||
@@ -838,7 +838,7 @@ void GuildBankManager::SendGuildBank(Client *c)
|
||||
strn0cpy(gbius->Donator, (*Iterator)->Items.MainArea[i].Donator, sizeof(gbius->Donator));
|
||||
|
||||
strn0cpy(gbius->WhoFor, (*Iterator)->Items.MainArea[i].WhoFor, sizeof(gbius->WhoFor));
|
||||
|
||||
|
||||
c->FastQueuePacket(&outapp);
|
||||
}
|
||||
}
|
||||
@@ -924,15 +924,15 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32
|
||||
}
|
||||
}
|
||||
|
||||
if(Slot < 0)
|
||||
if(Slot < 0)
|
||||
{
|
||||
_log(GUILDS__BANK_ERROR, "No space to add item to the guild bank.");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
const char *Query="INSERT INTO `guild_bank` (`guildid`, `area`, `slot`, `itemid`, `qty`, `donator`, `permissions`, `WhoFor`) "
|
||||
"VALUES (%i, %i, %i, %i, %i, '%s', %i, '%s')";
|
||||
"VALUES (%i, %i, %i, %i, %i, '%s', %i, '%s')";
|
||||
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
|
||||
@@ -1014,7 +1014,7 @@ int GuildBankManager::Promote(uint32 GuildID, int SlotID)
|
||||
|
||||
strn0cpy((*Iterator)->Items.MainArea[MainSlot].WhoFor, (*Iterator)->Items.DepositArea[SlotID].WhoFor, sizeof((*Iterator)->Items.MainArea[MainSlot].WhoFor));
|
||||
|
||||
const char *Query="UPDATE `guild_bank` SET `area` = 1, `slot` = %i WHERE `guildid` = %i AND `area` = 0 AND `slot` = %i LIMIT 1";
|
||||
const char *Query="UPDATE `guild_bank` SET `area` = 1, `slot` = %i WHERE `guildid` = %i AND `area` = 0 AND `slot` = %i LIMIT 1";
|
||||
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
|
||||
@@ -1043,10 +1043,10 @@ int GuildBankManager::Promote(uint32 GuildID, int SlotID)
|
||||
{
|
||||
if((*Iterator)->Items.MainArea[MainSlot].Quantity == Item->StackSize)
|
||||
gbius.Init(GuildBankItemUpdate, 1, MainSlot, GuildBankMainArea, 1, Item->ID, Item->Icon,
|
||||
(*Iterator)->Items.MainArea[MainSlot].Quantity, 0, 0, 0);
|
||||
(*Iterator)->Items.MainArea[MainSlot].Quantity, 0, 0, 0);
|
||||
else
|
||||
gbius.Init(GuildBankItemUpdate, 1, MainSlot, GuildBankMainArea, 1, Item->ID, Item->Icon,
|
||||
(*Iterator)->Items.MainArea[MainSlot].Quantity, 0, 1, 0);
|
||||
(*Iterator)->Items.MainArea[MainSlot].Quantity, 0, 1, 0);
|
||||
}
|
||||
|
||||
strn0cpy(gbius.ItemName, Item->Name, sizeof(gbius.ItemName));
|
||||
@@ -1077,7 +1077,7 @@ void GuildBankManager::SetPermissions(uint32 GuildID, uint16 SlotID, uint32 Perm
|
||||
return;
|
||||
}
|
||||
|
||||
const char *Query="UPDATE `guild_bank` SET `permissions` = %i, `whofor` = '%s' WHERE `guildid` = %i AND `area` = 1 AND `slot` = %i LIMIT 1";
|
||||
const char *Query="UPDATE `guild_bank` SET `permissions` = %i, `whofor` = '%s' WHERE `guildid` = %i AND `area` = 1 AND `slot` = %i LIMIT 1";
|
||||
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
|
||||
@@ -1112,10 +1112,10 @@ void GuildBankManager::SetPermissions(uint32 GuildID, uint16 SlotID, uint32 Perm
|
||||
{
|
||||
if((*Iterator)->Items.MainArea[SlotID].Quantity == Item->StackSize)
|
||||
gbius.Init(GuildBankItemUpdate, 1, SlotID, GuildBankMainArea, 1, Item->ID, Item->Icon,
|
||||
(*Iterator)->Items.MainArea[SlotID].Quantity, (*Iterator)->Items.MainArea[SlotID].Permissions, 0, 0);
|
||||
(*Iterator)->Items.MainArea[SlotID].Quantity, (*Iterator)->Items.MainArea[SlotID].Permissions, 0, 0);
|
||||
else
|
||||
gbius.Init(GuildBankItemUpdate, 1, SlotID, GuildBankMainArea, 1, Item->ID, Item->Icon,
|
||||
(*Iterator)->Items.MainArea[SlotID].Quantity, (*Iterator)->Items.MainArea[SlotID].Permissions, 1, 0);
|
||||
(*Iterator)->Items.MainArea[SlotID].Quantity, (*Iterator)->Items.MainArea[SlotID].Permissions, 1, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1126,7 +1126,7 @@ void GuildBankManager::SetPermissions(uint32 GuildID, uint16 SlotID, uint32 Perm
|
||||
entity_list.QueueClientsGuildBankItemUpdate(&gbius, GuildID);
|
||||
}
|
||||
|
||||
ItemInst* GuildBankManager::GetItem(uint32 GuildID, uint16 Area, uint16 SlotID, uint32 Quantity)
|
||||
ItemInst* GuildBankManager::GetItem(uint32 GuildID, uint16 Area, uint16 SlotID, uint32 Quantity)
|
||||
{
|
||||
std::list<GuildBank*>::iterator Iterator = GetGuildBank(GuildID);
|
||||
|
||||
@@ -1264,7 +1264,7 @@ bool GuildBankManager::DeleteItem(uint32 GuildID, uint16 Area, uint16 SlotID, ui
|
||||
const char *Query = "UPDATE `guild_bank` SET `qty` = %i where `guildid` = %i AND `area` = %i AND `slot` = %i LIMIT 1";
|
||||
|
||||
if(!database.RunQuery(query, MakeAnyLenString(&query, Query, BankArea[SlotID].Quantity - Quantity,
|
||||
GuildID, Area, SlotID), errbuf))
|
||||
GuildID, Area, SlotID), errbuf))
|
||||
{
|
||||
_log(GUILDS__BANK_ERROR, "Update item failed. %s : %s", query, errbuf);
|
||||
|
||||
@@ -1441,7 +1441,7 @@ void GuildBankManager::UpdateItemQuantity(uint32 GuildID, uint16 Area, uint16 Sl
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
safe_delete_array(query);
|
||||
}
|
||||
|
||||
@@ -1481,7 +1481,7 @@ bool GuildApproval::ProcessApproval()
|
||||
{
|
||||
if(owner && owner->GuildID() != 0)
|
||||
{
|
||||
owner->Message(10,"You are already in a guild! Guild request deleted.");
|
||||
owner->Message(10,"You are already in a guild! Guild request deleted.");
|
||||
return false;
|
||||
}
|
||||
if(deletion_timer->Check() || !owner)
|
||||
@@ -1490,7 +1490,7 @@ bool GuildApproval::ProcessApproval()
|
||||
owner->Message(0,"You took too long! Your guild request has been deleted.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1522,7 +1522,7 @@ bool GuildApproval::AddMemberApproval(Client* addition)
|
||||
if(members[i] && members[i] == addition)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
for(int i=0;i<tmp;i++)
|
||||
{
|
||||
if(!members[i])
|
||||
@@ -1536,7 +1536,7 @@ bool GuildApproval::AddMemberApproval(Client* addition)
|
||||
}
|
||||
if(z==tmp)
|
||||
GuildApproved();
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1596,8 +1596,8 @@ void GuildApproval::GuildApproved()
|
||||
pet->SetPetitionText(petitext);
|
||||
pet->SetZone(zone->GetZoneID());
|
||||
pet->SetUrgency(0);
|
||||
petition_list.AddPetition(pet);
|
||||
database.InsertPetitionToDB(pet);
|
||||
petition_list.AddPetition(pet);
|
||||
database.InsertPetitionToDB(pet);
|
||||
petition_list.UpdateGMQueue();
|
||||
petition_list.UpdateZoneListQueue();
|
||||
worldserver.SendEmoteMessage(0, 0, 80, 15, "%s has made a petition. #%i", owner->CastToClient()->GetName(), pet->GetID());
|
||||
@@ -1611,3 +1611,4 @@ void GuildApproval::GuildApproved()
|
||||
owner->Message(0, "Your guild was created.");
|
||||
owner = 0;
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -80,15 +80,15 @@ public:
|
||||
uint32 GetFreeID() { return id+1; }
|
||||
//called by worldserver when it receives a message from world.
|
||||
void ProcessWorldPacket(ServerPacket *pack);
|
||||
|
||||
|
||||
void ListGuilds(Client *c) const;
|
||||
void DescribeGuild(Client *c, uint32 guild_id) const;
|
||||
|
||||
|
||||
|
||||
|
||||
// bool DonateTribute(uint32 charid, uint32 guild_id, uint32 tribute_amount);
|
||||
|
||||
|
||||
uint8 *MakeGuildMembers(uint32 guild_id, const char *prefix_name, uint32 &length); //make a guild member list packet, returns ownership of the buffer.
|
||||
|
||||
|
||||
void RecordInvite(uint32 char_id, uint32 guild_id, uint8 rank);
|
||||
bool VerifyAndClearInvite(uint32 char_id, uint32 guild_id, uint8 rank);
|
||||
void SendGuildMemberUpdateToWorld(const char *MemberName, uint32 GuildID, uint16 ZoneID, uint32 LastSeen);
|
||||
|
||||
+130
-130
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
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 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
|
||||
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.
|
||||
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
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "../common/debug.h"
|
||||
@@ -44,14 +44,14 @@ HateList::~HateList()
|
||||
// checks if target still is in frenzy mode
|
||||
void HateList::CheckFrenzyHate()
|
||||
{
|
||||
LinkedListIterator<tHateEntry*> iterator(list);
|
||||
iterator.Reset();
|
||||
LinkedListIterator<tHateEntry*> iterator(list);
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements())
|
||||
{
|
||||
if (iterator.GetData()->ent->GetHPRatio() >= 20)
|
||||
iterator.GetData()->bFrenzy = false;
|
||||
iterator.Advance();
|
||||
}
|
||||
{
|
||||
if (iterator.GetData()->ent->GetHPRatio() >= 20)
|
||||
iterator.GetData()->bFrenzy = false;
|
||||
iterator.Advance();
|
||||
}
|
||||
}
|
||||
|
||||
void HateList::Wipe()
|
||||
@@ -59,48 +59,48 @@ void HateList::Wipe()
|
||||
LinkedListIterator<tHateEntry*> iterator(list);
|
||||
iterator.Reset();
|
||||
|
||||
while(iterator.MoreElements())
|
||||
while(iterator.MoreElements())
|
||||
{
|
||||
Mob* m = iterator.GetData()->ent;
|
||||
parse->EventNPC(EVENT_HATE_LIST, owner->CastToNPC(), m, "0", 0);
|
||||
iterator.RemoveCurrent();
|
||||
parse->EventNPC(EVENT_HATE_LIST, owner->CastToNPC(), m, "0", 0);
|
||||
iterator.RemoveCurrent();
|
||||
|
||||
if(m->IsClient())
|
||||
m->CastToClient()->DecrementAggroCount();
|
||||
}
|
||||
}
|
||||
|
||||
bool HateList::IsOnHateList(Mob *mob)
|
||||
{
|
||||
if (Find(mob))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
bool HateList::IsOnHateList(Mob *mob)
|
||||
{
|
||||
if (Find(mob))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
tHateEntry *HateList::Find(Mob *ent)
|
||||
{
|
||||
_ZP(HateList_Find);
|
||||
LinkedListIterator<tHateEntry*> iterator(list);
|
||||
iterator.Reset();
|
||||
LinkedListIterator<tHateEntry*> iterator(list);
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements())
|
||||
{
|
||||
if(iterator.GetData()->ent == ent)
|
||||
return iterator.GetData();
|
||||
iterator.Advance();
|
||||
}
|
||||
{
|
||||
if(iterator.GetData()->ent == ent)
|
||||
return iterator.GetData();
|
||||
iterator.Advance();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void HateList::Set(Mob* other, uint32 in_hate, uint32 in_dam)
|
||||
{
|
||||
tHateEntry *p = Find(other);
|
||||
if(p)
|
||||
{
|
||||
tHateEntry *p = Find(other);
|
||||
if(p)
|
||||
{
|
||||
if(in_dam > 0)
|
||||
p->damage = in_dam;
|
||||
p->damage = in_dam;
|
||||
if(in_hate > 0)
|
||||
p->hate = in_hate;
|
||||
}
|
||||
p->hate = in_hate;
|
||||
}
|
||||
}
|
||||
|
||||
Mob* HateList::GetDamageTop(Mob* hater)
|
||||
@@ -111,10 +111,10 @@ Mob* HateList::GetDamageTop(Mob* hater)
|
||||
Raid* r = nullptr;
|
||||
uint32 dmg_amt = 0;
|
||||
|
||||
LinkedListIterator<tHateEntry*> iterator(list);
|
||||
iterator.Reset();
|
||||
LinkedListIterator<tHateEntry*> iterator(list);
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements())
|
||||
{
|
||||
{
|
||||
grp = nullptr;
|
||||
r = nullptr;
|
||||
|
||||
@@ -122,7 +122,7 @@ Mob* HateList::GetDamageTop(Mob* hater)
|
||||
r = entity_list.GetRaidByClient(iterator.GetData()->ent->CastToClient());
|
||||
}
|
||||
|
||||
grp = entity_list.GetGroupByMob(iterator.GetData()->ent);
|
||||
grp = entity_list.GetGroupByMob(iterator.GetData()->ent);
|
||||
|
||||
if(iterator.GetData()->ent && r){
|
||||
if(r->GetTotalRaidDamage(hater) >= dmg_amt)
|
||||
@@ -132,20 +132,20 @@ Mob* HateList::GetDamageTop(Mob* hater)
|
||||
}
|
||||
}
|
||||
else if (iterator.GetData()->ent != nullptr && grp != nullptr)
|
||||
{
|
||||
{
|
||||
if (grp->GetTotalGroupDamage(hater) >= dmg_amt)
|
||||
{
|
||||
{
|
||||
current = iterator.GetData()->ent;
|
||||
dmg_amt = grp->GetTotalGroupDamage(hater);
|
||||
}
|
||||
}
|
||||
else if (iterator.GetData()->ent != nullptr && (uint32)iterator.GetData()->damage >= dmg_amt)
|
||||
{
|
||||
}
|
||||
}
|
||||
else if (iterator.GetData()->ent != nullptr && (uint32)iterator.GetData()->damage >= dmg_amt)
|
||||
{
|
||||
current = iterator.GetData()->ent;
|
||||
dmg_amt = iterator.GetData()->damage;
|
||||
}
|
||||
iterator.Advance();
|
||||
}
|
||||
}
|
||||
iterator.Advance();
|
||||
}
|
||||
return current;
|
||||
}
|
||||
|
||||
@@ -154,21 +154,21 @@ Mob* HateList::GetClosest(Mob *hater) {
|
||||
Mob* close = nullptr;
|
||||
float closedist = 99999.9f;
|
||||
float thisdist;
|
||||
|
||||
LinkedListIterator<tHateEntry*> iterator(list);
|
||||
iterator.Reset();
|
||||
|
||||
LinkedListIterator<tHateEntry*> iterator(list);
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements()) {
|
||||
thisdist = iterator.GetData()->ent->DistNoRootNoZ(*hater);
|
||||
if(iterator.GetData()->ent != nullptr && thisdist <= closedist) {
|
||||
closedist = thisdist;
|
||||
close = iterator.GetData()->ent;
|
||||
}
|
||||
iterator.Advance();
|
||||
iterator.Advance();
|
||||
}
|
||||
|
||||
|
||||
if (close == 0 && hater->IsNPC())
|
||||
close = hater->CastToNPC()->GetHateTop();
|
||||
|
||||
|
||||
return close;
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ Mob* HateList::GetClosest(Mob *hater) {
|
||||
void HateList::Add(Mob *ent, int32 in_hate, int32 in_dam, bool bFrenzy, bool iAddIfNotExist)
|
||||
{
|
||||
if(!ent)
|
||||
return;
|
||||
return;
|
||||
|
||||
if(ent->IsCorpse())
|
||||
return;
|
||||
@@ -193,17 +193,17 @@ void HateList::Add(Mob *ent, int32 in_hate, int32 in_dam, bool bFrenzy, bool iAd
|
||||
p->bFrenzy = bFrenzy;
|
||||
}
|
||||
else if (iAddIfNotExist) {
|
||||
p = new tHateEntry;
|
||||
p->ent = ent;
|
||||
p->damage = (in_dam>=0)?in_dam:0;
|
||||
p->hate = in_hate;
|
||||
p->bFrenzy = bFrenzy;
|
||||
list.Append(p);
|
||||
parse->EventNPC(EVENT_HATE_LIST, owner->CastToNPC(), ent, "1", 0);
|
||||
p = new tHateEntry;
|
||||
p->ent = ent;
|
||||
p->damage = (in_dam>=0)?in_dam:0;
|
||||
p->hate = in_hate;
|
||||
p->bFrenzy = bFrenzy;
|
||||
list.Append(p);
|
||||
parse->EventNPC(EVENT_HATE_LIST, owner->CastToNPC(), ent, "1", 0);
|
||||
|
||||
if(ent->IsClient())
|
||||
ent->CastToClient()->IncrementAggroCount();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool HateList::RemoveEnt(Mob *ent)
|
||||
@@ -216,14 +216,14 @@ bool HateList::RemoveEnt(Mob *ent)
|
||||
{
|
||||
if(iterator.GetData()->ent == ent)
|
||||
{
|
||||
parse->EventNPC(EVENT_HATE_LIST, owner->CastToNPC(), ent, "0", 0);
|
||||
parse->EventNPC(EVENT_HATE_LIST, owner->CastToNPC(), ent, "0", 0);
|
||||
iterator.RemoveCurrent();
|
||||
found = true;
|
||||
|
||||
if(ent->IsClient())
|
||||
ent->CastToClient()->DecrementAggroCount();
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
iterator.Advance();
|
||||
}
|
||||
@@ -234,21 +234,21 @@ void HateList::DoFactionHits(int32 nfl_id) {
|
||||
_ZP(HateList_DoFactionHits);
|
||||
if (nfl_id <= 0)
|
||||
return;
|
||||
LinkedListIterator<tHateEntry*> iterator(list);
|
||||
iterator.Reset();
|
||||
LinkedListIterator<tHateEntry*> iterator(list);
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements())
|
||||
{
|
||||
Client *p;
|
||||
{
|
||||
Client *p;
|
||||
|
||||
if (iterator.GetData()->ent && iterator.GetData()->ent->IsClient())
|
||||
p = iterator.GetData()->ent->CastToClient();
|
||||
else
|
||||
p = nullptr;
|
||||
if (iterator.GetData()->ent && iterator.GetData()->ent->IsClient())
|
||||
p = iterator.GetData()->ent->CastToClient();
|
||||
else
|
||||
p = nullptr;
|
||||
|
||||
if (p)
|
||||
if (p)
|
||||
p->SetFactionLevel(p->CharacterID(), nfl_id, p->GetBaseClass(), p->GetBaseRace(), p->GetDeity());
|
||||
iterator.Advance();
|
||||
}
|
||||
iterator.Advance();
|
||||
}
|
||||
}
|
||||
|
||||
Mob *HateList::GetTop(Mob *center)
|
||||
@@ -256,36 +256,36 @@ Mob *HateList::GetTop(Mob *center)
|
||||
_ZP(HateList_GetTop);
|
||||
Mob* top = nullptr;
|
||||
int32 hate = -1;
|
||||
|
||||
|
||||
if (RuleB(Aggro,SmartAggroList)){
|
||||
Mob* topClientTypeInRange = nullptr;
|
||||
int32 hateClientTypeInRange = -1;
|
||||
int skipped_count = 0;
|
||||
int skipped_count = 0;
|
||||
|
||||
LinkedListIterator<tHateEntry*> iterator(list);
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements())
|
||||
{
|
||||
tHateEntry *cur = iterator.GetData();
|
||||
tHateEntry *cur = iterator.GetData();
|
||||
int16 aggroMod = 0;
|
||||
|
||||
if(!cur){
|
||||
iterator.Advance();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if(!cur->ent){
|
||||
iterator.Advance();
|
||||
continue;
|
||||
}
|
||||
|
||||
if(center->IsNPC() && center->CastToNPC()->IsUnderwaterOnly() && zone->HasWaterMap()) {
|
||||
if(!zone->watermap->InLiquid(cur->ent->GetX(), cur->ent->GetY(), cur->ent->GetZ())) {
|
||||
skipped_count++;
|
||||
iterator.Advance();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if(center->IsNPC() && center->CastToNPC()->IsUnderwaterOnly() && zone->HasWaterMap()) {
|
||||
if(!zone->watermap->InLiquid(cur->ent->GetX(), cur->ent->GetY(), cur->ent->GetZ())) {
|
||||
skipped_count++;
|
||||
iterator.Advance();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if(cur->ent->DivineAura() || cur->ent->IsMezzed() || cur->ent->IsFeared()){
|
||||
if(hate == -1)
|
||||
@@ -300,7 +300,7 @@ Mob *HateList::GetTop(Mob *center)
|
||||
int32 currentHate = cur->hate;
|
||||
|
||||
if(cur->ent->IsClient()){
|
||||
|
||||
|
||||
if(cur->ent->CastToClient()->IsSitting()){
|
||||
aggroMod += RuleI(Aggro, SittingAggroMod);
|
||||
}
|
||||
@@ -362,7 +362,7 @@ Mob *HateList::GetTop(Mob *center)
|
||||
}
|
||||
#endif //BOTS
|
||||
|
||||
if(!isTopClientType) {
|
||||
if(!isTopClientType) {
|
||||
if(top->IsMerc()) {
|
||||
isTopClientType = true;
|
||||
topClientTypeInRange = top;
|
||||
@@ -373,28 +373,28 @@ Mob *HateList::GetTop(Mob *center)
|
||||
return topClientTypeInRange;
|
||||
|
||||
return top;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(top == nullptr && skipped_count > 0) {
|
||||
return center->GetTarget();
|
||||
}
|
||||
return center->GetTarget();
|
||||
}
|
||||
return top;
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
LinkedListIterator<tHateEntry*> iterator(list);
|
||||
iterator.Reset();
|
||||
int skipped_count = 0;
|
||||
int skipped_count = 0;
|
||||
while(iterator.MoreElements())
|
||||
{
|
||||
tHateEntry *cur = iterator.GetData();
|
||||
if(center->IsNPC() && center->CastToNPC()->IsUnderwaterOnly() && zone->HasWaterMap()) {
|
||||
if(!zone->watermap->InLiquid(cur->ent->GetX(), cur->ent->GetY(), cur->ent->GetZ())) {
|
||||
skipped_count++;
|
||||
iterator.Advance();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
tHateEntry *cur = iterator.GetData();
|
||||
if(center->IsNPC() && center->CastToNPC()->IsUnderwaterOnly() && zone->HasWaterMap()) {
|
||||
if(!zone->watermap->InLiquid(cur->ent->GetX(), cur->ent->GetY(), cur->ent->GetZ())) {
|
||||
skipped_count++;
|
||||
iterator.Advance();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if(cur->ent != nullptr && ((cur->hate > hate) || cur->bFrenzy ))
|
||||
{
|
||||
@@ -404,8 +404,8 @@ Mob *HateList::GetTop(Mob *center)
|
||||
iterator.Advance();
|
||||
}
|
||||
if(top == nullptr && skipped_count > 0) {
|
||||
return center->GetTarget();
|
||||
}
|
||||
return center->GetTarget();
|
||||
}
|
||||
return top;
|
||||
}
|
||||
}
|
||||
@@ -434,32 +434,32 @@ Mob *HateList::GetMostHate(){
|
||||
|
||||
Mob *HateList::GetRandom()
|
||||
{
|
||||
int count = 0;
|
||||
LinkedListIterator<tHateEntry*> iterator(list);
|
||||
iterator.Reset();
|
||||
int count = 0;
|
||||
LinkedListIterator<tHateEntry*> iterator(list);
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements())
|
||||
{
|
||||
iterator.Advance();
|
||||
count++;
|
||||
}
|
||||
{
|
||||
iterator.Advance();
|
||||
count++;
|
||||
}
|
||||
if(!count)
|
||||
return nullptr;
|
||||
|
||||
int random = MakeRandomInt(0, count-1);
|
||||
iterator.Reset();
|
||||
for (int i = 0; i < random; i++)
|
||||
iterator.Advance();
|
||||
return iterator.GetData()->ent;
|
||||
int random = MakeRandomInt(0, count-1);
|
||||
iterator.Reset();
|
||||
for (int i = 0; i < random; i++)
|
||||
iterator.Advance();
|
||||
return iterator.GetData()->ent;
|
||||
}
|
||||
|
||||
int32 HateList::GetEntHate(Mob *ent, bool damage)
|
||||
{
|
||||
tHateEntry *p;
|
||||
|
||||
p = Find(ent);
|
||||
|
||||
p = Find(ent);
|
||||
|
||||
if ( p && damage)
|
||||
return p->damage;
|
||||
return p->damage;
|
||||
else if (p)
|
||||
return p->hate;
|
||||
else
|
||||
@@ -469,7 +469,7 @@ int32 HateList::GetEntHate(Mob *ent, bool damage)
|
||||
//looking for any mob with hate > -1
|
||||
bool HateList::IsEmpty() {
|
||||
_ZP(HateList_IsEmpty);
|
||||
|
||||
|
||||
return(list.Count() == 0);
|
||||
}
|
||||
|
||||
@@ -501,7 +501,7 @@ int HateList::AreaRampage(Mob *caster, Mob *target)
|
||||
while (iterator.MoreElements())
|
||||
{
|
||||
tHateEntry *h = iterator.GetData();
|
||||
iterator.Advance();
|
||||
iterator.Advance();
|
||||
if(h && h->ent && h->ent != caster)
|
||||
{
|
||||
if(caster->CombatRange(h->ent))
|
||||
@@ -533,7 +533,7 @@ void HateList::SpellCast(Mob *caster, uint32 spell_id, float range)
|
||||
return;
|
||||
}
|
||||
|
||||
//this is slower than just iterating through the list but avoids
|
||||
//this is slower than just iterating through the list but avoids
|
||||
//crashes when people kick the bucket in the middle of this call
|
||||
//that invalidates our iterator but there's no way to know sadly
|
||||
//So keep a list of entity ids and look up after
|
||||
@@ -555,7 +555,7 @@ void HateList::SpellCast(Mob *caster, uint32 spell_id, float range)
|
||||
{
|
||||
id_list.push_back(h->ent->GetID());
|
||||
}
|
||||
iterator.Advance();
|
||||
iterator.Advance();
|
||||
}
|
||||
|
||||
std::list<uint32>::iterator iter = id_list.begin();
|
||||
@@ -574,9 +574,9 @@ void HateList::SpellCast(Mob *caster, uint32 spell_id, float range)
|
||||
void HateList::GetHateList(std::list<tHateEntry*> &h_list)
|
||||
{
|
||||
h_list.clear();
|
||||
LinkedListIterator<tHateEntry*> iterator(list);
|
||||
LinkedListIterator<tHateEntry*> iterator(list);
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements())
|
||||
while(iterator.MoreElements())
|
||||
{
|
||||
tHateEntry *ent = iterator.GetData();
|
||||
h_list.push_back(ent);
|
||||
|
||||
+43
-43
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
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 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
|
||||
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.
|
||||
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
|
||||
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 HATELIST_H
|
||||
@@ -22,41 +22,41 @@
|
||||
class tHateEntry
|
||||
{
|
||||
public:
|
||||
Mob *ent;
|
||||
int32 damage, hate;
|
||||
bool bFrenzy;
|
||||
Mob *ent;
|
||||
int32 damage, hate;
|
||||
bool bFrenzy;
|
||||
};
|
||||
|
||||
class HateList
|
||||
{
|
||||
public:
|
||||
HateList();
|
||||
~HateList();
|
||||
HateList();
|
||||
~HateList();
|
||||
|
||||
// adds a mob to the hatelist
|
||||
void Add(Mob *ent, int32 in_hate=0, int32 in_dam=0, bool bFrenzy = false, bool iAddIfNotExist = true);
|
||||
// sets existing hate
|
||||
void Set(Mob *other, uint32 in_hate, uint32 in_dam);
|
||||
// removes mobs from hatelist
|
||||
bool RemoveEnt(Mob *ent);
|
||||
// Remove all
|
||||
void Wipe();
|
||||
// ???
|
||||
void DoFactionHits(int32 nfl_id);
|
||||
// Gets Hate amount for mob
|
||||
int32 GetEntHate(Mob *ent, bool damage = false);
|
||||
// gets top hated mob
|
||||
Mob *GetTop(Mob *center);
|
||||
// gets any on the list
|
||||
Mob *GetRandom();
|
||||
// get closest mob or nullptr if list empty
|
||||
Mob *GetClosest(Mob *hater);
|
||||
// gets top mob or nullptr if hate list empty
|
||||
Mob *GetDamageTop(Mob *hater);
|
||||
// used to check if mob is on hatelist
|
||||
bool IsOnHateList(Mob *);
|
||||
// used to remove or add frenzy hate
|
||||
void CheckFrenzyHate();
|
||||
// adds a mob to the hatelist
|
||||
void Add(Mob *ent, int32 in_hate=0, int32 in_dam=0, bool bFrenzy = false, bool iAddIfNotExist = true);
|
||||
// sets existing hate
|
||||
void Set(Mob *other, uint32 in_hate, uint32 in_dam);
|
||||
// removes mobs from hatelist
|
||||
bool RemoveEnt(Mob *ent);
|
||||
// Remove all
|
||||
void Wipe();
|
||||
// ???
|
||||
void DoFactionHits(int32 nfl_id);
|
||||
// Gets Hate amount for mob
|
||||
int32 GetEntHate(Mob *ent, bool damage = false);
|
||||
// gets top hated mob
|
||||
Mob *GetTop(Mob *center);
|
||||
// gets any on the list
|
||||
Mob *GetRandom();
|
||||
// get closest mob or nullptr if list empty
|
||||
Mob *GetClosest(Mob *hater);
|
||||
// gets top mob or nullptr if hate list empty
|
||||
Mob *GetDamageTop(Mob *hater);
|
||||
// used to check if mob is on hatelist
|
||||
bool IsOnHateList(Mob *);
|
||||
// used to remove or add frenzy hate
|
||||
void CheckFrenzyHate();
|
||||
//Gets the target with the most hate regardless of things like frenzy etc.
|
||||
Mob* GetMostHate();
|
||||
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
|
||||
void SpellCast(Mob *caster, uint32 spell_id, float range);
|
||||
|
||||
bool IsEmpty();
|
||||
bool IsEmpty();
|
||||
void PrintToClient(Client *c);
|
||||
|
||||
//For accessing the hate list via perl; don't use for anything else
|
||||
@@ -74,9 +74,9 @@ public:
|
||||
void SetOwner(Mob *newOwner) { owner = newOwner; }
|
||||
|
||||
protected:
|
||||
tHateEntry *Find(Mob *ent);
|
||||
tHateEntry *Find(Mob *ent);
|
||||
private:
|
||||
LinkedList<tHateEntry*> list;
|
||||
LinkedList<tHateEntry*> list;
|
||||
Mob *owner;
|
||||
};
|
||||
|
||||
|
||||
+36
-41
@@ -1,23 +1,21 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
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 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
|
||||
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.
|
||||
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
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "../common/debug.h"
|
||||
#include "masterentity.h"
|
||||
#include "../common/Item.h"
|
||||
@@ -30,26 +28,26 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
map<uint16, const NPCType *> Horse::horse_types;
|
||||
LinkedList<NPCType *> horses_auto_delete;
|
||||
|
||||
Horse::Horse(Client *_owner, uint16 spell_id, float x, float y, float z, float heading)
|
||||
Horse::Horse(Client *_owner, uint16 spell_id, float x, float y, float z, float heading)
|
||||
: NPC(GetHorseType(spell_id), nullptr, x, y, z, heading, FlyMode3)
|
||||
{
|
||||
//give the horse its proper name.
|
||||
strn0cpy(name, _owner->GetCleanName(), 55);
|
||||
strcat(name,"`s_Mount00");
|
||||
|
||||
|
||||
owner = _owner;
|
||||
}
|
||||
|
||||
|
||||
void Horse::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
||||
NPC::FillSpawnStruct(ns, ForWho);
|
||||
|
||||
|
||||
// ns->spawn.texture = NPCTypedata->mount_color;
|
||||
ns->spawn.petOwnerId = 0;
|
||||
|
||||
|
||||
//dunno why we do these, they should allready be set right.
|
||||
ns->spawn.runspeed = NPCTypedata->runspeed;
|
||||
}
|
||||
|
||||
|
||||
bool Horse::IsHorseSpell(uint16 spell_id) {
|
||||
//written in terms of a function which does a ton more work
|
||||
//than we need to to figure out if this is a horse spell.
|
||||
@@ -89,11 +87,11 @@ const NPCType *Horse::BuildHorseType(uint16 spell_id) {
|
||||
memset(npc_type, 0, sizeof(NPCType));
|
||||
strcpy(npc_type->name,"Unclaimed_Mount"); //this should never get used
|
||||
strcpy(npc_type->npc_attacks,"ABH");
|
||||
npc_type->cur_hp = 1;
|
||||
npc_type->max_hp = 1;
|
||||
npc_type->cur_hp = 1;
|
||||
npc_type->max_hp = 1;
|
||||
npc_type->race = atoi(row[0]);
|
||||
npc_type->gender = atoi(row[1]); // Drogmor's are female horses. Yuck.
|
||||
npc_type->class_ = 1;
|
||||
npc_type->class_ = 1;
|
||||
npc_type->deity= 1;
|
||||
npc_type->level = 1;
|
||||
npc_type->npc_id = 0;
|
||||
@@ -112,7 +110,7 @@ const NPCType *Horse::BuildHorseType(uint16 spell_id) {
|
||||
npc_type->INT = 75;
|
||||
npc_type->WIS = 75;
|
||||
npc_type->CHA = 75;
|
||||
|
||||
|
||||
horses_auto_delete.Insert(npc_type);
|
||||
|
||||
mysql_free_result(result);
|
||||
@@ -127,36 +125,34 @@ const NPCType *Horse::BuildHorseType(uint16 spell_id) {
|
||||
return nullptr;
|
||||
}
|
||||
else {
|
||||
LogFile->write(EQEMuLog::Error, "Error in Mount query '%s': %s", query, errbuf);
|
||||
LogFile->write(EQEMuLog::Error, "Error in Mount query '%s': %s", query, errbuf);
|
||||
safe_delete_array(query);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Client::SummonHorse(uint16 spell_id) {
|
||||
if (GetHorseId() != 0) {
|
||||
Message(13,"You already have a Horse. Get off, Fatbutt!");
|
||||
Message(13,"You already have a Horse. Get off, Fatbutt!");
|
||||
return;
|
||||
}
|
||||
if(!Horse::IsHorseSpell(spell_id)) {
|
||||
LogFile->write(EQEMuLog::Error, "%s tried to summon an unknown horse, spell id %d", GetName(), spell_id);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// No Horse, lets get them one.
|
||||
|
||||
|
||||
Horse* horse = new Horse(this, spell_id, GetX(), GetY(), GetZ(), GetHeading());
|
||||
|
||||
|
||||
//we want to manage the spawn packet ourself.
|
||||
//another reason is we dont want quests executing on it.
|
||||
entity_list.AddNPC(horse, false);
|
||||
|
||||
|
||||
// Okay, lets say they have a horse now.
|
||||
|
||||
|
||||
|
||||
|
||||
EQApplicationPacket outapp;
|
||||
horse->CreateHorseSpawnPacket(&outapp, GetName(), GetID());
|
||||
/* // Doodman: Kludged in here instead of adding a field to PCType. FIXME!
|
||||
@@ -167,18 +163,18 @@ void Client::SummonHorse(uint16 spell_id) {
|
||||
ns->spawn.runspeed=npc_type->runspeed;
|
||||
*/
|
||||
entity_list.QueueClients(horse, &outapp);
|
||||
|
||||
|
||||
|
||||
|
||||
uint16 tmpID = horse->GetID();
|
||||
SetHorseId(tmpID);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void Client::SetHorseId(uint16 horseid_in) {
|
||||
//if its the same, do nothing
|
||||
if(horseId == horseid_in)
|
||||
return;
|
||||
|
||||
|
||||
//otherwise it changed.
|
||||
//if we have a horse, get rid of it no matter what.
|
||||
if(horseId) {
|
||||
@@ -186,7 +182,7 @@ void Client::SetHorseId(uint16 horseid_in) {
|
||||
if(horse != nullptr)
|
||||
horse->Depop();
|
||||
}
|
||||
|
||||
|
||||
//now we take whatever they gave us.
|
||||
horseId = horseid_in;
|
||||
}
|
||||
@@ -198,11 +194,10 @@ void Mob::CreateHorseSpawnPacket(EQApplicationPacket* app, const char* ownername
|
||||
memset(app->pBuffer, 0, sizeof(NewSpawn_Struct));
|
||||
NewSpawn_Struct* ns = (NewSpawn_Struct*)app->pBuffer;
|
||||
FillSpawnStruct(ns, ForWho);
|
||||
|
||||
|
||||
#if (EQDEBUG >= 11)
|
||||
printf("Horse Spawn Packet - Owner: %s\n", ownername);
|
||||
DumpPacket(app);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
+14
-18
@@ -1,24 +1,23 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
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 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
|
||||
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.
|
||||
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
|
||||
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 HORSES_H
|
||||
#define HORSES_H
|
||||
|
||||
|
||||
#include "../common/debug.h"
|
||||
#include "npc.h"
|
||||
|
||||
@@ -28,21 +27,18 @@ using namespace std;
|
||||
class Horse : public NPC {
|
||||
public:
|
||||
Horse(Client *owner, uint16 spell_id, float x, float y, float z, float heading);
|
||||
|
||||
|
||||
virtual void FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho);
|
||||
|
||||
|
||||
static bool IsHorseSpell(uint16 spell_id);
|
||||
protected:
|
||||
uint8 mount_color;
|
||||
Client *owner;
|
||||
|
||||
|
||||
//generate npc type records for horses
|
||||
static map<uint16, const NPCType *> horse_types;
|
||||
static const NPCType *GetHorseType(uint16 spell_id);
|
||||
static const NPCType *BuildHorseType(uint16 spell_id);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
+354
-353
File diff suppressed because it is too large
Load Diff
+64
-64
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
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
|
||||
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
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "../common/debug.h"
|
||||
#include <stdio.h>
|
||||
@@ -61,15 +61,15 @@ void ZoneDatabase::AddLootTableToNPC(NPC* npc,uint32 loottable_id, ItemList* ite
|
||||
*copper = MakeRandomInt(mincoin, maxcoin);
|
||||
*silver = MakeRandomInt(mincoin, maxcoin);
|
||||
*gold = MakeRandomInt(mincoin, maxcoin);
|
||||
if(*copper > cash) { *copper = cash; }
|
||||
cash -= *copper;
|
||||
if(*silver>(cash/10)) { *silver = (cash/10); }
|
||||
cash -= *silver*10;
|
||||
if(*gold > (cash/100)) { *gold = (cash/100); }
|
||||
cash -= *gold*100;
|
||||
}
|
||||
if (cash < 0) {
|
||||
cash = 0;
|
||||
if(*copper > cash) { *copper = cash; }
|
||||
cash -= *copper;
|
||||
if(*silver>(cash/10)) { *silver = (cash/10); }
|
||||
cash -= *silver*10;
|
||||
if(*gold > (cash/100)) { *gold = (cash/100); }
|
||||
cash -= *gold*100;
|
||||
}
|
||||
if (cash < 0) {
|
||||
cash = 0;
|
||||
}
|
||||
*plat = cash / 1000;
|
||||
cash -= *plat * 1000;
|
||||
@@ -86,21 +86,21 @@ void ZoneDatabase::AddLootTableToNPC(NPC* npc,uint32 loottable_id, ItemList* ite
|
||||
// Do items
|
||||
for (uint32 i=0; i<lts->NumEntries; i++) {
|
||||
for (uint32 k = 1; k <= lts->Entries[i].multiplier; k++) {
|
||||
uint8 droplimit = lts->Entries[i].droplimit;
|
||||
uint8 mindrop = lts->Entries[i].mindrop;
|
||||
uint8 droplimit = lts->Entries[i].droplimit;
|
||||
uint8 mindrop = lts->Entries[i].mindrop;
|
||||
|
||||
//LootTable Entry probability
|
||||
float ltchance = 0.0f;
|
||||
ltchance = lts->Entries[i].probability;
|
||||
//LootTable Entry probability
|
||||
float ltchance = 0.0f;
|
||||
ltchance = lts->Entries[i].probability;
|
||||
|
||||
float drop_chance = 0.0f;
|
||||
if(ltchance > 0.0 && ltchance < 100.0) {
|
||||
drop_chance = MakeRandomFloat(0.0, 100.0);
|
||||
}
|
||||
float drop_chance = 0.0f;
|
||||
if(ltchance > 0.0 && ltchance < 100.0) {
|
||||
drop_chance = MakeRandomFloat(0.0, 100.0);
|
||||
}
|
||||
|
||||
if (ltchance != 0.0 && (ltchance == 100.0 || drop_chance < ltchance)) {
|
||||
AddLootDropToNPC(npc,lts->Entries[i].lootdrop_id, itemlist, droplimit, mindrop);
|
||||
}
|
||||
if (ltchance != 0.0 && (ltchance == 100.0 || drop_chance < ltchance)) {
|
||||
AddLootDropToNPC(npc,lts->Entries[i].lootdrop_id, itemlist, droplimit, mindrop);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117,13 +117,13 @@ void ZoneDatabase::AddLootDropToNPC(NPC* npc,uint32 lootdrop_id, ItemList* iteml
|
||||
|
||||
// Too long a list needs to be limited.
|
||||
if(lds->NumEntries > 99 && droplimit < 1)
|
||||
droplimit = lds->NumEntries/100;
|
||||
droplimit = lds->NumEntries/100;
|
||||
|
||||
uint8 limit = 0;
|
||||
// Start at a random point in itemlist.
|
||||
uint32 item = MakeRandomInt(0, lds->NumEntries-1);
|
||||
// Main loop.
|
||||
for (uint32 i=0; i<lds->NumEntries;)
|
||||
for (uint32 i=0; i<lds->NumEntries;)
|
||||
{
|
||||
//Force the itemlist back to beginning.
|
||||
if (item > (lds->NumEntries-1))
|
||||
@@ -132,7 +132,7 @@ void ZoneDatabase::AddLootDropToNPC(NPC* npc,uint32 lootdrop_id, ItemList* iteml
|
||||
uint8 charges = lds->Entries[item].multiplier;
|
||||
uint8 pickedcharges = 0;
|
||||
// Loop to check multipliers.
|
||||
for (uint32 x=1; x<=charges; x++)
|
||||
for (uint32 x=1; x<=charges; x++)
|
||||
{
|
||||
// Actual roll.
|
||||
float thischance = 0.0;
|
||||
@@ -145,10 +145,10 @@ void ZoneDatabase::AddLootDropToNPC(NPC* npc,uint32 lootdrop_id, ItemList* iteml
|
||||
#if EQDEBUG>=11
|
||||
LogFile->write(EQEMuLog::Debug, "Drop chance for npc: %s, this chance:%f, drop roll:%f", npc->GetName(), thischance, drop_chance);
|
||||
#endif
|
||||
if (thischance == 100.0 || drop_chance < thischance)
|
||||
if (thischance == 100.0 || drop_chance < thischance)
|
||||
{
|
||||
uint32 itemid = lds->Entries[item].item_id;
|
||||
|
||||
|
||||
const Item_Struct* dbitem = GetItem(itemid);
|
||||
npc->AddLootDrop(dbitem, itemlist, lds->Entries[item].item_charges, lds->Entries[item].minlevel, lds->Entries[item].maxlevel, lds->Entries[item].equip_item, false);
|
||||
pickedcharges++;
|
||||
@@ -156,11 +156,11 @@ void ZoneDatabase::AddLootDropToNPC(NPC* npc,uint32 lootdrop_id, ItemList* iteml
|
||||
}
|
||||
// Items with multipliers only count as 1 towards the limit.
|
||||
if(pickedcharges > 0)
|
||||
limit++;
|
||||
limit++;
|
||||
|
||||
// If true, limit reached.
|
||||
if(limit >= droplimit && droplimit > 0)
|
||||
break;
|
||||
break;
|
||||
|
||||
item++;
|
||||
i++;
|
||||
@@ -178,16 +178,16 @@ void ZoneDatabase::AddLootDropToNPC(NPC* npc,uint32 lootdrop_id, ItemList* iteml
|
||||
void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charges, uint8 minlevel, uint8 maxlevel, bool equipit, bool wearchange) {
|
||||
if(item2 == nullptr)
|
||||
return;
|
||||
|
||||
|
||||
//make sure we are doing something...
|
||||
if(!itemlist && !wearchange)
|
||||
return;
|
||||
|
||||
|
||||
ServerLootItem_Struct* item = new ServerLootItem_Struct;
|
||||
#if EQDEBUG>=11
|
||||
LogFile->write(EQEMuLog::Debug, "Adding drop to npc: %s, Item: %i", GetName(), item2->ID);
|
||||
#endif
|
||||
|
||||
|
||||
EQApplicationPacket* outapp = nullptr;
|
||||
WearChange_Struct* wc = nullptr;
|
||||
if(wearchange) {
|
||||
@@ -196,7 +196,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
|
||||
wc->spawn_id = GetID();
|
||||
wc->material=0;
|
||||
}
|
||||
|
||||
|
||||
item->item_id = item2->ID;
|
||||
item->charges = charges;
|
||||
item->aug1 = 0;
|
||||
@@ -212,15 +212,15 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
|
||||
const Item_Struct* compitem = nullptr;
|
||||
bool found = false; // track if we found an empty slot we fit into
|
||||
int32 foundslot = -1; // for multi-slot items
|
||||
|
||||
|
||||
// Equip rules are as follows:
|
||||
// If the item has the NoPet flag set it will not be equipped.
|
||||
// An empty slot takes priority. The first empty one that an item can
|
||||
// fit into will be the one picked for the item.
|
||||
// fit into will be the one picked for the item.
|
||||
// AC is the primary choice for which item gets picked for a slot.
|
||||
// If AC is identical HP is considered next.
|
||||
// If an item can fit into multiple slots we'll pick the last one where
|
||||
// it is an improvement.
|
||||
// it is an improvement.
|
||||
|
||||
if (!item2->NoPet) {
|
||||
for (int i=0; !found && i<MAX_WORN_INVENTORY; i++) {
|
||||
@@ -229,7 +229,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
|
||||
if(equipment[i])
|
||||
{
|
||||
compitem = database.GetItem(equipment[i]);
|
||||
if (item2->AC > compitem->AC ||
|
||||
if (item2->AC > compitem->AC ||
|
||||
(item2->AC == compitem->AC && item2->HP > compitem->HP))
|
||||
{
|
||||
// item would be an upgrade
|
||||
@@ -244,7 +244,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
|
||||
found = true;
|
||||
}
|
||||
} // end if ac
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
equipment[i] = item2->ID;
|
||||
@@ -281,23 +281,23 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
|
||||
if (foundslot == SLOT_PRIMARY) {
|
||||
if (item2->Proc.Effect != 0)
|
||||
CastToMob()->AddProcToWeapon(item2->Proc.Effect, true);
|
||||
|
||||
|
||||
eslot = MATERIAL_PRIMARY;
|
||||
}
|
||||
else if (foundslot == SLOT_SECONDARY
|
||||
else if (foundslot == SLOT_SECONDARY
|
||||
&& (GetOwner() != nullptr || (GetLevel() >= 13 && MakeRandomInt(0,99) < NPC_DW_CHANCE) || (item2->Damage==0)) &&
|
||||
(item2->ItemType == ItemType1HS || item2->ItemType == ItemType1HB || item2->ItemType == ItemTypeShield ||
|
||||
item2->ItemType == ItemTypePierce))
|
||||
{
|
||||
if (item2->Proc.Effect!=0)
|
||||
CastToMob()->AddProcToWeapon(item2->Proc.Effect, true);
|
||||
|
||||
|
||||
eslot = MATERIAL_SECONDARY;
|
||||
}
|
||||
else if (foundslot == SLOT_HEAD) {
|
||||
eslot = MATERIAL_HEAD;
|
||||
}
|
||||
else if (foundslot == SLOT_CHEST) {
|
||||
else if (foundslot == SLOT_CHEST) {
|
||||
eslot = MATERIAL_CHEST;
|
||||
}
|
||||
else if (foundslot == SLOT_ARMS) {
|
||||
@@ -315,10 +315,10 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
|
||||
else if (foundslot == SLOT_FEET) {
|
||||
eslot = MATERIAL_FEET;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
what was this about???
|
||||
|
||||
|
||||
if (((npc->GetRace()==127) && (npc->CastToMob()->GetOwnerID()!=0)) && (item2->Slots==24576) || (item2->Slots==8192) || (item2->Slots==16384)){
|
||||
npc->d_meele_texture2=atoi(newid);
|
||||
wc->wear_slot_id=8;
|
||||
@@ -331,32 +331,32 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
|
||||
npc->INT+=item2->INT;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
//if we found an open slot it goes in...
|
||||
if(eslot != 0xFF) {
|
||||
if(wearchange) {
|
||||
wc->wear_slot_id = eslot;
|
||||
wc->material = emat;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (found) {
|
||||
CalcBonuses(); // This is less than ideal for bulk adding of items
|
||||
}
|
||||
item->equipSlot = item2->Slots;
|
||||
}
|
||||
|
||||
|
||||
if(itemlist != nullptr)
|
||||
itemlist->push_back(item);
|
||||
else
|
||||
safe_delete(item);
|
||||
|
||||
|
||||
if(wearchange && outapp) {
|
||||
entity_list.QueueClients(this, outapp);
|
||||
safe_delete(outapp);
|
||||
safe_delete(outapp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void NPC::AddItem(const Item_Struct* item, uint16 charges, bool equipitem) {
|
||||
//slot isnt needed, its determined from the item.
|
||||
AddLootDrop(item, &itemlist, charges, 1, 127, equipitem, equipitem);
|
||||
@@ -369,10 +369,10 @@ void NPC::AddItem(uint32 itemid, uint16 charges, bool equipitem) {
|
||||
return;
|
||||
AddLootDrop(i, &itemlist, charges, 1, 127, equipitem, equipitem);
|
||||
}
|
||||
|
||||
|
||||
void NPC::AddLootTable() {
|
||||
if (npctype_id != 0) { // check if it's a GM spawn
|
||||
database.AddLootTableToNPC(this,loottable_id, &itemlist, &copper, &silver, &gold, &platinum);
|
||||
database.AddLootTableToNPC(this,loottable_id, &itemlist, &copper, &silver, &gold, &platinum);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -50,7 +50,7 @@ const char *LuaEvents[_LargestEventID] = {
|
||||
"event_task_fail",
|
||||
"event_aggro_say",
|
||||
"event_player_pickup",
|
||||
"event_popup_response",
|
||||
"event_popupresponse",
|
||||
"event_proximity_say",
|
||||
"event_cast",
|
||||
"event_scale_calc",
|
||||
@@ -251,7 +251,7 @@ int LuaParser::_EventNPC(std::string package_name, QuestEventID evt, NPC* npc, M
|
||||
break;
|
||||
}
|
||||
|
||||
case EVENT_POPUP_RESPONSE:
|
||||
case EVENT_POPUPRESPONSE:
|
||||
case EVENT_WAYPOINT_ARRIVE:
|
||||
case EVENT_WAYPOINT_DEPART: {
|
||||
//client
|
||||
@@ -419,7 +419,7 @@ int LuaParser::_EventPlayer(std::string package_name, QuestEventID evt, Client *
|
||||
case EVENT_CLICK_OBJECT:
|
||||
case EVENT_CLICKDOOR:
|
||||
case EVENT_SIGNAL:
|
||||
case EVENT_POPUP_RESPONSE:
|
||||
case EVENT_POPUPRESPONSE:
|
||||
case EVENT_PLAYER_PICKUP:
|
||||
case EVENT_CAST:
|
||||
case EVENT_TASK_FAIL:
|
||||
|
||||
+30
-30
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
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 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
|
||||
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.
|
||||
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
|
||||
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 MAP_H
|
||||
#define MAP_H
|
||||
@@ -35,7 +35,7 @@ typedef struct _vertex{
|
||||
|
||||
_vertex()
|
||||
{
|
||||
x = y = z = 0.0f;
|
||||
x = y = z = 0.0f;
|
||||
};
|
||||
|
||||
_vertex(float ix, float iy, float iz)
|
||||
@@ -44,7 +44,7 @@ typedef struct _vertex{
|
||||
y = iy;
|
||||
z = iz;
|
||||
}
|
||||
bool operator==(const _vertex &v1) const
|
||||
bool operator==(const _vertex &v1) const
|
||||
{
|
||||
return((v1.x == x) && (v1.y == y) && (v1.z ==z));
|
||||
}
|
||||
@@ -71,7 +71,7 @@ typedef struct _mapHeader {
|
||||
unsigned shorts are adequate because, worst case
|
||||
even in a zone that is 6000x6000 with a small node
|
||||
size of 30x30, there are only 40000 nodes.
|
||||
|
||||
|
||||
quadrent definitions:
|
||||
quad 1 (nodes[0]):
|
||||
x>=0, y>=0
|
||||
@@ -81,9 +81,9 @@ typedef struct _mapHeader {
|
||||
x<0, y<0
|
||||
quad 4 (nodes[3]):
|
||||
x>=0, y<0
|
||||
|
||||
|
||||
*/
|
||||
enum { //node flags
|
||||
enum { //node flags
|
||||
nodeFinal = 0x01
|
||||
//7 more bits if theres something to use them for...
|
||||
};
|
||||
@@ -97,7 +97,7 @@ typedef struct _nodeHeader {
|
||||
float miny;
|
||||
float maxx;
|
||||
float maxy;
|
||||
|
||||
|
||||
uint8 flags;
|
||||
union {
|
||||
uint16 nodes[4]; //index 0 means nullptr, not root
|
||||
@@ -120,33 +120,33 @@ typedef uint16 NodeRef;
|
||||
nodeHeader head;
|
||||
unsigned int * pfaces;
|
||||
char mask;
|
||||
struct _node * node1, *node2, *node3, *node4;
|
||||
struct _node * node1, *node2, *node3, *node4;
|
||||
}NODE, *PNODE;*/
|
||||
|
||||
class Map {
|
||||
public:
|
||||
static Map* LoadMapfile(const char* in_zonename, const char *directory = nullptr);
|
||||
|
||||
|
||||
Map();
|
||||
~Map();
|
||||
|
||||
|
||||
bool loadMap(FILE *fp);
|
||||
|
||||
|
||||
//the result is always final, except special NODE_NONE
|
||||
NodeRef SeekNode( NodeRef _node, float x, float y ) const;
|
||||
|
||||
|
||||
//these are untested since rewrite:
|
||||
int *SeekFace( NodeRef _node, float x, float y );
|
||||
float GetFaceHeight( int _idx, float x, float y ) const;
|
||||
|
||||
|
||||
bool LocWithinNode( NodeRef _node, float x, float y ) const;
|
||||
|
||||
|
||||
//nodes to these functions must be final
|
||||
bool LineIntersectsNode( NodeRef _node, VERTEX start, VERTEX end, VERTEX *result, FACE **on = nullptr) const;
|
||||
bool LineIntersectsFace( PFACE cface, VERTEX start, VERTEX end, VERTEX *result) const;
|
||||
float FindBestZ( NodeRef _node, VERTEX start, VERTEX *result, FACE **on = nullptr) const;
|
||||
bool LineIntersectsZone(VERTEX start, VERTEX end, float step, VERTEX *result, FACE **on = nullptr) const;
|
||||
|
||||
|
||||
// inline unsigned int GetVertexNumber( ) {return m_Vertex; }
|
||||
inline uint32 GetFacesNumber( ) const { return m_Faces; }
|
||||
// inline PVERTEX GetVertex( int _idx ) {return mFinalVertex + _idx; }
|
||||
@@ -154,7 +154,7 @@ public:
|
||||
inline PFACE GetFaceFromlist( int _idx) {return &mFinalFaces[ mFaceLists[_idx] ]; }
|
||||
inline NodeRef GetRoot( ) const { return MAP_ROOT_NODE; }
|
||||
inline PNODE GetNode( NodeRef r ) { return( mNodes + r ); }
|
||||
|
||||
|
||||
inline float GetMinX() const { return(_minx); }
|
||||
inline float GetMaxX() const { return(_maxx); }
|
||||
inline float GetMinY() const { return(_miny); }
|
||||
@@ -173,13 +173,13 @@ private:
|
||||
PFACE mFinalFaces;
|
||||
PNODE mNodes;
|
||||
uint32 *mFaceLists;
|
||||
|
||||
|
||||
|
||||
|
||||
int mCandFaces[100];
|
||||
|
||||
|
||||
float _minz, _maxz;
|
||||
float _minx, _miny, _maxx, _maxy;
|
||||
|
||||
|
||||
static void Normalize(VERTEX *p);
|
||||
|
||||
// void RecLoadNode( PNODE _node, FILE *l_f );
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
//Trumpcard: EntityLists are composed of multiple list types. This is the
|
||||
//master that includes all types. When entity.h is required, many of these are as well.
|
||||
//Trumpcard: EntityLists are composed of multiple list types. This is the
|
||||
//master that includes all types. When entity.h is required, many of these are as well.
|
||||
|
||||
#include "entity.h"
|
||||
#include "groups.h"
|
||||
|
||||
+35
-35
@@ -1272,7 +1272,7 @@ uint16 Mob::MaxSkill_defensive(uint16 skillid, uint16 class_, uint16 level) cons
|
||||
case BARD: case BARDGM:
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
}
|
||||
case DISARM:{
|
||||
switch (class_) {
|
||||
@@ -1500,7 +1500,7 @@ uint16 Mob::MaxSkill_arcane(uint16 skillid, uint16 class_, uint16 level) const{
|
||||
r_value = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// Int caster
|
||||
case ENCHANTER: case ENCHANTERGM:
|
||||
case MAGICIAN: case MAGICIANGM:
|
||||
@@ -1510,7 +1510,7 @@ uint16 Mob::MaxSkill_arcane(uint16 skillid, uint16 class_, uint16 level) const{
|
||||
r_value = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
//make sure only 1 skill can be over 50
|
||||
uint16 hskill = 0;
|
||||
uint16 high = 0;
|
||||
@@ -1544,7 +1544,7 @@ uint16 Mob::MaxSkill_arcane(uint16 skillid, uint16 class_, uint16 level) const{
|
||||
r_value = 50;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (r_value > 200)
|
||||
r_value = 200;
|
||||
break;
|
||||
@@ -1802,7 +1802,7 @@ uint16 Mob::MaxSkill_class(uint16 skillid, uint16 class_, uint16 level) const{
|
||||
}// Class Switch
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
//Berzerkers
|
||||
case BERSERKING: {
|
||||
switch(class_){
|
||||
@@ -1817,7 +1817,7 @@ uint16 Mob::MaxSkill_class(uint16 skillid, uint16 class_, uint16 level) const{
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// Shaman
|
||||
case ALCHEMY:{
|
||||
switch(class_){
|
||||
@@ -1875,7 +1875,7 @@ uint16 Mob::MaxSkill_class(uint16 skillid, uint16 class_, uint16 level) const{
|
||||
}// Class Switch
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case SNEAK:{
|
||||
switch(class_){
|
||||
// True class
|
||||
@@ -1924,7 +1924,7 @@ uint16 Mob::MaxSkill_class(uint16 skillid, uint16 class_, uint16 level) const{
|
||||
}// Class Switch
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case SENSE_TRAPS:
|
||||
case PICK_LOCK:
|
||||
case DISARM_TRAPS:{
|
||||
@@ -2204,25 +2204,25 @@ uint16 Mob::MaxSkill(uint16 skillid, uint16 class_, uint16 level) const {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CLERIC: case CLERICGM:{
|
||||
r_value = ((level*5)+5);
|
||||
case CLERIC: case CLERICGM:{
|
||||
r_value = ((level*5)+5);
|
||||
if(level >= 50) {
|
||||
if(r_value > 201)
|
||||
r_value = 201;
|
||||
r_value = 201;
|
||||
} else {
|
||||
if(r_value > 200)
|
||||
r_value = 200;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case DRUID: case DRUIDGM:
|
||||
case SHAMAN: case SHAMANGM:{
|
||||
r_value = ((level*5) + 5);
|
||||
if(r_value > 200)
|
||||
r_value = 200;
|
||||
r_value = 200;
|
||||
break;
|
||||
}
|
||||
}
|
||||
case MAGICIAN: case MAGICIANGM:
|
||||
case ENCHANTER: case ENCHANTERGM:
|
||||
case NECROMANCER: case NECROMANCERGM:
|
||||
@@ -2234,23 +2234,23 @@ uint16 Mob::MaxSkill(uint16 skillid, uint16 class_, uint16 level) const {
|
||||
}
|
||||
case BEASTLORD: case BEASTLORDGM:
|
||||
case BERSERKER: case BERSERKERGM:
|
||||
case MONK: case MONKGM: {
|
||||
r_value = ((level*5)+5);
|
||||
case MONK: case MONKGM: {
|
||||
r_value = ((level*5)+5);
|
||||
if(level >= 50) {
|
||||
if(r_value > 210)
|
||||
r_value = 210;
|
||||
r_value = 210;
|
||||
} else {
|
||||
if(r_value > 200)
|
||||
r_value = 200;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case PALADIN: case PALADINGM: {
|
||||
case PALADIN: case PALADINGM: {
|
||||
if (level > 10) {
|
||||
r_value = (((level-10)*5)+5);
|
||||
r_value = (((level-10)*5)+5);
|
||||
if(level >= 50) {
|
||||
if(r_value > 210)
|
||||
r_value = 210;
|
||||
r_value = 210;
|
||||
} else {
|
||||
if(r_value > 200)
|
||||
r_value = 200;
|
||||
@@ -2258,12 +2258,12 @@ uint16 Mob::MaxSkill(uint16 skillid, uint16 class_, uint16 level) const {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case RANGER: case RANGERGM: {
|
||||
case RANGER: case RANGERGM: {
|
||||
if (level > 15) {
|
||||
r_value = (((level-15)*5)+5);
|
||||
r_value = (((level-15)*5)+5);
|
||||
if(level >= 50) {
|
||||
if(r_value > 200)
|
||||
r_value = 200;
|
||||
r_value = 200;
|
||||
} else {
|
||||
if(r_value > 150)
|
||||
r_value = 150;
|
||||
@@ -2271,35 +2271,35 @@ uint16 Mob::MaxSkill(uint16 skillid, uint16 class_, uint16 level) const {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case ROGUE: case ROGUEGM: {
|
||||
r_value = ((level*5)+5);
|
||||
|
||||
case ROGUE: case ROGUEGM: {
|
||||
r_value = ((level*5)+5);
|
||||
if(level >= 50) {
|
||||
if(r_value > 210)
|
||||
r_value = 210;
|
||||
r_value = 210;
|
||||
} else {
|
||||
if(r_value > 176)
|
||||
r_value = 176;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SHADOWKNIGHT: case SHADOWKNIGHTGM: {
|
||||
r_value = ((level*5)+5);
|
||||
if(level >= 50) {
|
||||
case SHADOWKNIGHT: case SHADOWKNIGHTGM: {
|
||||
r_value = ((level*5)+5);
|
||||
if(level >= 50) {
|
||||
if(r_value > 200)
|
||||
r_value = 200;
|
||||
r_value = 200;
|
||||
} else {
|
||||
if(r_value > 150)
|
||||
r_value = 150;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case WARRIOR: case WARRIORGM: {
|
||||
case WARRIOR: case WARRIORGM: {
|
||||
if (level > 5) {
|
||||
r_value = (((level-5)*5)+5);
|
||||
r_value = (((level-5)*5)+5);
|
||||
if(level >= 50) {
|
||||
if(r_value > 210)
|
||||
r_value = 210;
|
||||
r_value = 210;
|
||||
} else {
|
||||
if(r_value > 175)
|
||||
r_value = 175;
|
||||
@@ -2307,7 +2307,7 @@ uint16 Mob::MaxSkill(uint16 skillid, uint16 class_, uint16 level) const {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
default: r_value = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
+335
-335
File diff suppressed because it is too large
Load Diff
+33
-33
@@ -8,9 +8,9 @@ using namespace std;
|
||||
#define MAXMERCS 1
|
||||
#define MERC_DEBUG 0
|
||||
#define TANK 1
|
||||
#define HEALER 2
|
||||
#define HEALER 2
|
||||
#define MELEEDPS 9
|
||||
#define CASTERDPS 12
|
||||
#define CASTERDPS 12
|
||||
const int MercAISpellRange = 100; // TODO: Write a method that calcs what the merc's spell range is based on spell, equipment, AA, whatever and replace this
|
||||
|
||||
enum MercStanceType {
|
||||
@@ -30,7 +30,7 @@ struct MercSpell {
|
||||
uint32 type; // 0 = never, must be one (and only one) of the defined values
|
||||
int16 stance; // 0 = all, + = only this stance, - = all except this stance
|
||||
int16 slot;
|
||||
uint16 proc_chance;
|
||||
uint16 proc_chance;
|
||||
uint32 time_cancast; // when we can cast this spell next
|
||||
};
|
||||
|
||||
@@ -156,12 +156,12 @@ public:
|
||||
uint32 GetMercTemplateID() { return _MercTemplateID; }
|
||||
uint32 GetMercType() { return _MercType; }
|
||||
uint32 GetMercSubType() { return _MercSubType; }
|
||||
uint8 GetProficiencyID() { return _ProficiencyID; }
|
||||
uint8 GetTierID() { return _TierID; }
|
||||
uint8 GetProficiencyID() { return _ProficiencyID; }
|
||||
uint8 GetTierID() { return _TierID; }
|
||||
uint32 GetCostFormula() { return _CostFormula; }
|
||||
uint32 GetMercNameType() { return _NameType; }
|
||||
uint32 GetStance() { return _currentStance; }
|
||||
int GetHatedCount() { return _hatedCount; }
|
||||
int GetHatedCount() { return _hatedCount; }
|
||||
|
||||
inline const uint8 GetClientVersion() const { return _OwnerClientVersion; }
|
||||
|
||||
@@ -174,8 +174,8 @@ public:
|
||||
void CheckHateList();
|
||||
bool CheckTaunt();
|
||||
bool CheckAETaunt();
|
||||
bool CheckConfidence();
|
||||
bool TryHide();
|
||||
bool CheckConfidence();
|
||||
bool TryHide();
|
||||
|
||||
// stat functions
|
||||
virtual void CalcBonuses();
|
||||
@@ -267,15 +267,15 @@ public:
|
||||
protected:
|
||||
void CalcItemBonuses(StatBonuses* newbon);
|
||||
void AddItemBonuses(const Item_Struct *item, StatBonuses* newbon);
|
||||
int CalcRecommendedLevelBonus(uint8 level, uint8 reclevel, int basestat);
|
||||
int CalcRecommendedLevelBonus(uint8 level, uint8 reclevel, int basestat);
|
||||
|
||||
int16 GetFocusEffect(focusType type, uint16 spell_id);
|
||||
|
||||
std::vector<MercSpell> merc_spells;
|
||||
std::map<uint32,MercTimer> timers;
|
||||
|
||||
uint16 skills[HIGHEST_SKILL+1];
|
||||
uint32 equipment[MAX_WORN_INVENTORY]; //this is an array of item IDs
|
||||
uint16 skills[HIGHEST_SKILL+1];
|
||||
uint32 equipment[MAX_WORN_INVENTORY]; //this is an array of item IDs
|
||||
uint16 d_meele_texture1; //this is an item Material value
|
||||
uint16 d_meele_texture2; //this is an item Material value (offhand)
|
||||
uint8 prim_melee_type; //Sets the Primary Weapon attack message and animation
|
||||
@@ -283,22 +283,22 @@ protected:
|
||||
|
||||
private:
|
||||
|
||||
int16 CalcAC();
|
||||
int16 GetACMit();
|
||||
int16 GetACAvoid();
|
||||
int16 acmod();
|
||||
int16 CalcATK();
|
||||
//int CalcHaste();
|
||||
int16 CalcAC();
|
||||
int16 GetACMit();
|
||||
int16 GetACAvoid();
|
||||
int16 acmod();
|
||||
int16 CalcATK();
|
||||
//int CalcHaste();
|
||||
|
||||
int16 CalcSTR();
|
||||
int16 CalcSTA();
|
||||
int16 CalcDEX();
|
||||
int16 CalcAGI();
|
||||
int16 CalcINT();
|
||||
int16 CalcWIS();
|
||||
int16 CalcCHA();
|
||||
int16 CalcSTR();
|
||||
int16 CalcSTA();
|
||||
int16 CalcDEX();
|
||||
int16 CalcAGI();
|
||||
int16 CalcINT();
|
||||
int16 CalcWIS();
|
||||
int16 CalcCHA();
|
||||
|
||||
int16 CalcMR();
|
||||
int16 CalcMR();
|
||||
int16 CalcFR();
|
||||
int16 CalcDR();
|
||||
int16 CalcPR();
|
||||
@@ -323,10 +323,10 @@ private:
|
||||
void DoEnduranceUpkeep(); //does the endurance upkeep
|
||||
void CalcRestState();
|
||||
|
||||
int GroupLeadershipAAHealthEnhancement();
|
||||
int GroupLeadershipAAManaEnhancement();
|
||||
int GroupLeadershipAAHealthEnhancement();
|
||||
int GroupLeadershipAAManaEnhancement();
|
||||
int GroupLeadershipAAHealthRegeneration();
|
||||
int GroupLeadershipAAOffenseEnhancement();
|
||||
int GroupLeadershipAAOffenseEnhancement();
|
||||
|
||||
void GetMercSize();
|
||||
void GenerateAppearance();
|
||||
@@ -362,8 +362,8 @@ private:
|
||||
uint32 _MercTemplateID;
|
||||
uint32 _MercType;
|
||||
uint32 _MercSubType;
|
||||
uint8 _ProficiencyID;
|
||||
uint8 _TierID;
|
||||
uint8 _ProficiencyID;
|
||||
uint8 _TierID;
|
||||
uint8 _CostFormula;
|
||||
uint8 _NameType;
|
||||
uint8 _OwnerClientVersion;
|
||||
@@ -375,9 +375,9 @@ private:
|
||||
bool _medding;
|
||||
bool _suspended;
|
||||
bool p_depop;
|
||||
bool _check_confidence;
|
||||
bool _lost_confidence;
|
||||
int _hatedCount;
|
||||
bool _check_confidence;
|
||||
bool _lost_confidence;
|
||||
int _hatedCount;
|
||||
uint32 owner_char_id;
|
||||
Timer endupkeep_timer;
|
||||
Timer rest_timer;
|
||||
|
||||
+452
-455
File diff suppressed because it is too large
Load Diff
+1022
-1022
File diff suppressed because it is too large
Load Diff
+71
-71
@@ -1,20 +1,20 @@
|
||||
#define DONT_SHARED_OPCODES
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
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
|
||||
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
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "../common/debug.h"
|
||||
#include "../common/features.h"
|
||||
@@ -40,7 +40,7 @@ using namespace std;
|
||||
#define vsnprintf _vsnprintf
|
||||
#endif
|
||||
#define strncasecmp _strnicmp
|
||||
#define strcasecmp _stricmp
|
||||
#define strcasecmp _stricmp
|
||||
#endif
|
||||
|
||||
volatile bool RunLoops = true;
|
||||
@@ -100,7 +100,7 @@ DBAsync *dbasync = nullptr;
|
||||
TaskManager *taskmanager = 0;
|
||||
QuestParserCollection *parse = 0;
|
||||
|
||||
const SPDat_Spell_Struct* spells;
|
||||
const SPDat_Spell_Struct* spells;
|
||||
void LoadSpells(EQEmu::MemoryMappedFile **mmf);
|
||||
int32 SPDAT_RECORDS = -1;
|
||||
|
||||
@@ -115,11 +115,11 @@ void Shutdown();
|
||||
extern void MapOpcodes();
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
RegisterExecutablePlatform(ExePlatformZone);
|
||||
set_exception_handler();
|
||||
RegisterExecutablePlatform(ExePlatformZone);
|
||||
set_exception_handler();
|
||||
|
||||
const char *zone_name;
|
||||
|
||||
|
||||
if(argc == 3) {
|
||||
worldserver.SetLauncherName(argv[2]);
|
||||
worldserver.SetLaunchedName(argv[1]);
|
||||
@@ -157,7 +157,7 @@ int main(int argc, char** argv) {
|
||||
_log(ZONE__INIT, "Warning: Unable to read %s", Config->LogSettingsFile.c_str());
|
||||
else
|
||||
_log(ZONE__INIT, "Log settings loaded from %s", Config->LogSettingsFile.c_str());
|
||||
|
||||
|
||||
worldserver.SetPassword(Config->SharedKey.c_str());
|
||||
|
||||
_log(ZONE__INIT, "Connecting to MySQL...");
|
||||
@@ -179,12 +179,12 @@ int main(int argc, char** argv) {
|
||||
#ifdef _EQDEBUG
|
||||
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
|
||||
#endif
|
||||
|
||||
|
||||
_log(ZONE__INIT, "CURRENT_VERSION: %s", CURRENT_VERSION);
|
||||
|
||||
|
||||
/*
|
||||
* Setup nice signal handlers
|
||||
*/
|
||||
* Setup nice signal handlers
|
||||
*/
|
||||
if (signal(SIGINT, CatchSignal) == SIG_ERR) {
|
||||
_log(ZONE__INIT_ERR, "Could not set signal handler");
|
||||
return 0;
|
||||
@@ -205,7 +205,7 @@ int main(int argc, char** argv) {
|
||||
_log(ZONE__INIT, "Warning: Unable to read %s", log_ini_file);
|
||||
else
|
||||
_log(ZONE__INIT, "Log settings loaded from %s", log_ini_file);
|
||||
|
||||
|
||||
_log(ZONE__INIT, "Mapping Incoming Opcodes");
|
||||
MapOpcodes();
|
||||
_log(ZONE__INIT, "Loading Variables");
|
||||
@@ -215,7 +215,7 @@ int main(int argc, char** argv) {
|
||||
_log(ZONE__INIT, "Loading items");
|
||||
if (!database.LoadItems()) {
|
||||
_log(ZONE__INIT_ERR, "Loading items FAILED!");
|
||||
_log(ZONE__INIT, "Failed. But ignoring error and going on...");
|
||||
_log(ZONE__INIT, "Failed. But ignoring error and going on...");
|
||||
}
|
||||
|
||||
_log(ZONE__INIT, "Loading npc faction lists");
|
||||
@@ -229,16 +229,16 @@ int main(int argc, char** argv) {
|
||||
_log(ZONE__INIT_ERR, "Loading loot FAILED!");
|
||||
CheckEQEMuErrorAndPause();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
_log(ZONE__INIT, "Loading skill caps");
|
||||
if (!database.LoadSkillCaps()) {
|
||||
_log(ZONE__INIT_ERR, "Loading skill caps FAILED!");
|
||||
CheckEQEMuErrorAndPause();
|
||||
return 0;
|
||||
}
|
||||
|
||||
_log(ZONE__INIT, "Loading spells");
|
||||
EQEmu::MemoryMappedFile *mmf = nullptr;
|
||||
|
||||
_log(ZONE__INIT, "Loading spells");
|
||||
EQEmu::MemoryMappedFile *mmf = nullptr;
|
||||
LoadSpells(&mmf);
|
||||
|
||||
_log(ZONE__INIT, "Loading guilds");
|
||||
@@ -283,7 +283,7 @@ int main(int argc, char** argv) {
|
||||
taskmanager->LoadTasks();
|
||||
}
|
||||
|
||||
parse = new QuestParserCollection();
|
||||
parse = new QuestParserCollection();
|
||||
#ifdef EMBPERL
|
||||
//PerlXSParser *pxs = new PerlXSParser();
|
||||
PerlembParser *perl_parser = new PerlembParser();
|
||||
@@ -298,7 +298,7 @@ int main(int argc, char** argv) {
|
||||
//now we have our parser, load the quests
|
||||
_log(ZONE__INIT, "Loading quests");
|
||||
parse->ReloadQuests();
|
||||
|
||||
|
||||
|
||||
#ifdef CLIENT_LOGS
|
||||
LogFile->SetAllCallbacks(ClientLogs::EQEmuIO_buf);
|
||||
@@ -308,7 +308,7 @@ int main(int argc, char** argv) {
|
||||
if (!worldserver.Connect()) {
|
||||
_log(ZONE__INIT_ERR, "worldserver.Connect() FAILED!");
|
||||
}
|
||||
|
||||
|
||||
Timer InterserverTimer(INTERSERVER_TIMER); // does MySQL pings and auto-reconnect
|
||||
#ifdef EQPROFILE
|
||||
#ifdef PROFILE_DUMP_TIME
|
||||
@@ -322,15 +322,15 @@ int main(int argc, char** argv) {
|
||||
_log(ZONE__INIT_ERR, "Zone bootup FAILED!");
|
||||
zone = 0;
|
||||
}
|
||||
|
||||
|
||||
//register all the patches we have avaliable with the stream identifier.
|
||||
EQStreamIdentifier stream_identifier;
|
||||
RegisterAllPatches(stream_identifier);
|
||||
|
||||
|
||||
#ifndef WIN32
|
||||
_log(COMMON__THREADS, "Main thread running with thread id %d", pthread_self());
|
||||
#endif
|
||||
|
||||
|
||||
Timer quest_timers(100);
|
||||
UpdateWindowTitle();
|
||||
bool worldwasconnected = worldserver.Connected();
|
||||
@@ -341,10 +341,10 @@ int main(int argc, char** argv) {
|
||||
while(RunLoops) {
|
||||
{ //profiler block to omit the sleep from times
|
||||
_ZP(net_main);
|
||||
|
||||
|
||||
//Advance the timer to our current point in time
|
||||
Timer::SetCurrentTime();
|
||||
|
||||
|
||||
//process stuff from world
|
||||
worldserver.Process();
|
||||
|
||||
@@ -357,7 +357,7 @@ int main(int argc, char** argv) {
|
||||
worldwasconnected = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//check the factory for any new incoming streams.
|
||||
while ((eqss = eqsf.Pop())) {
|
||||
//pull the stream out of the factory and give it to the stream identifier
|
||||
@@ -368,10 +368,10 @@ int main(int argc, char** argv) {
|
||||
_log(WORLD__CLIENT, "New connection from %s:%d", inet_ntoa(in),ntohs(eqss->GetRemotePort()));
|
||||
stream_identifier.AddStream(eqss); //takes the stream
|
||||
}
|
||||
|
||||
|
||||
//give the stream identifier a chance to do its work....
|
||||
stream_identifier.Process();
|
||||
|
||||
|
||||
//check the stream identifier for any now-identified streams
|
||||
while((eqsi = stream_identifier.PopIdentified())) {
|
||||
//now that we know what patch they are running, start up their client object
|
||||
@@ -381,11 +381,11 @@ int main(int argc, char** argv) {
|
||||
Client* client = new Client(eqsi);
|
||||
entity_list.AddClient(client);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//check for timeouts in other threads
|
||||
timeout_manager.CheckTimeouts();
|
||||
|
||||
|
||||
if (worldserver.Connected()) {
|
||||
worldwasconnected = true;
|
||||
}
|
||||
@@ -486,7 +486,7 @@ int main(int argc, char** argv) {
|
||||
#endif
|
||||
|
||||
safe_delete(mmf);
|
||||
|
||||
|
||||
if (zone != 0)
|
||||
Zone::Shutdown(true);
|
||||
//Fix for Linux world server problem.
|
||||
@@ -496,7 +496,7 @@ int main(int argc, char** argv) {
|
||||
dbasync->StopThread();
|
||||
safe_delete(taskmanager);
|
||||
command_deinit();
|
||||
|
||||
|
||||
CheckEQEMuErrorAndPause();
|
||||
_log(ZONE__INIT, "Proper zone shutdown complete.");
|
||||
return 0;
|
||||
@@ -520,36 +520,36 @@ void Shutdown()
|
||||
|
||||
uint32 NetConnection::GetIP()
|
||||
{
|
||||
char name[255+1];
|
||||
size_t len = 0;
|
||||
char name[255+1];
|
||||
size_t len = 0;
|
||||
hostent* host = 0;
|
||||
|
||||
|
||||
if (gethostname(name, len) < 0 || len <= 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
host = (hostent*)gethostbyname(name);
|
||||
if (host == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
return inet_addr(host->h_addr);
|
||||
}
|
||||
|
||||
uint32 NetConnection::GetIP(char* name)
|
||||
{
|
||||
hostent* host = 0;
|
||||
|
||||
|
||||
host = (hostent*)gethostbyname(name);
|
||||
if (host == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
return inet_addr(host->h_addr);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void NetConnection::SaveInfo(char* address, uint32 port, char* waddress, char* filename) {
|
||||
@@ -562,8 +562,8 @@ void NetConnection::SaveInfo(char* address, uint32 port, char* waddress, char* f
|
||||
strn0cpy(ZoneFileName, filename, sizeof(ZoneFileName));
|
||||
}
|
||||
|
||||
NetConnection::NetConnection()
|
||||
:
|
||||
NetConnection::NetConnection()
|
||||
:
|
||||
object_timer(5000),
|
||||
door_timer(5000),
|
||||
corpse_timer(2000),
|
||||
@@ -590,25 +590,25 @@ NetConnection::~NetConnection() {
|
||||
}
|
||||
|
||||
void LoadSpells(EQEmu::MemoryMappedFile **mmf) {
|
||||
int records = database.GetMaxSpellID() + 1;
|
||||
int records = database.GetMaxSpellID() + 1;
|
||||
|
||||
try {
|
||||
EQEmu::IPCMutex mutex("spells");
|
||||
mutex.Lock();
|
||||
*mmf = new EQEmu::MemoryMappedFile("shared/spells");
|
||||
uint32 size = (*mmf)->Size();
|
||||
if(size != (records * sizeof(SPDat_Spell_Struct))) {
|
||||
EQ_EXCEPT("Zone", "Unable to load spells: (*mmf)->Size() != records * sizeof(SPDat_Spell_Struct)");
|
||||
}
|
||||
try {
|
||||
EQEmu::IPCMutex mutex("spells");
|
||||
mutex.Lock();
|
||||
*mmf = new EQEmu::MemoryMappedFile("shared/spells");
|
||||
uint32 size = (*mmf)->Size();
|
||||
if(size != (records * sizeof(SPDat_Spell_Struct))) {
|
||||
EQ_EXCEPT("Zone", "Unable to load spells: (*mmf)->Size() != records * sizeof(SPDat_Spell_Struct)");
|
||||
}
|
||||
|
||||
spells = reinterpret_cast<SPDat_Spell_Struct*>((*mmf)->Get());
|
||||
mutex.Unlock();
|
||||
} catch(std::exception &ex) {
|
||||
LogFile->write(EQEMuLog::Error, "Error loading spells: %s", ex.what());
|
||||
return;
|
||||
}
|
||||
spells = reinterpret_cast<SPDat_Spell_Struct*>((*mmf)->Get());
|
||||
mutex.Unlock();
|
||||
} catch(std::exception &ex) {
|
||||
LogFile->write(EQEMuLog::Error, "Error loading spells: %s", ex.what());
|
||||
return;
|
||||
}
|
||||
|
||||
SPDAT_RECORDS = records;
|
||||
SPDAT_RECORDS = records;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+12
-12
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
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 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
|
||||
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.
|
||||
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
|
||||
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
|
||||
*/
|
||||
#ifdef _WINDOWS
|
||||
#include <windows.h>
|
||||
@@ -39,7 +39,7 @@ class NetConnection
|
||||
public:
|
||||
~NetConnection();
|
||||
NetConnection();
|
||||
|
||||
|
||||
uint32 GetIP();
|
||||
uint32 GetIP(char* name);
|
||||
void SaveInfo(char* address, uint32 port, char* waddress,char* filename);
|
||||
|
||||
+413
-413
File diff suppressed because it is too large
Load Diff
+80
-80
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
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 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
|
||||
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.
|
||||
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
|
||||
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 NPC_H
|
||||
#define NPC_H
|
||||
@@ -34,7 +34,7 @@ using namespace std;
|
||||
#include "../common/rulesys.h"
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#define M_PI 3.141592
|
||||
#define M_PI 3.141592
|
||||
#endif
|
||||
|
||||
#define LEAVECOMBAT 0
|
||||
@@ -64,7 +64,7 @@ struct AISpells_Struct {
|
||||
uint32 time_cancast; // when we can cast this spell next
|
||||
int32 recast_delay;
|
||||
int16 priority;
|
||||
int16 resist_adjust;
|
||||
int16 resist_adjust;
|
||||
};
|
||||
|
||||
class AA_SwarmPetInfo;
|
||||
@@ -74,9 +74,9 @@ class NPC : public Mob
|
||||
public:
|
||||
static NPC* SpawnNPC(const char* spawncommand, float in_x, float in_y, float in_z, float in_heading = 0, Client* client = 0);
|
||||
static int8 GetAILevel(bool iForceReRead = false);
|
||||
|
||||
|
||||
NPC(const NPCType* data, Spawn2* respawn, float x, float y, float z, float heading, int iflymode, bool IsCorpse = false);
|
||||
|
||||
|
||||
virtual ~NPC();
|
||||
|
||||
//abstract virtual function implementations requird by base abstract class
|
||||
@@ -109,12 +109,12 @@ public:
|
||||
void CalcNPCDamage();
|
||||
|
||||
|
||||
int32 GetActSpellDamage(uint16 spell_id, int32 value);
|
||||
int32 GetActSpellHealing(uint16 spell_id, int32 value);
|
||||
inline void SetSpellFocusDMG(int32 NewSpellFocusDMG) {SpellFocusDMG = NewSpellFocusDMG;}
|
||||
inline void SetSpellFocusHeal(int32 NewSpellFocusHeal) {SpellFocusHeal = NewSpellFocusHeal;}
|
||||
int32 SpellFocusDMG;
|
||||
int32 SpellFocusHeal;
|
||||
int32 GetActSpellDamage(uint16 spell_id, int32 value);
|
||||
int32 GetActSpellHealing(uint16 spell_id, int32 value);
|
||||
inline void SetSpellFocusDMG(int32 NewSpellFocusDMG) {SpellFocusDMG = NewSpellFocusDMG;}
|
||||
inline void SetSpellFocusHeal(int32 NewSpellFocusHeal) {SpellFocusHeal = NewSpellFocusHeal;}
|
||||
int32 SpellFocusDMG;
|
||||
int32 SpellFocusHeal;
|
||||
|
||||
virtual void SetTarget(Mob* mob);
|
||||
virtual uint16 GetSkill(SkillType skill_num) const { if (skill_num <= HIGHEST_SKILL) { return skills[skill_num]; } return 0; }
|
||||
@@ -134,7 +134,7 @@ public:
|
||||
|
||||
virtual void RangedAttack(Mob* other);
|
||||
virtual void ThrowingAttack(Mob* other) { }
|
||||
int32 GetNumberOfAttacks() const { return attack_count; }
|
||||
int32 GetNumberOfAttacks() const { return attack_count; }
|
||||
|
||||
bool DatabaseCastAccepted(int spell_id);
|
||||
bool IsFactionListAlly(uint32 other_faction);
|
||||
@@ -156,7 +156,7 @@ public:
|
||||
void AddLootTable();
|
||||
void AddLootTable(uint32 ldid);
|
||||
void DescribeAggro(Client *towho, Mob *mob, bool verbose);
|
||||
void RemoveItem(uint32 item_id, uint16 quantity = 0, uint16 slot = 0);
|
||||
void RemoveItem(uint32 item_id, uint16 quantity = 0, uint16 slot = 0);
|
||||
void CheckMinMaxLevel(Mob *them);
|
||||
void ClearItemList();
|
||||
ServerLootItem_Struct* GetItem(int slot_id);
|
||||
@@ -179,7 +179,7 @@ public:
|
||||
inline void SetPlatinum(uint32 amt) { platinum = amt; }
|
||||
|
||||
|
||||
virtual int32 CalcMaxMana();
|
||||
virtual int32 CalcMaxMana();
|
||||
void SetGrid(int32 grid_){ grid=grid_; }
|
||||
void SetSp2(uint32 sg2){ spawn_group=sg2; }
|
||||
void SetWaypointMax(uint16 wp_){ wp_m=wp_; }
|
||||
@@ -197,9 +197,9 @@ public:
|
||||
float GetGuardPointX() const { return guard_x; }
|
||||
float GetGuardPointY() const { return guard_y; }
|
||||
float GetGuardPointZ() const { return guard_z; }
|
||||
float GetGuardPointH() const { return guard_heading; }
|
||||
EmuAppearance GetGuardPointAnim() const { return guard_anim; }
|
||||
void SaveGuardPointAnim(EmuAppearance anim) { guard_anim = anim; }
|
||||
float GetGuardPointH() const { return guard_heading; }
|
||||
EmuAppearance GetGuardPointAnim() const { return guard_anim; }
|
||||
void SaveGuardPointAnim(EmuAppearance anim) { guard_anim = anim; }
|
||||
|
||||
void SetFlyMode(uint8 FlyMode){ flymode=FlyMode; }
|
||||
uint32 GetFlyMode() const { return flymode; }
|
||||
@@ -216,35 +216,35 @@ public:
|
||||
uint32 GetSwarmOwner();
|
||||
uint32 GetSwarmTarget();
|
||||
void SetSwarmTarget(int target_id = 0);
|
||||
|
||||
|
||||
void SignalNPC(int _signal_id);
|
||||
|
||||
|
||||
inline int32 GetNPCFactionID() const { return npc_faction_id; }
|
||||
inline int32 GetPrimaryFaction() const { return primary_faction; }
|
||||
int32 GetNPCHate(Mob* in_ent) {return hate_list.GetEntHate(in_ent);}
|
||||
bool IsOnHatelist(Mob*p) { return hate_list.IsOnHateList(p);}
|
||||
int32 GetNPCHate(Mob* in_ent) {return hate_list.GetEntHate(in_ent);}
|
||||
bool IsOnHatelist(Mob*p) { return hate_list.IsOnHateList(p);}
|
||||
|
||||
void SetNPCFactionID(int32 in) { npc_faction_id = in; database.GetFactionIdsForNPC(npc_faction_id, &faction_list, &primary_faction); }
|
||||
|
||||
float org_x, org_y, org_z, org_heading;
|
||||
|
||||
float org_x, org_y, org_z, org_heading;
|
||||
|
||||
uint32 GetMaxDMG() const {return max_dmg;}
|
||||
uint32 GetMinDMG() const {return min_dmg;}
|
||||
float GetSlowMitigation() const {return slow_mitigation;}
|
||||
float GetAttackSpeed() const {return attack_speed;}
|
||||
bool IsAnimal() const { return(bodytype == BT_Animal); }
|
||||
uint16 GetPetSpellID() const {return pet_spell_id;}
|
||||
void SetPetSpellID(uint16 amt) {pet_spell_id = amt;}
|
||||
uint16 GetPetSpellID() const {return pet_spell_id;}
|
||||
void SetPetSpellID(uint16 amt) {pet_spell_id = amt;}
|
||||
uint32 GetMaxDamage(uint8 tlevel);
|
||||
void SetTaunting(bool tog) {taunting = tog;}
|
||||
void SetTaunting(bool tog) {taunting = tog;}
|
||||
void PickPocket(Client* thief);
|
||||
void StartSwarmTimer(uint32 duration) { swarm_timer.Start(duration); }
|
||||
void AddLootDrop(const Item_Struct*dbitem, ItemList* itemlistconst, int16 charges, uint8 minlevel, uint8 maxlevel, bool equipit, bool wearchange = false);
|
||||
virtual void DoClassAttacks(Mob *target);
|
||||
void CheckSignal();
|
||||
|
||||
|
||||
//waypoint crap
|
||||
int GetMaxWp() const { return max_wp; }
|
||||
int GetMaxWp() const { return max_wp; }
|
||||
void DisplayWaypointInfo(Client *to);
|
||||
void CalculateNewWaypoint();
|
||||
void AssignWaypoints(int32 grid);
|
||||
@@ -256,11 +256,11 @@ public:
|
||||
void ResumeWandering();
|
||||
void PauseWandering(int pausetime);
|
||||
void MoveTo(float mtx, float mty, float mtz, float mth, bool saveguardspot);
|
||||
void GetClosestWaypoint(list<wplist> &wp_list, int count, float m_x, float m_y, float m_z);
|
||||
|
||||
void GetClosestWaypoint(list<wplist> &wp_list, int count, float m_x, float m_y, float m_z);
|
||||
|
||||
uint32 GetEquipment(uint8 material_slot) const; // returns item id
|
||||
int32 GetEquipmentMaterial(uint8 material_slot) const;
|
||||
|
||||
|
||||
void NextGuardPosition();
|
||||
void SaveGuardSpot(bool iClearGuardSpot = false);
|
||||
inline bool IsGuarding() const { return(guard_heading != 0); }
|
||||
@@ -268,7 +268,7 @@ public:
|
||||
void RestoreGuardSpotCharm();
|
||||
void AI_SetRoambox(float iDist, float iRoamDist, uint32 iDelay = 2500);
|
||||
void AI_SetRoambox(float iDist, float iMaxX, float iMinX, float iMaxY, float iMinY, uint32 iDelay = 2500);
|
||||
|
||||
|
||||
//mercenary stuff
|
||||
void LoadMercTypes();
|
||||
void LoadMercs();
|
||||
@@ -280,13 +280,13 @@ public:
|
||||
int GetNumMercTypes( uint32 expansion );
|
||||
int GetNumMercs() { return static_cast<int>(mercDataList.size()); };
|
||||
int GetNumMercs( uint32 expansion );
|
||||
|
||||
|
||||
inline bool WillAggroNPCs() const { return(npc_aggro); }
|
||||
|
||||
|
||||
inline void GiveNPCTypeData(NPCType *ours) { NPCTypedata_ours = ours; }
|
||||
inline const uint32 GetNPCSpellsID() const { return npc_spells_id; }
|
||||
|
||||
ItemList itemlist; //kathgar - why is this public? Doing other things or I would check the code
|
||||
|
||||
ItemList itemlist; //kathgar - why is this public? Doing other things or I would check the code
|
||||
|
||||
NPCProximity* proximity;
|
||||
Spawn2* respawn2;
|
||||
@@ -326,7 +326,7 @@ public:
|
||||
|
||||
//The corpse we make can only be looted by people who got credit for the kill
|
||||
const bool HasPrivateCorpse() const { return NPCTypedata->private_corpse; }
|
||||
const bool IsUnderwaterOnly() const { return NPCTypedata->underwater; }
|
||||
const bool IsUnderwaterOnly() const { return NPCTypedata->underwater; }
|
||||
const char* GetRawNPCTypeName() const { return NPCTypedata->name; }
|
||||
|
||||
bool GetDepop() { return p_depop; }
|
||||
@@ -336,17 +336,17 @@ public:
|
||||
uint32 GetAdventureTemplate() const { return adventure_template_id; }
|
||||
void AddSpellToNPCList(int16 iPriority, int16 iSpellID, uint16 iType, int16 iManaCost, int32 iRecastDelay, int16 iResistAdjust);
|
||||
void RemoveSpellFromNPCList(int16 spell_id);
|
||||
Timer *GetRefaceTimer() const { return reface_timer; }
|
||||
const uint32 GetAltCurrencyType() const { return NPCTypedata->alt_currency_type; }
|
||||
Timer *GetRefaceTimer() const { return reface_timer; }
|
||||
const uint32 GetAltCurrencyType() const { return NPCTypedata->alt_currency_type; }
|
||||
|
||||
NPC_Emote_Struct* GetNPCEmote(uint16 emoteid, uint8 event_);
|
||||
void DoNPCEmote(uint8 event_, uint16 emoteid);
|
||||
bool CanTalk();
|
||||
|
||||
inline void SetSpellScale(float amt) { spellscale = amt; }
|
||||
inline void SetSpellScale(float amt) { spellscale = amt; }
|
||||
inline float GetSpellScale() { return spellscale; }
|
||||
|
||||
inline void SetHealScale(float amt) { healscale = amt; }
|
||||
inline void SetHealScale(float amt) { healscale = amt; }
|
||||
inline float GetHealScale() { return healscale; }
|
||||
|
||||
void AddQuestItem(ItemInst* inst) { questItems.Insert(inst); }
|
||||
@@ -361,8 +361,8 @@ public:
|
||||
{
|
||||
ClearQuestDeleteItems(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void ClearQuestItems(bool delete_=false)
|
||||
{
|
||||
LinkedListIterator<ItemInst*> iterator(questItems);
|
||||
@@ -386,7 +386,7 @@ public:
|
||||
|
||||
questDeletionItems.Clear();
|
||||
}
|
||||
|
||||
|
||||
ItemInst* FindQuestItemByID(uint32 itmID, int charges, bool flagItemForDeletion=false)
|
||||
{
|
||||
LinkedListIterator<ItemInst*> iterator(questItems);
|
||||
@@ -413,7 +413,7 @@ public:
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool DoesQuestItemExist(uint32 itmID, int charges, bool flagItemForDeletion=false) {
|
||||
bool DoesQuestItemExist(uint32 itmID, int charges, bool flagItemForDeletion=false) {
|
||||
ItemInst* inst = FindQuestItemByID(itmID,charges,flagItemForDeletion);
|
||||
if ( inst != nullptr )
|
||||
{
|
||||
@@ -462,7 +462,7 @@ public:
|
||||
void mod_npc_killed(Mob* oos);
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
const NPCType* NPCTypedata;
|
||||
NPCType* NPCTypedata_ours; //special case for npcs with uniquely created data.
|
||||
|
||||
@@ -472,24 +472,24 @@ protected:
|
||||
uint32 silver;
|
||||
uint32 gold;
|
||||
uint32 platinum;
|
||||
int32 grid;
|
||||
uint32 spawn_group;
|
||||
int32 grid;
|
||||
uint32 spawn_group;
|
||||
uint16 wp_m;
|
||||
|
||||
int32 npc_faction_id;
|
||||
int32 primary_faction;
|
||||
|
||||
|
||||
Timer attacked_timer; //running while we are being attacked (damaged)
|
||||
Timer swarm_timer;
|
||||
Timer classattack_timer;
|
||||
Timer swarm_timer;
|
||||
Timer classattack_timer;
|
||||
Timer knightattack_timer;
|
||||
Timer assist_timer; //ask for help from nearby mobs
|
||||
Timer assist_timer; //ask for help from nearby mobs
|
||||
Timer qglobal_purge_timer;
|
||||
|
||||
bool combat_event; //true if we are in combat, false otherwise
|
||||
Timer sendhpupdate_timer;
|
||||
Timer sendhpupdate_timer;
|
||||
Timer enraged_timer;
|
||||
Timer *reface_timer;
|
||||
Timer *reface_timer;
|
||||
|
||||
uint32 npc_spells_id;
|
||||
uint8 casting_spell_AIindex;
|
||||
@@ -499,33 +499,33 @@ protected:
|
||||
bool HasAISpell;
|
||||
virtual bool AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes);
|
||||
virtual bool AIDoSpellCast(uint8 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgainBefore = 0);
|
||||
|
||||
|
||||
|
||||
|
||||
uint32 max_dmg;
|
||||
uint32 min_dmg;
|
||||
int32 accuracy_rating;
|
||||
int16 attack_count;
|
||||
uint32 npc_mana;
|
||||
float spellscale;
|
||||
float healscale;
|
||||
int16 attack_count;
|
||||
uint32 npc_mana;
|
||||
float spellscale;
|
||||
float healscale;
|
||||
|
||||
//pet crap:
|
||||
uint16 pet_spell_id;
|
||||
bool taunting;
|
||||
Timer taunt_timer; //for pet taunting
|
||||
|
||||
Timer taunt_timer; //for pet taunting
|
||||
|
||||
bool npc_aggro;
|
||||
|
||||
|
||||
deque<int> signal_q;
|
||||
|
||||
|
||||
//waypoint crap:
|
||||
vector<wplist> Waypoints;
|
||||
void _ClearWaypints();
|
||||
int max_wp;
|
||||
int save_wp;
|
||||
float guard_x, guard_y, guard_z, guard_heading;
|
||||
float guard_x, guard_y, guard_z, guard_heading;
|
||||
float guard_x_saved, guard_y_saved, guard_z_saved, guard_heading_saved;
|
||||
EmuAppearance guard_anim;
|
||||
EmuAppearance guard_anim;
|
||||
float roambox_max_x;
|
||||
float roambox_max_y;
|
||||
float roambox_min_x;
|
||||
@@ -534,15 +534,15 @@ protected:
|
||||
float roambox_movingto_x;
|
||||
float roambox_movingto_y;
|
||||
uint32 roambox_delay;
|
||||
|
||||
uint16 skills[HIGHEST_SKILL+1];
|
||||
uint32 equipment[MAX_WORN_INVENTORY]; //this is an array of item IDs
|
||||
|
||||
uint16 skills[HIGHEST_SKILL+1];
|
||||
uint32 equipment[MAX_WORN_INVENTORY]; //this is an array of item IDs
|
||||
uint16 d_meele_texture1; //this is an item Material value
|
||||
uint16 d_meele_texture2; //this is an item Material value (offhand)
|
||||
uint8 prim_melee_type; //Sets the Primary Weapon attack message and animation
|
||||
uint8 sec_melee_type; //Sets the Secondary Weapon attack message and animation
|
||||
AA_SwarmPetInfo *swarmInfoPtr;
|
||||
|
||||
|
||||
bool ldon_trapped;
|
||||
uint8 ldon_trap_type;
|
||||
uint16 ldon_spell_id;
|
||||
|
||||
+27
-27
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2003 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2003 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 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
|
||||
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.
|
||||
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
|
||||
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 OBJECT_H
|
||||
#define OBJECT_H
|
||||
@@ -91,10 +91,10 @@ IT10725_ACTORDEF=Shuriken
|
||||
#define OT_TEIRDALFORGE 0x20 //dark elf
|
||||
#define OT_OGGOKFORGE 0x21 //ogre
|
||||
#define OT_STORMGUARDF 0x22 //dwarven
|
||||
#define OT_VALEFORGE 0x31 //halfling
|
||||
#define OT_VALEFORGE 0x31 //halfling
|
||||
// gnome forge 0x23 (ak'anon forge)
|
||||
// barbarian forge 0x24 (northman forge)
|
||||
//
|
||||
//
|
||||
// iksar forge 0x26 (cabilis forge)
|
||||
// human forge 0x27 (qeynos or freeport?) (royal qeynos forge or freeport forge)
|
||||
// human forge 0x28 (qeynos or freeport?)
|
||||
@@ -136,7 +136,7 @@ public:
|
||||
Object(Client* client, const ItemInst* inst);
|
||||
Object(const ItemInst *inst, float x, float y, float z, float heading, uint32 decay_time = 300000);
|
||||
Object(const char *model, float x, float y, float z, float heading, uint8 type, uint32 decay_time = 0);
|
||||
|
||||
|
||||
// Destructor
|
||||
~Object();
|
||||
bool Process();
|
||||
@@ -148,39 +148,39 @@ public:
|
||||
static void HandleCombine(Client* user, const NewCombine_Struct* in_combine, Object *worldo);
|
||||
static void HandleAugmentation(Client* user, const AugmentItem_Struct* in_augment, Object *worldo);
|
||||
static void HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac);
|
||||
|
||||
|
||||
static SkillType TypeToSkill(uint32 type);
|
||||
|
||||
|
||||
// Packet functions
|
||||
void CreateSpawnPacket(EQApplicationPacket* app);
|
||||
void CreateDeSpawnPacket(EQApplicationPacket* app);
|
||||
void Depop();
|
||||
void Repop();
|
||||
|
||||
|
||||
//Decay functions
|
||||
void StartDecay() {decay_timer.Start();}
|
||||
|
||||
|
||||
// Container functions
|
||||
void PutItem(uint8 index, const ItemInst* inst);
|
||||
void DeleteItem(uint8 index); // Item inside container
|
||||
ItemInst* PopItem(uint8 index); // Pop item out of container
|
||||
|
||||
|
||||
// Override base class implementations
|
||||
virtual bool IsObject() const { return true; }
|
||||
virtual bool Save();
|
||||
virtual uint16 VarSave();
|
||||
virtual void SetID(uint16 set_id);
|
||||
|
||||
|
||||
void ClearUser() { user = nullptr; }
|
||||
|
||||
uint32 GetDBID();
|
||||
uint32 GetType();
|
||||
void SetType(uint32 type);
|
||||
void SetDBID(uint32 dbid);
|
||||
void SetType(uint32 type);
|
||||
void SetDBID(uint32 dbid);
|
||||
uint32 GetIcon();
|
||||
void SetIcon(uint32 icon);
|
||||
void SetIcon(uint32 icon);
|
||||
uint32 GetItemID();
|
||||
void SetItemID(uint32 itemid);
|
||||
void SetItemID(uint32 itemid);
|
||||
void GetObjectData(Object_Struct* Data);
|
||||
void SetObjectData(Object_Struct* Data);
|
||||
void GetLocation(float* x, float* y, float* z);
|
||||
@@ -204,7 +204,7 @@ public:
|
||||
protected:
|
||||
void ResetState(); // Set state back to original
|
||||
void RandomSpawn(bool send_packet = false); //spawn this ground spawn at a random place
|
||||
|
||||
|
||||
Object_Struct m_data; // Packet data
|
||||
ItemInst* m_inst; // Item representing object
|
||||
bool m_inuse; // Currently in use by a client?
|
||||
@@ -220,10 +220,10 @@ protected:
|
||||
bool m_ground_spawn;
|
||||
|
||||
std::map<std::string, std::string> o_EntityVariables;
|
||||
|
||||
|
||||
Client *user;
|
||||
Client *last_user;
|
||||
|
||||
|
||||
Timer respawn_timer;
|
||||
Timer decay_timer;
|
||||
};
|
||||
|
||||
+256
-256
File diff suppressed because it is too large
Load Diff
+11
-14
@@ -1,25 +1,22 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemu.org)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
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 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
|
||||
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.
|
||||
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
|
||||
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 OLDCODE_H
|
||||
#define OLDCODE_H
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+96
-95
@@ -13,7 +13,7 @@
|
||||
#include "zone.h"
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#define snprintf _snprintf
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
//#define PATHDEBUG
|
||||
@@ -54,7 +54,7 @@ PathManager* PathManager::LoadPathFile(const char* ZoneName)
|
||||
PathManager* Ret = nullptr;
|
||||
|
||||
strn0cpy(LowerCaseZoneName, ZoneName, 64);
|
||||
|
||||
|
||||
strlwr(LowerCaseZoneName);
|
||||
|
||||
snprintf(ZonePathFileName, 250, MAP_DIR "/%s.path", LowerCaseZoneName);
|
||||
@@ -114,7 +114,7 @@ bool PathManager::loadPaths(FILE *PathFile)
|
||||
fread(&Head, sizeof(Head), 1, PathFile);
|
||||
|
||||
LogFile->write(EQEMuLog::Status, "Path File Header: Version %ld, PathNodes %ld",
|
||||
(long)Head.version, (long)Head.PathNodeCount);
|
||||
(long)Head.version, (long)Head.PathNodeCount);
|
||||
|
||||
if(Head.version != 2)
|
||||
{
|
||||
@@ -123,7 +123,7 @@ bool PathManager::loadPaths(FILE *PathFile)
|
||||
}
|
||||
|
||||
PathNodes = new PathNode[Head.PathNodeCount];
|
||||
|
||||
|
||||
fread(PathNodes, sizeof(PathNode), Head.PathNodeCount, PathFile);
|
||||
|
||||
ClosedListFlag = new int[Head.PathNodeCount];
|
||||
@@ -163,8 +163,8 @@ void PathManager::PrintPathing()
|
||||
for(uint32 i = 0; i < Head.PathNodeCount; ++i)
|
||||
{
|
||||
printf("PathNode: %2d id %2d. (%8.3f, %8.3f, %8.3f), BestZ: %8.3f\n",
|
||||
i, PathNodes[i].id, PathNodes[i].v.x, PathNodes[i].v.y, PathNodes[i].v.z, PathNodes[i].bestz);
|
||||
|
||||
i, PathNodes[i].id, PathNodes[i].v.x, PathNodes[i].v.y, PathNodes[i].v.z, PathNodes[i].bestz);
|
||||
|
||||
|
||||
if(PathNodes[i].Neighbours[0].id == -1)
|
||||
{
|
||||
@@ -178,7 +178,7 @@ void PathManager::PrintPathing()
|
||||
break;
|
||||
|
||||
printf(" Neighbour: %2d, Distance %8.3f", PathNodes[i].Neighbours[j].id,
|
||||
PathNodes[i].Neighbours[j].distance);
|
||||
PathNodes[i].Neighbours[j].distance);
|
||||
|
||||
if(PathNodes[i].Neighbours[j].Teleport)
|
||||
printf(" ***** TELEPORT *****");
|
||||
@@ -206,7 +206,7 @@ VERTEX PathManager::GetPathNodeCoordinates(int NodeNumber, bool BestZ)
|
||||
}
|
||||
|
||||
return Result;
|
||||
|
||||
|
||||
}
|
||||
|
||||
list<int> PathManager::FindRoute(int startID, int endID)
|
||||
@@ -238,7 +238,7 @@ list<int> PathManager::FindRoute(int startID, int endID)
|
||||
CurrentNode = (*OpenList.begin());
|
||||
|
||||
ClosedList.push_back(CurrentNode);
|
||||
|
||||
|
||||
ClosedListFlag[CurrentNode.PathNodeID] = true;
|
||||
|
||||
OpenList.pop_front();
|
||||
@@ -256,7 +256,7 @@ list<int> PathManager::FindRoute(int startID, int endID)
|
||||
Route.push_back(CurrentNode.PathNodeID);
|
||||
|
||||
Route.push_back(endID);
|
||||
|
||||
|
||||
list<AStarNode>::iterator RouteIterator;
|
||||
|
||||
while(CurrentNode.PathNodeID != startID)
|
||||
@@ -269,7 +269,7 @@ list<int> PathManager::FindRoute(int startID, int endID)
|
||||
Route.insert(Route.begin(), -1);
|
||||
|
||||
CurrentNode = (*RouteIterator);
|
||||
|
||||
|
||||
Route.insert(Route.begin(), CurrentNode.PathNodeID);
|
||||
|
||||
break;
|
||||
@@ -294,10 +294,10 @@ list<int> PathManager::FindRoute(int startID, int endID)
|
||||
|
||||
AStarEntry.GCost = CurrentNode.GCost + PathNodes[CurrentNode.PathNodeID].Neighbours[i].distance;
|
||||
|
||||
float FCost = AStarEntry.HCost + AStarEntry.GCost;
|
||||
#ifdef PATHDEBUG
|
||||
float FCost = AStarEntry.HCost + AStarEntry.GCost;
|
||||
#ifdef PATHDEBUG
|
||||
printf("Node: %i, Open Neighbour %i has HCost %8.3f, GCost %8.3f (Total Cost: %8.3f)\n",
|
||||
CurrentNode.PathNodeID,
|
||||
CurrentNode.PathNodeID,
|
||||
PathNodes[CurrentNode.PathNodeID].Neighbours[i].id,
|
||||
AStarEntry.HCost,
|
||||
AStarEntry.GCost,
|
||||
@@ -314,7 +314,7 @@ list<int> PathManager::FindRoute(int startID, int endID)
|
||||
{
|
||||
AlreadyInOpenList = true;
|
||||
|
||||
float GCostToNode = CurrentNode.GCost + PathNodes[CurrentNode.PathNodeID].Neighbours[i].distance;
|
||||
float GCostToNode = CurrentNode.GCost + PathNodes[CurrentNode.PathNodeID].Neighbours[i].distance;
|
||||
|
||||
if(GCostToNode < (*OpenListIterator).GCost)
|
||||
{
|
||||
@@ -361,7 +361,7 @@ list<int> PathManager::FindRoute(VERTEX Start, VERTEX End)
|
||||
|
||||
_ZP(Pathing_FindRoute_FromVertices);
|
||||
|
||||
_log(PATHING__DEBUG, "FindRoute(%8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f)", Start.x, Start.y, Start.z, End.x, End.y, End.z);
|
||||
_log(PATHING__DEBUG, "FindRoute(%8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f)", Start.x, Start.y, Start.z, End.x, End.y, End.z);
|
||||
|
||||
list<int> noderoute;
|
||||
|
||||
@@ -381,16 +381,16 @@ list<int> PathManager::FindRoute(VERTEX Start, VERTEX End)
|
||||
for(uint32 i = 0 ; i < Head.PathNodeCount; ++i)
|
||||
{
|
||||
if((ABS(Start.x - PathNodes[i].v.x) <= CandidateNodeRangeXY) &&
|
||||
(ABS(Start.y - PathNodes[i].v.y) <= CandidateNodeRangeXY) &&
|
||||
(ABS(Start.z - PathNodes[i].v.z) <= CandidateNodeRangeZ))
|
||||
(ABS(Start.y - PathNodes[i].v.y) <= CandidateNodeRangeXY) &&
|
||||
(ABS(Start.z - PathNodes[i].v.z) <= CandidateNodeRangeZ))
|
||||
{
|
||||
TempNode.id = i;
|
||||
TempNode.id = i;
|
||||
TempNode.Distance = VertexDistanceNoRoot(Start, PathNodes[i].v);
|
||||
SortedByDistance.push_back(TempNode);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SortedByDistance.sort(SortPathNodesByDistance);
|
||||
|
||||
for(list<PathNodeSortStruct>::iterator Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator)
|
||||
@@ -420,15 +420,15 @@ list<int> PathManager::FindRoute(VERTEX Start, VERTEX End)
|
||||
for(uint32 i = 0 ; i < Head.PathNodeCount; ++i)
|
||||
{
|
||||
if((ABS(End.x - PathNodes[i].v.x) <= CandidateNodeRangeXY) &&
|
||||
(ABS(End.y - PathNodes[i].v.y) <= CandidateNodeRangeXY) &&
|
||||
(ABS(End.z - PathNodes[i].v.z) <= CandidateNodeRangeZ))
|
||||
(ABS(End.y - PathNodes[i].v.y) <= CandidateNodeRangeXY) &&
|
||||
(ABS(End.z - PathNodes[i].v.z) <= CandidateNodeRangeZ))
|
||||
{
|
||||
TempNode.id = i;
|
||||
TempNode.id = i;
|
||||
TempNode.Distance = VertexDistanceNoRoot(End, PathNodes[i].v);
|
||||
SortedByDistance.push_back(TempNode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SortedByDistance.sort(SortPathNodesByDistance);
|
||||
|
||||
for(list<PathNodeSortStruct>::iterator Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator)
|
||||
@@ -444,7 +444,7 @@ list<int> PathManager::FindRoute(VERTEX Start, VERTEX End)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(ClosestPathNodeToEnd < 0) {
|
||||
_log(PATHING__DEBUG, "No LOS to any end Path Node within range.");
|
||||
return noderoute;
|
||||
@@ -464,7 +464,7 @@ list<int> PathManager::FindRoute(VERTEX Start, VERTEX End)
|
||||
if(NodesToAttemptToCull > 0)
|
||||
{
|
||||
int CulledNodes = 0;
|
||||
|
||||
|
||||
list<int>::iterator First, Second;
|
||||
|
||||
while((noderoute.size() >= 2) && (CulledNodes < NodesToAttemptToCull))
|
||||
@@ -479,7 +479,7 @@ list<int> PathManager::FindRoute(VERTEX Start, VERTEX End)
|
||||
break;
|
||||
|
||||
if(!zone->zonemap->LineIntersectsZone(Start, PathNodes[(*Second)].v, 1.0f, nullptr, nullptr)
|
||||
&& zone->pathing->NoHazards(Start, PathNodes[(*Second)].v))
|
||||
&& zone->pathing->NoHazards(Start, PathNodes[(*Second)].v))
|
||||
{
|
||||
noderoute.erase(First);
|
||||
|
||||
@@ -489,13 +489,13 @@ list<int> PathManager::FindRoute(VERTEX Start, VERTEX End)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
NodesToAttemptToCull = RuleI(Pathing, CullNodesFromEnd);
|
||||
|
||||
if(NodesToAttemptToCull > 0)
|
||||
{
|
||||
int CulledNodes = 0;
|
||||
|
||||
|
||||
list<int>::iterator First, Second;
|
||||
|
||||
while((noderoute.size() >= 2) && (CulledNodes < NodesToAttemptToCull))
|
||||
@@ -512,7 +512,7 @@ list<int> PathManager::FindRoute(VERTEX Start, VERTEX End)
|
||||
break;
|
||||
|
||||
if(!zone->zonemap->LineIntersectsZone(End, PathNodes[(*Second)].v, 1.0f, nullptr, nullptr)
|
||||
&& zone->pathing->NoHazards(End, PathNodes[(*Second)].v))
|
||||
&& zone->pathing->NoHazards(End, PathNodes[(*Second)].v))
|
||||
{
|
||||
noderoute.erase(First);
|
||||
|
||||
@@ -566,7 +566,7 @@ void PathManager::SpawnPathNodes()
|
||||
else if(PathNodes[i].id < 100)
|
||||
sprintf(npc_type->name, "%s_%s", DigitToWord(PathNodes[i].id/10), DigitToWord(PathNodes[i].id % 10));
|
||||
else
|
||||
sprintf(npc_type->name, "%s_%s_%s", DigitToWord(PathNodes[i].id/100), DigitToWord((PathNodes[i].id % 100)/10),
|
||||
sprintf(npc_type->name, "%s_%s_%s", DigitToWord(PathNodes[i].id/100), DigitToWord((PathNodes[i].id % 100)/10),
|
||||
DigitToWord(((PathNodes[i].id % 100) %10)));
|
||||
|
||||
sprintf(npc_type->lastname, "%i", PathNodes[i].id);
|
||||
@@ -586,7 +586,7 @@ void PathManager::SpawnPathNodes()
|
||||
npc_type->d_meele_texture2 = 1;
|
||||
npc_type->merchanttype = 1;
|
||||
npc_type->bodytype = 1;
|
||||
|
||||
|
||||
npc_type->STR = 150;
|
||||
npc_type->STA = 150;
|
||||
npc_type->DEX = 150;
|
||||
@@ -596,10 +596,10 @@ void PathManager::SpawnPathNodes()
|
||||
npc_type->CHA = 150;
|
||||
|
||||
npc_type->findable = 1;
|
||||
|
||||
|
||||
NPC* npc = new NPC(npc_type, 0, PathNodes[i].v.x, PathNodes[i].v.y, PathNodes[i].v.z, 0, FlyMode1);
|
||||
npc->GiveNPCTypeData(npc_type);
|
||||
|
||||
|
||||
entity_list.AddNPC(npc, true, true);
|
||||
}
|
||||
}
|
||||
@@ -619,7 +619,7 @@ void PathManager::MeshTest()
|
||||
{
|
||||
if(j == i)
|
||||
continue;
|
||||
|
||||
|
||||
list<int> Route = FindRoute(PathNodes[i].id, PathNodes[j].id);
|
||||
|
||||
if(Route.size() == 0)
|
||||
@@ -627,7 +627,7 @@ void PathManager::MeshTest()
|
||||
++NoConnections;
|
||||
printf("FindRoute(%i, %i) **** NO ROUTE FOUND ****\n", PathNodes[i].id, PathNodes[j].id);
|
||||
}
|
||||
++TotalTests;
|
||||
++TotalTests;
|
||||
}
|
||||
}
|
||||
printf("Executed %i route searches.\n", TotalTests);
|
||||
@@ -642,7 +642,7 @@ void PathManager::SimpleMeshTest()
|
||||
int TotalTests = 0;
|
||||
int NoConnections = 0;
|
||||
|
||||
printf("Beginning Pathmanager connectivity tests.\n");
|
||||
printf("Beginning Pathmanager connectivity tests.\n");
|
||||
fflush(stdout);
|
||||
|
||||
for(uint32 j = 1; j < Head.PathNodeCount; ++j)
|
||||
@@ -654,7 +654,7 @@ void PathManager::SimpleMeshTest()
|
||||
++NoConnections;
|
||||
printf("FindRoute(%i, %i) **** NO ROUTE FOUND ****\n", PathNodes[0].id, PathNodes[j].id);
|
||||
}
|
||||
++TotalTests;
|
||||
++TotalTests;
|
||||
}
|
||||
printf("Executed %i route searches.\n", TotalTests);
|
||||
printf("Failed to find %i routes.\n", NoConnections);
|
||||
@@ -673,7 +673,7 @@ VERTEX Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Waypo
|
||||
|
||||
VERTEX From(GetX(), GetY(), GetZ());
|
||||
|
||||
VERTEX HeadPosition(From.x, From.y, From.z + (GetSize() < 6.0 ? 6 : GetSize()) * HEAD_POSITION);
|
||||
VERTEX HeadPosition(From.x, From.y, From.z + (GetSize() < 6.0 ? 6 : GetSize()) * HEAD_POSITION);
|
||||
|
||||
VERTEX To(ToX, ToY, ToZ);
|
||||
|
||||
@@ -725,7 +725,7 @@ VERTEX Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Waypo
|
||||
|
||||
PathingLastPosition = From;
|
||||
}
|
||||
|
||||
|
||||
if(Route.size() > 0)
|
||||
{
|
||||
|
||||
@@ -743,7 +743,7 @@ VERTEX Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Waypo
|
||||
// We have reached the path node.
|
||||
if(NodeLoc == From)
|
||||
{
|
||||
mlog(PATHING__DEBUG, " Arrived at node %i", NextNode);
|
||||
mlog(PATHING__DEBUG, " Arrived at node %i", NextNode);
|
||||
|
||||
NodeReached = true;
|
||||
|
||||
@@ -761,8 +761,8 @@ VERTEX Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Waypo
|
||||
|
||||
if((RouteSize == 2)
|
||||
|| ((PathingTraversedNodes >= RuleI(Pathing, MinNodesTraversedForLOSCheck))
|
||||
&& (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck))
|
||||
&& PathingLOSCheckTimer->Check()))
|
||||
&& (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck))
|
||||
&& PathingLOSCheckTimer->Check()))
|
||||
{
|
||||
mlog(PATHING__DEBUG, " Checking distance to target.");
|
||||
float Distance = VertexDistanceNoRoot(From, To);
|
||||
@@ -770,13 +770,13 @@ VERTEX Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Waypo
|
||||
mlog(PATHING__DEBUG, " Distance between From and To (NoRoot) is %8.3f", Distance);
|
||||
|
||||
if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort))
|
||||
&& (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold)))
|
||||
&& (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold)))
|
||||
{
|
||||
if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr, nullptr))
|
||||
PathingLOSState = HaveLOS;
|
||||
else
|
||||
PathingLOSState = NoLOS;
|
||||
mlog(PATHING__DEBUG, " LOS stats is %s", (PathingLOSState == HaveLOS) ? "HaveLOS" : "NoLOS");
|
||||
mlog(PATHING__DEBUG, " LOS stats is %s", (PathingLOSState == HaveLOS) ? "HaveLOS" : "NoLOS");
|
||||
|
||||
if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To))
|
||||
{
|
||||
@@ -787,7 +787,7 @@ VERTEX Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Waypo
|
||||
}
|
||||
else
|
||||
{
|
||||
mlog(PATHING__DEBUG, " Continuing on node path.");
|
||||
mlog(PATHING__DEBUG, " Continuing on node path.");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -836,10 +836,10 @@ VERTEX Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Waypo
|
||||
|
||||
mlog(PATHING__DEBUG, " Now moving to node %i", NextNode);
|
||||
|
||||
return zone->pathing->GetPathNodeCoordinates(NextNode);
|
||||
return zone->pathing->GetPathNodeCoordinates(NextNode);
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
// we have run all the nodes, all that is left is the direct path from the last node
|
||||
// to the destination
|
||||
mlog(PATHING__DEBUG, " Reached end of node path, running direct to target.");
|
||||
@@ -853,8 +853,8 @@ VERTEX Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Waypo
|
||||
int RouteSize = Route.size();
|
||||
|
||||
if((PathingTraversedNodes >= RuleI(Pathing, MinNodesTraversedForLOSCheck))
|
||||
&& (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck))
|
||||
&& PathingLOSCheckTimer->Check())
|
||||
&& (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck))
|
||||
&& PathingLOSCheckTimer->Check())
|
||||
{
|
||||
mlog(PATHING__DEBUG, " Checking distance to target.");
|
||||
|
||||
@@ -863,13 +863,13 @@ VERTEX Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Waypo
|
||||
mlog(PATHING__DEBUG, " Distance between From and To (NoRoot) is %8.3f", Distance);
|
||||
|
||||
if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort))
|
||||
&& (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold)))
|
||||
&& (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold)))
|
||||
{
|
||||
if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr, nullptr))
|
||||
PathingLOSState = HaveLOS;
|
||||
else
|
||||
PathingLOSState = NoLOS;
|
||||
mlog(PATHING__DEBUG, " LOS stats is %s", (PathingLOSState == HaveLOS) ? "HaveLOS" : "NoLOS");
|
||||
mlog(PATHING__DEBUG, " LOS stats is %s", (PathingLOSState == HaveLOS) ? "HaveLOS" : "NoLOS");
|
||||
|
||||
if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To))
|
||||
{
|
||||
@@ -880,7 +880,7 @@ VERTEX Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Waypo
|
||||
}
|
||||
else
|
||||
{
|
||||
mlog(PATHING__DEBUG, " Continuing on node path.");
|
||||
mlog(PATHING__DEBUG, " Continuing on node path.");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -895,22 +895,22 @@ VERTEX Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Waypo
|
||||
mlog(PATHING__DEBUG, " Target has changed position.");
|
||||
// Update our record of where we are going to.
|
||||
PathingDestination = To;
|
||||
// Check if we now have LOS etc to the new destination.
|
||||
// Check if we now have LOS etc to the new destination.
|
||||
if(PathingLOSCheckTimer->Check())
|
||||
{
|
||||
float Distance = VertexDistanceNoRoot(From, To);
|
||||
|
||||
if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort))
|
||||
&& (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold)))
|
||||
&& (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold)))
|
||||
{
|
||||
mlog(PATHING__DEBUG, " Checking for short LOS at distance %8.3f.", Distance);
|
||||
if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr, nullptr))
|
||||
PathingLOSState = HaveLOS;
|
||||
else
|
||||
PathingLOSState = NoLOS;
|
||||
|
||||
mlog(PATHING__DEBUG, " LOS stats is %s", (PathingLOSState == HaveLOS) ? "HaveLOS" : "NoLOS");
|
||||
|
||||
|
||||
mlog(PATHING__DEBUG, " LOS stats is %s", (PathingLOSState == HaveLOS) ? "HaveLOS" : "NoLOS");
|
||||
|
||||
if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To))
|
||||
{
|
||||
mlog(PATHING__DEBUG, " No hazards. Running directly to target.");
|
||||
@@ -919,7 +919,7 @@ VERTEX Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Waypo
|
||||
}
|
||||
else
|
||||
{
|
||||
mlog(PATHING__DEBUG, " Continuing on node path.");
|
||||
mlog(PATHING__DEBUG, " Continuing on node path.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -966,13 +966,13 @@ VERTEX Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Waypo
|
||||
// May need to refine this as rounding errors may mean we never have equality
|
||||
// Check if we have reached a path node.
|
||||
if(NodeLoc == From)
|
||||
{
|
||||
{
|
||||
mlog(PATHING__DEBUG, " Arrived at node %i, moving to next one.\n", Route.front());
|
||||
|
||||
NodeReached = true;
|
||||
|
||||
PathingLastNodeVisited = Route.front();
|
||||
|
||||
|
||||
Route.pop_front();
|
||||
|
||||
++PathingTraversedNodes;
|
||||
@@ -993,7 +993,7 @@ VERTEX Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Waypo
|
||||
mlog(PATHING__DEBUG, "Missing node after teleport.");
|
||||
return To;
|
||||
}
|
||||
|
||||
|
||||
NextNode = Route.front();
|
||||
|
||||
NodeLoc = zone->pathing->GetPathNodeCoordinates(NextNode);
|
||||
@@ -1024,7 +1024,7 @@ VERTEX Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Waypo
|
||||
}
|
||||
return NodeLoc;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
mlog(PATHING__DEBUG, " Target moved. End node is different. Clearing route.");
|
||||
|
||||
@@ -1053,17 +1053,17 @@ VERTEX Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Waypo
|
||||
float Distance = VertexDistanceNoRoot(From, To);
|
||||
|
||||
if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckLong))
|
||||
&& (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold)))
|
||||
{
|
||||
&& (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold)))
|
||||
{
|
||||
mlog(PATHING__DEBUG, " Checking for long LOS at distance %8.3f.", Distance);
|
||||
|
||||
|
||||
if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr, nullptr))
|
||||
PathingLOSState = HaveLOS;
|
||||
else
|
||||
PathingLOSState = NoLOS;
|
||||
|
||||
mlog(PATHING__DEBUG, " LOS stats is %s", (PathingLOSState == HaveLOS) ? "HaveLOS" : "NoLOS");
|
||||
|
||||
mlog(PATHING__DEBUG, " LOS stats is %s", (PathingLOSState == HaveLOS) ? "HaveLOS" : "NoLOS");
|
||||
|
||||
if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To))
|
||||
{
|
||||
mlog(PATHING__DEBUG, "Target is reachable. Running directly there.");
|
||||
@@ -1121,16 +1121,16 @@ int PathManager::FindNearestPathNode(VERTEX Position)
|
||||
for(uint32 i = 0 ; i < Head.PathNodeCount; ++i)
|
||||
{
|
||||
if((ABS(Position.x - PathNodes[i].v.x) <= CandidateNodeRangeXY) &&
|
||||
(ABS(Position.y - PathNodes[i].v.y) <= CandidateNodeRangeXY) &&
|
||||
(ABS(Position.z - PathNodes[i].v.z) <= CandidateNodeRangeZ))
|
||||
(ABS(Position.y - PathNodes[i].v.y) <= CandidateNodeRangeXY) &&
|
||||
(ABS(Position.z - PathNodes[i].v.z) <= CandidateNodeRangeZ))
|
||||
{
|
||||
TempNode.id = i;
|
||||
TempNode.id = i;
|
||||
TempNode.Distance = VertexDistanceNoRoot(Position, PathNodes[i].v);
|
||||
SortedByDistance.push_back(TempNode);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SortedByDistance.sort(SortPathNodesByDistance);
|
||||
|
||||
for(list<PathNodeSortStruct>::iterator Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator)
|
||||
@@ -1188,16 +1188,16 @@ bool PathManager::NoHazardsAccurate(VERTEX From, VERTEX To)
|
||||
cury = From.y;
|
||||
curz = From.z;
|
||||
|
||||
do
|
||||
do
|
||||
{
|
||||
stepx = (float)To.x - curx;
|
||||
stepy = (float)To.y - cury;
|
||||
stepz = (float)To.z - curz;
|
||||
float factor = sqrt(stepx*stepx + stepy*stepy + stepz*stepz);
|
||||
float factor = sqrt(stepx*stepx + stepy*stepy + stepz*stepz);
|
||||
stepx = (stepx/factor)*step_size;
|
||||
stepy = (stepy/factor)*step_size;
|
||||
stepz = (stepz/factor)*step_size;
|
||||
|
||||
|
||||
VERTEX TestPoint(curx, cury, curz);
|
||||
float NewZ = zone->zonemap->FindBestZ(MAP_ROOT_NODE, TestPoint, nullptr, nullptr);
|
||||
if(ABS(NewZ - last_z) > 5.0)
|
||||
@@ -1211,7 +1211,7 @@ bool PathManager::NoHazardsAccurate(VERTEX From, VERTEX To)
|
||||
if(zone->watermap)
|
||||
{
|
||||
NodeRef n = zone->zonemap->SeekNode( zone->zonemap->GetRoot(), TestPoint.x, TestPoint.y);
|
||||
if(n != NODE_NONE)
|
||||
if(n != NODE_NONE)
|
||||
{
|
||||
if(zone->watermap->InLiquid(From.x, From.y, From.z) || zone->watermap->InLiquid(To.x, To.y, To.z))
|
||||
{
|
||||
@@ -1225,7 +1225,7 @@ bool PathManager::NoHazardsAccurate(VERTEX From, VERTEX To)
|
||||
VERTEX hit;
|
||||
TestPointWaterDest.z -= 500;
|
||||
float best_z2 = -999990;
|
||||
if(zone->zonemap->LineIntersectsNode(n, TestPointWater, TestPointWaterDest, &hit, nullptr))
|
||||
if(zone->zonemap->LineIntersectsNode(n, TestPointWater, TestPointWaterDest, &hit, nullptr))
|
||||
{
|
||||
best_z2 = hit.z;
|
||||
}
|
||||
@@ -1270,7 +1270,7 @@ bool PathManager::NoHazardsAccurate(VERTEX From, VERTEX To)
|
||||
if(ABS(cury - To.y) < step_size) cur.y = To.y;
|
||||
if(ABS(curz - To.z) < step_size) cur.z = To.z;
|
||||
|
||||
}
|
||||
}
|
||||
while(cur.x != To.x || cur.y != To.y || cur.z != To.z);
|
||||
return true;
|
||||
}
|
||||
@@ -1279,7 +1279,7 @@ void Mob::PrintRoute()
|
||||
{
|
||||
|
||||
printf("Route is : ");
|
||||
|
||||
|
||||
list<int>::iterator Iterator;
|
||||
|
||||
for(Iterator = Route.begin(); Iterator !=Route.end(); ++Iterator)
|
||||
@@ -1331,11 +1331,11 @@ void Client::SendPathPacket(vector<FindPerson_Point> &points) {
|
||||
QueuePacket(&outapp);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
int len = sizeof(FindPersonResult_Struct) + (points.size()+1) * sizeof(FindPerson_Point);
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_FindPersonReply, len);
|
||||
FindPersonResult_Struct* fpr=(FindPersonResult_Struct*)outapp->pBuffer;
|
||||
|
||||
|
||||
vector<FindPerson_Point>::iterator cur, end;
|
||||
cur = points.begin();
|
||||
end = points.end();
|
||||
@@ -1350,8 +1350,8 @@ void Client::SendPathPacket(vector<FindPerson_Point> &points) {
|
||||
fpr->dest = *cur;
|
||||
|
||||
FastQueuePacket(&outapp);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
PathNode* PathManager::FindPathNodeByCoordinates(float x, float y, float z)
|
||||
@@ -1393,7 +1393,7 @@ void PathManager::ShowPathNodeNeighbours(Client *c)
|
||||
else if(PathNodes[i].id < 100)
|
||||
sprintf(Name, "%s_%s000", DigitToWord(PathNodes[i].id / 10), DigitToWord(PathNodes[i].id % 10));
|
||||
else
|
||||
sprintf(Name, "%s_%s_%s000", DigitToWord(PathNodes[i].id/100), DigitToWord((PathNodes[i].id % 100)/10),
|
||||
sprintf(Name, "%s_%s_%s000", DigitToWord(PathNodes[i].id/100), DigitToWord((PathNodes[i].id % 100)/10),
|
||||
DigitToWord(((PathNodes[i].id % 100) %10)));
|
||||
|
||||
Mob *m = entity_list.GetMob(Name);
|
||||
@@ -1408,7 +1408,7 @@ void PathManager::ShowPathNodeNeighbours(Client *c)
|
||||
{
|
||||
if(Node->Neighbours[i].id == -1)
|
||||
break;
|
||||
Neighbours << Node->Neighbours[i].id << ", ";
|
||||
Neighbours << Node->Neighbours[i].id << ", ";
|
||||
|
||||
char Name[64];
|
||||
|
||||
@@ -1417,7 +1417,7 @@ void PathManager::ShowPathNodeNeighbours(Client *c)
|
||||
else if(Node->Neighbours[i].id < 100)
|
||||
sprintf(Name, "%s_%s000", DigitToWord(Node->Neighbours[i].id / 10), DigitToWord(Node->Neighbours[i].id % 10));
|
||||
else
|
||||
sprintf(Name, "%s_%s_%s000", DigitToWord(Node->Neighbours[i].id/100), DigitToWord((Node->Neighbours[i].id % 100)/10),
|
||||
sprintf(Name, "%s_%s_%s000", DigitToWord(Node->Neighbours[i].id/100), DigitToWord((Node->Neighbours[i].id % 100)/10),
|
||||
DigitToWord(((Node->Neighbours[i].id % 100) %10)));
|
||||
|
||||
Mob *m = entity_list.GetMob(Name);
|
||||
@@ -1447,7 +1447,7 @@ void PathManager::NodeInfo(Client *c)
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(0, "Pathing node: %i at (%.2f, %.2f, %.2f) with bestz %.2f",
|
||||
c->Message(0, "Pathing node: %i at (%.2f, %.2f, %.2f) with bestz %.2f",
|
||||
Node->id, Node->v.x, Node->v.y, Node->v.z, Node->bestz);
|
||||
|
||||
bool neighbour = false;
|
||||
@@ -1460,7 +1460,7 @@ void PathManager::NodeInfo(Client *c)
|
||||
c->Message(0, "Neighbours found:");
|
||||
neighbour = true;
|
||||
}
|
||||
c->Message(0, "id: %i, distance: %.2f, door id: %i, is teleport: %i",
|
||||
c->Message(0, "id: %i, distance: %.2f, door id: %i, is teleport: %i",
|
||||
Node->Neighbours[x].id, Node->Neighbours[x].distance,
|
||||
Node->Neighbours[x].DoorID, Node->Neighbours[x].Teleport);
|
||||
}
|
||||
@@ -1498,9 +1498,9 @@ int32 PathManager::AddNode(float x, float y, float z, float best_z, int32 reques
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(new_id == -1)
|
||||
{
|
||||
{
|
||||
for(uint32 i = 0; i < Head.PathNodeCount; ++i)
|
||||
{
|
||||
if(PathNodes[i].id > new_id)
|
||||
@@ -1508,7 +1508,7 @@ int32 PathManager::AddNode(float x, float y, float z, float best_z, int32 reques
|
||||
}
|
||||
new_id++;
|
||||
}
|
||||
|
||||
|
||||
PathNode new_node;
|
||||
new_node.v.x = x;
|
||||
new_node.v.y = y;
|
||||
@@ -1568,7 +1568,7 @@ int32 PathManager::AddNode(float x, float y, float z, float best_z, int32 reques
|
||||
else if(new_id < 100)
|
||||
sprintf(npc_type->name, "%s_%s", DigitToWord(new_id/10), DigitToWord(new_id % 10));
|
||||
else
|
||||
sprintf(npc_type->name, "%s_%s_%s", DigitToWord(new_id/100), DigitToWord((new_id % 100)/10),
|
||||
sprintf(npc_type->name, "%s_%s_%s", DigitToWord(new_id/100), DigitToWord((new_id % 100)/10),
|
||||
DigitToWord(((new_id % 100) %10)));
|
||||
|
||||
sprintf(npc_type->lastname, "%i", new_id);
|
||||
@@ -1628,7 +1628,7 @@ int32 PathManager::AddNode(float x, float y, float z, float best_z, int32 reques
|
||||
else if(new_id < 100)
|
||||
sprintf(npc_type->name, "%s_%s", DigitToWord(new_id/10), DigitToWord(new_id % 10));
|
||||
else
|
||||
sprintf(npc_type->name, "%s_%s_%s", DigitToWord(new_id/100), DigitToWord((new_id % 100)/10),
|
||||
sprintf(npc_type->name, "%s_%s_%s", DigitToWord(new_id/100), DigitToWord((new_id % 100)/10),
|
||||
DigitToWord(((new_id % 100) %10)));
|
||||
|
||||
sprintf(npc_type->lastname, "%i", new_id);
|
||||
@@ -1955,7 +1955,7 @@ void PathManager::DisconnectNodeToNode(int32 Node1, int32 Node2)
|
||||
|
||||
bool disconnect_a_from_b = false;
|
||||
if(NodesConnected(a, b))
|
||||
disconnect_a_from_b = true;
|
||||
disconnect_a_from_b = true;
|
||||
|
||||
bool disconnect_b_from_a = false;
|
||||
if(NodesConnected(b, a))
|
||||
@@ -2094,7 +2094,7 @@ bool PathManager::CheckLosFN(VERTEX a, VERTEX b)
|
||||
{
|
||||
VERTEX hit;
|
||||
|
||||
VERTEX myloc;
|
||||
VERTEX myloc;
|
||||
VERTEX oloc;
|
||||
|
||||
myloc.x = a.x;
|
||||
@@ -2295,3 +2295,4 @@ void PathManager::SortNodes()
|
||||
safe_delete_array(PathNodes);
|
||||
PathNodes = t_PathNodes;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -107,6 +107,6 @@ private:
|
||||
int *ClosedListFlag;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+13
-15
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* This file was generated automatically by xsubpp version 1.9508 from the
|
||||
* contents of tmp. Do not edit this file, edit tmp instead.
|
||||
*
|
||||
* ANY CHANGES MADE HERE WILL BE LOST!
|
||||
*
|
||||
*/
|
||||
* This file was generated automatically by xsubpp version 1.9508 from the
|
||||
* contents of tmp. Do not edit this file, edit tmp instead.
|
||||
*
|
||||
* ANY CHANGES MADE HERE WILL BE LOST!
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 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
|
||||
@@ -18,11 +18,11 @@
|
||||
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.
|
||||
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
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "../common/features.h"
|
||||
@@ -36,8 +36,8 @@
|
||||
|
||||
#include "PlayerCorpse.h"
|
||||
|
||||
#ifdef THIS /* this macro seems to leak out on some systems */
|
||||
#undef THIS
|
||||
#ifdef THIS /* this macro seems to leak out on some systems */
|
||||
#undef THIS
|
||||
#endif
|
||||
|
||||
|
||||
@@ -797,15 +797,13 @@ XS(boot_Corpse)
|
||||
char file[256];
|
||||
strncpy(file, __FILE__, 256);
|
||||
file[255] = 0;
|
||||
|
||||
|
||||
if(items != 1)
|
||||
fprintf(stderr, "boot_quest does not take any arguments.");
|
||||
char buf[128];
|
||||
|
||||
//add the strcpy stuff to get rid of const warnings....
|
||||
|
||||
|
||||
|
||||
XS_VERSION_BOOTCHECK ;
|
||||
|
||||
newXSproto(strcpy(buf, "GetCharID"), XS_Corpse_GetCharID, file, "$");
|
||||
|
||||
+43
-43
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* This file was generated automatically by xsubpp version 1.9508 from the
|
||||
* contents of tmp. Do not edit this file, edit tmp instead.
|
||||
*
|
||||
* ANY CHANGES MADE HERE WILL BE LOST!
|
||||
*
|
||||
*/
|
||||
* This file was generated automatically by xsubpp version 1.9508 from the
|
||||
* contents of tmp. Do not edit this file, edit tmp instead.
|
||||
*
|
||||
* ANY CHANGES MADE HERE WILL BE LOST!
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 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
|
||||
@@ -16,13 +16,13 @@
|
||||
|
||||
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.
|
||||
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
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "../common/features.h"
|
||||
@@ -1696,7 +1696,7 @@ XS(XS_Client_TakeMoneyFromPP)
|
||||
{
|
||||
dXSARGS;
|
||||
if (items < 2 || items > 3)
|
||||
Perl_croak(aTHX_ "Usage: Client::TakeMoneyFromPP(THIS, copper, updateclient=false)");
|
||||
Perl_croak(aTHX_ "Usage: Client::TakeMoneyFromPP(THIS, copper, updateclient=false)");
|
||||
{
|
||||
Client * THIS;
|
||||
bool RETVAL;
|
||||
@@ -2887,7 +2887,7 @@ XS(XS_Client_NukeItem)
|
||||
Perl_croak(aTHX_ "THIS is not of type Client");
|
||||
if(THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
|
||||
if(items < 3){
|
||||
where_to_check = 0xFF;
|
||||
}
|
||||
@@ -3897,8 +3897,8 @@ XS(XS_Client_GetClientVersionBit)
|
||||
if (items != 1)
|
||||
Perl_croak(aTHX_ "Usage: Client::GetClientVersionBit(THIS)");
|
||||
{
|
||||
Client * THIS;
|
||||
uint32 RETVAL;
|
||||
Client * THIS;
|
||||
uint32 RETVAL;
|
||||
dXSTARG;
|
||||
|
||||
if (sv_derived_from(ST(0), "Client")) {
|
||||
@@ -4883,7 +4883,7 @@ XS(XS_Client_AddLevelBasedExp)
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
XS(XS_Client_IncrementAA);
|
||||
XS(XS_Client_IncrementAA);
|
||||
XS(XS_Client_IncrementAA)
|
||||
{
|
||||
dXSARGS;
|
||||
@@ -4901,17 +4901,17 @@ XS(XS_Client_IncrementAA)
|
||||
Perl_croak(aTHX_ "THIS is not of type Client");
|
||||
if(THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
|
||||
SendAA_Struct* aa2 = zone->FindAA(aaskillid);
|
||||
|
||||
|
||||
if(aa2 == nullptr)
|
||||
Perl_croak(aTHX_ "Invalid AA.");
|
||||
|
||||
if(THIS->GetAA(aaskillid) == aa2->max_level)
|
||||
Perl_croak(aTHX_ "AA at Max already.");
|
||||
|
||||
Perl_croak(aTHX_ "Invalid AA.");
|
||||
|
||||
if(THIS->GetAA(aaskillid) == aa2->max_level)
|
||||
Perl_croak(aTHX_ "AA at Max already.");
|
||||
|
||||
THIS->SetAA(aaskillid, THIS->GetAA(aaskillid)+1);
|
||||
|
||||
|
||||
THIS->Save();
|
||||
|
||||
THIS->SendAA(aaskillid);
|
||||
@@ -4942,7 +4942,7 @@ XS(XS_Client_GetAALevel)
|
||||
Perl_croak(aTHX_ "THIS is not of type Client");
|
||||
if(THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
|
||||
RETVAL = THIS->GetAA(aaskillid);
|
||||
XSprePUSH; PUSHu((UV)RETVAL);
|
||||
}
|
||||
@@ -5453,8 +5453,8 @@ XS(XS_Client_GetItemInInventory)
|
||||
Perl_croak(aTHX_ "Usage: Client::GetItemInInventory(THIS, slot_id)");
|
||||
{
|
||||
Client * THIS;
|
||||
int16 slot_id = (int16)SvIV(ST(1));
|
||||
ItemInst *RETVAL = nullptr;
|
||||
int16 slot_id = (int16)SvIV(ST(1));
|
||||
ItemInst *RETVAL = nullptr;
|
||||
|
||||
if (sv_derived_from(ST(0), "Client")) {
|
||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||
@@ -5465,8 +5465,8 @@ XS(XS_Client_GetItemInInventory)
|
||||
if(THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
RETVAL = THIS->GetInv().GetItem(slot_id);
|
||||
ST(0) = sv_newmortal();
|
||||
RETVAL = THIS->GetInv().GetItem(slot_id);
|
||||
ST(0) = sv_newmortal();
|
||||
sv_setref_pv(ST(0), "QuestItem", (void*)RETVAL);
|
||||
}
|
||||
XSRETURN(1);
|
||||
@@ -5480,9 +5480,9 @@ XS(XS_Client_SetCustomItemData)
|
||||
Perl_croak(aTHX_ "Usage: Client::SetCustomItemData(THIS, slot_id, identifier, value)");
|
||||
{
|
||||
Client * THIS;
|
||||
int16 slot_id = (int16)SvIV(ST(1));
|
||||
Const_char* identifier = SvPV_nolen(ST(2));
|
||||
Const_char* value = SvPV_nolen(ST(3));
|
||||
int16 slot_id = (int16)SvIV(ST(1));
|
||||
Const_char* identifier = SvPV_nolen(ST(2));
|
||||
Const_char* value = SvPV_nolen(ST(3));
|
||||
|
||||
if (sv_derived_from(ST(0), "Client")) {
|
||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||
@@ -5493,7 +5493,7 @@ XS(XS_Client_SetCustomItemData)
|
||||
if(THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
THIS->GetInv().SetCustomItemData(THIS->CharacterID(), slot_id, std::string(identifier), std::string(value));
|
||||
THIS->GetInv().SetCustomItemData(THIS->CharacterID(), slot_id, std::string(identifier), std::string(value));
|
||||
}
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
@@ -5506,9 +5506,9 @@ XS(XS_Client_GetCustomItemData)
|
||||
Perl_croak(aTHX_ "Usage: Client::GetCustomItemData(THIS, slot_id, identifier)");
|
||||
{
|
||||
Client * THIS;
|
||||
int16 slot_id = (int16)SvIV(ST(1));
|
||||
Const_char* identifier = SvPV_nolen(ST(2));
|
||||
Const_char * RETVAL;
|
||||
int16 slot_id = (int16)SvIV(ST(1));
|
||||
Const_char* identifier = SvPV_nolen(ST(2));
|
||||
Const_char * RETVAL;
|
||||
dXSTARG;
|
||||
|
||||
if (sv_derived_from(ST(0), "Client")) {
|
||||
@@ -5520,9 +5520,9 @@ XS(XS_Client_GetCustomItemData)
|
||||
if(THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
std::string ret_val = THIS->GetInv().GetCustomItemData(slot_id, std::string(identifier));
|
||||
RETVAL = ret_val.c_str();
|
||||
sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
|
||||
std::string ret_val = THIS->GetInv().GetCustomItemData(slot_id, std::string(identifier));
|
||||
RETVAL = ret_val.c_str();
|
||||
sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
|
||||
}
|
||||
XSRETURN(1);
|
||||
}
|
||||
@@ -5559,7 +5559,7 @@ XS(XS_Client_SignalClient)
|
||||
{
|
||||
Client * THIS;
|
||||
uint32 data = (uint32)SvUV(ST(1));
|
||||
|
||||
|
||||
if (sv_derived_from(ST(0), "Client")) {
|
||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||
THIS = INT2PTR(Client *,tmp);
|
||||
@@ -5584,7 +5584,7 @@ XS(XS_Client_AddAlternateCurrencyValue)
|
||||
Client * THIS;
|
||||
uint32 currency_id = (uint32)SvUV(ST(1));
|
||||
int32 amount = (int32)SvUV(ST(2));
|
||||
|
||||
|
||||
if (sv_derived_from(ST(0), "Client")) {
|
||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||
THIS = INT2PTR(Client *,tmp);
|
||||
@@ -5790,7 +5790,7 @@ XS(boot_Client)
|
||||
newXSproto(strcpy(buf, "GetWeight"), XS_Client_GetWeight, file, "$");
|
||||
newXSproto(strcpy(buf, "GetEXP"), XS_Client_GetEXP, file, "$");
|
||||
newXSproto(strcpy(buf, "GetAAExp"), XS_Client_GetAAExp, file, "$");
|
||||
newXSproto(strcpy(buf, "GetTotalSecondsPlayed"), XS_Client_GetTotalSecondsPlayed, file, "$");
|
||||
newXSproto(strcpy(buf, "GetTotalSecondsPlayed"), XS_Client_GetTotalSecondsPlayed, file, "$");
|
||||
newXSproto(strcpy(buf, "UpdateLDoNPoints"), XS_Client_UpdateLDoNPoints, file, "$$$");
|
||||
newXSproto(strcpy(buf, "SetDeity"), XS_Client_SetDeity, file, "$$");
|
||||
newXSproto(strcpy(buf, "AddEXP"), XS_Client_AddEXP, file, "$$;$$");
|
||||
|
||||
+16
-18
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* This file was generated automatically by xsubpp version 1.9508 from the
|
||||
* contents of tmp. Do not edit this file, edit tmp instead.
|
||||
*
|
||||
* ANY CHANGES MADE HERE WILL BE LOST!
|
||||
*
|
||||
*/
|
||||
* This file was generated automatically by xsubpp version 1.9508 from the
|
||||
* contents of tmp. Do not edit this file, edit tmp instead.
|
||||
*
|
||||
* ANY CHANGES MADE HERE WILL BE LOST!
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 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
|
||||
@@ -16,13 +16,13 @@
|
||||
|
||||
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.
|
||||
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
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "../common/features.h"
|
||||
@@ -36,8 +36,8 @@
|
||||
|
||||
#include "doors.h"
|
||||
|
||||
#ifdef THIS /* this macro seems to leak out on some systems */
|
||||
#undef THIS
|
||||
#ifdef THIS /* this macro seems to leak out on some systems */
|
||||
#undef THIS
|
||||
#endif
|
||||
|
||||
XS(XS_Doors_GetDoorDBID); /* prototype to pass -Wmissing-prototypes */
|
||||
@@ -730,15 +730,13 @@ XS(boot_Doors)
|
||||
char file[256];
|
||||
strncpy(file, __FILE__, 256);
|
||||
file[255] = 0;
|
||||
|
||||
|
||||
if(items != 1)
|
||||
fprintf(stderr, "boot_quest does not take any arguments.");
|
||||
char buf[128];
|
||||
|
||||
//add the strcpy stuff to get rid of const warnings....
|
||||
|
||||
|
||||
|
||||
XS_VERSION_BOOTCHECK ;
|
||||
newXSproto(strcpy(buf, "GetID"),XS_Doors_GetID, file, "$");
|
||||
newXSproto(strcpy(buf, "SetModelName"),XS_Doors_SetModelName, file, "$$");
|
||||
@@ -751,7 +749,7 @@ XS(boot_Doors)
|
||||
newXSproto(strcpy(buf, "SetY"),XS_Doors_SetY, file, "$$");
|
||||
newXSproto(strcpy(buf, "SetZ"),XS_Doors_SetZ, file, "$$");
|
||||
newXSproto(strcpy(buf, "SetHeading"),XS_Doors_SetHeading, file, "$$");
|
||||
newXSproto(strcpy(buf, "SetLocation"),XS_Doors_SetLocation, file, "$$$$");
|
||||
newXSproto(strcpy(buf, "SetLocation"),XS_Doors_SetLocation, file, "$$$$");
|
||||
newXSproto(strcpy(buf, "GetDoorDBID"),XS_Doors_GetDoorDBID, file, "$");
|
||||
newXSproto(strcpy(buf, "GetDoorID"),XS_Doors_GetDoorID, file, "$");
|
||||
newXSproto(strcpy(buf, "SetSize"),XS_Doors_SetSize, file, "$$");
|
||||
|
||||
+15
-15
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* This file was generated automatically by xsubpp version 1.9508 from the
|
||||
* contents of tmp. Do not edit this file, edit tmp instead.
|
||||
*
|
||||
* ANY CHANGES MADE HERE WILL BE LOST!
|
||||
*
|
||||
*/
|
||||
* This file was generated automatically by xsubpp version 1.9508 from the
|
||||
* contents of tmp. Do not edit this file, edit tmp instead.
|
||||
*
|
||||
* ANY CHANGES MADE HERE WILL BE LOST!
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 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
|
||||
@@ -16,13 +16,13 @@
|
||||
|
||||
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.
|
||||
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
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "../common/features.h"
|
||||
@@ -37,8 +37,8 @@
|
||||
|
||||
#include "entity.h"
|
||||
|
||||
#ifdef THIS /* this macro seems to leak out on some systems */
|
||||
#undef THIS
|
||||
#ifdef THIS /* this macro seems to leak out on some systems */
|
||||
#undef THIS
|
||||
#endif
|
||||
|
||||
|
||||
@@ -2112,7 +2112,7 @@ XS(boot_EntityList)
|
||||
char file[256];
|
||||
strncpy(file, __FILE__, 256);
|
||||
file[255] = 0;
|
||||
|
||||
|
||||
if(items != 1)
|
||||
fprintf(stderr, "boot_quest does not take any arguments.");
|
||||
char buf[128];
|
||||
|
||||
+17
-19
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* This file was generated automatically by xsubpp version 1.9508 from the
|
||||
* contents of tmp. Do not edit this file, edit tmp instead.
|
||||
*
|
||||
* ANY CHANGES MADE HERE WILL BE LOST!
|
||||
*
|
||||
*/
|
||||
* This file was generated automatically by xsubpp version 1.9508 from the
|
||||
* contents of tmp. Do not edit this file, edit tmp instead.
|
||||
*
|
||||
* ANY CHANGES MADE HERE WILL BE LOST!
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 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
|
||||
@@ -16,13 +16,13 @@
|
||||
|
||||
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.
|
||||
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
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "../common/features.h"
|
||||
@@ -36,8 +36,8 @@
|
||||
|
||||
#include "groups.h"
|
||||
|
||||
#ifdef THIS /* this macro seems to leak out on some systems */
|
||||
#undef THIS
|
||||
#ifdef THIS /* this macro seems to leak out on some systems */
|
||||
#undef THIS
|
||||
#endif
|
||||
|
||||
|
||||
@@ -580,7 +580,7 @@ XS(XS_Group_GetID)
|
||||
}
|
||||
|
||||
XS(XS_Group_GetMember);
|
||||
XS(XS_Group_GetMember)
|
||||
XS(XS_Group_GetMember)
|
||||
{
|
||||
dXSARGS;
|
||||
if (items != 2)
|
||||
@@ -601,7 +601,7 @@ XS(XS_Group_GetMember)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
int index = (int)SvUV(ST(1));
|
||||
if (index < 0 || index > 5)
|
||||
if (index < 0 || index > 5)
|
||||
RETVAL = nullptr;
|
||||
else {
|
||||
member = THIS->members[index];
|
||||
@@ -625,15 +625,13 @@ XS(boot_Group)
|
||||
char file[256];
|
||||
strncpy(file, __FILE__, 256);
|
||||
file[255] = 0;
|
||||
|
||||
|
||||
if(items != 1)
|
||||
fprintf(stderr, "boot_quest does not take any arguments.");
|
||||
char buf[128];
|
||||
|
||||
//add the strcpy stuff to get rid of const warnings....
|
||||
|
||||
|
||||
|
||||
XS_VERSION_BOOTCHECK ;
|
||||
|
||||
newXSproto(strcpy(buf, "DisbandGroup"), XS_Group_DisbandGroup, file, "$");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2009 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2009 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
|
||||
@@ -9,11 +9,11 @@
|
||||
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.
|
||||
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
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "../common/features.h"
|
||||
@@ -116,7 +116,7 @@ extern "C"
|
||||
#endif
|
||||
|
||||
XS(boot_HateEntry);
|
||||
XS(boot_HateEntry)
|
||||
XS(boot_HateEntry)
|
||||
{
|
||||
dXSARGS;
|
||||
char file[256];
|
||||
@@ -139,3 +139,4 @@ XS(boot_HateEntry)
|
||||
}
|
||||
|
||||
#endif //EMBPERL_XS_CLASSES
|
||||
|
||||
|
||||
+38
-40
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* This file was generated automatically by xsubpp version 1.9508 from the
|
||||
* contents of tmp. Do not edit this file, edit tmp instead.
|
||||
*
|
||||
* ANY CHANGES MADE HERE WILL BE LOST!
|
||||
*
|
||||
*/
|
||||
* This file was generated automatically by xsubpp version 1.9508 from the
|
||||
* contents of tmp. Do not edit this file, edit tmp instead.
|
||||
*
|
||||
* ANY CHANGES MADE HERE WILL BE LOST!
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 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
|
||||
@@ -18,11 +18,11 @@
|
||||
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.
|
||||
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
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "../common/features.h"
|
||||
@@ -40,8 +40,8 @@ typedef const char Const_char;
|
||||
#include "client.h"
|
||||
#include "../common/spdat.h"
|
||||
|
||||
#ifdef THIS /* this macro seems to leak out on some systems */
|
||||
#undef THIS
|
||||
#ifdef THIS /* this macro seems to leak out on some systems */
|
||||
#undef THIS
|
||||
#endif
|
||||
|
||||
|
||||
@@ -5872,9 +5872,9 @@ XS(XS_Mob_NPCSpecialAttacks)
|
||||
{
|
||||
Mob * THIS;
|
||||
char* parse = (char *)SvPV_nolen(ST(1));
|
||||
int permtag = (int)SvIV(ST(2));
|
||||
bool reset = items == 4 ? (bool)SvTRUE(ST(3)) : true;
|
||||
bool remove = items == 5 ? (bool)SvTRUE(ST(4)) : false;
|
||||
int permtag = (int)SvIV(ST(2));
|
||||
bool reset = items == 4 ? (bool)SvTRUE(ST(3)) : true;
|
||||
bool remove = items == 5 ? (bool)SvTRUE(ST(4)) : false;
|
||||
|
||||
if (sv_derived_from(ST(0), "Mob")) {
|
||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||
@@ -6571,7 +6571,7 @@ XS(XS_Mob_SignalClient)
|
||||
Mob * THIS;
|
||||
Client* client = nullptr;
|
||||
uint32 data = (uint32)SvUV(ST(2));
|
||||
|
||||
|
||||
if (sv_derived_from(ST(0), "Mob")) {
|
||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||
THIS = INT2PTR(Mob *,tmp);
|
||||
@@ -6792,7 +6792,7 @@ XS(XS_Mob_ProjectileAnim)
|
||||
{
|
||||
dXSARGS;
|
||||
if (items < 3 || items > 8)
|
||||
Perl_croak(aTHX_ "Usage: Mob::ProjectileAnim(THIS, mob, item_id, IsArrow?, speed, angle, tilt, arc)");
|
||||
Perl_croak(aTHX_ "Usage: Mob::ProjectileAnim(THIS, mob, item_id, IsArrow?, speed, angle, tilt, arc)");
|
||||
|
||||
{
|
||||
Mob * THIS;
|
||||
@@ -6926,7 +6926,7 @@ XS(XS_Mob_QuestReward)
|
||||
Client* client = nullptr;
|
||||
int32 silver = 0;
|
||||
int32 gold = 0;
|
||||
int32 platinum = 0;
|
||||
int32 platinum = 0;
|
||||
|
||||
if (sv_derived_from(ST(0), "Mob")) {
|
||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||
@@ -7162,7 +7162,7 @@ XS(XS_Mob_SpellEffect)
|
||||
uint32 unk20 = 3000;
|
||||
bool perm_effect = false;
|
||||
Client* client = nullptr;
|
||||
|
||||
|
||||
|
||||
if (sv_derived_from(ST(0), "Mob")) {
|
||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||
@@ -7188,7 +7188,7 @@ XS(XS_Mob_SpellEffect)
|
||||
if(client == nullptr)
|
||||
Perl_croak(aTHX_ "client is nullptr, avoiding crash.");
|
||||
}
|
||||
|
||||
|
||||
|
||||
THIS->SendSpellEffect(effect, duration, finish_delay, zone_wide, unk20, perm_effect, client);
|
||||
}
|
||||
@@ -7407,7 +7407,7 @@ XS(XS_Mob_DoKnockback)
|
||||
Perl_croak(aTHX_ "Usage: Mob::DoKnockback(THIS, caster, pushback, pushup)");
|
||||
{
|
||||
Mob * THIS;
|
||||
Mob * caster;
|
||||
Mob * caster;
|
||||
uint32 pushback = (uint16)SvUV(ST(2));
|
||||
uint32 pushup = (uint16)SvUV(ST(2));
|
||||
|
||||
@@ -7477,7 +7477,7 @@ XS(XS_Mob_SetRunning)
|
||||
if(THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
THIS->SetRunning(value);
|
||||
THIS->SetRunning(value);
|
||||
}
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
@@ -7502,7 +7502,7 @@ XS(XS_Mob_IsRunning)
|
||||
if(THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
RETVAL = THIS->IsRunning();
|
||||
RETVAL = THIS->IsRunning();
|
||||
ST(0) = boolSV(RETVAL);
|
||||
sv_2mortal(ST(0));
|
||||
}
|
||||
@@ -7518,7 +7518,7 @@ XS(XS_Mob_SetBodyType)
|
||||
{
|
||||
Mob * THIS;
|
||||
int32 type = (int32)SvIV(ST(1));
|
||||
bool overwrite_orig = false;
|
||||
bool overwrite_orig = false;
|
||||
|
||||
if (sv_derived_from(ST(0), "Mob")) {
|
||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||
@@ -7529,11 +7529,11 @@ XS(XS_Mob_SetBodyType)
|
||||
if(THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
if(items == 3) {
|
||||
overwrite_orig = (bool)SvTRUE(ST(2));
|
||||
}
|
||||
if(items == 3) {
|
||||
overwrite_orig = (bool)SvTRUE(ST(2));
|
||||
}
|
||||
|
||||
THIS->SetBodyType((bodyType)type, overwrite_orig);
|
||||
THIS->SetBodyType((bodyType)type, overwrite_orig);
|
||||
}
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
@@ -7584,7 +7584,7 @@ XS(XS_Mob_SetLD)
|
||||
if(THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
THIS->SendAppearancePacket(AT_Linkdead, value);
|
||||
THIS->SendAppearancePacket(AT_Linkdead, value);
|
||||
}
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
@@ -7735,7 +7735,7 @@ XS(XS_Mob_SetAllowBeneficial)
|
||||
if(THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
THIS->SetAllowBeneficial(value);
|
||||
THIS->SetAllowBeneficial(value);
|
||||
}
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
@@ -7811,7 +7811,7 @@ XS(XS_Mob_ModVulnerability)
|
||||
Perl_croak(aTHX_ "Usage: Mob::ModVulnerability(THIS, resist, value)");
|
||||
{
|
||||
Mob * THIS;
|
||||
uint8 resist = (uint8)SvIV(ST(1));
|
||||
uint8 resist = (uint8)SvIV(ST(1));
|
||||
int16 value = (int16)SvIV(ST(2));
|
||||
|
||||
if (sv_derived_from(ST(0), "Mob")) {
|
||||
@@ -7902,8 +7902,8 @@ XS(XS_Mob_DoArcheryAttackDmg)
|
||||
{
|
||||
Mob * THIS;
|
||||
Mob* target;
|
||||
ItemInst* RangeWeapon = nullptr;
|
||||
ItemInst* Ammo = nullptr;
|
||||
ItemInst* RangeWeapon = nullptr;
|
||||
ItemInst* Ammo = nullptr;
|
||||
uint16 weapon_damage = (uint16)SvIV(ST(4));
|
||||
int16 chance_mod = (int16)SvIV(ST(5));
|
||||
int16 focus = (int16)SvIV(ST(6));
|
||||
@@ -7940,7 +7940,7 @@ XS(XS_Mob_DoThrowingAttackDmg)
|
||||
{
|
||||
Mob * THIS;
|
||||
Mob* target;
|
||||
ItemInst* RangeWeapon = nullptr;
|
||||
ItemInst* RangeWeapon = nullptr;
|
||||
Item_Struct* item = nullptr;
|
||||
uint16 weapon_damage = (uint16)SvIV(ST(4));
|
||||
int16 chance_mod = (int16)SvIV(ST(5));
|
||||
@@ -7988,7 +7988,7 @@ XS(XS_Mob_SetDisableMelee)
|
||||
if(THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
THIS->SetDisableMelee(value);
|
||||
THIS->SetDisableMelee(value);
|
||||
}
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
@@ -8079,15 +8079,13 @@ XS(boot_Mob)
|
||||
char file[256];
|
||||
strncpy(file, __FILE__, 256);
|
||||
file[255] = 0;
|
||||
|
||||
|
||||
if(items != 1)
|
||||
fprintf(stderr, "boot_quest does not take any arguments.");
|
||||
char buf[128];
|
||||
|
||||
//add the strcpy stuff to get rid of const warnings....
|
||||
|
||||
|
||||
|
||||
XS_VERSION_BOOTCHECK ;
|
||||
|
||||
newXSproto(strcpy(buf, "IsClient"), XS_Mob_IsClient, file, "$");
|
||||
@@ -8351,7 +8349,7 @@ XS(boot_Mob)
|
||||
newXSproto(strcpy(buf, "SetDeltas"), XS_Mob_SetDeltas, file, "$$$$$");
|
||||
newXSproto(strcpy(buf, "SetLD"), XS_Mob_SetLD, file, "$$");
|
||||
newXSproto(strcpy(buf, "SetTargetDestSteps"), XS_Mob_SetTargetDestSteps, file, "$$");
|
||||
newXSproto(strcpy(buf, "SetTargetable"), XS_Mob_SetTargetable, file, "$$");
|
||||
newXSproto(strcpy(buf, "SetTargetable"), XS_Mob_SetTargetable, file, "$$");
|
||||
newXSproto(strcpy(buf, "MakeTempPet"), XS_Mob_MakeTempPet, file, "$$;$$$$");
|
||||
newXSproto(strcpy(buf, "ModSkillDmgTaken"), XS_Mob_ModSkillDmgTaken, file, "$$$");
|
||||
newXSproto(strcpy(buf, "GetModSkillDmgTaken"), XS_Mob_GetModSkillDmgTaken, file, "$$");
|
||||
@@ -8368,7 +8366,7 @@ XS(boot_Mob)
|
||||
newXSproto(strcpy(buf, "IsMeleeDisabled"), XS_Mob_IsMeleeDisabled, file, "$$");
|
||||
newXSproto(strcpy(buf, "SetFlurryChance"), XS_Mob_SetFlurryChance, file, "$$");
|
||||
newXSproto(strcpy(buf, "GetFlurryChance"), XS_Mob_GetFlurryChance, file, "$");
|
||||
|
||||
|
||||
XSRETURN_YES;
|
||||
}
|
||||
|
||||
|
||||
+17
-19
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* This file was generated automatically by xsubpp version 1.9508 from the
|
||||
* contents of tmp. Do not edit this file, edit tmp instead.
|
||||
*
|
||||
* ANY CHANGES MADE HERE WILL BE LOST!
|
||||
*
|
||||
*/
|
||||
* This file was generated automatically by xsubpp version 1.9508 from the
|
||||
* contents of tmp. Do not edit this file, edit tmp instead.
|
||||
*
|
||||
* ANY CHANGES MADE HERE WILL BE LOST!
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 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
|
||||
@@ -16,13 +16,13 @@
|
||||
|
||||
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.
|
||||
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
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "../common/features.h"
|
||||
@@ -38,8 +38,8 @@ typedef const char Const_char;
|
||||
|
||||
#include "npc.h"
|
||||
|
||||
#ifdef THIS /* this macro seems to leak out on some systems */
|
||||
#undef THIS
|
||||
#ifdef THIS /* this macro seems to leak out on some systems */
|
||||
#undef THIS
|
||||
#endif
|
||||
|
||||
|
||||
@@ -852,8 +852,8 @@ XS(XS_NPC_GetMinDMG)
|
||||
if (items != 1)
|
||||
Perl_croak(aTHX_ "Usage: NPC::GetMinDMG(THIS)");
|
||||
{
|
||||
NPC * THIS;
|
||||
uint32 RETVAL;
|
||||
NPC * THIS;
|
||||
uint32 RETVAL;
|
||||
dXSTARG;
|
||||
|
||||
if (sv_derived_from(ST(0), "NPC")) {
|
||||
@@ -2147,15 +2147,13 @@ XS(boot_NPC)
|
||||
char file[256];
|
||||
strncpy(file, __FILE__, 256);
|
||||
file[255] = 0;
|
||||
|
||||
|
||||
if(items != 1)
|
||||
fprintf(stderr, "boot_quest does not take any arguments.");
|
||||
char buf[128];
|
||||
|
||||
//add the strcpy stuff to get rid of const warnings....
|
||||
|
||||
|
||||
|
||||
XS_VERSION_BOOTCHECK ;
|
||||
|
||||
newXSproto(strcpy(buf, "SignalNPC"), XS_NPC_SignalNPC, file, "$$");
|
||||
|
||||
+13
-15
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* This file was generated automatically by xsubpp version 1.9508 from the
|
||||
* contents of tmp. Do not edit this file, edit tmp instead.
|
||||
*
|
||||
* ANY CHANGES MADE HERE WILL BE LOST!
|
||||
*
|
||||
*/
|
||||
* This file was generated automatically by xsubpp version 1.9508 from the
|
||||
* contents of tmp. Do not edit this file, edit tmp instead.
|
||||
*
|
||||
* ANY CHANGES MADE HERE WILL BE LOST!
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 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
|
||||
@@ -18,11 +18,11 @@
|
||||
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.
|
||||
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
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "../common/features.h"
|
||||
@@ -36,8 +36,8 @@
|
||||
|
||||
#include "object.h"
|
||||
|
||||
#ifdef THIS /* this macro seems to leak out on some systems */
|
||||
#undef THIS
|
||||
#ifdef THIS /* this macro seems to leak out on some systems */
|
||||
#undef THIS
|
||||
#endif
|
||||
|
||||
XS(XS_Object_IsGroundSpawn); /* prototype to pass -Wmissing-prototypes */
|
||||
@@ -920,15 +920,13 @@ XS(boot_Object)
|
||||
char file[256];
|
||||
strncpy(file, __FILE__, 256);
|
||||
file[255] = 0;
|
||||
|
||||
|
||||
if(items != 1)
|
||||
fprintf(stderr, "boot_quest does not take any arguments.");
|
||||
char buf[128];
|
||||
|
||||
//add the strcpy stuff to get rid of const warnings....
|
||||
|
||||
|
||||
|
||||
XS_VERSION_BOOTCHECK ;
|
||||
newXSproto(strcpy(buf, "Depop"),XS_Object_Depop, file, "$");
|
||||
newXSproto(strcpy(buf, "Repop"),XS_Object_Repop, file, "$");
|
||||
|
||||
+18
-18
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* This file was generated automatically by xsubpp version 1.9508 from the
|
||||
* contents of tmp. Do not edit this file, edit tmp instead.
|
||||
*
|
||||
* ANY CHANGES MADE HERE WILL BE LOST!
|
||||
*
|
||||
*/
|
||||
* This file was generated automatically by xsubpp version 1.9508 from the
|
||||
* contents of tmp. Do not edit this file, edit tmp instead.
|
||||
*
|
||||
* ANY CHANGES MADE HERE WILL BE LOST!
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 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
|
||||
@@ -16,13 +16,13 @@
|
||||
|
||||
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.
|
||||
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
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "../common/features.h"
|
||||
@@ -36,8 +36,8 @@
|
||||
|
||||
#include "perlpacket.h"
|
||||
|
||||
#ifdef THIS /* this macro seems to leak out on some systems */
|
||||
#undef THIS
|
||||
#ifdef THIS /* this macro seems to leak out on some systems */
|
||||
#undef THIS
|
||||
#endif
|
||||
|
||||
XS(XS_PerlPacket_new); /* prototype to pass -Wmissing-prototypes */
|
||||
@@ -47,9 +47,9 @@ XS(XS_PerlPacket_new)
|
||||
if (items < 1 || items > 3)
|
||||
Perl_croak(aTHX_ "Usage: PerlPacket::new(CLASS, opcode= \"OP_Unknown\", len= 0)");
|
||||
{
|
||||
char *CLASS = (char *)SvPV_nolen(ST(0));
|
||||
PerlPacket *RETVAL;
|
||||
const char *opcode;
|
||||
char *CLASS = (char *)SvPV_nolen(ST(0));
|
||||
PerlPacket *RETVAL;
|
||||
const char *opcode;
|
||||
uint32 len;
|
||||
|
||||
if (items < 2)
|
||||
@@ -561,7 +561,7 @@ XS(boot_PerlPacket)
|
||||
char file[256];
|
||||
strncpy(file, __FILE__, 256);
|
||||
file[255] = 0;
|
||||
|
||||
|
||||
if(items != 1)
|
||||
fprintf(stderr, "boot_quest does not take any arguments.");
|
||||
char buf[128];
|
||||
|
||||
+16
-16
@@ -1,5 +1,5 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 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
|
||||
@@ -7,13 +7,13 @@
|
||||
|
||||
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.
|
||||
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
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "../common/features.h"
|
||||
@@ -58,7 +58,7 @@ XS(XS_QuestItem_GetName) {
|
||||
}
|
||||
|
||||
XS(XS_QuestItem_SetScale);
|
||||
XS(XS_QuestItem_SetScale)
|
||||
XS(XS_QuestItem_SetScale)
|
||||
{
|
||||
dXSARGS;
|
||||
if (items != 2)
|
||||
@@ -66,7 +66,7 @@ XS(XS_QuestItem_SetScale)
|
||||
{
|
||||
ItemInst * THIS;
|
||||
float Mult;
|
||||
|
||||
|
||||
if (sv_derived_from(ST(0), "QuestItem")) {
|
||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||
THIS = INT2PTR(ItemInst *,tmp);
|
||||
@@ -86,7 +86,7 @@ XS(XS_QuestItem_SetScale)
|
||||
}
|
||||
|
||||
XS(XS_QuestItem_ItemSay);
|
||||
XS(XS_QuestItem_ItemSay)
|
||||
XS(XS_QuestItem_ItemSay)
|
||||
{
|
||||
dXSARGS;
|
||||
if (items != 2 && items != 3)
|
||||
@@ -201,7 +201,7 @@ XS(XS_QuestItem_GetAugment)
|
||||
Perl_croak(aTHX_ "Usage: QuestItem::GetAugment(THIS, augment_id)");
|
||||
{
|
||||
ItemInst* THIS;
|
||||
int16 slot_id = (int16)SvIV(ST(1));
|
||||
int16 slot_id = (int16)SvIV(ST(1));
|
||||
ItemInst* RETVAL;
|
||||
|
||||
if (sv_derived_from(ST(0), "QuestItem")) {
|
||||
@@ -213,8 +213,8 @@ XS(XS_QuestItem_GetAugment)
|
||||
if(THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
RETVAL = THIS->GetAugment(slot_id);
|
||||
ST(0) = sv_newmortal();
|
||||
RETVAL = THIS->GetAugment(slot_id);
|
||||
ST(0) = sv_newmortal();
|
||||
sv_setref_pv(ST(0), "QuestItem", (void*)RETVAL);
|
||||
}
|
||||
XSRETURN(1);
|
||||
@@ -240,7 +240,7 @@ XS(XS_QuestItem_GetID)
|
||||
if(THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
RETVAL = THIS->GetItem()->ID;
|
||||
RETVAL = THIS->GetItem()->ID;
|
||||
XSprePUSH; PUSHi((IV)RETVAL);
|
||||
}
|
||||
XSRETURN(1);
|
||||
@@ -251,7 +251,7 @@ extern "C"
|
||||
#endif
|
||||
|
||||
XS(boot_QuestItem);
|
||||
XS(boot_QuestItem)
|
||||
XS(boot_QuestItem)
|
||||
{
|
||||
dXSARGS;
|
||||
char file[256];
|
||||
@@ -272,8 +272,8 @@ XS(boot_QuestItem)
|
||||
newXSproto(strcpy(buf, "IsType"), XS_QuestItem_IsType, file, "$$");
|
||||
newXSproto(strcpy(buf, "IsAttuned"), XS_QuestItem_IsAttuned, file, "$");
|
||||
newXSproto(strcpy(buf, "GetCharges"), XS_QuestItem_GetCharges, file, "$");
|
||||
newXSproto(strcpy(buf, "GetAugment"), XS_QuestItem_GetAugment, file, "$$");
|
||||
newXSproto(strcpy(buf, "GetID"), XS_QuestItem_GetID, file, "$");
|
||||
newXSproto(strcpy(buf, "GetAugment"), XS_QuestItem_GetAugment, file, "$$");
|
||||
newXSproto(strcpy(buf, "GetID"), XS_QuestItem_GetID, file, "$");
|
||||
|
||||
XSRETURN_YES;
|
||||
}
|
||||
|
||||
+17
-19
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* This file was generated automatically by ExtUtils::ParseXS version 2.18 from the
|
||||
* contents of raids.h.xs. Do not edit this file, edit raids.h.xs instead.
|
||||
*
|
||||
* ANY CHANGES MADE HERE WILL BE LOST!
|
||||
*
|
||||
*/
|
||||
* This file was generated automatically by ExtUtils::ParseXS version 2.18 from the
|
||||
* contents of raids.h.xs. Do not edit this file, edit raids.h.xs instead.
|
||||
*
|
||||
* ANY CHANGES MADE HERE WILL BE LOST!
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 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
|
||||
@@ -16,13 +16,13 @@
|
||||
|
||||
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.
|
||||
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
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "../common/features.h"
|
||||
@@ -37,8 +37,8 @@
|
||||
#include "raids.h"
|
||||
#include "client.h"
|
||||
|
||||
#ifdef THIS /* this macro seems to leak out on some systems */
|
||||
#undef THIS
|
||||
#ifdef THIS /* this macro seems to leak out on some systems */
|
||||
#undef THIS
|
||||
#endif
|
||||
|
||||
|
||||
@@ -543,7 +543,7 @@ XS(XS_Raid_GetID)
|
||||
}
|
||||
|
||||
XS(XS_Raid_GetMember);
|
||||
XS(XS_Raid_GetMember)
|
||||
XS(XS_Raid_GetMember)
|
||||
{
|
||||
dXSARGS;
|
||||
if (items != 2)
|
||||
@@ -563,7 +563,7 @@ XS(XS_Raid_GetMember)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
int index = (int)SvUV(ST(1));
|
||||
if (index < 0 || index > 71)
|
||||
if (index < 0 || index > 71)
|
||||
RETVAL = nullptr;
|
||||
else {
|
||||
if(THIS->members[index].member != nullptr)
|
||||
@@ -586,15 +586,13 @@ XS(boot_Raid)
|
||||
char file[256];
|
||||
strncpy(file, __FILE__, 256);
|
||||
file[255] = 0;
|
||||
|
||||
|
||||
if(items != 1)
|
||||
fprintf(stderr, "boot_quest does not take any arguments.");
|
||||
char buf[128];
|
||||
|
||||
//add the strcpy stuff to get rid of const warnings....
|
||||
|
||||
|
||||
|
||||
XS_VERSION_BOOTCHECK ;
|
||||
|
||||
newXSproto(strcpy(buf, "IsRaidMember"), XS_Raid_IsRaidMember, file, "$$");
|
||||
|
||||
+18
-22
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2005 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2005 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 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
|
||||
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.
|
||||
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
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "../common/debug.h"
|
||||
#include <stdlib.h>
|
||||
@@ -61,21 +61,21 @@ void PerlPacket::Resize(uint32 length) {
|
||||
void PerlPacket::SendTo(Client *who) {
|
||||
if(!who || op == OP_Unknown || (len > 0 && packet == nullptr))
|
||||
return;
|
||||
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(op, len);
|
||||
if(len > 0)
|
||||
memcpy(outapp->pBuffer, packet, len);
|
||||
|
||||
|
||||
// printf("Created this packet with PerlPacket: OP: %s\n", ZoneOpcodeManager->EmuToName(op));
|
||||
DumpPacket(outapp);
|
||||
|
||||
|
||||
who->FastQueuePacket(&outapp);
|
||||
}
|
||||
|
||||
void PerlPacket::SendToAll() {
|
||||
if(op == OP_Unknown || (len > 0 && packet == nullptr))
|
||||
return;
|
||||
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(op, len);
|
||||
if(len > 0)
|
||||
memcpy(outapp->pBuffer, packet, len);
|
||||
@@ -137,12 +137,10 @@ void PerlPacket::SetString(uint32 pos, char *str) {
|
||||
|
||||
#pragma pack(1)
|
||||
struct EQ1319 {
|
||||
int32 part13:13,
|
||||
part19:19;
|
||||
int32 part13:13, part19:19;
|
||||
};
|
||||
struct EQ1913 {
|
||||
int32 part19:19,
|
||||
part13:13;
|
||||
int32 part19:19, part13:13;
|
||||
};
|
||||
#pragma pack()
|
||||
|
||||
@@ -161,7 +159,7 @@ void PerlPacket::SetEQ1913(uint32 pos, float part19, float part13) {
|
||||
p->part19 = FloatToEQ19(part19);
|
||||
p->part13 = FloatToEQ13(part13);
|
||||
}
|
||||
|
||||
|
||||
//reading
|
||||
uint8 PerlPacket::GetByte(uint32 pos) {
|
||||
if(pos + sizeof(uint8) > len || packet == nullptr)
|
||||
@@ -191,5 +189,3 @@ float PerlPacket::GetFloat(uint32 pos) {
|
||||
return(*p);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+17
-20
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2005 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2005 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 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
|
||||
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.
|
||||
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
|
||||
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 PERLPACKET_H
|
||||
#define PERLPACKET_H
|
||||
@@ -30,14 +30,14 @@ class PerlPacket {
|
||||
public:
|
||||
PerlPacket(const char *opcode = "OP_Unknown", uint32 len = 0);
|
||||
~PerlPacket();
|
||||
|
||||
|
||||
bool SetOpcode(const char *opcode);
|
||||
void Resize(uint32 len);
|
||||
|
||||
|
||||
//sending functions
|
||||
void SendTo(Client *who);
|
||||
void SendToAll();
|
||||
|
||||
|
||||
//editing
|
||||
void Zero();
|
||||
void FromArray(int numbers[], uint32 length);
|
||||
@@ -46,23 +46,20 @@ public:
|
||||
void SetLong(uint32 pos, uint32 val);
|
||||
void SetFloat(uint32 pos, float val);
|
||||
void SetString(uint32 pos, char *str);
|
||||
|
||||
|
||||
void SetEQ1319(uint32 pos, float part13, float part19);
|
||||
void SetEQ1913(uint32 pos, float part19, float part13);
|
||||
|
||||
|
||||
//reading
|
||||
uint8 GetByte(uint32 pos);
|
||||
uint16 GetShort(uint32 pos);
|
||||
uint32 GetLong(uint32 pos);
|
||||
float GetFloat(uint32 pos);
|
||||
|
||||
|
||||
protected:
|
||||
EmuOpcode op;
|
||||
uint32 len;
|
||||
unsigned char *packet;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.org)
|
||||
|
||||
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
|
||||
*/
|
||||
|
||||
//extends the perl parser to use C methods
|
||||
//instead of the command queue.
|
||||
|
||||
#ifndef PERLPARSER_H
|
||||
#define PERLPARSER_H
|
||||
|
||||
#ifdef EMBPERL
|
||||
#ifdef EMBPERL_XS
|
||||
|
||||
#include "embparser.h"
|
||||
|
||||
class PerlXSParser : public PerlembParser {
|
||||
public:
|
||||
PerlXSParser();
|
||||
// ~PerlXSParser();
|
||||
|
||||
virtual void SendCommands(const char * pkgprefix, const char *event, uint32 npcid, Mob* other, Mob* mob, ItemInst* iteminst);
|
||||
protected:
|
||||
void map_funs();
|
||||
|
||||
SV *_empty_sv;
|
||||
};
|
||||
|
||||
|
||||
#endif //EMBPERL_XS
|
||||
#endif //EMBPERL
|
||||
|
||||
#endif //PERLPARSER_H
|
||||
+53
-53
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
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
|
||||
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
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "../common/debug.h"
|
||||
#include <stdlib.h>
|
||||
@@ -77,7 +77,7 @@ void Petition::SendPetitionToPlayer(Client* clientto) {
|
||||
return;
|
||||
}
|
||||
|
||||
Petition::Petition(uint32 id)
|
||||
Petition::Petition(uint32 id)
|
||||
{
|
||||
petid = id;
|
||||
charclass = 0;
|
||||
@@ -93,56 +93,56 @@ Petition::Petition(uint32 id)
|
||||
memset(lastgm, 0, sizeof(lastgm));
|
||||
memset(petitiontext, 0, sizeof(petitiontext));
|
||||
memset(gmtext, 0, sizeof(gmtext));
|
||||
|
||||
|
||||
//memset(this->zone, 0, sizeof(this->zone));
|
||||
zone = 1;
|
||||
}
|
||||
Petition* PetitionList::GetPetitionByID(uint32 id_in) {
|
||||
LinkedListIterator<Petition*> iterator(list);
|
||||
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements()) {
|
||||
if (iterator.GetData()->GetID() == id_in)
|
||||
Petition* PetitionList::GetPetitionByID(uint32 id_in) {
|
||||
LinkedListIterator<Petition*> iterator(list);
|
||||
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements()) {
|
||||
if (iterator.GetData()->GetID() == id_in)
|
||||
return iterator.GetData();
|
||||
iterator.Advance();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
iterator.Advance();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
uint32 PetitionList::GetTotalPetitions(){
|
||||
LinkedListIterator<Petition*> iterator(list);
|
||||
iterator.Reset();
|
||||
uint32 total=0;
|
||||
while(iterator.MoreElements()) {
|
||||
while(iterator.MoreElements()) {
|
||||
total++;
|
||||
iterator.Advance();
|
||||
iterator.Advance();
|
||||
}
|
||||
return total;
|
||||
return total;
|
||||
}
|
||||
bool PetitionList::FindPetitionByAccountName(const char* acctname) {
|
||||
LinkedListIterator<Petition*> iterator(list);
|
||||
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements()) {
|
||||
if (!strcmp(acctname,iterator.GetData()->GetAccountName()))
|
||||
LinkedListIterator<Petition*> iterator(list);
|
||||
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements()) {
|
||||
if (!strcmp(acctname,iterator.GetData()->GetAccountName()))
|
||||
return true;
|
||||
iterator.Advance();
|
||||
}
|
||||
return false;
|
||||
iterator.Advance();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool PetitionList::DeletePetitionByCharName(const char* charname) {
|
||||
LinkedListIterator<Petition*> iterator(list);
|
||||
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements()) {
|
||||
LinkedListIterator<Petition*> iterator(list);
|
||||
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements()) {
|
||||
if (!strcmp(charname,iterator.GetData()->GetCharName())) {
|
||||
if(DeletePetition(iterator.GetData()->GetID())==0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
iterator.Advance();
|
||||
}
|
||||
return false;
|
||||
iterator.Advance();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
void PetitionList::UpdateZoneListQueue() {
|
||||
ServerPacket* pack = new ServerPacket(ServerOP_Petition, sizeof(ServerPetitionUpdate_Struct));
|
||||
@@ -219,7 +219,7 @@ void PetitionList::UpdatePetition(Petition* pet) {
|
||||
|
||||
void ZoneDatabase::DeletePetitionFromDB(Petition* wpet) {
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
char *query = 0;
|
||||
uint32 affected_rows = 0;
|
||||
uint8 checkedout = 0;
|
||||
if (wpet->CheckedOut()) checkedout = 0;
|
||||
@@ -228,13 +228,13 @@ void ZoneDatabase::DeletePetitionFromDB(Petition* wpet) {
|
||||
LogFile->write(EQEMuLog::Error, "Error in DeletePetitionFromDB query '%s': %s", query, errbuf);
|
||||
}
|
||||
safe_delete_array(query);
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void ZoneDatabase::UpdatePetitionToDB(Petition* wpet) {
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
char *query = 0;
|
||||
uint32 affected_rows = 0;
|
||||
uint8 checkedout = 0;
|
||||
if (wpet->CheckedOut()) checkedout = 1;
|
||||
@@ -251,14 +251,14 @@ void ZoneDatabase::UpdatePetitionToDB(Petition* wpet) {
|
||||
void ZoneDatabase::InsertPetitionToDB(Petition* wpet)
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
char *query = 0;
|
||||
uint32 affected_rows = 0;
|
||||
uint8 checkedout = 0;
|
||||
if (wpet->CheckedOut())
|
||||
checkedout = 1;
|
||||
else
|
||||
checkedout = 0;
|
||||
|
||||
|
||||
uint32 len = strlen(wpet->GetPetitionText());
|
||||
char* petitiontext = new char[2*len+1];
|
||||
memset(petitiontext, 0, 2*len+1);
|
||||
@@ -266,7 +266,7 @@ void ZoneDatabase::InsertPetitionToDB(Petition* wpet)
|
||||
if (!RunQuery(query, MakeAnyLenString(&query, "INSERT INTO petitions (petid, charname, accountname, lastgm, petitiontext, zone, urgency, charclass, charrace, charlevel, checkouts, unavailables, ischeckedout, senttime, gmtext) values (%i,'%s','%s','%s','%s',%i,%i,%i,%i,%i,%i,%i,%i,%i, '%s')", wpet->GetID(), wpet->GetCharName(), wpet->GetAccountName(), wpet->GetLastGM(), petitiontext, wpet->GetZone(), wpet->GetUrgency(), wpet->GetCharClass(), wpet->GetCharRace(), wpet->GetCharLevel(), wpet->GetCheckouts(), wpet->GetUnavails(), checkedout, wpet->GetSentTime(), wpet->GetGMText()), errbuf, 0, &affected_rows)) {
|
||||
LogFile->write(EQEMuLog::Error, "Error in InsertPetitionToDB query '%s': %s", query, errbuf);
|
||||
}
|
||||
|
||||
|
||||
safe_delete_array(petitiontext);
|
||||
safe_delete_array(query);
|
||||
#if EQDEBUG >= 5
|
||||
@@ -278,9 +278,9 @@ void ZoneDatabase::InsertPetitionToDB(Petition* wpet)
|
||||
void ZoneDatabase::RefreshPetitionsFromDB()
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
char *query = 0;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
Petition* newpet;
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT petid, charname, accountname, lastgm, petitiontext, zone, urgency, charclass, charrace, charlevel, checkouts, unavailables, ischeckedout, senttime, gmtext from petitions order by petid"), errbuf, &result))
|
||||
{
|
||||
@@ -312,6 +312,6 @@ void ZoneDatabase::RefreshPetitionsFromDB()
|
||||
safe_delete_array(query);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
+25
-25
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
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 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
|
||||
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.
|
||||
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
|
||||
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 PETITIONS_H
|
||||
#define PETITIONS_H
|
||||
@@ -40,14 +40,14 @@ public:
|
||||
uint32 GetCharRace() { return charrace; }
|
||||
uint32 GetCharClass() { return charclass; }
|
||||
uint32 GetUrgency() { return urgency; }
|
||||
//char* GetZone() { return this->zone; }
|
||||
//char* GetZone() { return this->zone; }
|
||||
uint32 GetZone() { return this->zone; }
|
||||
char* GetCharName() { return charname; }
|
||||
char* GetAccountName() { return accountname; }
|
||||
char* GetLastGM() { return lastgm; }
|
||||
char* GetCharName() { return charname; }
|
||||
char* GetAccountName() { return accountname; }
|
||||
char* GetLastGM() { return lastgm; }
|
||||
time_t GetSentTime() { return senttime; }
|
||||
char* GetPetitionText() { return petitiontext; }
|
||||
char* GetGMText() { return gmtext; }
|
||||
char* GetPetitionText() { return petitiontext; }
|
||||
char* GetGMText() { return gmtext; }
|
||||
bool CheckedOut() { return ischeckedout; }
|
||||
|
||||
|
||||
@@ -71,16 +71,16 @@ public:
|
||||
void SetUnavails(uint32 unavails_in) { unavailables = unavails_in; }
|
||||
void SetSentTime() { time(&senttime); }
|
||||
void SetSentTime2(time_t senttime_in) { senttime = senttime_in; }
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
uint32 petid;
|
||||
char charname[64];
|
||||
char accountname[32];
|
||||
char lastgm[64];
|
||||
char petitiontext[1024];
|
||||
char gmtext[1024];
|
||||
//char zone[32];
|
||||
char charname[64];
|
||||
char accountname[32];
|
||||
char lastgm[64];
|
||||
char petitiontext[1024];
|
||||
char gmtext[1024];
|
||||
//char zone[32];
|
||||
uint32 zone;
|
||||
uint32 urgency; // 0 = green, 1 = yellow, 2 = red
|
||||
uint32 charclass;
|
||||
@@ -112,7 +112,7 @@ public:
|
||||
private:
|
||||
LinkedList<Petition*> list;
|
||||
uint32 last_insert_id;
|
||||
Mutex PList_Mutex;
|
||||
Mutex PList_Mutex;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+64
-64
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemu.org)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
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 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
|
||||
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.
|
||||
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
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "../common/debug.h"
|
||||
#include "../common/spdat.h"
|
||||
@@ -221,7 +221,7 @@ void Mob::MakePet(uint16 spell_id, const char* pettype, const char *petname) {
|
||||
MakePoweredPet(spell_id, pettype, -1, petname);
|
||||
}
|
||||
|
||||
// Split from the basic MakePet to allow backward compatiblity with existing code while also
|
||||
// Split from the basic MakePet to allow backward compatiblity with existing code while also
|
||||
// making it possible for petpower to be retained without the focus item having to
|
||||
// stay equipped when the character zones. petpower of -1 means that the currently equipped petfocus
|
||||
// of a client is searched for and used instead.
|
||||
@@ -288,9 +288,9 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, c
|
||||
npc_type->max_hp += (npc_type->max_hp*MaxHP)/100;
|
||||
npc_type->cur_hp = npc_type->max_hp;
|
||||
}
|
||||
|
||||
|
||||
//TODO: think about regen (engaged vs. not engaged)
|
||||
|
||||
|
||||
// Pet naming:
|
||||
// 0 - `s pet
|
||||
// 1 - `s familiar
|
||||
@@ -323,38 +323,38 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, c
|
||||
npc_type->name[25] = '\0';
|
||||
strcat(npc_type->name, "`s_pet");
|
||||
}
|
||||
|
||||
|
||||
//handle beastlord pet appearance
|
||||
if(record.petnaming == 2)
|
||||
if(record.petnaming == 2)
|
||||
{
|
||||
switch(GetBaseRace())
|
||||
switch(GetBaseRace())
|
||||
{
|
||||
case VAHSHIR:
|
||||
npc_type->race = TIGER;
|
||||
npc_type->size *= 0.8f;
|
||||
case VAHSHIR:
|
||||
npc_type->race = TIGER;
|
||||
npc_type->size *= 0.8f;
|
||||
break;
|
||||
case TROLL:
|
||||
npc_type->race = ALLIGATOR;
|
||||
npc_type->size *= 2.5f;
|
||||
case TROLL:
|
||||
npc_type->race = ALLIGATOR;
|
||||
npc_type->size *= 2.5f;
|
||||
break;
|
||||
case OGRE:
|
||||
npc_type->race = BEAR;
|
||||
npc_type->texture = 3;
|
||||
npc_type->gender = 2;
|
||||
case OGRE:
|
||||
npc_type->race = BEAR;
|
||||
npc_type->texture = 3;
|
||||
npc_type->gender = 2;
|
||||
break;
|
||||
case BARBARIAN:
|
||||
npc_type->race = WOLF;
|
||||
case BARBARIAN:
|
||||
npc_type->race = WOLF;
|
||||
npc_type->texture = 2;
|
||||
break;
|
||||
case IKSAR:
|
||||
npc_type->race = WOLF;
|
||||
npc_type->texture = 0;
|
||||
npc_type->gender = 1;
|
||||
case IKSAR:
|
||||
npc_type->race = WOLF;
|
||||
npc_type->texture = 0;
|
||||
npc_type->gender = 1;
|
||||
npc_type->size *= 2.0f;
|
||||
npc_type->luclinface = 0;
|
||||
break;
|
||||
default:
|
||||
npc_type->race = WOLF;
|
||||
default:
|
||||
npc_type->race = WOLF;
|
||||
npc_type->texture = 0;
|
||||
}
|
||||
}
|
||||
@@ -366,7 +366,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, c
|
||||
MYSQL_RES *result = nullptr;
|
||||
MYSQL_ROW row = nullptr;
|
||||
uint32 monsterid;
|
||||
|
||||
|
||||
// get a random npc id from the spawngroups assigned to this zone
|
||||
if (database.RunQuery(query, MakeAnyLenString(&query,
|
||||
"SELECT npcID FROM (spawnentry INNER JOIN spawn2 ON spawn2.spawngroupID = spawnentry.spawngroupID) "
|
||||
@@ -376,16 +376,16 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, c
|
||||
"ORDER BY RAND() LIMIT 1", zone->GetShortName()), errbuf, &result))
|
||||
{
|
||||
row = mysql_fetch_row(result);
|
||||
if (row)
|
||||
if (row)
|
||||
monsterid = atoi(row[0]);
|
||||
else
|
||||
else
|
||||
monsterid = 567; // since we don't have any monsters, just make it look like an earth pet for now
|
||||
}
|
||||
else { // if the database query failed
|
||||
LogFile->write(EQEMuLog::Error, "Error querying database for monster summoning pet in zone %s (%s)", zone->GetShortName(), errbuf);
|
||||
monsterid = 567;
|
||||
}
|
||||
|
||||
|
||||
// give the summoned pet the attributes of the monster we found
|
||||
const NPCType* monster = database.GetNPCType(monsterid);
|
||||
if(monster) {
|
||||
@@ -426,7 +426,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, c
|
||||
// We need to handle PetType 5 (petHatelist), add the current target to the hatelist of the pet
|
||||
}
|
||||
/* This is why the pets ghost - pets were being spawned too far away from its npc owner and some
|
||||
into walls or objects (+10), this sometimes creates the "ghost" effect. I changed to +2 (as close as I
|
||||
into walls or objects (+10), this sometimes creates the "ghost" effect. I changed to +2 (as close as I
|
||||
could get while it still looked good). I also noticed this can happen if an NPC is spawned on the same spot of another or in a related bad spot.*/
|
||||
Pet::Pet(NPCType *type_data, Mob *owner, PetType type, uint16 spell_id, int16 power)
|
||||
: NPC(type_data, 0, owner->GetX()+2, owner->GetY()+2, owner->GetZ(), owner->GetHeading(), FlyMode3)
|
||||
@@ -445,10 +445,10 @@ bool ZoneDatabase::GetPetEntry(const char *pet_type, PetRecord *into) {
|
||||
|
||||
bool ZoneDatabase::GetPoweredPetEntry(const char *pet_type, int16 petpower, PetRecord *into) {
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
char *query = 0;
|
||||
uint32 querylen = 0;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
|
||||
if (petpower <= 0) {
|
||||
querylen = MakeAnyLenString(&query,
|
||||
@@ -465,7 +465,7 @@ bool ZoneDatabase::GetPoweredPetEntry(const char *pet_type, int16 petpower, PetR
|
||||
safe_delete_array(query);
|
||||
if (mysql_num_rows(result) == 1) {
|
||||
row = mysql_fetch_row(result);
|
||||
|
||||
|
||||
into->npc_type = atoi(row[0]);
|
||||
into->temporary = atoi(row[1]);
|
||||
into->petpower = atoi(row[2]);
|
||||
@@ -473,14 +473,14 @@ bool ZoneDatabase::GetPoweredPetEntry(const char *pet_type, int16 petpower, PetR
|
||||
into->petnaming = atoi(row[4]);
|
||||
into->monsterflag = atoi(row[5]);
|
||||
into->equipmentset = atoi(row[6]);
|
||||
|
||||
|
||||
mysql_free_result(result);
|
||||
return(true);
|
||||
}
|
||||
mysql_free_result(result);
|
||||
}
|
||||
else {
|
||||
LogFile->write(EQEMuLog::Error, "Error in GetPoweredPetEntry query '%s': %s", query, errbuf);
|
||||
LogFile->write(EQEMuLog::Error, "Error in GetPoweredPetEntry query '%s': %s", query, errbuf);
|
||||
safe_delete_array(query);
|
||||
}
|
||||
return(false);
|
||||
@@ -489,18 +489,18 @@ bool ZoneDatabase::GetPoweredPetEntry(const char *pet_type, int16 petpower, PetR
|
||||
Mob* Mob::GetPet() {
|
||||
if(GetPetID() == 0)
|
||||
return(nullptr);
|
||||
|
||||
|
||||
Mob* tmp = entity_list.GetMob(GetPetID());
|
||||
if(tmp == nullptr) {
|
||||
SetPetID(0);
|
||||
return(nullptr);
|
||||
}
|
||||
|
||||
|
||||
if(tmp->GetOwnerID() != GetID()) {
|
||||
SetPetID(0);
|
||||
return(nullptr);
|
||||
}
|
||||
|
||||
|
||||
return(tmp);
|
||||
}
|
||||
|
||||
@@ -535,10 +535,10 @@ void Mob::SetPetID(uint16 NewPetID) {
|
||||
void NPC::GetPetState(SpellBuff_Struct *pet_buffs, uint32 *items, char *name) {
|
||||
//save the pet name
|
||||
strn0cpy(name, GetName(), 64);
|
||||
|
||||
|
||||
//save their items, we only care about what they are actually wearing
|
||||
memcpy(items, equipment, sizeof(uint32)*MAX_WORN_INVENTORY);
|
||||
|
||||
|
||||
//save their buffs.
|
||||
for (int i=0; i < GetPetMaxTotalSlots(); i++) {
|
||||
if (buffs[i].spellid != SPELL_UNKNOWN) {
|
||||
@@ -561,7 +561,7 @@ void NPC::GetPetState(SpellBuff_Struct *pet_buffs, uint32 *items, char *name) {
|
||||
|
||||
void NPC::SetPetState(SpellBuff_Struct *pet_buffs, uint32 *items) {
|
||||
//restore their buffs...
|
||||
|
||||
|
||||
int i;
|
||||
for (i = 0; i < GetPetMaxTotalSlots(); i++) {
|
||||
for(int z = 0; z < GetPetMaxTotalSlots(); z++) {
|
||||
@@ -571,7 +571,7 @@ void NPC::SetPetState(SpellBuff_Struct *pet_buffs, uint32 *items) {
|
||||
pet_buffs[i].spellid = 0xFFFFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (pet_buffs[i].spellid <= (uint32)SPDAT_RECORDS && pet_buffs[i].spellid != 0 && pet_buffs[i].duration > 0) {
|
||||
if(pet_buffs[i].level == 0 || pet_buffs[i].level > 100)
|
||||
pet_buffs[i].level = 1;
|
||||
@@ -579,7 +579,7 @@ void NPC::SetPetState(SpellBuff_Struct *pet_buffs, uint32 *items) {
|
||||
buffs[i].ticsremaining = pet_buffs[i].duration;
|
||||
buffs[i].casterlevel = pet_buffs[i].level;
|
||||
buffs[i].casterid = 0;
|
||||
buffs[i].counters = pet_buffs[i].counters;
|
||||
buffs[i].counters = pet_buffs[i].counters;
|
||||
buffs[i].numhits = spells[pet_buffs[i].spellid].numhits;
|
||||
}
|
||||
else {
|
||||
@@ -627,7 +627,7 @@ void NPC::SetPetState(SpellBuff_Struct *pet_buffs, uint32 *items) {
|
||||
for(i = 0; i < MAX_WORN_INVENTORY; i++) {
|
||||
if(items[i] == 0)
|
||||
continue;
|
||||
|
||||
|
||||
const Item_Struct* item2 = database.GetItem(items[i]);
|
||||
if (item2 && item2->NoDrop != 0) {
|
||||
//dont bother saving item charges for now, NPCs never use them
|
||||
@@ -649,14 +649,14 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) {
|
||||
// are loaded after that, up to a max depth of 5. (Arbitrary limit
|
||||
// so we don't go into an endless loop if the DB data is cyclic for
|
||||
// some reason.)
|
||||
// A slot will only get an item put in it if it is empty. That way
|
||||
// A slot will only get an item put in it if it is empty. That way
|
||||
// an equipmentset can overload a slot for the set(s) it includes.
|
||||
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
char *query = 0;
|
||||
uint32 querylen = 0;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
int depth = 0;
|
||||
int32 curset = equipmentset;
|
||||
int32 nextset = -1;
|
||||
@@ -670,7 +670,7 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) {
|
||||
// already. If no, add the item id to the equipment array.
|
||||
|
||||
while (curset >= 0 && depth < 5) {
|
||||
if (RunQuery(query,
|
||||
if (RunQuery(query,
|
||||
MakeAnyLenString(&query, "SELECT nested_set FROM pets_equipmentset WHERE set_id='%s'", curset),
|
||||
errbuf, &result))
|
||||
{
|
||||
@@ -679,8 +679,8 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) {
|
||||
row = mysql_fetch_row(result);
|
||||
nextset = atoi(row[0]);
|
||||
mysql_free_result(result);
|
||||
|
||||
if (RunQuery(query,
|
||||
|
||||
if (RunQuery(query,
|
||||
MakeAnyLenString(&query, "SELECT slot, item_id FROM pets_equipmentset_entries WHERE set_id='%s'", curset),
|
||||
errbuf, &result))
|
||||
{
|
||||
@@ -697,7 +697,7 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) {
|
||||
mysql_free_result(result);
|
||||
}
|
||||
else {
|
||||
LogFile->write(EQEMuLog::Error, "Error in GetBasePetItems query '%s': %s", query, errbuf);
|
||||
LogFile->write(EQEMuLog::Error, "Error in GetBasePetItems query '%s': %s", query, errbuf);
|
||||
safe_delete_array(query);
|
||||
}
|
||||
curset = nextset;
|
||||
@@ -713,7 +713,7 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) {
|
||||
}
|
||||
else
|
||||
{
|
||||
LogFile->write(EQEMuLog::Error, "Error in GetBasePetItems query '%s': %s", query, errbuf);
|
||||
LogFile->write(EQEMuLog::Error, "Error in GetBasePetItems query '%s': %s", query, errbuf);
|
||||
safe_delete_array(query);
|
||||
return false;
|
||||
}
|
||||
|
||||
+7
-20
@@ -14,30 +14,17 @@
|
||||
#define PET_HOLD 12
|
||||
#define PET_NOTAUNT 14
|
||||
#define PET_LEADER 16
|
||||
#define PET_SLUMBER 17
|
||||
#define PET_NOCAST 18
|
||||
#define PET_FOCUS 19
|
||||
#define PET_FOCUS_ON 25
|
||||
#define PET_FOCUS_OFF 26
|
||||
|
||||
#define PET_SLUMBER 17
|
||||
#define PET_NOCAST 18
|
||||
#define PET_FOCUS 19
|
||||
#define PET_FOCUS_ON 25
|
||||
#define PET_FOCUS_OFF 26
|
||||
|
||||
class Pet : public NPC {
|
||||
public:
|
||||
Pet(NPCType *type_data, Mob *owner, PetType type, uint16 spell_id, int16 power);
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+94
-89
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2005 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2005 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 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
|
||||
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.
|
||||
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
|
||||
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
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -108,12 +108,12 @@ void QuestManager::Process() {
|
||||
//make sure the mob is still in zone.
|
||||
if(entity_list.IsMobInZone(cur->mob)){
|
||||
if(cur->mob->IsNPC()) {
|
||||
parse->EventNPC(EVENT_TIMER, cur->mob->CastToNPC(), nullptr, cur->name, 0);
|
||||
parse->EventNPC(EVENT_TIMER, cur->mob->CastToNPC(), nullptr, cur->name, 0);
|
||||
}
|
||||
else {
|
||||
//this is inheriently unsafe if we ever make it so more than npc/client start timers
|
||||
parse->EventPlayer(EVENT_TIMER, cur->mob->CastToClient(), cur->name, 0);
|
||||
}
|
||||
//this is inheriently unsafe if we ever make it so more than npc/client start timers
|
||||
parse->EventPlayer(EVENT_TIMER, cur->mob->CastToClient(), cur->name, 0);
|
||||
}
|
||||
|
||||
//we MUST reset our iterator since the quest could have removed/added any
|
||||
//number of timers... worst case we have to check a bunch of timers twice
|
||||
@@ -203,7 +203,7 @@ void QuestManager::ClearAllTimers() {
|
||||
|
||||
//quest perl functions
|
||||
void QuestManager::echo(int colour, const char *str) {
|
||||
entity_list.MessageClose(initiator, false, 200, colour, str);
|
||||
entity_list.MessageClose(initiator, false, 200, colour, str);
|
||||
}
|
||||
|
||||
void QuestManager::say(const char *str) {
|
||||
@@ -212,12 +212,12 @@ void QuestManager::say(const char *str) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
if(RuleB(NPC, EnableNPCQuestJournal) && initiator) {
|
||||
owner->QuestJournalledSay(initiator, str);
|
||||
}
|
||||
else {
|
||||
owner->Say(str);
|
||||
}
|
||||
if(RuleB(NPC, EnableNPCQuestJournal) && initiator) {
|
||||
owner->QuestJournalledSay(initiator, str);
|
||||
}
|
||||
else {
|
||||
owner->Say(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -557,7 +557,7 @@ void QuestManager::shout2(const char *str) {
|
||||
|
||||
void QuestManager::gmsay(const char *str, uint32 color, bool send_to_world, uint32 to_guilddbid, uint32 to_minstatus) {
|
||||
if(send_to_world)
|
||||
worldserver.SendEmoteMessage(0, to_guilddbid, to_minstatus, color, "%s", str);
|
||||
worldserver.SendEmoteMessage(0, to_guilddbid, to_minstatus, color, "%s", str);
|
||||
else
|
||||
entity_list.MessageStatus(to_guilddbid, to_minstatus, color, "%s", str);
|
||||
}
|
||||
@@ -666,7 +666,7 @@ void QuestManager::sfollow() {
|
||||
void QuestManager::changedeity(int diety_id) {
|
||||
//Changes the deity.
|
||||
if(initiator)
|
||||
{
|
||||
{
|
||||
if(initiator->IsClient())
|
||||
{
|
||||
initiator->SetDeity(diety_id);
|
||||
@@ -796,21 +796,21 @@ void QuestManager::surname(const char *name) {
|
||||
}
|
||||
|
||||
void QuestManager::permaclass(int class_id) {
|
||||
//Makes the client the class specified
|
||||
//Makes the client the class specified
|
||||
initiator->SetBaseClass(class_id);
|
||||
initiator->Save(2);
|
||||
initiator->Kick();
|
||||
}
|
||||
|
||||
void QuestManager::permarace(int race_id) {
|
||||
//Makes the client the race specified
|
||||
//Makes the client the race specified
|
||||
initiator->SetBaseRace(race_id);
|
||||
initiator->Save(2);
|
||||
initiator->Kick();
|
||||
}
|
||||
|
||||
void QuestManager::permagender(int gender_id) {
|
||||
//Makes the client the gender specified
|
||||
//Makes the client the gender specified
|
||||
initiator->SetBaseGender(gender_id);
|
||||
initiator->Save(2);
|
||||
initiator->Kick();
|
||||
@@ -819,7 +819,7 @@ void QuestManager::permagender(int gender_id) {
|
||||
uint16 QuestManager::scribespells(uint8 max_level, uint8 min_level) {
|
||||
uint16 book_slot, count;
|
||||
uint16 curspell;
|
||||
|
||||
|
||||
uint16 Char_ID = initiator->CharacterID();
|
||||
bool SpellGlobalRule = RuleB(Spells, EnableSpellGlobals);
|
||||
bool SpellGlobalCheckResult = 0;
|
||||
@@ -836,9 +836,9 @@ uint16 QuestManager::scribespells(uint8 max_level, uint8 min_level) {
|
||||
( !RuleB(Spells, UseCHAScribeHack) || spells[curspell].effectid[EFFECT_COUNT - 1] != 10 )
|
||||
)
|
||||
{
|
||||
if (book_slot == -1) //no more book slots
|
||||
if (book_slot == -1) //no more book slots
|
||||
break;
|
||||
if(!IsDiscipline(curspell) && !initiator->HasSpellScribed(curspell)) { //isn't a discipline & we don't already have it scribed
|
||||
if(!IsDiscipline(curspell) && !initiator->HasSpellScribed(curspell)) { //isn't a discipline & we don't already have it scribed
|
||||
if (SpellGlobalRule) {
|
||||
// Bool to see if the character has the required QGlobal to scribe it if one exists in the Spell_Globals table
|
||||
SpellGlobalCheckResult = initiator->SpellGlobalCheck(curspell, Char_ID);
|
||||
@@ -854,17 +854,17 @@ uint16 QuestManager::scribespells(uint8 max_level, uint8 min_level) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return count; //how many spells were scribed successfully
|
||||
return count; //how many spells were scribed successfully
|
||||
}
|
||||
|
||||
uint16 QuestManager::traindiscs(uint8 max_level, uint8 min_level) {
|
||||
uint16 count;
|
||||
uint16 curspell;
|
||||
|
||||
|
||||
uint16 Char_ID = initiator->CharacterID();
|
||||
bool SpellGlobalRule = RuleB(Spells, EnableSpellGlobals);
|
||||
bool SpellGlobalCheckResult = 0;
|
||||
|
||||
|
||||
for(curspell = 0, count = 0; curspell < SPDAT_RECORDS; curspell++)
|
||||
{
|
||||
if
|
||||
@@ -905,7 +905,7 @@ uint16 QuestManager::traindiscs(uint8 max_level, uint8 min_level) {
|
||||
} //if we get to this point, there's already a discipline in this slot, so we skip it
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return count; //how many disciplines were learned successfully
|
||||
}
|
||||
@@ -936,7 +936,7 @@ void QuestManager::givecash(int copper, int silver, int gold, int platinum) {
|
||||
tmp = "You receive ";
|
||||
else
|
||||
tmp += ",";
|
||||
|
||||
|
||||
tmp += itoa(gold);
|
||||
tmp += " gold";
|
||||
}
|
||||
@@ -956,7 +956,7 @@ void QuestManager::givecash(int copper, int silver, int gold, int platinum) {
|
||||
tmp = "You receive ";
|
||||
else
|
||||
tmp += ",";
|
||||
|
||||
|
||||
tmp += itoa(copper);
|
||||
tmp += " copper";
|
||||
}
|
||||
@@ -979,7 +979,7 @@ void QuestManager::pvp(const char *mode) {
|
||||
|
||||
void QuestManager::movepc(int zone_id, float x, float y, float z, float heading) {
|
||||
if (initiator && initiator->IsClient())
|
||||
initiator->MovePC(zone_id, x, y, z, heading);
|
||||
initiator->MovePC(zone_id, x, y, z, heading);
|
||||
}
|
||||
|
||||
void QuestManager::gmmove(float x, float y, float z) {
|
||||
@@ -988,23 +988,26 @@ void QuestManager::gmmove(float x, float y, float z) {
|
||||
}
|
||||
|
||||
void QuestManager::movegrp(int zoneid, float x, float y, float z) {
|
||||
if (initiator && initiator->IsClient())
|
||||
if (initiator && initiator->IsClient())
|
||||
{
|
||||
Group *g = entity_list.GetGroupByClient(initiator);
|
||||
if (g != nullptr){
|
||||
if (g != nullptr) {
|
||||
g->TeleportGroup(owner, zoneid, 0, x, y, z, 0.0f);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Raid *r = entity_list.GetRaidByClient(initiator);
|
||||
if (r != nullptr){
|
||||
if (r != nullptr) {
|
||||
uint32 gid = r->GetGroup(initiator);
|
||||
if (gid >= 0 && gid < 12) {
|
||||
r->TeleportGroup(owner, zoneid, 0, x, y, z, 0.0f, gid);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
initiator->MovePC(zoneid, x, y, z, 0.0f);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
initiator->MovePC(zoneid, x, y, z, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1121,7 +1124,7 @@ void QuestManager::setguild(uint32 new_guild_id, uint8 new_rank) {
|
||||
}
|
||||
|
||||
void QuestManager::CreateGuild(const char *guild_name, const char *leader) {
|
||||
uint32 cid = database.GetCharacterID(leader);
|
||||
uint32 cid = database.GetCharacterID(leader);
|
||||
char hString[250];
|
||||
if (cid == 0) {
|
||||
worldserver.SendEmoteMessage(0, 0, 80, 15, "%s", "Guild Creation: Guild leader not found.");
|
||||
@@ -1133,7 +1136,7 @@ void QuestManager::CreateGuild(const char *guild_name, const char *leader) {
|
||||
sprintf(hString, "Guild Creation: Error: %s already is the leader of DB# %i '%s'.", leader, tmp, guild_mgr.GetGuildName(tmp));
|
||||
worldserver.SendEmoteMessage(0, 0, 80, 15, "%s", hString);
|
||||
}
|
||||
else {
|
||||
else {
|
||||
uint32 gid = guild_mgr.CreateGuild(guild_name, cid);
|
||||
if (gid == GUILD_NONE)
|
||||
worldserver.SendEmoteMessage(0, 0, 80, 15, "%s", "Guild Creation: Guild creation failed");
|
||||
@@ -1141,9 +1144,9 @@ void QuestManager::CreateGuild(const char *guild_name, const char *leader) {
|
||||
sprintf(hString, "Guild Creation: Guild created: Leader: %i, number %i: %s", cid, gid, leader);
|
||||
worldserver.SendEmoteMessage(0, 0, 80, 15, "%s", hString);
|
||||
if(!guild_mgr.SetGuild(cid, gid, GUILD_LEADER))
|
||||
worldserver.SendEmoteMessage(0, 0, 80, 15, "%s", "Unable to set guild leader's guild in the database. Your going to have to run #guild set");
|
||||
worldserver.SendEmoteMessage(0, 0, 80, 15, "%s", "Unable to set guild leader's guild in the database. Your going to have to run #guild set");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1194,7 +1197,7 @@ void QuestManager::setglobal(const char *varname, const char *newvalue, int opti
|
||||
|
||||
/* options value determines the availability of global variables to NPCs when a quest begins
|
||||
------------------------------------------------------------------
|
||||
value npcid player zone
|
||||
value npcid player zone
|
||||
------------------------------------------------------------------
|
||||
0 this this this
|
||||
1 all this this
|
||||
@@ -1205,7 +1208,7 @@ void QuestManager::setglobal(const char *varname, const char *newvalue, int opti
|
||||
6 this all all
|
||||
7 all all all
|
||||
*/
|
||||
if (initiator && initiator->IsClient()) // some events like waypoint and spawn don't have a player involved
|
||||
if (initiator && initiator->IsClient()) // some events like waypoint and spawn don't have a player involved
|
||||
{
|
||||
qgCharid=initiator->CharacterID();
|
||||
}
|
||||
@@ -1331,7 +1334,7 @@ void QuestManager::delglobal(const char *varname) {
|
||||
int qgZoneid=zone->GetZoneID();
|
||||
int qgCharid=0;
|
||||
int qgNpcid=owner->GetNPCTypeID();
|
||||
if (initiator && initiator->IsClient()) // some events like waypoint and spawn don't have a player involved
|
||||
if (initiator && initiator->IsClient()) // some events like waypoint and spawn don't have a player involved
|
||||
{
|
||||
qgCharid=initiator->CharacterID();
|
||||
}
|
||||
@@ -1341,10 +1344,10 @@ void QuestManager::delglobal(const char *varname) {
|
||||
qgCharid=-qgNpcid; // make char id negative npc id as a fudge
|
||||
}
|
||||
if (!database.RunQuery(query,
|
||||
MakeAnyLenString(&query,
|
||||
"DELETE FROM quest_globals WHERE name='%s'"
|
||||
" && (npcid=0 || npcid=%i) && (charid=0 || charid=%i) && (zoneid=%i || zoneid=0)",
|
||||
varname,qgNpcid,qgCharid,qgZoneid),errbuf))
|
||||
MakeAnyLenString(&query,
|
||||
"DELETE FROM quest_globals WHERE name='%s'"
|
||||
" && (npcid=0 || npcid=%i) && (charid=0 || charid=%i) && (zoneid=%i || zoneid=0)",
|
||||
varname,qgNpcid,qgCharid,qgZoneid),errbuf))
|
||||
{
|
||||
cerr << "delglobal error deleting " << varname << " : " << errbuf << endl;
|
||||
}
|
||||
@@ -1670,11 +1673,11 @@ uint32 QuestManager::getplayerburriedcorpsecount(uint32 char_id) {
|
||||
return Result;
|
||||
}
|
||||
|
||||
bool QuestManager::buryplayercorpse(uint32 char_id)
|
||||
bool QuestManager::buryplayercorpse(uint32 char_id)
|
||||
{
|
||||
bool Result = false;
|
||||
|
||||
if(char_id > 0)
|
||||
if(char_id > 0)
|
||||
{
|
||||
uint32 PlayerCorpse = database.GetFirstCorpseID(char_id);
|
||||
if(PlayerCorpse > 0)
|
||||
@@ -1886,7 +1889,8 @@ void QuestManager::npcfeature(char *feature, int setting)
|
||||
|
||||
void QuestManager::popup(char *title, char *text, uint32 popupid, uint32 buttons, uint32 Duration)
|
||||
{
|
||||
if(initiator) initiator->SendPopupToClient(title, text, popupid, buttons, Duration);
|
||||
if(initiator)
|
||||
initiator->SendPopupToClient(title, text, popupid, buttons, Duration);
|
||||
}
|
||||
|
||||
#ifdef BOTS
|
||||
@@ -2015,7 +2019,7 @@ int QuestManager::gettaskactivitydonecount(int task, int activity) {
|
||||
return initiator->GetTaskActivityDoneCountFromTaskID(task, activity);
|
||||
|
||||
return 0; //improper args
|
||||
|
||||
|
||||
}
|
||||
void QuestManager::updatetaskactivity(int task, int activity, int count) {
|
||||
|
||||
@@ -2126,7 +2130,7 @@ bool QuestManager::istaskappropriate(int task) {
|
||||
return false;
|
||||
}
|
||||
void QuestManager::clearspawntimers() {
|
||||
if(zone) {
|
||||
if(zone) {
|
||||
//TODO: Dec 19, 2008, replace with code updated for current spawn timers.
|
||||
LinkedListIterator<Spawn2*> iterator(zone->spawn2_list);
|
||||
iterator.Reset();
|
||||
@@ -2158,7 +2162,7 @@ int QuestManager::getlevel(uint8 type)
|
||||
else if(type == 1)
|
||||
{
|
||||
Group *g = entity_list.GetGroupByClient(initiator);
|
||||
if (g != nullptr)
|
||||
if (g != nullptr)
|
||||
return (g->GetAvgLevel());
|
||||
else
|
||||
return 0;
|
||||
@@ -2166,7 +2170,7 @@ int QuestManager::getlevel(uint8 type)
|
||||
else if(type == 2)
|
||||
{
|
||||
Raid *r = entity_list.GetRaidByClient(initiator);
|
||||
if (r != nullptr)
|
||||
if (r != nullptr)
|
||||
return (r->GetAvgLevel());
|
||||
else
|
||||
return 0;
|
||||
@@ -2303,7 +2307,7 @@ void QuestManager::UpdateSpawnTimer(uint32 id, uint32 newTime)
|
||||
}
|
||||
}
|
||||
|
||||
// used to set the number of an item in the selected merchant's temp item list. Defaults to zero if no quantity is specified.
|
||||
// used to set the number of an item in the selected merchant's temp item list. Defaults to zero if no quantity is specified.
|
||||
void QuestManager::MerchantSetItem(uint32 NPCid, uint32 itemid, uint32 quantity) {
|
||||
Mob* merchant = entity_list.GetMobByNpcTypeID(NPCid);
|
||||
|
||||
@@ -2474,9 +2478,9 @@ const char* QuestManager::saylink(char* Phrase, bool silent, char* LinkName) {
|
||||
MYSQL_ROW row;
|
||||
int sayid = 0;
|
||||
|
||||
int sz = strlen(Phrase);
|
||||
char *escaped_string = new char[sz * 2];
|
||||
database.DoEscapeString(escaped_string, Phrase, sz);
|
||||
int sz = strlen(Phrase);
|
||||
char *escaped_string = new char[sz * 2];
|
||||
database.DoEscapeString(escaped_string, Phrase, sz);
|
||||
|
||||
// Query for an existing phrase and id in the saylink table
|
||||
if(database.RunQuery(query,MakeAnyLenString(&query,"SELECT `id` FROM `saylink` WHERE `phrase` = '%s'", escaped_string),errbuf,&result))
|
||||
@@ -2489,7 +2493,7 @@ const char* QuestManager::saylink(char* Phrase, bool silent, char* LinkName) {
|
||||
}
|
||||
mysql_free_result(result);
|
||||
}
|
||||
else // Add a new saylink entry to the database and query it again for the new sayid number
|
||||
else // Add a new saylink entry to the database and query it again for the new sayid number
|
||||
{
|
||||
safe_delete_array(query);
|
||||
|
||||
@@ -2515,7 +2519,7 @@ const char* QuestManager::saylink(char* Phrase, bool silent, char* LinkName) {
|
||||
}
|
||||
}
|
||||
safe_delete_array(query);
|
||||
safe_delete_array(escaped_string);
|
||||
safe_delete_array(escaped_string);
|
||||
|
||||
if(silent)
|
||||
sayid = sayid + 750000;
|
||||
@@ -2630,17 +2634,17 @@ uint8 QuestManager::FactionValue()
|
||||
}
|
||||
|
||||
void QuestManager::enabletitle(int titleset) {
|
||||
initiator->EnableTitle(titleset);
|
||||
initiator->EnableTitle(titleset);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool QuestManager::checktitle(int titleset) {
|
||||
return initiator->CheckTitle(titleset);
|
||||
return initiator->CheckTitle(titleset);
|
||||
}
|
||||
|
||||
void QuestManager::removetitle(int titleset) {
|
||||
initiator->RemoveTitle(titleset);
|
||||
initiator->RemoveTitle(titleset);
|
||||
}
|
||||
|
||||
void QuestManager::wearchange(uint8 slot, uint16 texture)
|
||||
@@ -2683,24 +2687,24 @@ void QuestManager::voicetell(char *str, int macronum, int racenum, int gendernum
|
||||
}
|
||||
|
||||
void QuestManager::LearnRecipe(uint32 recipe_id) {
|
||||
if(!initiator)
|
||||
return;
|
||||
initiator->LearnRecipe(recipe_id);
|
||||
if(!initiator)
|
||||
return;
|
||||
initiator->LearnRecipe(recipe_id);
|
||||
}
|
||||
|
||||
void QuestManager::SendMail(const char *to, const char *from, const char *subject, const char *message) {
|
||||
if(to == nullptr || from == nullptr || subject == nullptr || message == nullptr) {
|
||||
return;
|
||||
}
|
||||
if(to == nullptr || from == nullptr || subject == nullptr || message == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 message_len = strlen(message) + 1;
|
||||
ServerPacket* pack = new ServerPacket(ServerOP_UCSMailMessage, sizeof(ServerMailMessageHeader_Struct) + message_len);
|
||||
uint32 message_len = strlen(message) + 1;
|
||||
ServerPacket* pack = new ServerPacket(ServerOP_UCSMailMessage, sizeof(ServerMailMessageHeader_Struct) + message_len);
|
||||
ServerMailMessageHeader_Struct* mail = (ServerMailMessageHeader_Struct*) pack->pBuffer;
|
||||
|
||||
strn0cpy(mail->to, to, 64);
|
||||
strn0cpy(mail->from, from, 64);
|
||||
strn0cpy(mail->subject, subject, 128);
|
||||
strcpy(mail->message, message);
|
||||
strn0cpy(mail->to, to, 64);
|
||||
strn0cpy(mail->from, from, 64);
|
||||
strn0cpy(mail->subject, subject, 128);
|
||||
strcpy(mail->message, message);
|
||||
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
@@ -2714,16 +2718,16 @@ uint16 QuestManager::CreateDoor(const char* model, float x, float y, float z, fl
|
||||
}
|
||||
|
||||
int32 QuestManager::GetZoneID(const char *zone) {
|
||||
return static_cast<int32>(database.GetZoneID(zone));
|
||||
return static_cast<int32>(database.GetZoneID(zone));
|
||||
}
|
||||
|
||||
const char* QuestManager::GetZoneLongName(const char *zone) {
|
||||
char *long_name;
|
||||
database.GetZoneLongName(zone, &long_name);
|
||||
std::string ln = long_name;
|
||||
safe_delete_array(long_name);
|
||||
char *long_name;
|
||||
database.GetZoneLongName(zone, &long_name);
|
||||
std::string ln = long_name;
|
||||
safe_delete_array(long_name);
|
||||
|
||||
return ln.c_str();
|
||||
return ln.c_str();
|
||||
}
|
||||
|
||||
bool QuestManager::TurnInItem(uint32 itm, int charges)
|
||||
@@ -2792,3 +2796,4 @@ void QuestManager::CrossZoneMessagePlayerByName(uint32 Type, const char *CharNam
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
|
||||
|
||||
+30
-30
@@ -1,25 +1,25 @@
|
||||
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA */
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA */
|
||||
|
||||
/*
|
||||
Code for generell handling of priority Queues.
|
||||
Implemention of queues from "Algoritms in C" by Robert Sedgewick.
|
||||
Copyright Monty Program KB.
|
||||
By monty.
|
||||
Code for generell handling of priority Queues.
|
||||
Implemention of queues from "Algoritms in C" by Robert Sedgewick.
|
||||
Copyright Monty Program KB.
|
||||
By monty.
|
||||
*/
|
||||
|
||||
#ifndef _queues_h
|
||||
@@ -29,13 +29,13 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct st_queue {
|
||||
byte **root;
|
||||
void *first_cmp_arg;
|
||||
uint elements;
|
||||
uint max_elements;
|
||||
uint offset_to_key; /* compare is done on element+offset */
|
||||
int max_at_top; /* Set if queue_top gives max */
|
||||
int (*compare)(void *, byte *,byte *);
|
||||
byte **root;
|
||||
void *first_cmp_arg;
|
||||
uint elements;
|
||||
uint max_elements;
|
||||
uint offset_to_key; /* compare is done on element+offset */
|
||||
int max_at_top; /* Set if queue_top gives max */
|
||||
int (*compare)(void *, byte *,byte *);
|
||||
} QUEUE;
|
||||
|
||||
#define queue_top(queue) ((queue)->root[1])
|
||||
@@ -44,11 +44,11 @@ typedef struct st_queue {
|
||||
#define queue_replaced(queue) _downheap(queue,1)
|
||||
|
||||
int init_queue(QUEUE *queue,uint max_elements,uint offset_to_key,
|
||||
pbool max_at_top, int (*compare)(void *,byte *, byte *),
|
||||
void *first_cmp_arg);
|
||||
pbool max_at_top, int (*compare)(void *,byte *, byte *),
|
||||
void *first_cmp_arg);
|
||||
int reinit_queue(QUEUE *queue,uint max_elements,uint offset_to_key,
|
||||
pbool max_at_top, int (*compare)(void *,byte *, byte *),
|
||||
void *first_cmp_arg);
|
||||
pbool max_at_top, int (*compare)(void *,byte *, byte *),
|
||||
void *first_cmp_arg);
|
||||
void delete_queue(QUEUE *queue);
|
||||
void queue_insert(QUEUE *queue,byte *element);
|
||||
byte *queue_remove(QUEUE *queue,uint idx);
|
||||
|
||||
+102
-102
@@ -1,23 +1,23 @@
|
||||
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA */
|
||||
|
||||
/* Parser needs these defines always, even if USE_RAID is not defined */
|
||||
#define RAID_TYPE_0 1 /* Striping */
|
||||
#define RAID_TYPE_x 2 /* Some new modes */
|
||||
/* Parser needs these defines always, even if USE_RAID is not defined */
|
||||
#define RAID_TYPE_0 1 /* Striping */
|
||||
#define RAID_TYPE_x 2 /* Some new modes */
|
||||
#define RAID_TYPE_y 3
|
||||
|
||||
#define RAID_DEFAULT_CHUNKS 4
|
||||
@@ -43,119 +43,119 @@ const char *my_raid_type(int raid_type);
|
||||
/* Trap all occurences of my_...() in source and use our wrapper around this function */
|
||||
|
||||
#ifdef MAP_TO_USE_RAID
|
||||
#define my_read(A,B,C,D) my_raid_read(A,B,C,D)
|
||||
#define my_write(A,B,C,D) my_raid_write(A,B,C,D)
|
||||
#define my_pwrite(A,B,C,D,E) my_raid_pwrite(A,B,C,D,E)
|
||||
#define my_pread(A,B,C,D,E) my_raid_pread(A,B,C,D,E)
|
||||
#define my_chsize(A,B,C) my_raid_chsize(A,B,C)
|
||||
#define my_close(A,B) my_raid_close(A,B)
|
||||
#define my_tell(A,B) my_raid_tell(A,B)
|
||||
#define my_seek(A,B,C,D) my_raid_seek(A,B,C,D)
|
||||
#define my_lock(A,B,C,D,E) my_raid_lock(A,B,C,D,E)
|
||||
#define my_fstat(A,B,C) my_raid_fstat(A,B,C)
|
||||
#define my_read(A,B,C,D) my_raid_read(A,B,C,D)
|
||||
#define my_write(A,B,C,D) my_raid_write(A,B,C,D)
|
||||
#define my_pwrite(A,B,C,D,E) my_raid_pwrite(A,B,C,D,E)
|
||||
#define my_pread(A,B,C,D,E) my_raid_pread(A,B,C,D,E)
|
||||
#define my_chsize(A,B,C) my_raid_chsize(A,B,C)
|
||||
#define my_close(A,B) my_raid_close(A,B)
|
||||
#define my_tell(A,B) my_raid_tell(A,B)
|
||||
#define my_seek(A,B,C,D) my_raid_seek(A,B,C,D)
|
||||
#define my_lock(A,B,C,D,E) my_raid_lock(A,B,C,D,E)
|
||||
#define my_fstat(A,B,C) my_raid_fstat(A,B,C)
|
||||
#endif /* MAP_TO_USE_RAID */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void init_raid(void);
|
||||
void end_raid(void);
|
||||
void init_raid(void);
|
||||
void end_raid(void);
|
||||
|
||||
bool is_raid(File fd);
|
||||
File my_raid_create(const char *FileName, int CreateFlags, int access_flags,
|
||||
uint raid_type, uint raid_chunks, ulong raid_chunksize,
|
||||
myf MyFlags);
|
||||
File my_raid_open(const char *FileName, int Flags,
|
||||
uint raid_type, uint raid_chunks, ulong raid_chunksize,
|
||||
myf MyFlags);
|
||||
int my_raid_rename(const char *from, const char *to, uint raid_chunks,
|
||||
myf MyFlags);
|
||||
int my_raid_delete(const char *from, uint raid_chunks, myf MyFlags);
|
||||
int my_raid_redel(const char *old_name, const char *new_name,
|
||||
uint raid_chunks, myf MyFlags);
|
||||
bool is_raid(File fd);
|
||||
File my_raid_create(const char *FileName, int CreateFlags, int access_flags,
|
||||
uint raid_type, uint raid_chunks, ulong raid_chunksize,
|
||||
myf MyFlags);
|
||||
File my_raid_open(const char *FileName, int Flags,
|
||||
uint raid_type, uint raid_chunks, ulong raid_chunksize,
|
||||
myf MyFlags);
|
||||
int my_raid_rename(const char *from, const char *to, uint raid_chunks,
|
||||
myf MyFlags);
|
||||
int my_raid_delete(const char *from, uint raid_chunks, myf MyFlags);
|
||||
int my_raid_redel(const char *old_name, const char *new_name,
|
||||
uint raid_chunks, myf MyFlags);
|
||||
|
||||
my_off_t my_raid_seek(File fd, my_off_t pos, int whence, myf MyFlags);
|
||||
my_off_t my_raid_tell(File fd, myf MyFlags);
|
||||
my_off_t my_raid_seek(File fd, my_off_t pos, int whence, myf MyFlags);
|
||||
my_off_t my_raid_tell(File fd, myf MyFlags);
|
||||
|
||||
uint my_raid_write(File,const byte *Buffer, uint Count, myf MyFlags);
|
||||
uint my_raid_read(File Filedes, byte *Buffer, uint Count, myf MyFlags);
|
||||
uint my_raid_write(File,const byte *Buffer, uint Count, myf MyFlags);
|
||||
uint my_raid_read(File Filedes, byte *Buffer, uint Count, myf MyFlags);
|
||||
|
||||
uint my_raid_pread(File Filedes, byte *Buffer, uint Count, my_off_t offset,
|
||||
myf MyFlags);
|
||||
uint my_raid_pwrite(int Filedes, const byte *Buffer, uint Count,
|
||||
my_off_t offset, myf MyFlags);
|
||||
uint my_raid_pread(File Filedes, byte *Buffer, uint Count, my_off_t offset,
|
||||
myf MyFlags);
|
||||
uint my_raid_pwrite(int Filedes, const byte *Buffer, uint Count,
|
||||
my_off_t offset, myf MyFlags);
|
||||
|
||||
int my_raid_lock(File,int locktype, my_off_t start, my_off_t length,
|
||||
myf MyFlags);
|
||||
int my_raid_chsize(File fd, my_off_t newlength, myf MyFlags);
|
||||
int my_raid_close(File, myf MyFlags);
|
||||
int my_raid_fstat(int Filedes, struct stat *buf, myf MyFlags);
|
||||
int my_raid_lock(File,int locktype, my_off_t start, my_off_t length,
|
||||
myf MyFlags);
|
||||
int my_raid_chsize(File fd, my_off_t newlength, myf MyFlags);
|
||||
int my_raid_close(File, myf MyFlags);
|
||||
int my_raid_fstat(int Filedes, struct stat *buf, myf MyFlags);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
class RaidName {
|
||||
public:
|
||||
RaidName(const char *FileName);
|
||||
~RaidName();
|
||||
bool IsRaid();
|
||||
int Rename(const char * from, const char * to, myf MyFlags);
|
||||
private:
|
||||
uint _raid_type; /* RAID_TYPE_0 or RAID_TYPE_1 or RAID_TYPE_5 */
|
||||
uint _raid_chunks; /* 1..n */
|
||||
ulong _raid_chunksize; /* 1..n in bytes */
|
||||
public:
|
||||
RaidName(const char *FileName);
|
||||
~RaidName();
|
||||
bool IsRaid();
|
||||
int Rename(const char * from, const char * to, myf MyFlags);
|
||||
private:
|
||||
uint _raid_type; /* RAID_TYPE_0 or RAID_TYPE_1 or RAID_TYPE_5 */
|
||||
uint _raid_chunks; /* 1..n */
|
||||
ulong _raid_chunksize; /* 1..n in bytes */
|
||||
};
|
||||
|
||||
class RaidFd {
|
||||
public:
|
||||
RaidFd(uint raid_type, uint raid_chunks , ulong raid_chunksize);
|
||||
~RaidFd();
|
||||
File Create(const char *FileName, int CreateFlags, int access_flags,
|
||||
public:
|
||||
RaidFd(uint raid_type, uint raid_chunks , ulong raid_chunksize);
|
||||
~RaidFd();
|
||||
File Create(const char *FileName, int CreateFlags, int access_flags,
|
||||
myf MyFlags);
|
||||
File Open(const char *FileName, int Flags, myf MyFlags);
|
||||
my_off_t Seek(my_off_t pos,int whence,myf MyFlags);
|
||||
my_off_t Tell(myf MyFlags);
|
||||
int Write(const byte *Buffer, uint Count, myf MyFlags);
|
||||
int Read(const byte *Buffer, uint Count, myf MyFlags);
|
||||
int Lock(int locktype, my_off_t start, my_off_t length, myf MyFlags);
|
||||
int Chsize(File fd, my_off_t newlength, myf MyFlags);
|
||||
int Fstat(int fd, MY_STAT *stat_area, myf MyFlags );
|
||||
int Close(myf MyFlags);
|
||||
static bool IsRaid(File fd);
|
||||
static DYNAMIC_ARRAY _raid_map; /* Map of RaidFD* */
|
||||
private:
|
||||
File Open(const char *FileName, int Flags, myf MyFlags);
|
||||
my_off_t Seek(my_off_t pos,int whence,myf MyFlags);
|
||||
my_off_t Tell(myf MyFlags);
|
||||
int Write(const byte *Buffer, uint Count, myf MyFlags);
|
||||
int Read(const byte *Buffer, uint Count, myf MyFlags);
|
||||
int Lock(int locktype, my_off_t start, my_off_t length, myf MyFlags);
|
||||
int Chsize(File fd, my_off_t newlength, myf MyFlags);
|
||||
int Fstat(int fd, MY_STAT *stat_area, myf MyFlags );
|
||||
int Close(myf MyFlags);
|
||||
static bool IsRaid(File fd);
|
||||
static DYNAMIC_ARRAY _raid_map; /* Map of RaidFD* */
|
||||
private:
|
||||
|
||||
uint _raid_type; /* RAID_TYPE_0 or RAID_TYPE_1 or RAID_TYPE_5 */
|
||||
uint _raid_chunks; /* 1..n */
|
||||
ulong _raid_chunksize; /* 1..n in bytes */
|
||||
uint _raid_type; /* RAID_TYPE_0 or RAID_TYPE_1 or RAID_TYPE_5 */
|
||||
uint _raid_chunks; /* 1..n */
|
||||
ulong _raid_chunksize; /* 1..n in bytes */
|
||||
|
||||
ulong _total_block; /* We are operating with block no x (can be 0..many). */
|
||||
uint _this_block; /* can be 0.._raid_chunks */
|
||||
uint _remaining_bytes; /* Maximum bytes that can be written in this block */
|
||||
ulong _total_block; /* We are operating with block no x (can be 0..many). */
|
||||
uint _this_block; /* can be 0.._raid_chunks */
|
||||
uint _remaining_bytes; /* Maximum bytes that can be written in this block */
|
||||
|
||||
my_off_t _position;
|
||||
my_off_t _size; /* Cached file size for faster seek(SEEK_END) */
|
||||
File _fd;
|
||||
File *_fd_vector; /* Array of File */
|
||||
off_t *_seek_vector; /* Array of cached seek positions */
|
||||
my_off_t _position;
|
||||
my_off_t _size; /* Cached file size for faster seek(SEEK_END) */
|
||||
File _fd;
|
||||
File *_fd_vector; /* Array of File */
|
||||
off_t *_seek_vector; /* Array of cached seek positions */
|
||||
|
||||
inline void Calculate()
|
||||
{
|
||||
DBUG_ENTER("RaidFd::_Calculate");
|
||||
DBUG_PRINT("info",("_position: %lu _raid_chunksize: %d, _size: %lu",
|
||||
(ulong) _position, _raid_chunksize, (ulong) _size));
|
||||
inline void Calculate()
|
||||
{
|
||||
DBUG_ENTER("RaidFd::_Calculate");
|
||||
DBUG_PRINT("info",("_position: %lu _raid_chunksize: %d, _size: %lu",
|
||||
(ulong) _position, _raid_chunksize, (ulong) _size));
|
||||
|
||||
_total_block = (ulong) (_position / _raid_chunksize);
|
||||
_this_block = _total_block % _raid_chunks; /* can be 0.._raid_chunks */
|
||||
_remaining_bytes = (uint) (_raid_chunksize -
|
||||
(_position - _total_block * _raid_chunksize));
|
||||
DBUG_PRINT("info",
|
||||
("_total_block: %d this_block: %d _remaining_bytes:%d",
|
||||
_total_block, _this_block, _remaining_bytes));
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
_total_block = (ulong) (_position / _raid_chunksize);
|
||||
_this_block = _total_block % _raid_chunks; /* can be 0.._raid_chunks */
|
||||
_remaining_bytes = (uint) (_raid_chunksize - (_position - _total_block * _raid_chunksize));
|
||||
DBUG_PRINT("info",
|
||||
("_total_block: %d this_block: %d _remaining_bytes:%d",
|
||||
_total_block, _this_block, _remaining_bytes));
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* __cplusplus */
|
||||
#endif /* USE_RAID */
|
||||
|
||||
|
||||
+147
-148
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2005 EQEMu Development Team (http://eqemulator.net)
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2005 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 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
|
||||
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.
|
||||
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
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "../common/debug.h"
|
||||
#include "masterentity.h"
|
||||
@@ -75,7 +75,7 @@ void Raid::AddMember(Client *c, uint32 group, bool rleader, bool groupleader, bo
|
||||
return;
|
||||
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char* query = 0;
|
||||
char* query = 0;
|
||||
MYSQL_RES *result;
|
||||
if (database.RunQuery(query,MakeAnyLenString(&query, "INSERT INTO raid_members SET raidid=%lu, charid=%lu, groupid=%lu, _class=%d, level=%d, name='%s', isgroupleader=%d, israidleader=%d, islooter=%d", (unsigned long)GetID(), (unsigned long)c->CharacterID(), (unsigned long)group, c->GetClass(), c->GetLevel(), c->GetName(), groupleader, rleader, looter ),errbuf,&result)){
|
||||
mysql_free_result(result);
|
||||
@@ -103,7 +103,7 @@ void Raid::AddMember(Client *c, uint32 group, bool rleader, bool groupleader, bo
|
||||
void Raid::RemoveMember(const char *c)
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char* query = 0;
|
||||
char* query = 0;
|
||||
MYSQL_RES *result;
|
||||
if (database.RunQuery(query,MakeAnyLenString(&query, "DELETE FROM raid_members where name='%s'", c ),errbuf,&result)){
|
||||
mysql_free_result(result);
|
||||
@@ -134,7 +134,7 @@ void Raid::RemoveMember(const char *c)
|
||||
void Raid::DisbandRaid()
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char* query = 0;
|
||||
char* query = 0;
|
||||
MYSQL_RES *result;
|
||||
if (database.RunQuery(query,MakeAnyLenString(&query, "DELETE FROM raid_members WHERE raidid=%lu", (unsigned long)GetID()),errbuf,&result)){
|
||||
mysql_free_result(result);
|
||||
@@ -160,7 +160,7 @@ void Raid::DisbandRaid()
|
||||
void Raid::MoveMember(const char *name, uint32 newGroup)
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char* query = 0;
|
||||
char* query = 0;
|
||||
MYSQL_RES *result;
|
||||
if (database.RunQuery(query,MakeAnyLenString(&query, "UPDATE raid_members SET groupid=%lu WHERE name='%s'", (unsigned long)newGroup, name),errbuf,&result)){
|
||||
mysql_free_result(result);
|
||||
@@ -184,7 +184,7 @@ void Raid::MoveMember(const char *name, uint32 newGroup)
|
||||
void Raid::SetGroupLeader(const char *who, bool glFlag)
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char* query = 0;
|
||||
char* query = 0;
|
||||
MYSQL_RES *result;
|
||||
if (database.RunQuery(query,MakeAnyLenString(&query, "UPDATE raid_members SET isgroupleader=%lu WHERE name='%s'", (unsigned long)glFlag, who),errbuf,&result)){
|
||||
mysql_free_result(result);
|
||||
@@ -211,7 +211,7 @@ void Raid::SetGroupLeader(const char *who, bool glFlag)
|
||||
void Raid::SetRaidLeader(const char *wasLead, const char *name)
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char* query = 0;
|
||||
char* query = 0;
|
||||
MYSQL_RES *result;
|
||||
if (!database.RunQuery(query,MakeAnyLenString(&query, "UPDATE raid_members SET israidleader=0 WHERE name='%s'", wasLead),errbuf,&result)){
|
||||
printf("Set Raid Leader error: %s\n", errbuf);
|
||||
@@ -265,7 +265,7 @@ bool Raid::IsGroupLeader(const char *who)
|
||||
void Raid::UpdateLevel(const char *name, int newLevel)
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char* query = 0;
|
||||
char* query = 0;
|
||||
MYSQL_RES *result;
|
||||
if (database.RunQuery(query,MakeAnyLenString(&query, "UPDATE raid_members SET level=%lu WHERE name='%s'", (unsigned long)newLevel, name),errbuf,&result)){
|
||||
mysql_free_result(result);
|
||||
@@ -416,7 +416,7 @@ void Raid::CastGroupSpell(Mob* caster, uint16 spellid, uint32 gid)
|
||||
return;
|
||||
|
||||
range = caster->GetAOERange(spellid);
|
||||
|
||||
|
||||
float range2 = range*range;
|
||||
|
||||
for(int x = 0; x < MAX_RAID_MEMBERS; x++)
|
||||
@@ -514,8 +514,8 @@ void Raid::BalanceHP(int32 penalty, uint32 gid)
|
||||
if(members[gi].member){
|
||||
if(members[gi].GroupNumber == gid)
|
||||
{
|
||||
if((members[gi].member->GetMaxHP() - dmgtaken) < 1){ //this way the ability will never kill someone
|
||||
members[gi].member->SetHP(1); //but it will come darn close
|
||||
if((members[gi].member->GetMaxHP() - dmgtaken) < 1){//this way the ability will never kill someone
|
||||
members[gi].member->SetHP(1); //but it will come darn close
|
||||
members[gi].member->SendHPUpdate();
|
||||
}
|
||||
else{
|
||||
@@ -549,14 +549,14 @@ void Raid::BalanceMana(int32 penalty, uint32 gid)
|
||||
if(members[gi].member){
|
||||
if(members[gi].GroupNumber == gid)
|
||||
{
|
||||
if((members[gi].member->GetMaxMana() - manataken) < 1){
|
||||
members[gi].member->SetMana(1);
|
||||
if (members[gi].member->IsClient())
|
||||
members[gi].member->CastToClient()->SendManaUpdate();
|
||||
if((members[gi].member->GetMaxMana() - manataken) < 1){
|
||||
members[gi].member->SetMana(1);
|
||||
if (members[gi].member->IsClient())
|
||||
members[gi].member->CastToClient()->SendManaUpdate();
|
||||
}
|
||||
else{
|
||||
members[gi].member->SetMana(members[gi].member->GetMaxMana() - manataken);
|
||||
if (members[gi].member->IsClient())
|
||||
if (members[gi].member->IsClient())
|
||||
members[gi].member->CastToClient()->SendManaUpdate();
|
||||
}
|
||||
}
|
||||
@@ -569,91 +569,90 @@ void Raid::SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum
|
||||
//avoid unneeded work
|
||||
if(copper == 0 && silver == 0 && gold == 0 && platinum == 0)
|
||||
return;
|
||||
|
||||
uint32 i;
|
||||
uint8 membercount = 0;
|
||||
for (i = 0; i < MAX_RAID_MEMBERS; i++) {
|
||||
if (members[i].member != nullptr) {
|
||||
|
||||
membercount++;
|
||||
}
|
||||
}
|
||||
uint32 i;
|
||||
uint8 membercount = 0;
|
||||
for (i = 0; i < MAX_RAID_MEMBERS; i++) {
|
||||
if (members[i].member != nullptr) {
|
||||
membercount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (membercount == 0)
|
||||
return;
|
||||
|
||||
uint32 mod;
|
||||
//try to handle round off error a little better
|
||||
if(membercount > 1) {
|
||||
mod = platinum % membercount;
|
||||
if((mod) > 0) {
|
||||
platinum -= mod;
|
||||
gold += 10 * mod;
|
||||
}
|
||||
mod = gold % membercount;
|
||||
if((mod) > 0) {
|
||||
gold -= mod;
|
||||
silver += 10 * mod;
|
||||
}
|
||||
mod = silver % membercount;
|
||||
if((mod) > 0) {
|
||||
silver -= mod;
|
||||
copper += 10 * mod;
|
||||
}
|
||||
}
|
||||
|
||||
//calculate the splits
|
||||
//We can still round off copper pieces, but I dont care
|
||||
uint32 sc;
|
||||
uint32 cpsplit = copper / membercount;
|
||||
sc = copper % membercount;
|
||||
uint32 spsplit = silver / membercount;
|
||||
uint32 gpsplit = gold / membercount;
|
||||
uint32 ppsplit = platinum / membercount;
|
||||
if (membercount == 0)
|
||||
return;
|
||||
|
||||
char buf[128];
|
||||
buf[63] = '\0';
|
||||
string msg = "You receive";
|
||||
bool one = false;
|
||||
|
||||
if(ppsplit > 0) {
|
||||
snprintf(buf, 63, " %u platinum", ppsplit);
|
||||
msg += buf;
|
||||
one = true;
|
||||
}
|
||||
if(gpsplit > 0) {
|
||||
if(one)
|
||||
msg += ",";
|
||||
snprintf(buf, 63, " %u gold", gpsplit);
|
||||
msg += buf;
|
||||
one = true;
|
||||
}
|
||||
if(spsplit > 0) {
|
||||
if(one)
|
||||
msg += ",";
|
||||
snprintf(buf, 63, " %u silver", spsplit);
|
||||
msg += buf;
|
||||
one = true;
|
||||
}
|
||||
if(cpsplit > 0) {
|
||||
if(one)
|
||||
msg += ",";
|
||||
//this message is not 100% accurate for the splitter
|
||||
//if they are receiving any roundoff
|
||||
snprintf(buf, 63, " %u copper", cpsplit);
|
||||
msg += buf;
|
||||
one = true;
|
||||
}
|
||||
msg += " as your split";
|
||||
|
||||
for (i = 0; i < MAX_RAID_MEMBERS; i++) {
|
||||
if (members[i].member != nullptr) { // If Group Member is Client
|
||||
uint32 mod;
|
||||
//try to handle round off error a little better
|
||||
if(membercount > 1) {
|
||||
mod = platinum % membercount;
|
||||
if((mod) > 0) {
|
||||
platinum -= mod;
|
||||
gold += 10 * mod;
|
||||
}
|
||||
mod = gold % membercount;
|
||||
if((mod) > 0) {
|
||||
gold -= mod;
|
||||
silver += 10 * mod;
|
||||
}
|
||||
mod = silver % membercount;
|
||||
if((mod) > 0) {
|
||||
silver -= mod;
|
||||
copper += 10 * mod;
|
||||
}
|
||||
}
|
||||
|
||||
//calculate the splits
|
||||
//We can still round off copper pieces, but I dont care
|
||||
uint32 sc;
|
||||
uint32 cpsplit = copper / membercount;
|
||||
sc = copper % membercount;
|
||||
uint32 spsplit = silver / membercount;
|
||||
uint32 gpsplit = gold / membercount;
|
||||
uint32 ppsplit = platinum / membercount;
|
||||
|
||||
char buf[128];
|
||||
buf[63] = '\0';
|
||||
string msg = "You receive";
|
||||
bool one = false;
|
||||
|
||||
if(ppsplit > 0) {
|
||||
snprintf(buf, 63, " %u platinum", ppsplit);
|
||||
msg += buf;
|
||||
one = true;
|
||||
}
|
||||
if(gpsplit > 0) {
|
||||
if(one)
|
||||
msg += ",";
|
||||
snprintf(buf, 63, " %u gold", gpsplit);
|
||||
msg += buf;
|
||||
one = true;
|
||||
}
|
||||
if(spsplit > 0) {
|
||||
if(one)
|
||||
msg += ",";
|
||||
snprintf(buf, 63, " %u silver", spsplit);
|
||||
msg += buf;
|
||||
one = true;
|
||||
}
|
||||
if(cpsplit > 0) {
|
||||
if(one)
|
||||
msg += ",";
|
||||
//this message is not 100% accurate for the splitter
|
||||
//if they are receiving any roundoff
|
||||
snprintf(buf, 63, " %u copper", cpsplit);
|
||||
msg += buf;
|
||||
one = true;
|
||||
}
|
||||
msg += " as your split";
|
||||
|
||||
for (i = 0; i < MAX_RAID_MEMBERS; i++) {
|
||||
if (members[i].member != nullptr) { // If Group Member is Client
|
||||
//I could not get MoneyOnCorpse to work, so we use this
|
||||
members[i].member->AddMoneyToPP(cpsplit, spsplit, gpsplit, ppsplit, true);
|
||||
|
||||
|
||||
members[i].member->Message(2, msg.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Raid::GroupBardPulse(Mob* caster, uint16 spellid, uint32 gid){
|
||||
@@ -664,7 +663,7 @@ void Raid::GroupBardPulse(Mob* caster, uint16 spellid, uint32 gid){
|
||||
return;
|
||||
|
||||
range = caster->GetAOERange(spellid);
|
||||
|
||||
|
||||
float range2 = range*range;
|
||||
|
||||
for(z=0; z < MAX_RAID_MEMBERS; z++) {
|
||||
@@ -694,7 +693,7 @@ void Raid::GroupBardPulse(Mob* caster, uint16 spellid, uint32 gid){
|
||||
|
||||
void Raid::TeleportGroup(Mob* sender, uint32 zoneID, uint16 instance_id, float x, float y, float z, float heading, uint32 gid)
|
||||
{
|
||||
for(int i = 0; i < MAX_RAID_MEMBERS; i++)
|
||||
for(int i = 0; i < MAX_RAID_MEMBERS; i++)
|
||||
{
|
||||
if(members[i].member)
|
||||
{
|
||||
@@ -703,13 +702,13 @@ void Raid::TeleportGroup(Mob* sender, uint32 zoneID, uint16 instance_id, float x
|
||||
members[i].member->MovePC(zoneID, instance_id, x, y, z, heading, 0, ZoneSolicited);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void Raid::TeleportRaid(Mob* sender, uint32 zoneID, uint16 instance_id, float x, float y, float z, float heading)
|
||||
{
|
||||
for(int i = 0; i < MAX_RAID_MEMBERS; i++)
|
||||
for(int i = 0; i < MAX_RAID_MEMBERS; i++)
|
||||
{
|
||||
if(members[i].member)
|
||||
{
|
||||
@@ -721,7 +720,7 @@ void Raid::TeleportRaid(Mob* sender, uint32 zoneID, uint16 instance_id, float x,
|
||||
void Raid::ChangeLootType(uint32 type)
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char* query = 0;
|
||||
char* query = 0;
|
||||
MYSQL_RES *result;
|
||||
if (database.RunQuery(query,MakeAnyLenString(&query, "UPDATE raid_details SET loottype=%lu WHERE raidid=%lu", (unsigned long)type, (unsigned long)GetID()),errbuf,&result)){
|
||||
mysql_free_result(result);
|
||||
@@ -734,14 +733,14 @@ void Raid::ChangeLootType(uint32 type)
|
||||
void Raid::AddRaidLooter(const char* looter)
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char* query = 0;
|
||||
char* query = 0;
|
||||
MYSQL_RES *result;
|
||||
if (database.RunQuery(query,MakeAnyLenString(&query, "UPDATE raid_members SET islooter=1 WHERE name='%s'", looter),errbuf,&result)){
|
||||
mysql_free_result(result);
|
||||
}
|
||||
|
||||
safe_delete_array(query);
|
||||
|
||||
|
||||
for(int x = 0; x < MAX_RAID_MEMBERS; x++)
|
||||
{
|
||||
if(strcmp(looter, members[x].membername) == 0)
|
||||
@@ -771,14 +770,14 @@ void Raid::AddRaidLooter(const char* looter)
|
||||
void Raid::RemoveRaidLooter(const char* looter)
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char* query = 0;
|
||||
char* query = 0;
|
||||
MYSQL_RES *result;
|
||||
if (database.RunQuery(query,MakeAnyLenString(&query, "UPDATE raid_members SET islooter=0 WHERE name='%s'", looter),errbuf,&result)){
|
||||
mysql_free_result(result);
|
||||
}
|
||||
|
||||
safe_delete_array(query);
|
||||
|
||||
|
||||
for(int x = 0; x < MAX_RAID_MEMBERS; x++)
|
||||
{
|
||||
if(strcmp(looter, members[x].membername) == 0)
|
||||
@@ -987,8 +986,8 @@ void Raid::SendRaidMove(const char* who, Client *to)
|
||||
SendRaidAdd(who, to);
|
||||
if(c && c == to){
|
||||
SendBulkRaid(c);
|
||||
if(IsLocked()) {
|
||||
SendRaidLockTo(c);
|
||||
if(IsLocked()) {
|
||||
SendRaidLockTo(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1080,7 +1079,7 @@ void Raid::SendGroupUpdate(Client *to)
|
||||
return;
|
||||
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_GroupUpdate,sizeof(GroupUpdate2_Struct));
|
||||
GroupUpdate2_Struct* gu = (GroupUpdate2_Struct*)outapp->pBuffer;
|
||||
GroupUpdate2_Struct* gu = (GroupUpdate2_Struct*)outapp->pBuffer;
|
||||
gu->action = groupActUpdate;
|
||||
int index = 0;
|
||||
uint32 grp = GetGroup(to->GetName());
|
||||
@@ -1227,7 +1226,7 @@ void Raid::SendRaidGroupRemove(const char *who, uint32 gid)
|
||||
void Raid::LockRaid(bool lockFlag)
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char* query = 0;
|
||||
char* query = 0;
|
||||
MYSQL_RES *result;
|
||||
if (database.RunQuery(query,MakeAnyLenString(&query, "UPDATE raid_details SET locked=%d WHERE raidid=%lu", lockFlag, (unsigned long)GetID()),errbuf,&result)){
|
||||
mysql_free_result(result);
|
||||
@@ -1253,7 +1252,7 @@ void Raid::LockRaid(bool lockFlag)
|
||||
void Raid::SetRaidDetails()
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char* query = 0;
|
||||
char* query = 0;
|
||||
MYSQL_RES *result;
|
||||
if (database.RunQuery(query,MakeAnyLenString(&query, "INSERT INTO raid_details SET raidid=%lu, loottype=4, locked=0", (unsigned long)GetID()),errbuf,&result)){
|
||||
mysql_free_result(result);
|
||||
@@ -1265,7 +1264,7 @@ void Raid::SetRaidDetails()
|
||||
void Raid::GetRaidDetails()
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char* query = 0;
|
||||
char* query = 0;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
if (database.RunQuery(query,MakeAnyLenString(&query, "SELECT locked, loottype FROM raid_details WHERE raidid=%lu", (unsigned long)GetID()),errbuf,&result)){
|
||||
@@ -1288,7 +1287,7 @@ bool Raid::LearnMembers()
|
||||
{
|
||||
memset(members, 0, (sizeof(RaidMember)*MAX_RAID_MEMBERS));
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char* query = 0;
|
||||
char* query = 0;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
if (database.RunQuery(query,MakeAnyLenString(&query, "SELECT name, groupid, _class, level, isgroupleader, israidleader, islooter FROM raid_members WHERE raidid=%lu", (unsigned long)GetID()),errbuf,&result)){
|
||||
@@ -1365,10 +1364,10 @@ void Raid::SendHPPacketsTo(Client *c)
|
||||
{
|
||||
if(!c)
|
||||
return;
|
||||
|
||||
|
||||
uint32 gid = this->GetGroup(c);
|
||||
EQApplicationPacket hpapp;
|
||||
EQApplicationPacket outapp(OP_MobManaUpdate, sizeof(MobManaUpdate_Struct));
|
||||
EQApplicationPacket outapp(OP_MobManaUpdate, sizeof(MobManaUpdate_Struct));
|
||||
for(int x = 0; x < MAX_RAID_MEMBERS; x++)
|
||||
{
|
||||
if(members[x].member)
|
||||
@@ -1377,18 +1376,18 @@ void Raid::SendHPPacketsTo(Client *c)
|
||||
{
|
||||
members[x].member->CreateHPPacket(&hpapp);
|
||||
c->QueuePacket(&hpapp, false);
|
||||
if(c->GetClientVersion() >= EQClientSoD)
|
||||
{
|
||||
outapp.SetOpcode(OP_MobManaUpdate);
|
||||
MobManaUpdate_Struct *mmus = (MobManaUpdate_Struct *)outapp.pBuffer;
|
||||
mmus->spawn_id = members[x].member->GetID();
|
||||
mmus->mana = members[x].member->GetManaPercent();
|
||||
c->QueuePacket(&outapp, false);
|
||||
outapp.SetOpcode(OP_MobEnduranceUpdate);
|
||||
MobEnduranceUpdate_Struct *meus = (MobEnduranceUpdate_Struct *)outapp.pBuffer;
|
||||
meus->endurance = members[x].member->GetEndurancePercent();
|
||||
c->QueuePacket(&outapp, false);
|
||||
}
|
||||
if(c->GetClientVersion() >= EQClientSoD)
|
||||
{
|
||||
outapp.SetOpcode(OP_MobManaUpdate);
|
||||
MobManaUpdate_Struct *mmus = (MobManaUpdate_Struct *)outapp.pBuffer;
|
||||
mmus->spawn_id = members[x].member->GetID();
|
||||
mmus->mana = members[x].member->GetManaPercent();
|
||||
c->QueuePacket(&outapp, false);
|
||||
outapp.SetOpcode(OP_MobEnduranceUpdate);
|
||||
MobEnduranceUpdate_Struct *meus = (MobEnduranceUpdate_Struct *)outapp.pBuffer;
|
||||
meus->endurance = members[x].member->GetEndurancePercent();
|
||||
c->QueuePacket(&outapp, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1403,7 +1402,7 @@ void Raid::SendHPPacketsFrom(Mob *m)
|
||||
if(m->IsClient())
|
||||
gid = this->GetGroup(m->CastToClient());
|
||||
EQApplicationPacket hpapp;
|
||||
EQApplicationPacket outapp(OP_MobManaUpdate, sizeof(MobManaUpdate_Struct));
|
||||
EQApplicationPacket outapp(OP_MobManaUpdate, sizeof(MobManaUpdate_Struct));
|
||||
|
||||
m->CreateHPPacket(&hpapp);
|
||||
for(int x = 0; x < MAX_RAID_MEMBERS; x++)
|
||||
@@ -1413,18 +1412,18 @@ void Raid::SendHPPacketsFrom(Mob *m)
|
||||
if(!m->IsClient() || ((members[x].member != m->CastToClient()) && (members[x].GroupNumber == gid)))
|
||||
{
|
||||
members[x].member->QueuePacket(&hpapp, false);
|
||||
if(members[x].member->GetClientVersion() >= EQClientSoD)
|
||||
{
|
||||
outapp.SetOpcode(OP_MobManaUpdate);
|
||||
MobManaUpdate_Struct *mmus = (MobManaUpdate_Struct *)outapp.pBuffer;
|
||||
mmus->spawn_id = m->GetID();
|
||||
mmus->mana = m->GetManaPercent();
|
||||
members[x].member->QueuePacket(&outapp, false);
|
||||
outapp.SetOpcode(OP_MobEnduranceUpdate);
|
||||
MobEnduranceUpdate_Struct *meus = (MobEnduranceUpdate_Struct *)outapp.pBuffer;
|
||||
meus->endurance = m->GetEndurancePercent();
|
||||
members[x].member->QueuePacket(&outapp, false);
|
||||
}
|
||||
if(members[x].member->GetClientVersion() >= EQClientSoD)
|
||||
{
|
||||
outapp.SetOpcode(OP_MobManaUpdate);
|
||||
MobManaUpdate_Struct *mmus = (MobManaUpdate_Struct *)outapp.pBuffer;
|
||||
mmus->spawn_id = m->GetID();
|
||||
mmus->mana = m->GetManaPercent();
|
||||
members[x].member->QueuePacket(&outapp, false);
|
||||
outapp.SetOpcode(OP_MobEnduranceUpdate);
|
||||
MobEnduranceUpdate_Struct *meus = (MobEnduranceUpdate_Struct *)outapp.pBuffer;
|
||||
meus->endurance = m->GetEndurancePercent();
|
||||
members[x].member->QueuePacket(&outapp, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user