No message when mobs drop gil
Forum rules
NO LONGER BEING MAINTAINED!
NO LONGER BEING MAINTAINED!
No message when mobs drop gil
I've noticed lately that when mobs drop gil, there's no message stating that a player has received gil. It's not a showstopper but was definitely confusing. Any thoughts on where to look?
Re: No message when mobs drop gil
Code: Select all
PChar->pushPacket(new CMessageDebugPacket(PChar, PChar, [b]VARIABLE HERE[/b], 0, 565));
Re: No message when mobs drop gil
probably not a debug packet would be more correctanglos wrote:Putting the above in the DistributeGil function seems to be the fix. Not sure if that's retail-correct though.Code: Select all
PChar->pushPacket(new CMessageDebugPacket(PChar, PChar, [b]VARIABLE HERE[/b], 0, 565));
(i think, i'm no master of packets by any means)
Re: No message when mobs drop gil
What would be the alternative to the DebugPacket? I just figured this out hunting through stuff. Also, I made a mistake above.kjLotus wrote:probably not a debug packet would be more correctanglos wrote:Putting the above in the DistributeGil function seems to be the fix. Not sure if that's retail-correct though.Code: Select all
PChar->pushPacket(new CMessageDebugPacket(PChar, PChar, [b]VARIABLE HERE[/b], 0, 565));
(i think, i'm no master of packets by any means)
Solo:
Code: Select all
else if (distance(PChar->loc.p, PMob->loc.p) < 100)
{
UpdateItem(PChar, LOC_INVENTORY, 0, gil);
PChar->pushPacket(new CMessageDebugPacket(PChar, PChar, gil, 0, 565));
}
Code: Select all
for (uint8 i = 0; i < PChar->PParty->members.size(); i++)
{
CCharEntity* PMember = (CCharEntity*)PChar->PParty->members[i];
if (PMember->getZone() == PMob->getZone() && distance(PMember->loc.p, PMob->loc.p) < 100)
{
UpdateItem(PMember, LOC_INVENTORY, 0, gilperperson);
PMember->pushPacket(new CMessageDebugPacket(PMember, PMember, gilperperson, 0, 565));
}
}
-
- Posts: 16
- Joined: Tue Jan 22, 2013 12:10 pm
Re: No message when mobs drop gil
party:
alone:
Also! If you want everything to drop gil,
(ai/ai_mob_dummy.cpp)
Original:
To make everything drop gil:
Or you can just remove the commented lines.
Code: Select all
if (PMember->getZone() == PMob->getZone() && distance(PMember->loc.p, PMob->loc.p) < 100)
{
UpdateItem(PMember, LOC_INVENTORY, 0, gilperperson);
PChar->pushPacket(new CMessageDebugPacket(PChar, PChar, gilperperson, 0, 565));
}
Code: Select all
else if (distance(PChar->loc.p, PMob->loc.p) < 100)
{
UpdateItem(PChar, LOC_INVENTORY, 0, gil);
PChar->pushPacket(new CMessageDebugPacket(PChar, PChar, gil, 0, 565));
}
(ai/ai_mob_dummy.cpp)
Original:
Code: Select all
if(m_PMob->m_EcoSystem == SYSTEM_BEASTMEN || m_PMob->m_Type & MOBTYPE_NOTORIOUS)
{
charutils::DistributeGil(PChar, m_PMob); // TODO: REALISATION MUST BE IN TREASUREPOOL
}
Code: Select all
//if(m_PMob->m_EcoSystem == SYSTEM_BEASTMEN || m_PMob->m_Type & MOBTYPE_NOTORIOUS)
//{
charutils::DistributeGil(PChar, m_PMob); // TODO: REALISATION MUST BE IN TREASUREPOOL
//}
Re: No message when mobs drop gil
twistedvengeance,
That's what I've got so far except for party, I used pmember within the party loop as pchar was causing only one person to get the message instead of all members of the party.
By the way, thank you all for your assistance.
That's what I've got so far except for party, I used pmember within the party loop as pchar was causing only one person to get the message instead of all members of the party.
By the way, thank you all for your assistance.
Re: No message when mobs drop gil
probably CMessageBasicPacket(sender, target, param, value, 565)anglos wrote:What would be the alternative to the DebugPacket? I just figured this out hunting through stuff. Also, I made a mistake above.
not sure which (param or value) is the gil amount, it'll be one of em
Re: No message when mobs drop gil
Just added this to main repository.
Re: No message when mobs drop gil
Hi Luatan,lautan wrote:Just added this to main repository.
I found that if you use PChar in the party loop for the gil message, the person that lands the killing blow gets the gil message x the number of party members while no one else gets the message. Everyone gets gil though.
This was my solution:
Code: Select all
uint32 gilperperson = count == 0 ? gil : (gil / count);
for (uint8 i = 0; i < PChar->PParty->members.size(); i++)
{
CCharEntity* PMember = (CCharEntity*)PChar->PParty->members[i];
if (PMember->getZone() == PMob->getZone() && distance(PMember->loc.p, PMob->loc.p) < 100)
{
UpdateItem(PMember, LOC_INVENTORY, 0, gilperperson);
PMember->pushPacket(new CMessageDebugPacket(PMember, PMember, gilperperson, 0, 565));
}
}