Commit Graph

64 Commits

Author SHA1 Message Date
Trazom62 5bada89128 Fix compilation error in previous commit.
--HG--
branch : trunk
2010-03-21 10:52:50 +01:00
Machiavelli 4a406751af Add some more function calls to remove refund referenced from player's m_refundableItems, preventing the triggering of an assert in _saveInventory.
--HG--
branch : trunk
2010-03-21 02:53:51 +01:00
Machiavelli a0fd280a34 Memory optimization by making m_refundableItems a std::set<uint64>. Also fix a crash caused by invalid iterator in Player::_SaveInventory(). This should fix the last of the item save related crashes.
--HG--
branch : trunk
2010-03-20 21:49:01 +01:00
Machiavelli d21f0c3ce8 Make sure a to be traded item ends up in the item update queue for the correct player.
--HG--
branch : trunk
2010-03-20 16:42:22 +01:00
Machiavelli a0d8b0be48 Item system update
- Set ITEM_FIELD_CREATE_PLAYED_TIME to 0 in Item::Create, should fix crash described in issue 1199
- Change some function calls so on Player::_saveInventory the core doesn't have to check for existance of item anymore when iterating over m_refundableItems. The loop will now only update played time, removal of items from this set is done in other functions.
- Cleanup in affected functions.

--HG--
branch : trunk
2010-03-20 16:26:16 +01:00
Machiavelli 35a7f4849e Store alternate currency spent on an item by Item ExtendedCost entry instead of honorPts/arenaPts/items seperately. Thanks to Opterman for the idea.
--HG--
branch : trunk
2010-03-18 22:56:48 +01:00
Machiavelli 302af79bc2 Implement vendor item refund system.
For info about this system, see: hxxp://us.blizzard.com/support/article.xml?locale=en_US&articleId=27351
Thanks to:
- Opterman, Malcrom, Xanadu + anonymous colleagues for aiding research on packet structure
- Aokromes and Svannon for testing

--HG--
branch : trunk
2010-03-18 17:27:40 +01:00
Machiavelli bbfdc117c8 Overload Item::SetState correctly in Item::SetItemRandomProperties.
Fixes issue #1126

--HG--
branch : trunk
2010-03-16 08:05:09 +01:00
Machiavelli b0b17e56de - Overload Item::SetState with player argument where possible to ensure updated data is saved to DB properly.
- Alter Item::SetEnchantmentDuration function, add parameter Player* because GetOwner() cannot be called in the function due to hashtable locking in the SaveAllPlayers process.
- Remove a sanity check prior to Item::AddToUpdateQueueOf, so assertions can detect whenever a higher level function was not called properly. Please report any crashes related to these assertions to get them resolved asap.

--HG--
branch : trunk
2010-03-16 01:05:56 +01:00
Machiavelli f9a3aedc14 Don't call Item::AddToUpdateQueueOf if no player is specified as parameter for Item::SetState, since in this case, only data stored in the item_instance table is altered, not that of character_inventory.
--HG--
branch : trunk
2010-03-15 14:52:02 +01:00
Machiavelli c47b8a89c1 Fix issue with .save or .saveall where either the core would freeze, or items would not be saved to the DB properly.
Fixes issue #381
Fixes issue #477

--HG--
branch : trunk
2010-03-15 14:03:13 +01:00
Machiavelli bb38d246f4 Minor code style cleanup
--HG--
branch : trunk
2010-03-10 16:24:48 +01:00
Machiavelli 35e1a1eda8 Use "REPLACE INTO" instead of "DELETE" + "INSERT INTO" in Item::SaveToDB call to fix a cause of items randomly disappearing (issue 925).
Note: due to the hierarchy of the function calls, it's not possible to use DB transactions in this function.

--HG--
branch : trunk
2010-03-10 16:16:29 +01:00
QAston 4cd4c4170f *Backout some WTF fixes. Do things correctly, or do not touch them at all...
*Really fix windows build.

