mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 16:37:00 +00:00
[7728] Use correct loot_type values in data sent to client instead long time existed hacks. Code cleanups.
Thanks to Seizerkiller and TOM_RUS for help in reseach.
This commit is contained in:
parent
9ab8c6edd3
commit
5b9e46edea
3 changed files with 51 additions and 76 deletions
|
|
@ -1134,7 +1134,7 @@ void Player::Update( uint32 p_time )
|
||||||
if (hasUnitState(UNIT_STAT_MELEE_ATTACKING))
|
if (hasUnitState(UNIT_STAT_MELEE_ATTACKING))
|
||||||
{
|
{
|
||||||
Unit *pVictim = getVictim();
|
Unit *pVictim = getVictim();
|
||||||
if( !IsNonMeleeSpellCasted(false) && pVictim)
|
if (pVictim && !IsNonMeleeSpellCasted(false))
|
||||||
{
|
{
|
||||||
// default combat reach 10
|
// default combat reach 10
|
||||||
// TODO add weapon,skill check
|
// TODO add weapon,skill check
|
||||||
|
|
@ -7083,12 +7083,6 @@ void Player::RemovedInsignia(Player* looterPlr)
|
||||||
looterPlr->SendLoot(bones->GetGUID(), LOOT_INSIGNIA);
|
looterPlr->SendLoot(bones->GetGUID(), LOOT_INSIGNIA);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Loot type MUST be
|
|
||||||
1-corpse, go
|
|
||||||
2-skinning
|
|
||||||
3-Fishing
|
|
||||||
*/
|
|
||||||
|
|
||||||
void Player::SendLootRelease( uint64 guid )
|
void Player::SendLootRelease( uint64 guid )
|
||||||
{
|
{
|
||||||
WorldPacket data( SMSG_LOOT_RELEASE_RESPONSE, (8+1) );
|
WorldPacket data( SMSG_LOOT_RELEASE_RESPONSE, (8+1) );
|
||||||
|
|
@ -7147,50 +7141,28 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(loot_type == LOOT_DISENCHANTING)
|
|
||||||
{
|
|
||||||
loot = &item->loot;
|
loot = &item->loot;
|
||||||
|
|
||||||
if (!item->m_lootGenerated)
|
if (!item->m_lootGenerated)
|
||||||
{
|
{
|
||||||
item->m_lootGenerated = true;
|
item->m_lootGenerated = true;
|
||||||
loot->clear();
|
loot->clear();
|
||||||
|
|
||||||
|
switch(loot_type)
|
||||||
|
{
|
||||||
|
case LOOT_DISENCHANTING:
|
||||||
loot->FillLoot(item->GetProto()->DisenchantID, LootTemplates_Disenchant, this,true);
|
loot->FillLoot(item->GetProto()->DisenchantID, LootTemplates_Disenchant, this,true);
|
||||||
}
|
break;
|
||||||
}
|
case LOOT_PROSPECTING:
|
||||||
else if(loot_type == LOOT_PROSPECTING)
|
|
||||||
{
|
|
||||||
loot = &item->loot;
|
|
||||||
|
|
||||||
if(!item->m_lootGenerated)
|
|
||||||
{
|
|
||||||
item->m_lootGenerated = true;
|
|
||||||
loot->clear();
|
|
||||||
loot->FillLoot(item->GetEntry(), LootTemplates_Prospecting, this,true);
|
loot->FillLoot(item->GetEntry(), LootTemplates_Prospecting, this,true);
|
||||||
}
|
break;
|
||||||
}
|
case LOOT_MILLING:
|
||||||
else if(loot_type == LOOT_MILLING)
|
|
||||||
{
|
|
||||||
loot = &item->loot;
|
|
||||||
|
|
||||||
if(!item->m_lootGenerated)
|
|
||||||
{
|
|
||||||
item->m_lootGenerated = true;
|
|
||||||
loot->clear();
|
|
||||||
loot->FillLoot(item->GetEntry(), LootTemplates_Milling, this,true);
|
loot->FillLoot(item->GetEntry(), LootTemplates_Milling, this,true);
|
||||||
}
|
break;
|
||||||
}
|
default:
|
||||||
else
|
|
||||||
{
|
|
||||||
loot = &item->loot;
|
|
||||||
|
|
||||||
if(!item->m_lootGenerated)
|
|
||||||
{
|
|
||||||
item->m_lootGenerated = true;
|
|
||||||
loot->clear();
|
|
||||||
loot->FillLoot(item->GetEntry(), LootTemplates_Item, this,true);
|
loot->FillLoot(item->GetEntry(), LootTemplates_Item, this,true);
|
||||||
|
|
||||||
loot->generateMoneyLoot(item->GetProto()->MinMoneyLoot,item->GetProto()->MaxMoneyLoot);
|
loot->generateMoneyLoot(item->GetProto()->MinMoneyLoot,item->GetProto()->MaxMoneyLoot);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7340,12 +7312,13 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
|
||||||
|
|
||||||
SetLootGUID(guid);
|
SetLootGUID(guid);
|
||||||
|
|
||||||
// LOOT_PICKPOCKETING, LOOT_PROSPECTING, LOOT_DISENCHANTING, LOOT_INSIGNIA and LOOT_MILLING unsupported by client, sending LOOT_SKINNING instead
|
// LOOT_INSIGNIA and LOOT_FISHINGHOLE unsupported by client
|
||||||
if(loot_type == LOOT_PICKPOCKETING || loot_type == LOOT_DISENCHANTING || loot_type == LOOT_PROSPECTING || loot_type == LOOT_INSIGNIA || loot_type == LOOT_MILLING)
|
switch(loot_type)
|
||||||
loot_type = LOOT_SKINNING;
|
{
|
||||||
|
case LOOT_INSIGNIA: loot_type = LOOT_SKINNING; break;
|
||||||
if(loot_type == LOOT_FISHINGHOLE)
|
case LOOT_FISHINGHOLE: loot_type = LOOT_FISHING; break;
|
||||||
loot_type = LOOT_FISHING;
|
default: break;
|
||||||
|
}
|
||||||
|
|
||||||
WorldPacket data(SMSG_LOOT_RESPONSE, (9+50)); // we guess size
|
WorldPacket data(SMSG_LOOT_RESPONSE, (9+50)); // we guess size
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -460,14 +460,16 @@ enum ActivateTaxiReplies
|
||||||
enum LootType
|
enum LootType
|
||||||
{
|
{
|
||||||
LOOT_CORPSE = 1,
|
LOOT_CORPSE = 1,
|
||||||
LOOT_SKINNING = 2,
|
LOOT_PICKPOCKETING = 2,
|
||||||
LOOT_FISHING = 3,
|
LOOT_FISHING = 3,
|
||||||
LOOT_PICKPOCKETING = 4, // unsupported by client, sending LOOT_SKINNING instead
|
LOOT_DISENCHANTING = 4,
|
||||||
LOOT_DISENCHANTING = 5, // unsupported by client, sending LOOT_SKINNING instead
|
// ignored always by client
|
||||||
LOOT_PROSPECTING = 6, // unsupported by client, sending LOOT_SKINNING instead
|
LOOT_SKINNING = 6,
|
||||||
LOOT_INSIGNIA = 7, // unsupported by client, sending LOOT_SKINNING instead
|
LOOT_PROSPECTING = 7,
|
||||||
LOOT_FISHINGHOLE = 8, // unsupported by client, sending LOOT_FISHING instead
|
LOOT_MILLING = 8,
|
||||||
LOOT_MILLING = 9 // unsupported by client, sending LOOT_SKINNING instead
|
|
||||||
|
LOOT_FISHINGHOLE = 20, // unsupported by client, sending LOOT_FISHING instead
|
||||||
|
LOOT_INSIGNIA = 21 // unsupported by client, sending LOOT_CORPSE instead
|
||||||
};
|
};
|
||||||
|
|
||||||
enum MirrorTimerType
|
enum MirrorTimerType
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7727"
|
#define REVISION_NR "7728"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue