Commit Graph

268 Commits

Author SHA1 Message Date
WyldePointer
47f7687bab Core: Remove unnecessary commas
Last element of enumerator does not need comma after it's value.

Closes #9367
2013-03-09 15:20:57 +00:00
Vincent_Michael
83c98d6dff Core/SmartAI: Implement SMART_ACTION_SUMMON_CREATURE_GROUP (107) 2013-03-09 02:03:37 +01:00
Nefarion
49fd11ab5a First step of comment style refactoring to doxygen-style. 2013-03-08 21:55:37 +01:00
Shauren
5b414bb813 Core/Scripts: Removed useless const modifier on method parameters accepting primitive types passed by value 2013-02-19 17:35:27 +01:00
Machiavelli
6b63a98ab0 Core/SmartAI: Prevent recursive EnterEvadeMode call
Ref #8679
2013-02-19 16:35:26 +01:00
Nay
028c72a9f2 Core/NPCs: Refactor equipments
- creature_template.equipment_id deleted
- creature_equip_template.entry == creature_template.entry
- id field added to creature_equip_template -> PK(entry, id)
- id field in creature_equip_template starts at 1
- creature.equipment_id references id of creature_equip_template
- creature.equipment_id = 0 means no equipment at all (default 1)
- creature.equipment_id = -1 means pick a random equipment from creature_equip_template
- add equipment info to .npc info command

While table creature_equip_template got bigger in size, this system is easier to mantain and allows creatures to have a random template from a group of equipments
2013-02-18 12:24:18 +00:00
Nay
2d861b71ce Core/SAI: Add actions to set/add/remove (104/105/106) gameobject flags 2013-02-16 18:42:26 +00:00
Shauren
985de41421 Core/SAI: Rewrite SmartAI::RemoveAuras in a safer way 2013-02-09 17:57:27 +01:00
Vincent_Michael
0f53f69e52 Core: Fix build 2013-02-03 01:12:07 +01:00
Vincent_Michael
847cafc121 Scripts/Misc: Some code optimisations 2013-02-03 00:38:34 +01:00
Vincent_Michael
2c2fe7d464 Core/Misc: Small code optimisations 2013-02-02 19:06:47 +01:00
Vincent_Michael
9d7d68395c Core/SmartAI: Implement SMART_ACTION_SET_ROOT (103) 2013-02-02 18:18:27 +01:00
Naios
6191642e59 Core/SmartScripts: Check Conditions also for timed Events
* some cleanup work in SmartScripts.cpp