--HG--
branch : trunk
2010-02-15 20:59:05 +01:00
Brian 486c00891b * Core switch to client 3.3.2 (11403)
* Credits (in no particular order) to:
* n0n4m3, raczman, manuel, Spp, Malcrom, Teacher, QAston, Tartalo,
* thenecromancer, Xanadu, Trazom, Zor, kiper
* Additional credits to:
* TOM_RUS and NoFantasy from MaNGOS
* Thanks for testing Aokromes and XTElite1
* SoTA still needs some work, but is very playable (huge thanks to raczman and
* kiper)
* To upgrade, you need to apply all SQL from sql/updates/3.2.2a_old from the
* last rev you are on
* and then apply all SQL from sql/updates/3.3.2_old to char / realmd / world
* DBs
* Known problem with guild banks.

--HG--
branch : trunk
2010-02-14 19:13:14 -07:00
Xanadu f8d1920fa5 Yet more cleanup, mostly in the script system. This should conclude the script integration into core.
--HG--
branch : trunk
2010-02-05 13:01:32 +01:00
silver1ce a307ba784c *Move object's field\visibility update functions to object from accessor
removed useless SendUpdateObjectToAllExcept - anyway fields will be updated, there is no sense to force update them

--HG--
branch : trunk
2010-02-03 16:53:40 +02:00
Spp aee31b9164 Remove unnecesary item enchants checks
By Az@zel
Closes issue #382

--HG--
branch : trunk
2010-01-30 20:48:23 +01:00
Anubisss d9cb070215 Implement QueryResult_AutoPtr type which is ACE's reference counted auto_ptr(ACE_Refcounted_Auto_Ptr) for QueryResult pointers.
Use this auto_ptr for every DB queries(except QueryNamedResult yet).

This patch guarantees NO memory leaks from QueryResult pointers.

Thanks to raczman for the idea and for the helping to make this patch.

--HG--
branch : trunk
2010-01-23 14:45:58 +01:00
Rat 0cc053ea4d *Integrate Script system to Core
-added ScriptMgr for loading scripts
-removed bindings
-moved script system to src/game
-moved scripts to src/scripts
-VC project files updated
-cmakes updated (not 100% done yet)

NOTE to Devs:
-file locations changed
-precompiled renamed to ScriptedPch
-ecsort_ai renamed to ScriptedEscortAI
-follower_ai renamed to ScriptedFollowerAI
-guard_ai renamed to ScriptedGuardAI
-simple_ai renamed to ScriptedSimpleAI
-sc_creature renamed to ScriptedCreature
-sc_gossip renamed to ScriptedGossip
-sc_instance  renamed to ScriptedInstance

*use the new headers in scripts, thank you

NOTE to ALL:
cmake not fully tested, please report any errors with it
could make creashes, incompability
USE AT YOUR OWN RISK before further tests!!

--HG--
branch : trunk
2010-01-19 11:36:05 +01:00
n0n4m3 99f66a6bc9 Updated copyright for new year.
--HG--
branch : trunk
2010-01-16 20:19:18 +03:00
n0n4m3 947b258479 Fixed Mana Gems, implement SPELL_EFFECT_CREATE_MANA_GEM and revert prev. commit...
--HG--
branch : trunk
2009-12-26 18:25:49 +01:00
n0n4m3 066efa09e3 Fixed items Mysterious Egg, Disgusting Jar (need db support).
--HG--
branch : trunk
2009-12-26 17:52:33 +01:00
Brian 36d30faabf * Add support for RewSpellCast=-1. If -1 remove all auras applied to player at
* quest start.
* Patch by Kudlaty -- THANK YOU!

--HG--
branch : trunk
2009-12-21 14:48:30 -07:00
maximius dc1207139a *Cleanup, proper indentation, and remove some wrong/irrelevant comments copied from custom patches..
--HG--
branch : trunk
2009-12-18 13:41:30 -08:00
n0n4m3 360edd11df Update InstanceSaveMgr for new instance system
--HG--
branch : trunk
2009-12-17 11:18:07 +01:00
spp df76273dd0 Check of required skill value and level in Item enchants, by azazel. Closes #512
* Added some cosmetic changes to the original patch

--HG--
branch : trunk
2009-12-13 09:17:12 +01:00
Kudlaty 38f3016d87 Fix exploit with using fist weapon without that skill. Patch by _krz
--HG--
branch : trunk
2009-10-29 13:29:34 +01:00
maximius 3f338cc1c3 *Massive cleanup redux.
--HG--
branch : trunk
2009-10-17 16:20:24 -07:00
maximius e585187b24 *Backed out changeset 3be01fb200a5
--HG--
branch : trunk
2009-10-17 15:51:44 -07:00
maximius 26b5e033ff *Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and some other cleanups by hand)
*Fix a possible crash in Spell::DoAllEffectOnTarget

