Commit Graph

172 Commits

Author SHA1 Message Date
Shauren
56f46e3ce5 Scripts
* Introduced GetGuidData/SetGuidData to store guids in instance scripts (GetData64/SetData64 are still there)
* CONDITION_INSTANCE_INFO: Changed existing DATA64 condition to GUID_DATA to preserve current use of this instance info type (most/all assume the data is a guid) and moved DATA64 to a different value - no db changes needed
* Fixed compile in boss scripts starting with letter A
2014-09-14 23:23:23 +02:00
Vincent-Michael
4a58341e6d Core: Fix warnings 2014-08-24 18:08:29 +02:00
joschiwald
2a36d2bf5b Core/Conditions: allow CONDITION_OBJECT_ENTRY to check for object guid
Ref #12910
2014-08-24 00:10:09 +02:00
Vincent-Michael
04f8a902af Core/Conditions: Added more infos for CONDITION_SPELL error log 2014-07-29 17:41:06 +02:00
Shauren
7532864264 Buildsystem/MSVC: Warning fixes
C4800 'type' : forcing value to bool 'true' or 'false' (performance warning)
C4127 conditional expression is constant
2014-07-17 15:42:57 +02:00
jackpoz
8c44259fae Core/Misc: Fix some static analysis issues
Fix uninitialized values, most of which are false positives, always initialized before being accessed.
Add some asserts and additional NULL checks as sanity checks. Use SpellMgr::EnsureSpellInfo() if the spell id is valid and always supposed to return a valid not-NULL SpellInfo* .
2014-03-27 21:43:59 +01:00
jackpoz
4c27c83efa Core/Misc: Fix some static analysis issues 2014-03-20 21:34:05 +01:00
Vincent_Michael
20004050bc Update copyright note for 2014.
Happy new year.
2014-01-01 00:07:53 +01:00
Spp
94e2b9332a Core/Logging: Remove LOG_FILTER_XXX defines with it's value (remember logger names are case-sensitive) 2013-11-08 10:50:51 +01:00
leguybrush
0a308144a8 Core/Code: Unify [more] codestyle for brackets: )\n{\n} to ) { }. 2013-10-28 14:36:07 -04:00
joschiwald
05e72b4906 Core/Achievements: Implemented ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE 2013-09-18 22:55:10 +02:00
Vincent-Michael
fab0f461c0 Core/Condition: Added CONDITION_SOURCE_TYPE_PHASE_DEFINITION define for only 4.3.4 branch 2013-09-07 00:16:10 +02:00
Nay
7165fd769e Merge pull request #9862 from Ric101/condition_creature_type
Core/Conditions: Implement CONDITION_CREATURE_TYPE - 24
2013-07-30 06:25:04 -07:00
Vincent-Michael
0e4816771a Core/Conditions: Add more infos for invalid skill condition log error 2013-07-16 18:22:03 +02:00
Malcrom
66978cfc3b Core: Some function renaming. 2013-06-11 19:54:27 -02:30
Ascathor
3e985c636d Core/Conditions: Adding more information to the invalid quest condition log error 2013-06-04 17:52:32 +02:00
Ric101
6fe47e7fcc Core/Conditions: Missing grid search support for CONDITION_CREATURE_TYPE 2013-05-25 08:57:49 +01:00
Ric101
6820ca8bda Core/Conditions: Implement CONDITION_CREATURE_TYPE - 24 2013-05-25 07:51:23 +01:00
Shauren
7d46703413 Core/Misc: Another batch of fixes for issues found by static analysis 2013-05-17 21:30:02 +02:00
Spp
d1677b2db0 Core/Logging: Performance-related tweaks to logging system
All sLog->out* functions (except outCommand atm) are replaced with TC_LOG_* macros.
    Memleak fix