Core/SmartScripts: Some Corrections to last commit
2013-01-17 20:25:29 +01:00
Spp
be3826825e Core/Logging: Use correct realmId when logging to DB 2013-01-16 08:59:56 +01:00
Nay
8274e42e3d Core/SAI: Add 2nd parameter to SMART_ACTION_CALL_FOR_HELP to say "%s calls for help!" if enabled
Similar to SMART_ACTION_FLEE_FOR_ASSIST "%s attempts to run away in fear!"
2013-01-10 15:09:12 +00:00
Shauren
59e4f6eb05 Core/SmartScripts: Fixed SAI targets 10 & 14 (SMART_TARGET_CREATURE_GUID, SMART_TARGET_GAMEOBJECT_GUID)
Note: If you used these targets to perform actions across maps, it will not work anymore, this functionality is deprecated as it was not safe.
2013-01-03 19:22:12 +01:00
Vincent_Michael
cc65aba789 Update copyright note for 2013.
Happy new year.
2013-01-01 00:41:01 +01:00
Warpten
63b9a7579c Core/SAI: Fixed build, i need new glasses. 2012-12-29 22:30:29 +01:00
Warpten
609c5700d6 Core/SAI: SMART_ACTION_NONE is not a valid action. Also accept SMART_ACTION_SET_RANGED_MOVEMENT as a valid action. 2012-12-29 22:27:32 +01:00
Subv
2002bc785e Core/SAI: Fixed SMART_ACTION_SET_RANGED_MOVEMENT 2012-12-29 15:35:56 -05:00
Spp-
e150393c95 Core/SAI: Fix SMART_EVENT_PASSENGER_REMOVED event 2012-12-02 18:07:57 +01:00
Spp
1d7adbfc7f Core/AI: Fix crash in SmartScript
Closes 8340
2012-11-21 12:36:00 +01:00
Spp
b5c9ab8802 Core/Misc: Reduction of header dependencies - Step II 2012-11-20 12:30:30 +01:00
Spp
81606e5d1e Core/Misc: Define some methods const 2012-11-20 09:29:52 +01:00
Nay
4294ccf95d Misc: Whitespace and tabs cleanup 2012-11-19 01:00:47 +00:00
Subv
b768ebc68f Fixed build.
Thanks vincent-michael
2012-11-17 15:21:05 -05:00
Subv
01d2126e7c Core/SAI: Allow the actions CALL_KILLEDMONSTER, CALL_GROUPEVENTHAPPENS and CALL_AREAEXPLOREDOREVENTHAPPENS to be used on vehicles, affecting all of their passengers. 2012-11-17 14:57:20 -05:00
Spp
876ad50dcd Core/Misc: Tweaked ThreatContainer internals
(and many cosmetic changes here and there)
2012-10-26 14:31:19 +02:00
Spp
013fb1f4d9 Core/Misc: reduced amount of string memory allocations (Step I) 2012-10-24 15:34:48 +02:00
Subv
0620d22491 Core/SAI: Added a missing break. 2012-10-08 18:38:15 -05:00
Subv
4dc28e9420 Core/SAI: Fixes crashes when using SMART_EVENT_[IC/OOC]_LOS
It should also fix some wrong behaviors in scripts that use these events.
2012-10-07 19:31:13 -05:00
kaelima
8c013955ac Core/Misc: Fix some possible issues detected by static code analysis 2012-10-07 01:31:43 +02:00
Kandera
b2a7d5d34a Core/SmartAI: revert previous setfly change. 2012-09-19 10:00:46 -04:00
Vincent-Michael
6ebc6b9a76 Core/SmartAI: Add missing break on 2e5e8331f3 2012-09-17 21:17:48 +02:00
Kandera
cc86f567ab Core/SmartAI: fix SMART_ACTION_SET_FLY. was backwards :P 2012-09-17 14:29:14 -04:00
Kandera
2e5e8331f3 Core/SmartAI: add SMART_ACTION_SET_HEALTH_REGEN (102). 2012-09-17 14:11:57 -04:00
Spp
358c6a26d6 Core: Warning fixes (Also some -pedantic under game folder) 2012-09-10 13:04:31 +02:00
Nay
7532013b27 Fix a typo in SmartScript.cpp
I blame vincent!
2012-09-08 02:15:38 +02:00
Santiago
e3b9b15779 Core/SAI: Implement SMART_ACTION_SET_HOME_POS (101)
No parameters; allowed targets: self and position

Closes #7689
2012-09-08 00:55:47 +01:00
Nay
334c078184 Core/SmartAI: Tiny tiny optimization in an if 2012-09-06 19:58:43 +01:00
w1sht0l1v3
68a54e6d91 Core/SAI: Add condition to run SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL code 2012-09-05 14:04:09 +03:00
w1sht0l1v3
50cea6638b Core/SAI: Fix SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL
Proper usage of params:
-param1: flat hp value
-param2: percent hp value
Note: only one of these params should be used(in case you set values in both,the script will chose percent)
2012-09-05 04:53:06 +03: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
Vincent-Michael
634b3645d5 Core/Misc: Use proper headers to optimize compile 2012-07-30 05:38:40 +02:00
Santiago
c7a0378a82 Core/SAI: Added new parameter to actions 90 and 91
Allows to set and remove all possible bytes1 based on `type` parameter
You can see them listed in Unit.h for reference
2012-07-21 01:29:15 -03:00
Shauren
577d5b4fd1 Core/SmartScript: Corrected size of pointId parameter for MOVE_TO_POS SAI action 2012-07-03 16:22:14 +02:00
Shauren
ea9339b171 Core/SmartAI: Fixed SMART_ACTION_SET_RANGED_MOVEMENT parameters 2012-06-23 12:15:52 +02:00