Skip to content

Commit

Permalink
Fixed various issues:
Browse files Browse the repository at this point in the history
- Hardcore will now kick to server or character (i forget which tbh) on death.
- Fixed a typo in group restrictions for solo mode.
- Fixed an issue where experience was not reset on setting SSF flags via lua call.
-Added return near OP_ClickObject to prevent picking up items when you shouldn't.
- Fixed IsBeneficialAllowed by moving PVP to the bottom of client <-> client beneficial checks, after the SSF checks.
- Removed a function copy that was committed by mistake.
  • Loading branch information
SecretsOTheP committed Jul 30, 2023
1 parent de77af7 commit 0cf6efe
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 18 deletions.
8 changes: 4 additions & 4 deletions zone/aggro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1055,9 +1055,6 @@ bool Mob::IsBeneficialAllowed(Mob *target)
return false;
}

if (c1->GetPVP() == c2->GetPVP())
return true;

if (c1->IsSoloOnly() || c2->IsSoloOnly())
{
// if either are solo only don't allow.
Expand All @@ -1068,10 +1065,13 @@ bool Mob::IsBeneficialAllowed(Mob *target)
{
bool can_get_experience = c1->IsInLevelRange(c2->GetLevel());
bool compatible = c1->IsSelfFound() == c2->IsSelfFound();
if (!compatible || compatible && can_get_experience)
if (!compatible || compatible && !can_get_experience)
return false;
}

if (c1->GetPVP() == c2->GetPVP())
return true;

}
else if(_NPC(mob2)) // client to npc
{
Expand Down
13 changes: 0 additions & 13 deletions zone/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1605,19 +1605,6 @@ void Client::SendClientMoneyUpdate(uint8 type,uint32 amount){
safe_delete(outapp);
}


void Client::SendClientMoneyUpdate(uint8 type, uint32 amount) {
auto outapp = new EQApplicationPacket(OP_TradeMoneyUpdate, sizeof(TradeMoneyUpdate_Struct));
TradeMoneyUpdate_Struct* mus = (TradeMoneyUpdate_Struct*)outapp->pBuffer;
mus->amount = amount;
mus->trader = 0;
mus->type = type;
Log(Logs::Detail, Logs::Debug, "Client::SendClientMoneyUpdate() %s added %i coin of type: %i.",
GetName(), amount, type);
QueuePacket(outapp);
safe_delete(outapp);
}

void Client::SendClientMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum)
{
// This method is used to update the client's coin when /split is used, and it cannot
Expand Down
3 changes: 2 additions & 1 deletion zone/client_packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2824,6 +2824,7 @@ void Client::Handle_OP_ClickObject(const EQApplicationPacket *app)
loreitem->drop_id = 0xFFFFFFFF;
QueuePacket(outapp);
safe_delete(outapp);
return;
}
}

Expand Down Expand Up @@ -4997,7 +4998,7 @@ void Client::Handle_OP_GroupInvite2(const EQApplicationPacket *app)

if (IsSoloOnly())
{
Message(CC_Red, "You have solo mode enabled, and cannot group with you.");
Message(CC_Red, "You have solo mode enabled, and cannot group with anyone.");
return;
}

Expand Down
5 changes: 5 additions & 0 deletions zone/inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ void Client::ResetStartingSkills()

void Client::ClearPlayerInfoAndGrantStartingItems()
{

//Clear player's money.
ClearMoney();

Expand Down Expand Up @@ -535,6 +536,10 @@ void Client::ClearPlayerInfoAndGrantStartingItems()
//Grant starting items to the player again, since we just removed their inventory.
database.ResetStartingItems(this, m_pp.race, m_pp.class_, m_pp.deity, m_pp.binds[4].zoneId, m_pp.name, Admin());

//Set Level / EXP to 0.
SetLevel(1, true);
SetEXP(0, 0);

//Their state is likely all sorts of messed up. Commit immediately (Save) and then Kick them.
Save(1);
}
Expand Down
5 changes: 5 additions & 0 deletions zone/zoning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,12 @@ void Client::GoToBind(uint8 bindnum) {
void Client::GoToDeath() {
//Client will request a zone in EQMac era clients, but let's make sure they get there:
zone_mode = ZoneToBindPoint;

MovePC(m_pp.binds[0].zoneId, 0.0f, 0.0f, 0.0f, 0.0f, 1, ZoneToBindPoint);
if (IsHardcore())
{
WorldKick();
}
}

void Client::SetZoneFlag(uint32 zone_id) {
Expand Down

0 comments on commit 0cf6efe

Please sign in to comment.