This cleanup small code and let catch some missing check cases
when 0 guid attempt searched by real DB query.
This also make function call more safe if it used with non-player guid by
some reason.
Source of crash in sharing item object for sent mail to new owner
and in same time use it in still existed auction for show pending paiment.
Crash possible if new onwer get mail in less hour delay and will drop item
at receive.
Solution: Added fields in memory auction object and table `auction` for
store item stack size and random property id. This let not use auction item
except points where item send to owner at expire and new owner at
buyout/timeout auction with bid.
Old code way work not allow create item without providing targeting player.
In result creating item that will not placed to inventory required additional hacks
for undo redundent links to player structures.
* New command allow place auction from chat/console and create auction without owner.
* Same code can be used in other place when server code want create generated auction
without need have associated player. Auction code update for support this case.
* MailDraft::SendMailTo now allow "send" mails to non-players. It correcly drop items in like case.
Now safe allow this casts in like way after completed convertion to ObjectGuid use.
Also simplify code in result allowed auto cast to uint64.
Please _not_ add new uint64 storages (local and in structures) for guid values.
Sometime to client can sedn bid infor near to same time.
In like cases client fail prevent bid apply attempt at self side
and need send proper error from server side instead just ignore packet.
* Use Set* names for cases when function replace old value by new (instead Add*)
* Prevent hidden MailDraft copy create becase if draft have items its can't be just shared
and need preoprtly cloned, but item close is high price operation (guid use, DB tiuched and etc)
So this must be explictly operation. In next commits will be added clone function for this.
* Some MailDraft overwrite by assign cases rewrited to more clean way.
* List its independelty. Each from this 2 fields have own flags. Cleanup lists.
* Not copy proto flags to item flags update field. This fix heroic item versions
show in client in result mixed use ITEM_DYNFLAG_WRAPPED (0x8) with ITEM_FLAG_HEROIC (0x8)
* Update uses to proto case use for some cases where before wrongly has been used item dyn.flags
* For ITEM_DYNFLAG_UNLOCKED (0x4) set for item at unlock and check for prevent re-unlocking.
This mostly for future case when will be implemented partly loting items support.
* For ITEM_FLAG_LOOTABLE (0x4) check loot absent or conflicting setting with containers/casted at use items.
Report wrong cases art loading.
* Better check related loot tables content using ITEM_FLAG_PROSPECTABLE and ITEM_FLAG_MILLABLE
Added ObjectGuid version Aura::GetCasterGuid()
But for prevent big problen with backporting AuraHolder
to mangos-0.12 in most cases still used old uint64 version
Aura::GetCasterGUID.
Recommended use new version where possible in clean way
as done for some cases in commit already.
Also
* Fixed some amount wrong uses low guids as full player guids.
* Add private without body ObjectGuid(uint32 const&) for catch wrong assigns low guids to ObjectGuid.
In some cases need assign "0" guid, then use ObjectGuid() instead.
* Fixed .pdump commands work.
* Field `auctioneerguid` replaced by `houseid` and table reanmed to `auction`
(it list auctions and `id` is auction id).
* Update related code.
* SQL update fill `houseid` field by old `auctioneerguid`
BUT: SQL update expect that you world DB named `mangos`.
If this not true for your case you need modify SQL update BEFORE APPLY
in 2 placed in part "mangos.creature AS c, mangos.creature_template AS ct"
* Another small possitive result: now possible easy select auctions related
to some auction store (1-3 is one team actions, 4-6 another team auction,
and 7 is neutral auction store for both teams
After this commit auction auctioneer guid used only for select auction house in packet or loading.
Next task replace it in DB by houseid, dependence DB data from creature guid isn't good.
* Avoid use explicit MailReciever/MailSender where not need.
Types specially added for autoconvertion from common cases.
* Prevent allow copy text auction mails. It anyway store encoded data.
Same for some another non-player mails.
Implemented new achievement criteria requirement:
* ACHIEVEMENT_CRITERIA_REQUIRE_S_EQUIPED_ITEM_LVL (item level and item quality equiped in specific slot)
Implemented suppoprt achievement types:
* ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM (required DB data)
* ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL (required DB data)
Also achievment types used only for statistics:
* ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION
* ACHIEVEMENT_CRITERIA_TYPE_WON_AUCTIONS
* ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS
* ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS
* ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM
* ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM
This was possible by using cheating tools only; the client denies such
actions without sending CMSG_AUCTION_PLACE_BID.
Thanks to leak for reporting this vulnerability.
* Move send functions to new MailDraft class from WorldSession
* Simplify use different args combinations used in SendMailTo
by groupping its by functionality in Helper classes. This also will prevent wrong way use args combinations.