Commit Graph
79 Commits
Author SHA1 Message Date
Shauren ccc1936660 Core/Loot: Items in generated loot will now be split in multiple stacks if their count exceeds max stack size defined in item_template 2013-02-03 15:36:29 +01:00
Shauren 104682767e Build fix 2013-02-03 01:28:18 +01:00
Shauren b50cda4a1a Core/Loot: Cleanup in LootMgr.
* Removed a lot of loot template copying
* Improved grouped loot selection when using loot modes
* Removed code doing nothing
2013-02-03 01:18:06 +01:00
Spp 8cd408ae6c Core/Misc: Some changes to minimize differences with 4.3.4 branch 2013-01-30 10:34:18 +01:00
Nay a509aea659 Core/Misc: Fix a couple of warnings, some of them performance related
Errors were found using Cppcheck, open-source static analysis tool
2013-01-04 23:14:14 +00:00
Vincent_Michael cc65aba789 Update copyright note for 2013.
Happy new year.
2013-01-01 00:41:01 +01:00
Shauren f1170ba0fb Core: Fixed some level 4 warnings (msvc) 2012-12-31 20:43:14 +01:00
MrSmite 04f08d26a7 Implements saving of loot (items / money) contained inside lootable inventory items.
* Unlooted items / money persist across player sessions
* Loot inside items is tied to the item rather than the player so if trading
  partially looted items becomes possible, this implementation will still work

* New tables added:

    characters_database.sql (first time users)
    characters_create_item_loot.sql (existing users)

Implementation Can be tested with:

 Watertight Trunk [21113]
 Bulging Sack of Gems [25422]
 Fat Sack of Coins [11937]

Closes #2048
2012-12-15 00:06:32 -05:00
Spp 2251d1bfae Core/Misc: Set mode 0644 for files 2012-11-27 13:03:12 +01:00
Spp b99c347747 Core: Remove Player.h dependency from all the possible headers 2012-11-17 05:18:37 +01:00
kaelima 7c971be3c5 Core/Misc: Fix some warnings and logic mistakes found by static code analysis 2012-09-05 17:18:05 +02:00
Spp a566e3e58b Core/Logging: Move more log messages to LOG_FILTER_SERVER_LOADING 2012-08-16 11:02:46 +02:00
Spp 634776e0bc Fix compile under windows 2012-08-03 15:54:54 +02:00
Spp 55ce180f28 Core/Logging: Add Asyncronous logging with Loggers ("What to log") and Appenders ("Where to log") system. Will allow to select to full log some parts of core while others are not even logged.
- Logging System is asyncronous to improve performance.
- Each msg and Logger has a Log Type and Log Level assigned. Each msg is assigned the Logger of same Log Type or "root" Logger is selected if there is no Logger configured for the given Log Type
- Loggers have a list of Appenders to send the msg to. The Msg in the Logger is not sent to Appenders if the msg LogLevel is lower than Logger LogLevel.
- There are three (at the moment) types of Appenders: Console, File or DB (this is WIP, not working ATM). Msg is not written to the resource if msg LogLevel is lower than Appender LogLevel.
- Appender and Console Log levels can be changed while server is active with command '.set loglevel (a/l) name level'

Explanation of use with Sample config:

Appender.Console.Type=1       (1 = Console)
Appender.Console.Level=2      (2 = Debug)

Appender.Server.Type=2        (2 = File)
Appender.Server.Level=3       (3 = Info)
Appender.Server.File=Server.log

Appender.SQL.Type=2           (2 = File)
Appender.SQL.Level=1          (1 = Trace)
Appender.SQL.File=sql.log

