mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +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))
|
||||
{
|
||||
Unit *pVictim = getVictim();
|
||||
if( !IsNonMeleeSpellCasted(false) && pVictim)
|
||||
if (pVictim && !IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
// default combat reach 10
|
||||
// TODO add weapon,skill check
|
||||
|
|
@ -7083,12 +7083,6 @@ void Player::RemovedInsignia(Player* looterPlr)
|
|||
looterPlr->SendLoot(bones->GetGUID(), LOOT_INSIGNIA);
|
||||
}
|
||||
|
||||
/*Loot type MUST be
|
||||
1-corpse, go
|
||||
2-skinning
|
||||
3-Fishing
|
||||
*/
|
||||
|
||||
void Player::SendLootRelease( uint64 guid )
|
||||
{
|
||||
WorldPacket data( SMSG_LOOT_RELEASE_RESPONSE, (8+1) );
|
||||
|
|
@ -7120,18 +7114,18 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
|
|||
|
||||
loot = &go->loot;
|
||||
|
||||
if(go->getLootState() == GO_READY)
|
||||
if (go->getLootState() == GO_READY)
|
||||
{
|
||||
uint32 lootid = go->GetLootId();
|
||||
|
||||
if(lootid)
|
||||
if (lootid)
|
||||
{
|
||||
sLog.outDebug(" if(lootid)");
|
||||
loot->clear();
|
||||
loot->FillLoot(lootid, LootTemplates_Gameobject, this, false);
|
||||
}
|
||||
|
||||
if(loot_type == LOOT_FISHING)
|
||||
if (loot_type == LOOT_FISHING)
|
||||
go->getFishLoot(loot,this);
|
||||
|
||||
go->SetLootState(GO_ACTIVATED);
|
||||
|
|
@ -7147,50 +7141,28 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
|
|||
return;
|
||||
}
|
||||
|
||||
if(loot_type == LOOT_DISENCHANTING)
|
||||
{
|
||||
loot = &item->loot;
|
||||
|
||||
if(!item->m_lootGenerated)
|
||||
if (!item->m_lootGenerated)
|
||||
{
|
||||
item->m_lootGenerated = true;
|
||||
loot->clear();
|
||||
|
||||
switch(loot_type)
|
||||
{
|
||||
case LOOT_DISENCHANTING:
|
||||
loot->FillLoot(item->GetProto()->DisenchantID, LootTemplates_Disenchant, this,true);
|
||||
}
|
||||
}
|
||||
else if(loot_type == LOOT_PROSPECTING)
|
||||
{
|
||||
loot = &item->loot;
|
||||
|
||||
if(!item->m_lootGenerated)
|
||||
{
|
||||
item->m_lootGenerated = true;
|
||||
loot->clear();
|
||||
break;
|
||||
case LOOT_PROSPECTING:
|
||||
loot->FillLoot(item->GetEntry(), LootTemplates_Prospecting, this,true);
|
||||
}
|
||||
}
|
||||
else if(loot_type == LOOT_MILLING)
|
||||
{
|
||||
loot = &item->loot;
|
||||
|
||||
if(!item->m_lootGenerated)
|
||||
{
|
||||
item->m_lootGenerated = true;
|
||||
loot->clear();
|
||||
break;
|
||||
case LOOT_MILLING:
|
||||
loot->FillLoot(item->GetEntry(), LootTemplates_Milling, this,true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
loot = &item->loot;
|
||||
|
||||
if(!item->m_lootGenerated)
|
||||
{
|
||||
item->m_lootGenerated = true;
|
||||
loot->clear();
|
||||
break;
|
||||
default:
|
||||
loot->FillLoot(item->GetEntry(), LootTemplates_Item, this,true);
|
||||
|
||||
loot->generateMoneyLoot(item->GetProto()->MinMoneyLoot,item->GetProto()->MaxMoneyLoot);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -7230,7 +7202,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
|
|||
return;
|
||||
}
|
||||
|
||||
if(loot_type == LOOT_PICKPOCKETING && IsFriendlyTo(creature))
|
||||
if (loot_type == LOOT_PICKPOCKETING && IsFriendlyTo(creature))
|
||||
{
|
||||
SendLootRelease(guid);
|
||||
return;
|
||||
|
|
@ -7238,9 +7210,9 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
|
|||
|
||||
loot = &creature->loot;
|
||||
|
||||
if(loot_type == LOOT_PICKPOCKETING)
|
||||
if (loot_type == LOOT_PICKPOCKETING)
|
||||
{
|
||||
if ( !creature->lootForPickPocketed )
|
||||
if (!creature->lootForPickPocketed)
|
||||
{
|
||||
creature->lootForPickPocketed = true;
|
||||
loot->clear();
|
||||
|
|
@ -7270,7 +7242,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
|
|||
loot->clear();
|
||||
}
|
||||
|
||||
if(!creature->lootForBody)
|
||||
if (!creature->lootForBody)
|
||||
{
|
||||
creature->lootForBody = true;
|
||||
loot->clear();
|
||||
|
|
@ -7280,7 +7252,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
|
|||
|
||||
loot->generateMoneyLoot(creature->GetCreatureInfo()->mingold,creature->GetCreatureInfo()->maxgold);
|
||||
|
||||
if(Group* group = recipient->GetGroup())
|
||||
if (Group* group = recipient->GetGroup())
|
||||
{
|
||||
group->UpdateLooterGuid(creature,true);
|
||||
|
||||
|
|
@ -7313,13 +7285,13 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
|
|||
{
|
||||
if(Group* group = GetGroup())
|
||||
{
|
||||
if( group == recipient->GetGroup() )
|
||||
if (group == recipient->GetGroup())
|
||||
{
|
||||
if(group->GetLootMethod() == FREE_FOR_ALL)
|
||||
if (group->GetLootMethod() == FREE_FOR_ALL)
|
||||
permission = ALL_PERMISSION;
|
||||
else if(group->GetLooterGuid() == GetGUID())
|
||||
else if (group->GetLooterGuid() == GetGUID())
|
||||
{
|
||||
if(group->GetLootMethod() == MASTER_LOOT)
|
||||
if (group->GetLootMethod() == MASTER_LOOT)
|
||||
permission = MASTER_PERMISSION;
|
||||
else
|
||||
permission = ALL_PERMISSION;
|
||||
|
|
@ -7330,7 +7302,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
|
|||
else
|
||||
permission = NONE_PERMISSION;
|
||||
}
|
||||
else if(recipient == this)
|
||||
else if (recipient == this)
|
||||
permission = ALL_PERMISSION;
|
||||
else
|
||||
permission = NONE_PERMISSION;
|
||||
|
|
@ -7340,12 +7312,13 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
|
|||
|
||||
SetLootGUID(guid);
|
||||
|
||||
// LOOT_PICKPOCKETING, LOOT_PROSPECTING, LOOT_DISENCHANTING, LOOT_INSIGNIA and LOOT_MILLING unsupported by client, sending LOOT_SKINNING instead
|
||||
if(loot_type == LOOT_PICKPOCKETING || loot_type == LOOT_DISENCHANTING || loot_type == LOOT_PROSPECTING || loot_type == LOOT_INSIGNIA || loot_type == LOOT_MILLING)
|
||||
loot_type = LOOT_SKINNING;
|
||||
|
||||
if(loot_type == LOOT_FISHINGHOLE)
|
||||
loot_type = LOOT_FISHING;
|
||||
// LOOT_INSIGNIA and LOOT_FISHINGHOLE unsupported by client
|
||||
switch(loot_type)
|
||||
{
|
||||
case LOOT_INSIGNIA: loot_type = LOOT_SKINNING; break;
|
||||
case LOOT_FISHINGHOLE: loot_type = LOOT_FISHING; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
WorldPacket data(SMSG_LOOT_RESPONSE, (9+50)); // we guess size
|
||||
|
||||
|
|
@ -7359,7 +7332,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
|
|||
if (permission != NONE_PERMISSION)
|
||||
loot->AddLooter(GetGUID());
|
||||
|
||||
if ( loot_type == LOOT_CORPSE && !IS_ITEM_GUID(guid) )
|
||||
if (loot_type == LOOT_CORPSE && !IS_ITEM_GUID(guid))
|
||||
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_LOOTING);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -460,14 +460,16 @@ enum ActivateTaxiReplies
|
|||
enum LootType
|
||||
{
|
||||
LOOT_CORPSE = 1,
|
||||
LOOT_SKINNING = 2,
|
||||
LOOT_PICKPOCKETING = 2,
|
||||
LOOT_FISHING = 3,
|
||||
LOOT_PICKPOCKETING = 4, // unsupported by client, sending LOOT_SKINNING instead
|
||||
LOOT_DISENCHANTING = 5, // unsupported by client, sending LOOT_SKINNING instead
|
||||
LOOT_PROSPECTING = 6, // unsupported by client, sending LOOT_SKINNING instead
|
||||
LOOT_INSIGNIA = 7, // unsupported by client, sending LOOT_SKINNING instead
|
||||
LOOT_FISHINGHOLE = 8, // unsupported by client, sending LOOT_FISHING instead
|
||||
LOOT_MILLING = 9 // unsupported by client, sending LOOT_SKINNING instead
|
||||
LOOT_DISENCHANTING = 4,
|
||||
// ignored always by client
|
||||
LOOT_SKINNING = 6,
|
||||
LOOT_PROSPECTING = 7,
|
||||
LOOT_MILLING = 8,
|
||||
|
||||
LOOT_FISHINGHOLE = 20, // unsupported by client, sending LOOT_FISHING instead
|
||||
LOOT_INSIGNIA = 21 // unsupported by client, sending LOOT_CORPSE instead
|
||||
};
|
||||
|
||||
enum MirrorTimerType
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "7727"
|
||||
#define REVISION_NR "7728"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue