Commit Graph

134 Commits

Author SHA1 Message Date
jackpoz
1083dbb993 Core/Misc: Remove Unit::Get* wrappers for ObjectAccessor::Get* 2014-05-20 21:21:33 +02:00
MitchesD
8e7cf15dd1 Scripts/HallsOfReflection: Major changes
* corrections to Intro Event (Falric, Marwyn etc.)
* fixed issues with Frostsworn General
* improved the whole Wrath of the Lich King event
* implemented outro gunship
* optimalization code and cleanup and fixed some typos
* Big thanks to @joschiwald, he is author too ;-)
2014-05-10 21:37:33 +02:00
Kinzcool
c536305e3a Core: Droped faction_H field -- only one faction table is necessary 2014-04-27 18:13:55 -04:00
jackpoz
8ca6371793 Core/Misc: Ensure GetVictim() returns a valid reference when expected
Add a new method EnsureVictim() which asserts a valid not NULL reference will be returned to the caller. Use this whenever the GetVictim() would be dereferenced .
2014-04-19 21:48:22 +02:00
Vincent_Michael
20004050bc Update copyright note for 2014.
Happy new year.
2014-01-01 00:07:53 +01:00
Malcrom
fe95371d9a Core/Scripting: Replace casted with cast as casted is not a word. 2013-12-25 14:16:55 -03:30
Malcrom
2d28d0c109 Core/ScriptedAI: Fix Headers. 2013-11-10 03:31:20 -03:30
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
Ascathor
2607738990 Core/Code: Unify codestyle for brackets: {} to { }.
Also added missing copyright to some files.
2013-10-27 23:46:02 +01:00
joschiwald
2b19ba1879 Misc: replace Unit::GetPlayer with ObjectAccessor::GetPlayer and some cosmetic changes 2013-08-18 01:41:10 +02:00
joschiwald
380cf5d241 Core/Misc: replace (Player*) casts with ToPlayer() 2013-07-21 01:38:21 +02:00
Vincent-Michael
6079f369af Scripted/Misc: Some cleanup 2013-07-06 01:00:05 +02:00
Malcrom
ec474a62e5 Core: More Function Renaming. 2013-06-11 21:25:12 -02:30
Malcrom
66978cfc3b Core: Some function renaming. 2013-06-11 19:54:27 -02:30
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
Gacko
8cbad9466d Core/Gossip: New AddMenuItem method for using DB texts
Many thanks to @Erimioa
2013-04-08 18:16:44 +02:00
Spp
156fb824a4 Core/Scripts: Removed CAST_CRE define 2013-03-21 13:48:36 +01:00
Spp
355029fb4f Core/Scripts: Removed CAST_PLR define 2013-03-21 13:07:10 +01:00
Spp
d091097433 Core/AI: Do not expose internal storage of SummonList 2013-03-21 11:06:05 +01:00
Nefarion
49fd11ab5a First step of comment style refactoring to doxygen-style. 2013-03-08 21:55:37 +01:00
Nay
b10aa126c7 Core/BossAI: Fix a typo in CheckBoundary
Method was using "me" (the boss) instead of the function's argument

Props to @Horn for finding the 4 year's old error