2013-05-13 15:07:36 +02:00
ille
4657cb896f Core/Conditions: add missing break
Core/Units: use attackers MeleeDamageSchoolMask to calculate benefit/mod for auras with SPELL_AURA_MOD_DAMAGE_TAKEN/SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN in Unit::MeleeDamageBonusTaken()
thx bonitas for pointing
2013-02-20 20:41:48 +01:00
Spp
8cd408ae6c Core/Misc: Some changes to minimize differences with 4.3.4 branch 2013-01-30 10:34:18 +01:00
Spp
802657250c Core/Misc: Apply codestyle to multiple files 2013-01-14 09:50:59 +01:00
Vincent_Michael
b13e5694b6 Core/Conditions: Implement CONDITION_UNIT_STATE = 21 2013-01-11 23:37:53 +01:00
Nay
5f28502c0a Merge pull request #8738 from joschiwald/spell_proc_conditions
Core/Conditions: implement CONDITION_SOURCE_TYPE_SPELL_PROC and use it i...
2013-01-06 18:29:55 -08: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
Subv
b4be02c8a0 Core/Conditions: Rename CONDITION_INSTANCE_DATA to CONDITION_INSTANCE_INFO.
And allow it to be used with GetData, GetData64 and GetBossState.
2012-12-30 16:03:25 -05:00
joschiwald
c19f78c363 Core/Conditions: implement CONDITION_SOURCE_TYPE_SPELL_PROC and use it in old and new proc system
Usage:
SourceTypeOrReferenceId: 24
- SourceGroup: always 0
- SourceEntry: spell id of aura which triggers the proc
- ConditionTarget:
 * 0 - Actor
 * 1 - ActionTarget
2012-12-22 01:37:54 +01:00
Vincent-Michael
e4f093cccc Core: Fix more typos (thx Expecto) 2012-12-01 13:51:02 +01:00
Vincent-Michael
f957dd462f Core/Conditions: Implemented CONDITION_SOURCE_TYPE_NPC_VENDOR = 23 2012-12-01 01:52:20 +01:00
Spp
e954498560 Core/Misc: Random changes here and there to minimize differences with 4.3.4 branch 2012-11-27 13:03:12 +01:00
Spp
2251d1bfae Core/Misc: Set mode 0644 for files 2012-11-27 13:03:12 +01:00
w1sht0l1v3
44f3930cf0 Fix compile after bdbafc0184 2012-11-26 23:50:14 +02:00
Subv
bdbafc0184 Core/Conditions: Add CONDITION_GENDER = 20 2012-11-26 14:35:28 -05:00
Nay
0591c468ac Core/SAI: Add more details to an error log 2012-11-24 23:49:48 +00:00
joschiwald
e83c5d1a0f Core/Conditions: use proper SpellCastResult instead of Notification when CONDITION_SOURCE_TYPE_SPELL fails 2012-11-24 02:45:48 +01:00
Spp
b5c9ab8802 Core/Misc: Reduction of header dependencies - Step II 2012-11-20 12:30:30 +01:00
Spp
013fb1f4d9 Core/Misc: reduced amount of string memory allocations (Step I) 2012-10-24 15:34:48 +02:00
Subv
e475b50f58 Core/Conditions: Fixed a mistake in Conditions loading which didn't allow to use SAI conditions with negative source entry (guid) 2012-10-21 15:33:31 -05:00
thesensei
e34b7e70c5 Core/Conditions: Add relation to creator
* This is used in spells with effect summon where the summoned creature doesn't get a *summonedby* flag and so relation to owner is not working. This way the unit get relation to the master who created it.
* World case where I'm going to use this is summoning Oculus drakes
* Blizzard seems to handle such cases with special spells in dbc that are missing and sniff gives nothing for them.  The number of spells is unknown, but existence of atleast 10 is seen. They are used usually as bonus effects to make the check however mechanic is unknown. Guessing it is good as adding this.
2012-09-21 00:07:56 +03:00
Spp
8c5f011e79 Core/Achievements: Force all calls to AchievementMgr be done through Player functions (Remove GetAchievementMgr)
Note: No real use in 3.3.5 but will be used in 4.3.4
2012-09-18 14:29:53 +02:00
Vincent-Michael
59e86f8df9 DB/Creatures: Fix "Frostbrood Vanquisher" flying
CLoses #5927
2012-09-15 23:20:58 +02:00
Vincent-Michael
883db2af3e Core/Conditions: Convert CONDITION_MAP_DIFFICULTY in CONDITION_SPAWNMASK for more handling 2012-09-15 22:32:10 +02:00
Vincent-Michael
5305626214 Core/Conditions: Implemented CONDITION_MAP_DIFFICULTY 2012-09-15 20:27:01 +02:00
Nay
e3d9768a50 Core: Fix many "errors"/warnings and coding style (3)
Game

Errors were found using Cppcheck, open-source static analysis tool
2012-08-30 22:44:33 +01:00
Spp
8a1e7dd070 Core/Loading: Re-enable Server loading log 2012-08-16 00:23:44 +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
Shauren
c8d20004a5 Core: Minor code style corrections 2012-06-30 16:07:09 +02:00