Vincent-Michael
2596f1f35d
Core/SAI: Added SMART_ACTION_CAST support for gameobject cast
2014-06-14 19:55:55 +02:00
Discover-
80daaf8d43
Core/SAI: SMART_EVENT_IC_LOS is now called when movement in LOS was made while the creature was in combat
2014-05-23 17:11:37 +02:00
jackpoz
1083dbb993
Core/Misc: Remove Unit::Get* wrappers for ObjectAccessor::Get*
2014-05-20 21:21:33 +02:00
jackpoz
d36ecbf4a3
Merge pull request #12076 from Trisjdc/even_more_sai
...
Core/SAI: Clear UNIT_STATE_EVADE immediately if we're about to follow a target on EnterEvadeMode
2014-05-19 22:00:48 +02:00
Trisjdc
9bad26fc88
Core/SAI: Clear UNIT_STATE_EVADE immediately if we're about to follow a target on EnterEvadeMode (MoveFollow does not clear evade)
2014-05-16 19:46:02 +01:00
Trisjdc
50336af1c7
Core/SAI: Prevent nullifying damage, because of player damage requirements
2014-05-15 17:05:02 +01:00
Dehravor
cbd36d5a4e
Core/Misc: Remove remaining COMPILER_HAS_CPP11_SUPPORT related macros
2014-05-01 11:19:32 +02:00
joschiwald
84bff76ba0
Core/Misc: remove some obsolete parameters
2014-04-28 20:05:36 +02:00
Kinzcool
c536305e3a
Core: Droped faction_H field -- only one faction table is necessary
2014-04-27 18:13:55 -04:00
joschiwald
211d56d633
Core/BG/SA:
...
* replaced some trinity_string with broadcasttexts
* basic implementation of phasing in SA
* spawn some triggers in SA (fixes dest position of teleport pads)
* added text getter to broadcasttext struct
* some cleanup in destructable go event notification
2014-04-26 03:40:30 +02:00
jackpoz
2585e799f9
Core/Misc: Change how Position struct is retrieved
...
Update Position::GetPosition() and similar methods signatures to reflect 2a4c9bcaf9 changes by return a Position object instead of accepting a Position parameter by reference.
2014-04-25 21:19:30 +02:00
joschiwald
465e4a0b0f
Core/Achievements: achievement earned message will now use broadcasttext instead of trinity_string
2014-04-23 01:14:20 +02:00
joschiwald
583039c1c5
Core/SmartScripts: use broadcasttext instead of trinity_string in SMART_ACTION_FLEE_FOR_ASSIST and SMART_ACTION_CALL_FOR_HELP
2014-04-22 19:24:47 +02: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
MitchesD
718b0e6bdd
Core/SmartScripts: SMART_ACTION_EQUIP prevent to false errors
2014-04-03 19:47:27 +02:00
Vincent-Michael
bacfbdc4ee
Core/Sai: Added new db errors :P (hihi)
2014-03-31 17:32:39 +02:00
Gacko
7630b3c627
SmartAI: Use same method for removing auras in EnterEvadeMode as in CreatureAI
...
Also fixes warnings about duplicate auras. Self-casted auras were not removed on entering evade mode in SAI as they are in CreatureAI.
2014-03-30 15:05:04 +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
Discover-
17674182c4
Core/SAI: Allow only creature sources to use the event types SMART_EVENT_DISTANCE_CREATURE and SMART_EVENT_DISTANCE_GAMEOBJECT for now.
2014-03-26 13:50:36 +01:00
Discover-
76641bc7dc
Core/SAI: Only allow SMART_EVENT_TARGET_BUFFED to be used from creature sources.
2014-03-26 13:44:36 +01:00
deathicon
78e9a3eb65
Core/SAI: Implement two new event types that are triggered when a certain creature/gameobject entry or guid gets within a given distance of the source.
2014-03-26 10:23:34 +01:00
jackpoz
7a188c8685
Core/SAI: Fix assertion in SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST
...
Fix assertion triggered in SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST if max entry is less than min entry
2014-02-09 16:09:09 +01:00
jackpoz
28946ac5db
Core/SAI: Improve error log
...
Log both target and current Object when checking if a Creature/GameObject have SmartAI enabled.
2014-02-08 22:38:29 +01:00
jackpoz
dbed818f6f
Core/SAI: Fix crash
...
Disable script type SMART_SCRIPT_TYPE_TIMED_ACTIONLIST actions if they are trying to overwrite the timed action list while iterating it.
This was invalidating the iterator and deleting any smart action stored in it, including the current executed one.
Valgrind log:
Invalid read of size 1
at SmartScript::OnUpdate(unsigned int) (SmartScript.cpp:3258)
by SmartAI::UpdateAI(unsigned int) (SmartAI.cpp:331)
by Creature::Update(unsigned int) (Creature.cpp:544)
Address 0x1807d9b2 is 10 bytes after a block of size 40 alloc'd
at operator new(unsigned long) (vg_replace_malloc.c:319)
...
by SmartAIMgr::LoadSmartAIFromDB() (SmartScriptMgr.cpp:231)
by World::SetInitialWorldSettings() (World.cpp:1724)
by Master::Run() (Master.cpp:169)
by main (Main.cpp:142)
2014-02-08 21:59:35 +01:00
Discover-
bebb581d2e
Core/SAI: I need more sleep...
2014-01-21 20:01:00 +01:00
Discover-
bf0d8c1346
Core/SAI: Implement three more event phases which makes a total of 9 (from 6).
...
Ref. #11486
2014-01-21 19:56:43 +01:00
jackpoz
cbba22ba68
Core/SAI: Fix assertion triggered in SmartScript
...
Remove assertion in SmartScript added in b8625f41bd and handle SmartScripts with GetBaseObject() returning NULL , like SmartTrigger . In this case SmartScript::mTargetStorage cannot be sanitized and might contain references to free'd WorldObjects if the script doesn't last a single Map::Update() call.
2014-01-15 20:20:01 +01:00
jackpoz
b8625f41bd
Core/SAI: Fix crash in SmartScript
...
Fix crash in SmartScript storing WorldObject* instead of guid as targets in SmartScript::mTargetStorage , used by SMART_TARGET_STORED target type , SMART_ESCORT_TARGETS and other escort related code.
Fixes #11228 , #10157 .
Valgrind log:
Invalid read of size 4
at : Object::GetTypeId() const (Object.h:140)
by : SmartScript::IsPlayer(WorldObject*) (SmartScript.h:73)
by : SmartScript::ProcessAction(SmartScriptHolder&, Unit*, unsigned int, unsigned int, bool, SpellInfo const*, GameObject*) (SmartScript.cpp:330)
by : SmartScript::ProcessEvent(SmartScriptHolder&, Unit*, unsigned int, unsigned int, bool, SpellInfo const*, GameObject*) (SmartScript.cpp:2662)
by : SmartScript::ProcessAction(SmartScriptHolder&, Unit*, unsigned int, unsigned int, bool, SpellInfo const*, GameObject*) (SmartScript.cpp:2226)
by : SmartScript::ProcessTimedAction(SmartScriptHolder&, unsigned int const&, unsigned int const&, Unit*, unsigned int, unsigned int, bool, SpellInfo const*, GameObject*) (SmartScript.cpp:2238)
by : SmartScript::ProcessEvent(SmartScriptHolder&, Unit*, unsigned int, unsigned int, bool, SpellInfo const*, GameObject*) (SmartScript.cpp:2685)
by : SmartScript::UpdateTimer(SmartScriptHolder&, unsigned int) (SmartScript.cpp:3198)
by : SmartScript::OnUpdate(unsigned int) (SmartScript.cpp:3244)
by : SmartAI::UpdateAI(unsigned int) (SmartAI.cpp:331)
by : Creature::Update(unsigned int) (Creature.cpp:544)
by : void Trinity::ObjectUpdater::Visit<Creature>(GridRefManager<Creature>&) (GridNotifiers.cpp:340)
2014-01-12 20:23:13 +01:00
joschiwald
7ec7fcf78c
Core/SAI: drop unneeded code
2014-01-10 17:36:04 +01: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
Shauren
8bcde41538
Core/Quests: Added stuff missing in previous commit
2013-12-25 12:17:23 +01:00
Shauren
5e8f829181
Core/SAI: Fixed a crash in call for help/flee for assist actions when they had an emote attached
2013-12-24 11:26:07 +01:00
Shauren
107af52853
Core/Chat: Refactored building chat packets
...
* Moved everything into one specialized method instead of being scattered all over the place
* Allow localizing creature names in chat messages (when using $N)
* Send SMSG_GM_MESSAGECHAT for gm messages
2013-12-23 14:23:49 +01:00
Discover-
c5788de8a4
Core/SAI: Fix another memory leak, thanks to @Xter
2013-12-19 10:50:16 +01:00
Discover-
e44e932d4d
Core/SAI: Fix two memoryleaks in my previous commits. Thanks to @Xter for the notice.
2013-12-19 10:28:45 +01:00
Discover-
e5f7beecf5
Core/SAI: Using SMART_ACTION_FORCE_DESPAWN now despawns the given target_type instead of always the creature itself.
2013-12-18 10:06:19 +01:00
Discover-
a0f7fee922
Core/SAI: Fix compile
...
Core/SAI: Don't limit SMART_ACTION_SET_INGAME_PHASE_MASK to unit targets only. Thanks to @Shauren for the notice.
2013-12-17 11:38:29 +01:00
Discover-
154ee466eb
Core/SAI: Using the action_type SMART_ACTION_SET_REACT_STATE now sets the react state of the target_type. Won't break any scripts as all current cases of this action_type have target_type 1 (SMART_TARGET_SELF).
2013-12-17 11:10:23 +01:00
Discover-
1f4d585bef
Core/SAI: In all npc flag related action_types we now check if the target is a creature instead of an unit (creature/player).
2013-12-17 11:06:07 +01:00
Discover-
20a22662df
Core/SAI: Using SMART_ACTION_SET_FOLLOW with target_type 0 (SMART_TARGET_NONE) will now stop the following completely. Fixes 6 scripts in a clean TDB already using this functionality even though it wasn't implemented.
2013-12-17 10:12:23 +01:00
Discover-
54b7162f1d
Core/SAI: Make SMART_ACTION_SET_INGAME_PHASE_MASK set the phasemask of the target_type instead of always the source calling the action type.
2013-12-17 09:44:06 +01:00
Discover-
e17af3f203
Core/Quests: Fix an issue where auto-completed quests would not be automatically completed if the quest was added through either the SmartAI action_type SMART_ACTION_ADD_QUEST, the spell effect SPELL_EFFECT_QUEST_START or the opcode CMSG_QUEST_CONFIRM_ACCEPT. Also fixes auto-complete quests in the SAI and opcode case not calling the AI hook.
2013-12-14 19:42:31 +01:00
jackpoz
1c0903e286
Core/Misc: Fix some static analysis issues
...
Fix some static analysis issues about uninitialized values. Most of them are false positives, always initialized before being accessed, while some of them are real issues spotted by valgrind too.
2013-12-14 18:41:26 +01:00
Discover-
4ca63412c8
Core/SmartAI: SMART_ACTION_UPDATE_TEMPLATE will no longer ignore the target type and force the source creature (creature only) to be updated; from now on it updates the given targets to the given entry (actionparam1)
2013-12-13 09:45:58 +01:00
Malcrom
c045d4c7f4
Core/SmartAI: Reset Actions will not be processed until creature reaches home.
2013-12-12 21:23:14 -03:30
Malcrom
9f741432a3
Core/AI: Some code cleanup
2013-12-12 18:09:07 -03:30
Malcrom
9d95351118
Core/SmartAI: Fixed issue where ranged caster would switch to combat ready state between cast.
2013-12-12 16:39:30 -03:30
joschiwald
a40e814240
Core/SmartScripts: speedup loading/validating sai scripts from db
...
Before:
>> Loaded 6953 SmartAI scripts in 3543 ms
After:
>> Loaded SmartAIMgr Helpers in 4 ms
>> Loaded 6953 SmartAI scripts in 95 ms
2013-12-11 18:53:05 +01:00
joschiwald
eddf1b5a64
Scripts: replace some SetOrientation() calls with spline packets and some random changes
2013-12-10 18:46:11 +01:00