Appenders=Console Server      (NOTE: SQL has not been included here... that will make core ignore the config for "SQL" as it's not in this list)

Logger.root.Type=0            (0 = Default - if it's not created by config, server will create it with LogLevel = DISABLED)
Logger.root.Level=5           (5 = Error)
Logger.root.Appenders=Console

Logger.SQL.Type=26            (26 = SQL)
Logger.SQL.Level=3            (2 = Debug)
Logger.SQL.Appenders=Console Server SQL

Logger.SomeRandomName.Type=24 (24 = Guild)
Logger.SomeRandomName.Level=5 (5 = Error)
Loggers=root SQL SomeRandomName

* At loading Appender SQL will be ignored, as it's not present on "Appenders"

* sLog->outDebug(LOG_FILTER_GUILD, "Some log msg related to Guilds")
  - Msg is sent to Logger of Type LOG_FILTER_GUILD (24). Logger with name SomeRandomName is found but it's LogLevel = 5 and Msg LogLevel=2... Msg is not logged

* sLog->outError(LOG_FILTER_GUILD, "Some error log msg related to Guilds")
  - Msg is sent to Logger of Type LOG_FILTER_GUILD (24). Logger with name SomeRandomeName is found with proper LogLevel but Logger does not have any Appenders assigned to that logger... Msg is not logged

* sLog->outDebug(LOG_FILTER_SQL, "Some msg related to SQLs")
  - Msg is sent to Logger SQL (matches type), as it matches LogLevel the msg is sent to Appenders Console, Server and SQL
    - Appender Console has lower Log Level: Msg is logged to Console
    - Appender Server has higher Log Level: Msg is not logged to file
    - Appender SQL has lower Log Level: Msg is logged to file sql.log

* sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Some msg related to Battelgrounds")
  - Msg is sent to Logger root (Type 0) as no Logger was found with Type LOG_FILTER_BATTLEGROUND (13). As Logger has higher LogLevel msg is not sent to any appender

* sLog->outError(LOG_FILTER_BATTLEGROUND, "Some error msg related to Battelgrounds")
  - Msg is sent to Logger root (Type 0) as no Logger was found with Type LOG_FILTER_BATTLEGROUND (13). Msg has lower LogLevel and is sent to Appender Console
    - Appender Console has lower LogLevel: Msg is logged to Console
2012-08-03 14:20:18 +02:00
Kandera a24b6576e2 Core/Loot: fix small error 2012-07-09 13:42:38 -04:00
Kandera 8f74498add Core/Loot: fix crash number 2 2012-07-09 13:36:52 -04:00
Kandera 80664e2421 Core/Loot: typos! 2012-07-09 13:09:44 -04:00
Kandera fcb4613245 Core/Loot: fix crash. 2012-07-09 13:00:35 -04:00
Kandera d5836422ac Core/Loot: couple of small changes to loot. 2012-07-09 11:12:59 -04:00
Discover- 8c46681b44 Core/LootMgr: Fix a little logging mistake on startup to prevent confusion. 2012-07-07 17:14:57 +02:00
Kandera 869ea34987 Core/Loot: fix the way quest items are handled. so far ive only found 3 quest items that should be able to be masterlooted. added a new flag to item_template.flagsCustom to allow for making a quest item always follow loot rules. a bonus may be the fix of the handlelootmasteropcode crash! 2012-07-05 12:59:42 -04:00
Abdollah Hasan 24a395c82d Core/Item: Modify IsCurrencyToken to use IsCurrencyToken in item template.
Changed all BAG_FAMILY_MASK_CURRENCY_TOKENS to IsCurrencyToken.
2012-06-22 16:34:06 +03:00
Kandera 4bfb96fbcf Core/Loot: fix mistake in previous commit. also fix flags in sql. i did things backwards ^^ 2012-06-07 14:05:52 -04:00
Kandera 0965e1f4c2 Core/Loot: fix loot rules for looting quest items that have the party loot flag 2012-06-07 13:01:49 -04:00
Shauren 5eee40249c Core/Items: Added custom flags field to item_template, currently 2 flag values are available
* ITEM_FLAGS_CU_DURATION_REAL_TIME determines item duration counts even if offline (replaced ugly negative duration workaround, easy to lose data when importing fresh wdb)
* ITEM_FLAGS_CU_IGNORE_QUEST_STATUS quest status will not affect this item appearing in loot, currently needed for Arena Master trinket
2012-05-31 15:39:18 +02:00
Subv 6400c13fcb Core/Loading: Make GameObject loot loading faster by removing an unneeded call to an expensive method.
Thanks Manuel for pointing it out
2012-04-12 20:19:23 -05:00
Gyx 360014856d Core/Game: Code style.
Signed-off-by: Gyx <[email protected]>
2012-03-29 13:42:04 +08:00
Gyx 1544b208da Core/Game: Code style again.
Signed-off-by: Gyx <[email protected]>
2012-03-28 20:00:29 +08:00
Gyx 72cdcbfced Core/Game: Code style.
Signed-off-by: Gyx <[email protected]>
2012-03-28 19:11:50 +08:00
Nay a92820b51c Core/DBLayer: Correct few more wrong read types (No. 1)
DB/World: Some consistency in the ints "length" field (not really a length)

From A to D world tables verified; missing all the others

int(11) -> int32
unsigned int(10) -> uint32
mediumint(8) -> int32
unsigned mediumint(8) -> uint32
smallint(6) -> int16
unsigned smallint(5) -> uint16
tinyint(4) -> int8
unsigned tinyint(3) -> uint8
2012-03-27 00:43:56 +01:00
Spp d38bc3a178 Core: Rename GetCreatureInfo to GetCreatureTemplate and minor cleanup here and there 2012-02-27 14:58:47 +01:00
Spp 03c34ee507 Fix a lot of warnings 2012-02-16 13:56:28 +01:00
Subv 8a72aede16 Codestyle: Renamed some variables to fit codestyle, corrected order in structure/class fields to match alignment (they use slightly less memory now)
Signed-off-by: Subv <[email protected]>
2012-02-14 12:46:26 -05:00
Subv 06df126bd0 Core/Loading: Speedup on the creature loading code
Signed-off-by: Subv <[email protected]>
2012-02-12 17:34:41 -05:00
QAston 8713b44ee7 Core/Db/Conditions: Prepare conditions system to work on objects of different type than players.
Warning: API has changed a bit:
ConditionScript::OnConditionCheck(Condition* condition, Player* player, Unit* invoker) is now
ConditionScript::OnConditionCheck(Condition* condition, WorldObject* object, WorldObject* invoker)
2012-02-10 14:18:59 +01:00
kiper 8299627ed9 Update headers for 2012. HAPPY NEW YEAR!!! 2012-01-01 00:32:13 +01:00
Bootz d1334624da Core: Codestyle clean-up
"pl"->"player"

 Note: codestyle methods needs maintained, Player* player.
still to do properly clean-up chat.cpp.
2011-11-07 11:18:00 -06:00
Bootz 96d7a1e970 REPO: code-style clean-up
* Fixed pGuild->guild
* Fixed pGroup->group
* Fixed pOwner->owner
2011-10-07 10:54:53 -05:00
Shocker 400716926c Core/Misc: Revert the loot-related code from 74616464f2, the iterator is needed later 2011-09-16 00:37:04 +03:00
Shocker 7afb179185 Misc/Util: Add a template function for returning a random element from any container 2011-09-15 21:28:40 +03:00
Spp af05915b9e [Cosmetic] Apply codestyle "XXX * " and "XXX *" changed to "XXX* " (with some exceptions) 2011-09-15 14:12:57 +02:00
QAston b0fe236265 Core: Use new SpellInfo class in core. Sadly, this commit is not compatibile with some of the custom code. To make your code work again you may need to change:
*SpellEntry is now SpellInfo
*GetSpellProto is now GetSpellInfo
*SpellEntry::Effect*[effIndex] is now avalible under SpellInfo.Effects[effIndex].*
*sSpellStore.LookupEntry is no longer valid, use sSpellMgr->GetSpellInfo()
*SpellFunctions from SpellMgr.h like DoSpellStuff(spellId) are now: spellInfo->DoStuff()
*SpellMgr::CalculateEffectValue and similar functions are now avalible in SpellEffectInfo class.
*GET_SPELL macro is removed, code which used it is moved to SpellMgr::LoadDbcDataCorrections
*code which affected dbc data in SpellMgr::LoadSpellCustomAttr is now moved to LoadDbcDataCorrections
2011-07-26 23:09:28 +02:00
kaelima b9e8694540 Core: Continued cleanup
If and for whitespaces.
2011-06-12 02:30:32 +02:00
click f16df538ee Core: More codestyle cleanups 2011-06-12 01:47:45 +02:00
click 158966dc79 Core: Codestyle cleanup 2011-06-11 22:35:29 +02:00
leak 1003f30448 Add spaces after commas 2011-04-29 20:47:02 +02:00
leak c51c817a45 Core/ObjectMgr: Refactor sCreatureStorage 2011-04-28 22:57:08 +02:00
leak e2e9431ca3 Core/ObjectMgr: Refactor sGOStorage 2011-04-28 22:54:30 +02:00
leak a82654debd Core/ObjectMgr: Refactor sItemStorage 2011-04-28 22:42:33 +02:00
Shauren 19cdf98c8a Core/Loot: Players who were not present during encounter completion are not eligible to receive the item in trade 2011-03-06 17:43:15 +01:00