Commit Graph

83 Commits

Author SHA1 Message Date
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
Discover-
e190a202ca Core/CreatureAI: Implement an OnSpellClick hook instead of the ugly way that uses DoAction with EVENT_SPELLCLICK.
Core/SmartAI: Implement SMART_EVENT_ON_SPELLCLICK. Parameter is the clicker.

If someone could update the wiki accordingly for SAI I would appreciate that. Thanks to @Shauren for some help!
2012-06-19 00:07:20 +02:00
Nay
53b561f550 Core/SAI: Remove some unused conditions related code
SAI conditions were implemented in a different way than initially planned

Signed-off-by: Nay <dnpd.dd@gmail.com>
2012-06-18 00:42:37 +01:00
Nay
d61f9fb40c Fix build in GCC
Signed-off-by: Nay <dnpd.dd@gmail.com>
2012-06-17 22:11:27 +01:00
Nay
8c16cc2260 Core/SAI: Implement SMART_EVENT_ACTION_DONE (72, DoAction)
Param1 is event id
This event is triggered on spellclick (id=1001), fall on ground (id=1002) and charge (id=1003)

Signed-off-by: Nay <dnpd.dd@gmail.com>
2012-06-17 21:50:01 +01:00
Subv
38f6f9d8cb Core/SAI: Missing change from previous commit 2012-06-11 11:15:33 -05:00
Shauren
28f8e42a69 Core/AI: Added EventInform hook for GameObjectAI and implemented it in SAI 2012-06-11 11:10:46 +02:00
Nay
cffcf633c3 Core/SAI: If spell id in SMART_ACTION_REMOVEAURASFROMSPELL is 0, remove all auras instead
Signed-off-by: Nay <dnpd.dd@gmail.com>
2012-06-02 14:29:15 +01:00
Discover-
1b77fd45fa Core/SAI: Revert SMART_ACTION_SET_STAND_STATE from 013fe44b92, can be done with SMART_ACTION_SET_UNIT_FIELD_BYTES_1. 2012-05-30 01:00:55 +02:00
Discover-
013fe44b92 Core/SAI: Implement SMART_ACTION_SET_RANGED_MOVEMENT (79) and SMART_ACTION_SET_STAND_STATE (101). Updated wiki accordingly. These were required in order to properly be able to convert EventAI to SmartAI. 2012-05-29 12:19:46 +02:00
Nay
66ce5a1148 And I forgot to Ctrl+S, yay me. 2012-05-20 16:36:44 +01:00
Nay
7661858ac0 Core/SAI: Few changes to db data validation for actions and event flags 2012-05-20 16:13:52 +01:00
Subv
6759bcab16 Core/SAI: Added a new event flag to allow events to NOT reset when the creature evades (SMART_EVENT_FLAG_DONT_RESET)
Closes #5568