Ref #7194
2013-02-26 02:34:45 +00: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
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
m7nu3l
f9654d52e0 Core/AI: Removed Scripted_NoMovementAI which has become obsolete. Use ScriptedAI::SetCombatMovement(false); to get the same functionality. 2013-02-04 19:18:48 -03:00
m7nu3l
124b5ed6e7 Core/AI: Implemented functionality for _isCombatMovementAllowed in ScriptedAI, only when AttackStart is called. 2013-02-03 14:46:17 -03:00
Vincent_Michael
cc65aba789 Update copyright note for 2013.
Happy new year.
2013-01-01 00:41:01 +01:00
Spp
81606e5d1e Core/Misc: Define some methods const 2012-11-20 09:29:52 +01:00
Spp
b99c347747 Core: Remove Player.h dependency from all the possible headers 2012-11-17 05:18:37 +01: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
Elron103
46852a3808 Core/Scripting: Fix DoAction function of SummonList incorrectly removing entries in SummonList 2012-09-02 00:19:13 +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
Kandera
0ac9c5b039 Core/Escort: few modifications to add the IMMUNE_TO_NPC flag after npc does a full reset. 2012-07-10 17:27:13 -04:00
Kandera
450f9e7d99 Core/Escort: fix issues with escorts not attacking enemies. 2012-07-10 16:19:18 -04:00
Chaplain
716e2db0e1 Core/Misc: Code-style + some const methods. 2012-06-21 21:05:45 +03:00
Elron103
f3aacb669c Scripts/Miscellaneous: Enable const-ness for various functions in ScriptedAI (Author: DorianGrey)
- Improve codestyle, since objects internal state is not changed here
- Make these functions available for inherited CanAIAttack() function
2012-06-20 21:29:41 +02:00
Chaplain
469ba0b0e7 Clean up for 58f63509cd
*restore const methods in spellauraeffects
*fix typo in Unit::CalculateMeleeDamage thx bytewarrior
*minor speed up in SpellInfo::GetMaxTicks() thx Warpten
*deleted duble ';;' thx bytewarrior
*speed up in SpellInfo::GetMaxTicks() thx goes to Vincent-Michael
2012-05-10 20:42:07 +03:00
kaelima
71bf2684be Core/Script: Use DoMeleeAttackIfReady in default ScriptedAI::UpdateAI method (fixes offhand attacks if not UpdateAI is overridden) 2012-04-12 17:53:52 +02:00
faramir118
e3f198ca56 couple wrong return types 2012-04-11 19:58:12 +02:00
kaelima
4c961ff393 Core/Scripts: Remove some unnecessary creature/player casts in scripts and do some safer casting in a silithus script 2012-04-09 14:28:46 +02:00
Machiavelli
bc96df1aae Core/Shared: Move container functions to shared project under Trinity::Container namespace. Also implement RandomResizeList which takes a predicate function as parameter.
Core/ScriptedAI: Extend SummonList::DoAction to take a predicate function as parameter and allow specifying a maximum number of units to be selected.
2012-04-08 17:40:05 +02:00
Gyx
a1c4786ba0 Core/Script: Code style and some rewriting.
MoveInLineOfSight(Unit* unit) -> MoveInLineOfSight(Unit* who)

Signed-off-by: Gyx <2359980687@qq.com>
2012-04-01 19:56:41 +08:00
Machiavelli
03a24a84e4 Core/Units:
- Implement UNIT_FIELD_HOVERHEIGHT (requires DB data). This field, sent in update object packet, will determine the height at which a creature hovers if it has movementflag_hover applied. Note that hovering will now update the server-sided z-coordinate by the value of this field, and that all subsequent positional updates to the client will need to send z coordinate MINUS the hover height offset, or the hoverheight will be visually doubled client side.
- Correct our usage of movementflag_flying, movementflag_can_fly, movementflag_hover and movementflag_disable_gravity (previously levitate), and how they relate to InhabitType in the database. This fixes "flying creatures on steroids" bug (wings flapping too fast), and potentially a lot of visual issues in AI scripts. Note that a lot of scripts still set wrong movementflags, these need to be fixed on a case by case basis.
- Send correct packets for SPELL_AURA_FEATHER_FALL, SPELL_AURA_WATER_WALK and SPELL_AURA_HOVER apply/unapply.
- Send correct packet contents for movement update in Unit::SetSpeed.
- Misc. cleanup in affected scripts.
2012-03-12 00:53:45 +01:00
Nay
2b2d054f64 R.I.P SimpleAI
- Convert SimpleAI to (DB) SmartAI
- Spell ids corrected (and completed some of the scripts)
- Random cleanup (code style) in some scripts
2012-03-11 16:59:17 +00:00
Shauren
f85fdbebe7 Core/DBC: Remove store getters (useless since we don't have scripts as external dll) 2012-03-10 20:53:26 +01:00
Spp
d38bc3a178 Core: Rename GetCreatureInfo to GetCreatureTemplate and minor cleanup here and there 2012-02-27 14:58:47 +01:00
Venugh
1cac01b3df Core/Movement: Use SetWalk(true/false) instead of AddUnit/RemoveUnit. 2012-02-23 11:50:58 +01:00
Shocker
08be716ef8 Core/Misc: Rename UNIT_STAT_* enums to UNIT_STATE_* 2012-02-03 19:02:17 +02:00