Commit Graph

341 Commits

Author SHA1 Message Date
Malcrom
e60fe4c303 Core/SmartAI: Fixed waypoint pathing not resuming after evade. 2013-12-03 23:41:11 -03:30
Malcrom
b407e72339 Core/SmartScript: Allow flag to be added to spell to determine combat movement.
Greatly simplifies SAI combat scripting.
2013-12-03 20:53:33 -03:30
Malcrom
48d8af0962 Core/SmartAI: Fix SMART_ACTION_ALLOW_COMBAT_MOVEMENT 2013-12-03 20:19:17 -03:30
Spp
cd48662233 Core/Logging: Minor changes
- Select stderr when writing ERROR and FATAL messages
- Simplify function defines
- Fix `logs` table structure with latest logging changes
2013-11-11 14:35:16 +01:00
Spp
65cd07a288 Core: Improve error messages for linked_respawn table (and minor cosmetic changes here and there) 2013-11-11 11:03:32 +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
Gacko
be19ac95ed Core/SmartAI: Better wording for telling "There is a spell for summoning this" 2013-11-07 11:56:02 +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
Discover-
0cc32e28e3 Core/SAI: Rename SMART_EVENT_TARGET_CASTING to SMART_EVENT_VICTIM_CASTING as that's what it actually does. It was often confused to use the target_type field instead of the victim. 2013-10-22 15:59:32 +02:00
Discover-
1a6157985c Core/Misc: Get rid of some useless code 2013-10-21 09:15:17 +02:00
Shauren
ce55647c41 Core/Transports
* Rewritten path generation, now uses splines - timers are a lot more accurate now
* Implemented stopping transports
* Implemented spawning transports in instances
* Implemented spawning gameobjects as transport passengers
* Transport passengers are now stored in creature/gameobject table using gameobject_template.data6 from transport's template as map id
2013-10-16 18:37:29 +02:00
Discover-
ca02411eff Core/SAI: When the castflags are set to both SMARTCAST_AURA_NOT_PRESENT and SMARTCAST_INTERRUPT_PREVIOUS, we only interrupt the spell if there is actually a spell cast. 2013-10-11 16:57:28 +02:00
Ellie
c803cc1f5c Merge branch 'master' of github.com:TrinityCore/TrinityCore into string_concatenation 2013-10-01 01:14:32 -07:00
Ellie
1fae858645 Whitespace between string literals and user-defined literals is now mandatory for concatenation in C++11 2013-10-01 01:13:13 -07:00
Discover-
11d9a44508 Core/SAI: Properly implement the second parameter of SMART_ACTION_CALL_TIMED_ACTIONLIST to reflect the wiki (which also makes more sense) 2013-10-01 10:08:05 +02:00
Discover-
80ce30ac7d Core/SAI: Add 'playerOnly' parameters to SMART_TARGET_CLOSEST_ENEMY and SMART_TARGET_CLOSEST_FRIENDLY. Wiki is updated accordingly. 2013-09-30 10:11:02 +02:00
Discover-
a5c248b60f Core/SAI: Get rid of unused parameter 'storageId' (third) in SMART_ACTION_SUMMON_CREATURE. This means the 4th parameter (actionInvoker 0/1) must move back one parameter. On a clean TDB there is not a single case of this parameter being used.
Updated wiki accordingly.
2013-09-25 11:46:51 +02:00
jackpoz
c256a0330a Merge branch 'master' of github.com:TrinityCore/TrinityCore 2013-09-24 23:35:11 +02:00
jackpoz
ec3832c2c1 Core/AI: Fix uninitialized values and array overflows in SAI
Proper initialize POD struct members to 0 in SMART_ACTION_CREATE_TIMED_EVENT action type.
Fix array overflows and access uninitialized values in SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST, SMART_ACTION_RANDOM_PHASE and SMART_ACTION_RANDOM_EMOTE .

Valgrind log for SMART_ACTION_RANDOM_PHASE case:
 Conditional jump or move depends on uninitialised value(s)
   at : SmartScript::UpdateTimer(SmartScriptHolder&, unsigned int) (SmartScript.cpp:3086)
   by : SmartScript::OnUpdate(unsigned int) (SmartScript.cpp:3176)
   by : SmartAI::UpdateAI(unsigned int) (SmartAI.cpp:335)
   by : Creature::Update(unsigned int) (Creature.cpp:542)
   by : TempSummon::Update(unsigned int) (TemporarySummon.cpp:47)

 Uninitialised value was created by a stack allocation
   at : SmartScript::ProcessAction(SmartScriptHolder&, Unit*, unsigned int, unsigned int, bool, SpellInfo const*, GameObject*) (SmartScript.cpp:143)