--HG--
branch : trunk
2009-10-17 15:35:07 -07:00
megamage 1302b3b7a9 *Fix build.
--HG--
branch : trunk
2009-08-20 10:33:34 -05:00
megamage 48eef97f80 *Fix a crash caused by itemexpire.
--HG--
branch : trunk
2009-08-20 10:12:44 -05:00
QAston ec5515ee49 *Remove hack in Brain Freeze code.
*Update Improved Mend Pet to 3.1.3.

--HG--
branch : trunk
2009-08-16 19:13:02 +02:00
megamage bc7f37fe1c *Fix a crash caused by ItemExpire though the reason is unknown.
--HG--
branch : trunk
2009-08-15 13:47:05 -05:00
QAston 2e34af64cf *Allow ItemExpire events to be scripted.
*Add .debug itemexpire command
*Add script for Disgusting Jar and Mysterious Egg - original patch by Elron.

--HG--
branch : trunk
2009-08-04 01:44:14 +02:00
megamage e379be0349 [8094] Overwrite max durability for item at item loading from prototype. Author: VladimirMangos
--HG--
branch : trunk
2009-07-01 17:50:59 -05:00
Machiavelli 3a309abfab * In case of a 'for' loop, don't declare the iterator of a type that has a larger value range when the iterator can take a maximum value of a more efficient data type. (int to uint8 in most cases).
* Other minor cleanups, Null pointer checks etc.

--HG--
branch : trunk
2009-06-18 17:21:25 +02:00
megamage 9d670fe6f5 *Switch to support client version 3.1.3
*I strongly recommend you not to use this until you get the 313 db. Now all destructible buildings cause client crash.

Source: Mangos
Thanks to TOM_RUS for most work to make this switch possible ;)

--HG--
branch : trunk
2009-06-11 00:45:59 -05:00
megamage 337772c433 [7981] Implement ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM required for 310 Author: VladimirMangos
[7982] Add lost by me check lines in [7980] :(

--HG--
branch : trunk
2009-06-09 17:20:19 -05:00
megamage 4e130dcdfd [7980] Implement item use target requirements store and check (new table item_required_target). Author: NoFantasy
Signed-off-by: VladimirMangos <vladimir@getmangos.com>

    * Also implement this table reload
    * Static Spell::SendCastResult function for call not from spell code.
      Can be also used in scripts where need send explicitly spell cast error to client.

--HG--
branch : trunk
2009-06-08 17:25:02 -05:00
megamage 7ccd99ecab [7900] Now really allow recieve account bounded items by mail reciver. Author: VladimirMangos
--HG--
branch : trunk
2009-05-27 16:39:49 -05:00
megamage 73d31e2552 [7898] Improve client error output at different mail send errors, cleanup code. Author: VladimirMangos
--HG--
branch : trunk
2009-05-27 16:38:50 -05:00
QAston 0f5a9cb46f *Implement enchanting vellums.
--HG--
branch : trunk
2009-05-01 15:40:49 +02:00
megamage de11b9e901 [7730] Some optimizantion and code style. Author: zhenya
--HG--
branch : trunk
2009-04-29 00:26:07 -05:00
megamage 59ce40e484 *Remove dual ERROR in logs Author: AlexDereka
--HG--
branch : trunk
2009-03-21 14:28:02 -06:00
megamage 61b999fd3a [7360] Use defines instead harcoded item prototype array sizes. Author: VladimirMangos
--HG--
branch : trunk
2009-03-02 16:47:20 -06:00
QAston 9772db0903 *Fix Lava Lash.
*Fix Seal of Corruption.

--HG--
branch : trunk
2009-02-26 22:10:29 +01:00
megamage 31637d4aac *Merge.
--HG--
branch : trunk
2009-02-18 11:36:19 -06:00
KingPin 14234c86fa Newline added to bottom of all files.
--HG--
branch : trunk
2009-02-17 20:07:49 -06:00