mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Trevius: Mercenaries can now zone once again.
This commit is contained in:
+45
-24
@@ -78,7 +78,8 @@ bool Client::Process() {
|
||||
if(Connected() || IsLD())
|
||||
{
|
||||
// try to send all packets that weren't sent before
|
||||
if(!IsLD() && zoneinpacket_timer.Check()){
|
||||
if(!IsLD() && zoneinpacket_timer.Check())
|
||||
{
|
||||
SendAllPackets();
|
||||
}
|
||||
|
||||
@@ -145,7 +146,9 @@ bool Client::Process() {
|
||||
|
||||
if(mana_timer.Check())
|
||||
SendManaUpdatePacket();
|
||||
if(dead && dead_timer.Check()) {
|
||||
|
||||
if(dead && dead_timer.Check())
|
||||
{
|
||||
database.MoveCharacterToZone(GetName(),database.GetZoneName(m_pp.binds[0].zoneId));
|
||||
m_pp.zone_id = m_pp.binds[0].zoneId;
|
||||
m_pp.zoneInstance = 0;
|
||||
@@ -176,14 +179,16 @@ bool Client::Process() {
|
||||
if(TaskPeriodic_Timer.Check() && taskstate)
|
||||
taskstate->TaskPeriodicChecks(this);
|
||||
|
||||
if(linkdead_timer.Check()){
|
||||
if(linkdead_timer.Check())
|
||||
{
|
||||
LeaveGroup();
|
||||
Save();
|
||||
if (GetMerc())
|
||||
{
|
||||
GetMerc()->Save();
|
||||
GetMerc()->Depop();
|
||||
}
|
||||
LeaveGroup();
|
||||
|
||||
Raid *myraid = entity_list.GetRaidByClient(this);
|
||||
if (myraid)
|
||||
{
|
||||
@@ -192,7 +197,8 @@ bool Client::Process() {
|
||||
return false; //delete client
|
||||
}
|
||||
|
||||
if (camp_timer.Check()) {
|
||||
if (camp_timer.Check())
|
||||
{
|
||||
LeaveGroup();
|
||||
Save();
|
||||
if (GetMerc())
|
||||
@@ -228,20 +234,22 @@ bool Client::Process() {
|
||||
} else {
|
||||
if(!ApplyNextBardPulse(bardsong, song_target, bardsong_slot))
|
||||
InterruptSpell(SONG_ENDS_ABRUPTLY, 0x121, bardsong);
|
||||
// SpellFinished(bardsong, bardsong_target, bardsong_slot, spells[bardsong].mana);
|
||||
//SpellFinished(bardsong, bardsong_target, bardsong_slot, spells[bardsong].mana);
|
||||
}
|
||||
}
|
||||
|
||||
if(GetMerc())
|
||||
{
|
||||
UpdateMercTimer();
|
||||
UpdateMercTimer();
|
||||
}
|
||||
|
||||
if(GetMercInfo().MercTemplateID != 0 && GetMercInfo().IsSuspended)
|
||||
{
|
||||
if(p_timers.Expired(&database, pTimerMercSuspend, false)) {
|
||||
CheckMercSuspendTimer();
|
||||
}
|
||||
//CheckMercSuspendTimer();
|
||||
if(p_timers.Expired(&database, pTimerMercSuspend, false))
|
||||
{
|
||||
CheckMercSuspendTimer();
|
||||
}
|
||||
}
|
||||
|
||||
if(IsAIControlled())
|
||||
@@ -715,16 +723,13 @@ bool Client::Process() {
|
||||
}
|
||||
#endif
|
||||
|
||||
if (client_state != CLIENT_LINKDEAD && (client_state == CLIENT_ERROR || client_state == DISCONNECTED || client_state == CLIENT_KICKED || !eqs->CheckState(ESTABLISHED))) {
|
||||
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();
|
||||
if (client_state != CLIENT_KICKED) {
|
||||
Save();
|
||||
}
|
||||
if (GetMerc())
|
||||
{
|
||||
GetMerc()->Depop();
|
||||
}
|
||||
|
||||
client_state = CLIENT_LINKDEAD;
|
||||
if (zoning || instalog || GetGM())
|
||||
@@ -732,23 +737,32 @@ bool Client::Process() {
|
||||
Group *mygroup = GetGroup();
|
||||
if (mygroup)
|
||||
{
|
||||
if (!zoning) {
|
||||
if (!zoning)
|
||||
{
|
||||
entity_list.MessageGroup(this, true, 15, "%s logged out.", GetName());
|
||||
mygroup->DelMember(this);
|
||||
} else {
|
||||
LeaveGroup();
|
||||
}
|
||||
else
|
||||
{
|
||||
entity_list.MessageGroup(this, true, 15, "%s left the zone.", GetName());
|
||||
mygroup->MemberZoned(this);
|
||||
if (GetMerc() && GetMerc()->HasGroup() && GetMerc()->GetGroup() == mygroup)
|
||||
{
|
||||
mygroup->DelMember(GetMerc());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Raid *myraid = entity_list.GetRaidByClient(this);
|
||||
if (myraid)
|
||||
{
|
||||
if (!zoning) {
|
||||
if (!zoning)
|
||||
{
|
||||
//entity_list.MessageGroup(this,true,15,"%s logged out.",GetName());
|
||||
//mygroup->DelMember(this);
|
||||
myraid->MemberZoned(this);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
//entity_list.MessageGroup(this,true,15,"%s left the zone.",GetName());
|
||||
myraid->MemberZoned(this);
|
||||
}
|
||||
@@ -774,8 +788,14 @@ bool Client::Process() {
|
||||
|
||||
/* Just a set of actions preformed all over in Client::Process */
|
||||
void Client::OnDisconnect(bool hard_disconnect) {
|
||||
if(hard_disconnect) {
|
||||
LeaveGroup();
|
||||
if(hard_disconnect)
|
||||
{
|
||||
LeaveGroup();
|
||||
if (GetMerc())
|
||||
{
|
||||
GetMerc()->Save();
|
||||
GetMerc()->Depop();
|
||||
}
|
||||
Raid *MyRaid = entity_list.GetRaidByClient(this);
|
||||
|
||||
if (MyRaid)
|
||||
@@ -791,7 +811,8 @@ void Client::OnDisconnect(bool hard_disconnect) {
|
||||
}
|
||||
|
||||
Mob *Other = trade->With();
|
||||
if(Other) {
|
||||
if(Other)
|
||||
{
|
||||
mlog(TRADING__CLIENT, "Client disconnected during a trade. Returning their items.");
|
||||
FinishTrade(this);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user