mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
+34
-49
@@ -75,10 +75,7 @@ Client::Client(EQStreamInterface* ieqs)
|
||||
0, // npctypeid
|
||||
0, // size
|
||||
0.7, // runspeed
|
||||
0, // heading
|
||||
0, // x
|
||||
0, // y
|
||||
0, // z
|
||||
xyz_heading::Origin(),
|
||||
0, // light
|
||||
0xFF, // texture
|
||||
0xFF, // helmtexture
|
||||
@@ -144,7 +141,11 @@ Client::Client(EQStreamInterface* ieqs)
|
||||
RespawnFromHoverTimer(0),
|
||||
merc_timer(RuleI(Mercs, UpkeepIntervalMS)),
|
||||
ItemTickTimer(10000),
|
||||
ItemQuestTimer(500)
|
||||
ItemQuestTimer(500),
|
||||
m_Proximity(FLT_MAX, FLT_MAX, FLT_MAX), //arbitrary large number
|
||||
m_ZoneSummonLocation(-2.0f,-2.0f,-2.0f),
|
||||
m_AutoAttackPosition(0.0f, 0.0f, 0.0f, 0.0f),
|
||||
m_AutoAttackTargetLocation(0.0f, 0.0f, 0.0f)
|
||||
{
|
||||
for(int cf=0; cf < _FilterCount; cf++)
|
||||
ClientFilters[cf] = FilterShow;
|
||||
@@ -190,16 +191,10 @@ Client::Client(EQStreamInterface* ieqs)
|
||||
auto_attack = false;
|
||||
auto_fire = false;
|
||||
linkdead_timer.Disable();
|
||||
zonesummon_x = -2;
|
||||
zonesummon_y = -2;
|
||||
zonesummon_z = -2;
|
||||
zonesummon_id = 0;
|
||||
zonesummon_ignorerestrictions = 0;
|
||||
zoning = false;
|
||||
zone_mode = ZoneUnsolicited;
|
||||
proximity_x = FLT_MAX; //arbitrary large number
|
||||
proximity_y = FLT_MAX;
|
||||
proximity_z = FLT_MAX;
|
||||
casting_spell_id = 0;
|
||||
npcflag = false;
|
||||
npclevel = 0;
|
||||
@@ -268,13 +263,6 @@ Client::Client(EQStreamInterface* ieqs)
|
||||
m_AssistExemption = 0;
|
||||
m_CheatDetectMoved = false;
|
||||
CanUseReport = true;
|
||||
aa_los_me.x = 0;
|
||||
aa_los_me.y = 0;
|
||||
aa_los_me.z = 0;
|
||||
aa_los_me_heading = 0;
|
||||
aa_los_them.x = 0;
|
||||
aa_los_them.y = 0;
|
||||
aa_los_them.z = 0;
|
||||
aa_los_them_mob = nullptr;
|
||||
los_status = false;
|
||||
los_status_facing = false;
|
||||
@@ -385,9 +373,9 @@ Client::~Client() {
|
||||
{
|
||||
m_pp.zone_id = m_pp.binds[0].zoneId;
|
||||
m_pp.zoneInstance = m_pp.binds[0].instance_id;
|
||||
x_pos = m_pp.binds[0].x;
|
||||
y_pos = m_pp.binds[0].y;
|
||||
z_pos = m_pp.binds[0].z;
|
||||
m_Position.m_X = m_pp.binds[0].x;
|
||||
m_Position.m_Y = m_pp.binds[0].y;
|
||||
m_Position.m_Z = m_pp.binds[0].z;
|
||||
}
|
||||
|
||||
// we save right now, because the client might be zoning and the world
|
||||
@@ -511,11 +499,11 @@ bool Client::Save(uint8 iCommitNow) {
|
||||
return false;
|
||||
|
||||
/* Wrote current basics to PP for saves */
|
||||
m_pp.x = x_pos;
|
||||
m_pp.y = y_pos;
|
||||
m_pp.z = z_pos;
|
||||
m_pp.x = m_Position.m_X;
|
||||
m_pp.y = m_Position.m_Y;
|
||||
m_pp.z = m_Position.m_Z;
|
||||
m_pp.guildrank = guildrank;
|
||||
m_pp.heading = heading;
|
||||
m_pp.heading = m_Position.m_Heading;
|
||||
|
||||
/* Mana and HP */
|
||||
if (GetHP() <= 0) {
|
||||
@@ -532,8 +520,10 @@ bool Client::Save(uint8 iCommitNow) {
|
||||
database.SaveCharacterCurrency(CharacterID(), &m_pp);
|
||||
|
||||
/* Save Current Bind Points */
|
||||
database.SaveCharacterBindPoint(CharacterID(), m_pp.binds[0].zoneId, m_pp.binds[0].instance_id, m_pp.binds[0].x, m_pp.binds[0].y, m_pp.binds[0].z, 0, 0); /* Regular bind */
|
||||
database.SaveCharacterBindPoint(CharacterID(), m_pp.binds[4].zoneId, m_pp.binds[4].instance_id, m_pp.binds[4].x, m_pp.binds[4].y, m_pp.binds[4].z, 0, 1); /* Home Bind */
|
||||
auto regularBindPosition = xyz_heading(m_pp.binds[0].x, m_pp.binds[0].y, m_pp.binds[0].z, 0.0f);
|
||||
auto homeBindPosition = xyz_heading(m_pp.binds[4].x, m_pp.binds[4].y, m_pp.binds[4].z, 0.0f);
|
||||
database.SaveCharacterBindPoint(CharacterID(), m_pp.binds[0].zoneId, m_pp.binds[0].instance_id, regularBindPosition, 0); /* Regular bind */
|
||||
database.SaveCharacterBindPoint(CharacterID(), m_pp.binds[4].zoneId, m_pp.binds[4].instance_id, homeBindPosition, 1); /* Home Bind */
|
||||
|
||||
/* Save Character Buffs */
|
||||
database.SaveBuffs(this);
|
||||
@@ -3683,7 +3673,7 @@ void Client::Sacrifice(Client *caster)
|
||||
|
||||
void Client::SendOPTranslocateConfirm(Mob *Caster, uint16 SpellID) {
|
||||
|
||||
if(!Caster || PendingTranslocate)
|
||||
if(!Caster || PendingTranslocate)
|
||||
return;
|
||||
|
||||
const SPDat_Spell_Struct &Spell = spells[SpellID];
|
||||
@@ -4136,7 +4126,7 @@ bool Client::GroupFollow(Client* inviter) {
|
||||
{
|
||||
GetMerc()->MercJoinClientGroup();
|
||||
}
|
||||
|
||||
|
||||
if (inviter->IsLFP())
|
||||
{
|
||||
// If the player who invited us to a group is LFP, have them update world now that we have joined their group.
|
||||
@@ -4800,8 +4790,7 @@ void Client::SummonAndRezzAllCorpses()
|
||||
|
||||
entity_list.RemoveAllCorpsesByCharID(CharacterID());
|
||||
|
||||
int CorpseCount = database.SummonAllCharacterCorpses(CharacterID(), zone->GetZoneID(), zone->GetInstanceID(),
|
||||
GetX(), GetY(), GetZ(), GetHeading());
|
||||
int CorpseCount = database.SummonAllCharacterCorpses(CharacterID(), zone->GetZoneID(), zone->GetInstanceID(), GetPosition());
|
||||
if(CorpseCount <= 0)
|
||||
{
|
||||
Message(clientMessageYellow, "You have no corpses to summnon.");
|
||||
@@ -4816,13 +4805,11 @@ void Client::SummonAndRezzAllCorpses()
|
||||
Message(clientMessageYellow, "All your corpses have been summoned to your feet and have received a 100% resurrection.");
|
||||
}
|
||||
|
||||
void Client::SummonAllCorpses(float dest_x, float dest_y, float dest_z, float dest_heading)
|
||||
void Client::SummonAllCorpses(const xyz_heading& position)
|
||||
{
|
||||
|
||||
if(dest_x == 0 && dest_y == 0 && dest_z == 0 && dest_heading == 0)
|
||||
{
|
||||
dest_x = GetX(); dest_y = GetY(); dest_z = GetZ(); dest_heading = GetHeading();
|
||||
}
|
||||
auto summonLocation = position;
|
||||
if(position.isOrigin() && position.m_Heading == 0.0f)
|
||||
summonLocation = GetPosition();
|
||||
|
||||
ServerPacket *Pack = new ServerPacket(ServerOP_DepopAllPlayersCorpses, sizeof(ServerDepopAllPlayersCorpses_Struct));
|
||||
|
||||
@@ -4838,12 +4825,7 @@ void Client::SummonAllCorpses(float dest_x, float dest_y, float dest_z, float de
|
||||
|
||||
entity_list.RemoveAllCorpsesByCharID(CharacterID());
|
||||
|
||||
int CorpseCount = database.SummonAllCharacterCorpses(CharacterID(), zone->GetZoneID(), zone->GetInstanceID(),
|
||||
dest_x, dest_y, dest_z, dest_heading);
|
||||
if(CorpseCount <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
database.SummonAllCharacterCorpses(CharacterID(), zone->GetZoneID(), zone->GetInstanceID(), summonLocation);
|
||||
}
|
||||
|
||||
void Client::DepopAllCorpses()
|
||||
@@ -6291,8 +6273,11 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, 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, 10, -10, 10, -10, 8, -8, 8, -8 };
|
||||
static const float swarm_pet_y[MAX_SWARM_PETS] = { 5, 5, -5, -5, 10, 10, -10, -10, 8, 8, -8, -8 };
|
||||
static const xy_location swarmPetLocations[MAX_SWARM_PETS] = {
|
||||
{5, 5}, {-5, 5}, {5, -5}, {-5, -5},
|
||||
{10, 10}, {-10, 10}, {10, -10}, {-10, -10},
|
||||
{8, 8}, {-8, 8}, {8, -8}, {-8, -8}
|
||||
};
|
||||
|
||||
while(summon_count > 0) {
|
||||
NPCType *npc_dup = nullptr;
|
||||
@@ -6304,8 +6289,8 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid
|
||||
NPC* npca = new NPC(
|
||||
(npc_dup!=nullptr)?npc_dup:npc_type, //make sure we give the NPC the correct data pointer
|
||||
0,
|
||||
GetX()+swarm_pet_x[summon_count], GetY()+swarm_pet_y[summon_count],
|
||||
GetZ(), GetHeading(), FlyMode3);
|
||||
GetPosition()+swarmPetLocations[summon_count],
|
||||
FlyMode3);
|
||||
|
||||
if(!npca->GetSwarmInfo()){
|
||||
AA_SwarmPetInfo* nSI = new AA_SwarmPetInfo;
|
||||
@@ -7333,7 +7318,7 @@ void Client::SendMercPersonalInfo()
|
||||
uint32 altCurrentType = 19; //TODO: Implement alternate currency purchases involving mercs!
|
||||
|
||||
MercTemplate *mercData = &zone->merc_templates[GetMercInfo().MercTemplateID];
|
||||
|
||||
|
||||
int stancecount = 0;
|
||||
stancecount += zone->merc_stance_list[GetMercInfo().MercTemplateID].size();
|
||||
if(stancecount > MAX_MERC_STANCES || mercCount > MAX_MERC || mercTypeCount > MAX_MERC_GRADES)
|
||||
@@ -7435,7 +7420,7 @@ void Client::SendMercPersonalInfo()
|
||||
}
|
||||
if (MERC_DEBUG > 0)
|
||||
Message(7, "Mercenary Debug: SendMercPersonalInfo Send Successful");
|
||||
|
||||
|
||||
SendMercMerchantResponsePacket(0);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user