2013-09-24 23:33:28 +02:00
Discover-
a0db0728f2 Merge branch 'master' of https://github.com/TrinityCore/TrinityCore 2013-09-23 16:47:47 +02:00
Discover-
9653576cb4 Core/SAI: Using SMART_TARGET_NONE no longer works the same way as SMART_TARGET_ACTION_INVOKER but rather return NULL instead.
Fixes #10908
2013-09-23 16:47:22 +02:00
Discover-
69b0a009c4 Core/SAI: Make SMART_ACTION_RANDOM_MOVE also work with SMART_TARGET_NONE and non-creature targets (if a non-creature target_type is specified and no creature target was found, the action is fired at the source)
Ref. #7431
2013-09-21 11:21:29 +02:00
Shauren
be5cf42ec3 Core/SmartAI: Fixed creatures using SAI not attacking its charmer after it breaks
Closes #7601
2013-09-09 17:44:07 +02:00
Shauren
fcf9552934 Core/SmartScripts: Fixed heap corruption in SMART_ACTION_EQUIP
Closes #10739
2013-09-08 12:15:13 +02:00
Aokromes
c3c5327fbd Merge pull request #10716 from Discover-/SAI_Owner_Or_Summoner
Core/SAI: Make SMART_TARGET_OWNER_OR_SUMMONER also work for creatures su...
2013-09-06 17:29:15 -07:00
Vincent-Michael
bc1a079b6c Core/SAI: Fix typo (i blame germans laziness) 2013-09-06 21:40:04 +02:00
Vincent-Michael
458f5b9502 Core/SAI: Added SMART_ACTION_SUMMON_CREA / SMART_ACTION_SUMMON_GO log for has already summon spell 2013-09-05 16:16:23 +02:00
Discover-
926edaf49d Tabs to spaces... 2013-09-04 14:07:27 +02:00
Discover-
9761affc8d Core/SAI: Make SMART_TARGET_OWNER_OR_SUMMONER also work for creatures summoned by spells 2013-09-04 09:35:21 +02:00
Vincent-Michael
ab85a9507e Core/SAI: Added SMART_ACTION_CALL_KILLEDMONSTER log for has already spell kill credit 2013-09-02 17:48:55 +02:00
Nay
582686090d Merge pull request #10685 from Discover-/SmartAI-Target-Casting
Core/SmartAI: Add a spellid to SMART_EVENT_TARGET_CASTING. If left on 0,...
2013-09-01 10:03:45 -07:00
Nay
c4bd91ceb9 Merge pull request #10690 from Discover-/SmartAI-Set-Home-Pos
Core/SAI: Allow using SMART_ACTION_SET_HOME_POS with multiple target typ...
2013-09-01 10:03:09 -07:00
Nay
b324646005 Merge pull request #10689 from Discover-/SmartAI-Killed-Monster-Credit
Core/SAI: Also use loot recipient for SMART_ACTION_CALL_KILLEDMONSTER wh...
2013-09-01 10:02:43 -07:00
Nay
a762df0aba Core/SAI: Fix processing linked events when return is used in ProcessAction
Thanks Discover-

Closes #10688
2013-09-01 18:01:59 +01:00
Discover-
8ba8190773 Core/SAI: Allow using SMART_ACTION_SET_HOME_POS with multiple target types 2013-09-01 13:56:35 +02:00
Discover-
7d7fc7b662 Core/SAI: Also use loot recipient for SMART_ACTION_CALL_KILLEDMONSTER when target is SMART_TARGET_SELF (used in four cases in a clean TDB which will be fixed by this) 2013-09-01 13:44:08 +02:00
Discover-
016dac995e Core/SmartAI: Add a spellid to SMART_EVENT_TARGET_CASTING. If left on 0, it checks for all spells (like it did without these changes) 2013-09-01 10:49:29 +02:00
Nay
7ecf4fdec1 Core/Quests: Split Flags and SpecialFlags 2013-08-30 23:08:40 +02:00
Nay
7776016106 Core/Quests: Remove CastedCreatureOrGO method
- Remove EAI's ACTION_T_CAST_EVENT and ACTION_T_CAST_EVENT_ALL
- Remove SAI's SMART_ACTION_CALL_CASTEDCREATUREORGO
- Split QUEST_TRINITY_FLAGS_KILL_OR_CAST into QUEST_TRINITY_FLAGS_KILL and QUEST_TRINITY_FLAGS_CAST
- Assign QUEST_TRINITY_FLAGS_CAST to all the quests that were using RequiredSpellCastX
- (unrelated) Fix a warning in Player.cpp
- Replace CastedCreatureOrGO usage in scripts by KilledMonsterCredit

TODO: Convert the two EAI scripts commented out in the .sql to proper SAI

