Show
Ignore:
Timestamp:
11/19/08 13:23:29 (17 years ago)
Author:
yumileroy
Message:

[svn] * Little fix in RandomMovementGenerator?
* Updated to 6731 and 680

Original author: Neo2003
Date: 2008-10-06 04:48:59-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/Player.cpp

    r12 r18  
    57955795        return; 
    57965796 
    5797     ReputationOnKillEntry const* Rep = objmgr.GetReputationOnKilEntry(pVictim->GetEntry()); 
     5797    ReputationOnKillEntry const* Rep = objmgr.GetReputationOnKilEntry(((Creature*)pVictim)->GetCreatureInfo()->Entry); 
    57985798 
    57995799    if(!Rep) 
     
    1638116381    } 
    1638216382 
    16383     // load vendor items if not yet 
    16384     pCreature->LoadGoods(); 
    16385  
    16386     CreatureItem* crItem = pCreature->FindItem(item); 
    16387     if(!crItem) 
     16383    VendorItemData const* vItems = pCreature->GetVendorItems(); 
     16384    if(!vItems || vItems->Empty()) 
    1638816385    { 
    1638916386        SendBuyError( BUY_ERR_CANT_FIND_ITEM, pCreature, item, 0); 
     
    1639116388    } 
    1639216389 
    16393     if( crItem->maxcount != 0 && crItem->count < count ) 
    16394     { 
    16395         SendBuyError( BUY_ERR_ITEM_ALREADY_SOLD, pCreature, item, 0); 
     16390    VendorItem const* crItem = vItems->FindItem(item); 
     16391    if(!crItem) 
     16392    { 
     16393        SendBuyError( BUY_ERR_CANT_FIND_ITEM, pCreature, item, 0); 
    1639616394        return false; 
     16395    } 
     16396 
     16397    // check current item amount if it limited 
     16398    if( crItem->maxcount != 0 ) 
     16399    { 
     16400        if(pCreature->GetVendorItemCurrentCount(crItem) < pProto->BuyCount * count ) 
     16401        { 
     16402            SendBuyError( BUY_ERR_ITEM_ALREADY_SOLD, pCreature, item, 0); 
     16403            return false; 
     16404        } 
    1639716405    } 
    1639816406 
     
    1650916517        if(Item *it = StoreNewItem( dest, item, true )) 
    1651016518        { 
    16511             if( crItem->maxcount != 0 ) 
    16512                 crItem->count -= pProto->BuyCount * count; 
     16519            uint32 new_count = pCreature->UpdateVendorItemCurrentCount(crItem,pProto->BuyCount * count); 
    1651316520 
    1651416521            WorldPacket data(SMSG_BUY_ITEM, (8+4+4+4)); 
    1651516522            data << pCreature->GetGUID(); 
    16516             data << (uint32)crItem->id;                     // entry 
    16517             data << (uint32)crItem->count; 
     16523            data << (uint32)crItem->item; 
     16524            data << (uint32)(crItem->maxcount > 0 ? new_count : 0xFFFFFFFF); 
    1651816525            data << (uint32)count; 
    1651916526            GetSession()->SendPacket(&data); 
    1652016527 
    16521             SendNewItem(it, count, true, false, false); 
     16528            SendNewItem(it, pProto->BuyCount*count, true, false, false); 
    1652216529        } 
    1652316530    } 
     
    1654916556        if(Item *it = EquipNewItem( dest, item, pProto->BuyCount * count, true )) 
    1655016557        { 
    16551             if( crItem->maxcount != 0 ) 
    16552                 crItem->count -= pProto->BuyCount * count; 
     16558            uint32 new_count = pCreature->UpdateVendorItemCurrentCount(crItem,pProto->BuyCount * count); 
    1655316559 
    1655416560            WorldPacket data(SMSG_BUY_ITEM, (8+4+4+4)); 
    1655516561            data << pCreature->GetGUID(); 
    16556             data << (uint32)crItem->id;                     // entry 
    16557             data << (uint32)crItem->count; 
     16562            data << (uint32)crItem->item; 
     16563            data << (uint32)(crItem->maxcount > 0 ? new_count : 0xFFFFFFFF); 
    1655816564            data << (uint32)count; 
    1655916565            GetSession()->SendPacket(&data); 
    1656016566 
    16561             SendNewItem(it, count, true, false, false); 
     16567            SendNewItem(it, pProto->BuyCount*count, true, false, false); 
    1656216568 
    1656316569            AutoUnequipOffhandIfNeed(); 
     
    1657016576    } 
    1657116577 
    16572     return crItem->maxcount!=0?true:false; 
     16578    return crItem->maxcount!=0; 
    1657316579} 
    1657416580 
     
    1717517181    // set fly flag if in fly form or taxi flight to prevent visually drop at ground in showup moment 
    1717617182    if(HasAuraType(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED) || isInFlight()) 
    17177         SetUnitMovementFlags(GetUnitMovementFlags() | MOVEMENTFLAG_FLYING2); 
     17183        AddUnitMovementFlag(MOVEMENTFLAG_FLYING2); 
    1717817184} 
    1717917185 
     
    1816818174    return false; 
    1816918175} 
     18176 
     18177bool Player::isAllowUseBattleGroundObject() 
     18178{ 
     18179    return ( //InBattleGround() &&                            // in battleground - not need, check in other cases 
     18180             !IsMounted() &&                                  // not mounted 
     18181             !HasStealthAura() &&                             // not stealthed 
     18182             !HasInvisibilityAura() &&                        // not invisible 
     18183             !HasAura(SPELL_RECENTLY_DROPPED_FLAG, 0) &&      // can't pickup 
     18184             isAlive()                                        // live player 
     18185           ); 
     18186}