Signed-off-by: Subv <s.v.h21@hotmail.com>
2012-04-05 12:10:56 -05:00
Shauren
e64d1d43dd Core: Add proper cleanup at exit for smart script waypoints and instance encounters 2012-03-24 18:42:35 +01:00
Discover-
c4fd6b89db Core/SAI: SMART_ACTION_MOVE_TO_POS will now have param1 as PointId. This means you can now (properly) use SMART_EVENT_MOVEMENTINFORM when reaching the point you make the NPC move to.
Wiki is updated accordingly.
2012-03-03 23:41:29 +01:00
Shauren
254256668b Core: Fixed compile without PCH 2012-03-01 23:45:07 +01:00
Subv
25d9e2ec29 Core/SAI: Implemented SMARTCAST_AURA_NOT_PRESENT as castflag, the spell will only be casted if the target does not have the aura
Signed-off-by: Subv <s.v.h21@hotmail.com>
2012-02-18 19:10:18 -05:00
click
5411e1ce52 Core: Clean up whitespace and tabs in the base sourcetree 2012-02-18 16:52:08 +01:00
Subv2112
a3f595ee10 Core/SAI: Implemented SMART_ACTION_SEND_TARGET_TO_TARGET, it can be used to send targets previously stored with SMART_ACTION_STORE_TARGET, to another npc, the other npc can then access them as if it was its own stored list
Signed-off-by: Subv2112 <s.v.h21@hotmail.com>
2012-01-22 07:54:32 -05:00
Machiavelli
5a504f94f7 Merge pull request #4700 from Subv/fix001
Core/SAI: Implement SMART_EVENT_GO_STATE_CHANGED and SMART_ACTION_GO_SET_LOOT_STATE
2012-01-07 11:24:53 -08:00
Subv2112
a40839fd7b Core/SAI: Changed SMART_ACTION_CALL_TIMED_ACTIONLIST params, now it has only 2, id and timerType
Signed-off-by: Subv2112 <s.v.h21@hotmail.com>
2012-01-06 22:29:26 -05:00
Subv2112
15d8763478 Core/SAI: Fixed the crash with using SMART_ACTION_ATTACK_START inside a TimedActionList, closes #4650
Signed-off-by: Subv2112 <s.v.h21@hotmail.com>
2012-01-06 22:24:11 -05:00
Subv2112
aaa255b83d Core/SAI: Implemented SMART_EVENT_GO_STATE_CHANGED and SMART_ACTION_GO_SET_LOOT_STATE
Signed-off-by: Subv2112 <s.v.h21@hotmail.com>
2012-01-06 11:09:01 -05:00
kiper
8299627ed9 Update headers for 2012. HAPPY NEW YEAR!!! 2012-01-01 00:32:13 +01:00
Machiavelli
6c03bf9535 Core/Misc: Some random meaningless Engrish to English conversion in a method name because Discovered is too lazy to do it himself. 2011-12-19 22:06:29 +01:00
Machiavelli
1b2c413933 Core/SAI: Preliminary implementation of SMART_EVENT_GAME_EVENT_START and SMART_EVENT_GAME_EVENT_END {param1: game_event.entry} 2011-12-11 16:23:43 +01:00
Machiavelli
f5b3553bb3 Core/SAI: Typo in second param of SMART_ACTION_SEND_GOSSIP_MENU. This is npc_text_id, not gossip_option_id. Wiki needs to be updated accordingly.
Thanks to Prodigy for pointing out.
2011-12-06 12:37:05 +01:00
kaelima
3d4d147196 Core/SmartAI:
- Drop useless actions SMART_ACTION_ENTER_VEHICLE, SMART_ACTION_LEAVE_VEHICLE and SMART_ACTION_REMOVE_PASSENGERS.
(Vehicles are aura-driven, just remove or add the proper aura to achieve the same as these actions did)
- Fixed possible crash in SMART_ACTION_SEND_GOSSIP_MENU
- Areatriggers should not be triggered by dead players
2011-10-31 02:01:17 +01:00
Nay
f17879d423 Core/SAI: Add input validation (params) to certain target types and update target comments 2011-10-30 13:12:39 +00:00
kaelima
f958fdf246 Core/SmartAI: Add actions SMART_ACTION_LEAVE_VEHICLE and SMART_ACTION_REMOVE_PASSENGERS.
Fix maxdist for SMART_TARGET_CLOSEST_PLAYER.
2011-10-25 23:50:00 +01:00
kaelima
199bcf1a88 Core/SmartAI: Allow SMART_ACTION_FOLLOW to take 0 values for dist and angle - will set them to their "default" following values. 2011-10-25 19:08:21 +01:00
Nay
5f58965fad Tiny typo on previous commit. 2011-10-23 13:01:04 +01:00
Geekotron
c2125ece3b Core/SAI: Add SMART_ACTION_SEND_GOSSIP_MENU.
It allows the scripter to change the gossip (and gossip menu option) of a creature with SAI
Param1 = `gossip_menu`.`entry`
Param2 = `gossip_menu_option`.`id`
2011-10-23 12:59:08 +01:00
Rat
e23fe1845f Core/SmartAI: Updated SMART_ACTION_RESPAWN_TARGET, should work for GOs as intented. Param1 is to set GO respawn time. 2011-10-07 14:12:09 +02:00
Nay
3ccfb5fefb Core/SAI: SMART_ACTION_FLEE: print flee emote if param1 is set 2011-09-04 18:51:16 +01:00
Chaplain
fb27848510 Core: Clean up here and there.
*replase postfix iterator increment\decrement with prefix in cycles
*replase strlen(*char) != 0 with *char[0] != '\0'
*replase strlen(rStr.c_str()) with rStr.length()
2011-08-23 18:09:08 +03:00
Fredi Machado
73b1448f29 Core/AI: English correction thanks u2blah for pointing 2011-08-21 00:07:38 -03:00
Fredi Machado
0b64d726c2 Core/AI: Code style and cleanups 2011-08-18 14:55:59 -03:00
QAston
b0fe236265 Core: Use new SpellInfo class in core. Sadly, this commit is not compatibile with some of the custom code. To make your code work again you may need to change:
*SpellEntry is now SpellInfo
*GetSpellProto is now GetSpellInfo
*SpellEntry::Effect*[effIndex] is now avalible under SpellInfo.Effects[effIndex].*
*sSpellStore.LookupEntry is no longer valid, use sSpellMgr->GetSpellInfo()
*SpellFunctions from SpellMgr.h like DoSpellStuff(spellId) are now: spellInfo->DoStuff()
*SpellMgr::CalculateEffectValue and similar functions are now avalible in SpellEffectInfo class.
*GET_SPELL macro is removed, code which used it is moved to SpellMgr::LoadDbcDataCorrections
*code which affected dbc data in SpellMgr::LoadSpellCustomAttr is now moved to LoadDbcDataCorrections
2011-07-26 23:09:28 +02:00
Jesper Meyer
b216522b3d Core/SAI: Add action SMART_ACTION_JUMP_TO_POS. 2011-07-02 07:52:03 +02:00
kaelima
d277ecc26a Core/SmartAI: Add ability to set/add/remove dynamicflags of a creature.
SmartAI Wiki is updated.
2011-06-12 17:50:23 +02:00
kaelima
b9e8694540 Core: Continued cleanup
If and for whitespaces.
2011-06-12 02:30:32 +02:00
Shauren
339e8cb7e0 Core/SAI/EAI: Pass struct parameters by reference instead of value, saves unneeded copying 2011-05-12 10:40:53 +02:00
leak
1003f30448 Add spaces after commas 2011-04-29 20:47:02 +02:00
leak
c51c817a45 Core/ObjectMgr: Refactor sCreatureStorage 2011-04-28 22:57:08 +02:00
leak
e2e9431ca3 Core/ObjectMgr: Refactor sGOStorage 2011-04-28 22:54:30 +02:00
Manuel Carrasco
4796848b83 Core/SAI: Implemented SMART_EVENT_IS_BEHIND_TARGET, it is triggered when the creature is behind its current target.
Signed-off-by: Manuel Carrasco <manue.l@live.com.ar>
2011-04-14 00:30:32 -03:00
Shauren
2f79b0f266 Core: Removed all double (and more) empty lines 2011-03-21 10:52:14 +01:00
Shauren
9710c41a40 More warning fixes 2011-03-08 19:11:02 +01:00