Closes #10667
2013-08-30 19:32:08 +01:00
Nay
aa5bc37e9c Core: Yet more warning fixes 2013-08-30 16:03:37 +01:00
Nay
ec837b1d7d Merge pull request #10666 from xjose93/SmartScripts-StartEvent
Implement SMART_ACTION_GAME_EVENT_STOP (111) and SMART_ACTION_GAME_EVENT_START (112).
2013-08-29 16:36:42 -07:00
xjose93
c3afc00571 Implement SMART_ACTION_GAME_EVENT_STOP (111) and SMART_ACTION_GAME_EVENT_START (112). 2013-08-30 01:23:01 +02:00
Kirkhammett
c84f545708 Core/SmartAI: Add passive check for WP movement 2013-08-29 14:35:22 +02:00
Nay
2050a36b58 SAI & Scripts: Fix unitialized values found by Valgrind
==3064== Conditional jump or move depends on uninitialised value(s)
==3064==    at 0x19B3031: boss_skarvald_the_constructor::boss_skarvald_the_constructorAI::UpdateAI(unsigned int) (boss_skarvald_dalronn.cpp:217)

==3064== Conditional jump or move depends on uninitialised value(s)
==3064==    at 0x19B3948: boss_dalronn_the_controller::boss_dalronn_the_controllerAI::UpdateAI(unsigned int) (boss_skarvald_dalronn.cpp:388)

==3064== Conditional jump or move depends on uninitialised value(s)
==3064==    at 0x15E2FCC: SmartScript::ProcessAction(SmartScriptHolder&, Unit*, unsigned int, unsigned int, bool, SpellInfo const*, GameObject*) (SmartScript.cpp:144)
==3064== Conditional jump or move depends on uninitialised value(s)
==3064==    at 0x191CB98: dummy_dragonAI::UpdateAI(unsigned int) (boss_sartharion.cpp:961)
==3064==    by 0x191D242: npc_shadron::npc_shadronAI::UpdateAI(unsigned int) (boss_sartharion.cpp:1122)
==3064== Conditional jump or move depends on uninitialised value(s)
==3064==    at 0x19AE913: boss_ymiron::boss_ymironAI::UpdateAI(unsigned int) (boss_ymiron.cpp:215)

==3064== Use of uninitialised value of size 8
...
==3064==    by 0x18A9F4A: boss_illidan_stormrage::boss_illidan_stormrageAI::Reset() (boss_illidan.cpp:1805)

==3064== Conditional jump or move depends on uninitialised value(s)
...
==3064==    by 0x18A9F4A: boss_illidan_stormrage::boss_illidan_stormrageAI::Reset() (boss_illidan.cpp:1805)

==3064== Conditional jump or move depends on uninitialised value(s)
==3064==    at 0x191CB98: dummy_dragonAI::UpdateAI(unsigned int) (boss_sartharion.cpp:961)
==3064==    by 0x191CE88: npc_tenebron::npc_tenebronAI::UpdateAI(unsigned int) (boss_sartharion.cpp:1027)

==3064== Conditional jump or move depends on uninitialised value(s)
==3064==    at 0x191CB98: dummy_dragonAI::UpdateAI(unsigned int) (boss_sartharion.cpp:961)
==3064==    by 0x191D5B8: npc_vesperon::npc_vesperonAI::UpdateAI(unsigned int) (boss_sartharion.cpp:1220)

==3064== Conditional jump or move depends on uninitialised value(s)
...
==3064==    by 0x1868F59: boss_lady_vashj::boss_lady_vashjAI::Reset() (boss_lady_vashj.cpp:206)

==3064== Conditional jump or move depends on uninitialised value(s)
==3064==    at 0x191C14C: dummy_dragonAI::MovementInform(unsigned int, unsigned int) (boss_sartharion.cpp:802)

==3064== Conditional jump or move depends on uninitialised value(s)
==3064==    at 0x1046986: Position::NormalizeOrientation(float) (Object.h:388)
...
==3064==    by 0x17D9463: boss_malchezaar::boss_malchezaarAI::SummonInfernal(unsigned int) (boss_prince_malchezaar.cpp:373)
2013-08-26 16:13:26 +01:00
joschiwald
2b19ba1879 Misc: replace Unit::GetPlayer with ObjectAccessor::GetPlayer and some cosmetic changes 2013-08-18 01:41:10 +02:00
Discover-
a0ff0233c5 Core/SmartAI: Implement SMART_TARGET_CLOSEST_FRIENDLY.
Parameter is distance to search for.

Closes #10521
2013-08-15 01:22:22 +01:00
Discover-
8c961687a0 Core/SmartAI: Implement SMART_EVENT_FRIENDLY_HEALTH_PCT.
On current clean TDB, there are a total of 106 creatures using
   SMART_EVENT_FRIENDLY_HEALTH (non-PCT) which has a flat first parameter, but
   only 8 of these use the event correctly (and therefore only 8 of them
   actually work).

Closes #10520
2013-08-15 01:18:10 +01:00
Kirkhammett
faa2ec9732 Core/SAI: Additions to d0bde02b21
Signed-off-by: Nay <dnpd.dd@gmail.com>
2013-08-12 14:06:48 +01:00
Nay
54d2b73f3c Merge pull request #10513 from Discover-/SmartAI-Casted-CreatureOrGo
Core/SmartAI: Drop support for SMART_ACTION_SEND_CASTCREATUREORGO. It is...
2013-08-11 06:26:52 -07:00