Commit Graph

71 Commits

Author SHA1 Message Date
Vincent-Michael 634b3645d5 Core/Misc: Use proper headers to optimize compile 2012-07-30 05:38:40 +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 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
Shauren 28f8e42a69 Core/AI: Added EventInform hook for GameObjectAI and implemented it in SAI 2012-06-11 11:10:46 +02:00
kaelima c3287fee06 Core/SmartAI:
- Improve an error msg in ProcessAction
- Allow dist/angle to be 0.0f and set default if negative when using SMART_ACTION_FOLLOW
- Some minor cleanup in Opcodes.cpp, all smsg's should have Handle_ServerSide
2012-05-19 13:04:58 +02:00
Shauren 4f14693ef2 Core/Scripts: Corrected previous commit and added a few AI hooks to GameObjectAI 2012-04-14 18:26:16 +02:00
Shocker a08cb234c0 Merge pull request #5918 from GyxTom/master
Core/Misc: Various cleanups
2012-03-28 18:00:42 -07:00
click cf29214364 Core/AI: Fix some wannabe-invinceable typos here and there... 2012-03-29 00:47:56 +02:00
kandera d94608777c Core/Scripts: Fix invincibility hp level for smart scripts. 2012-03-28 19:21:40 -03:00
Gyx 1544b208da Core/Game: Code style again.
Signed-off-by: Gyx <2359980687@qq.com>
2012-03-28 20:00:29 +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
Spp d38bc3a178 Core: Rename GetCreatureInfo to GetCreatureTemplate and minor cleanup here and there 2012-02-27 14:58:47 +01:00
Venugh 5416b734e4 Core/Movement: Use SetLevitate(true/false) instead of AddUnit/RemoveUnit. 2012-02-23 12:32:21 +01:00
Venugh 1cac01b3df Core/Movement: Use SetWalk(true/false) instead of AddUnit/RemoveUnit. 2012-02-23 11:50:58 +01:00
click 5411e1ce52 Core: Clean up whitespace and tabs in the base sourcetree 2012-02-18 16:52:08 +01:00
Subv2112 229d4119e8 Core/SAI: Fixed SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL
Signed-off-by: Subv <s.v.h21@hotmail.com>
2012-02-02 14:35:45 -05:00
Subv2112 e43b1cd750 Core/SAI: Run mode should not be set to true each time a creature resets, it should use its previous value
Signed-off-by: Subv2112 <s.v.h21@hotmail.com>
2012-01-27 08:34:36 -05:00
Subv2112 3d4f55723c Core/SAI: Linked events should be executed after the event that linked them is executed.
Core/SAI: Allow SMART_EVENT_GO_STATE_CHANGED to use ActionInvoker target

Signed-off-by: Subv2112 <s.v.h21@hotmail.com>
2012-01-22 20:36:01 -05:00
Subv2112 07b1101a63 Core/SAI: Run mode should be disabled by default in creatures with SAI
Signed-off-by: Subv2112 <s.v.h21@hotmail.com>
2012-01-21 18:54:05 -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 7f977c28b6 Core/SAI: Fixed the behaviour of SmartAI::RemoveAuras, it should only remove the auras that are applied on the unit by casters other than the unit
Signed-off-by: Subv2112 <s.v.h21@hotmail.com>
2012-01-06 20:50:05 -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
Subv2112 235b941964 Fixed a typo
Signed-off-by: Subv2112 <s.v.h21@hotmail.com>
2012-01-05 19:46:46 -05:00
Subv2112 d889edb436 Core/SAI: Self-casted auras should not be removed when the NPC resets
Signed-off-by: Subv2112 <s.v.h21@hotmail.com>
2012-01-05 15:09:55 -05:00
Subv2112 8197c37a92 Vehicles with SAI should not kick their passengers when resetting
Signed-off-by: Subv2112 <s.v.h21@hotmail.com>
2012-01-05 12:11:58 -05:00
kiper 8299627ed9 Update headers for 2012. HAPPY NEW YEAR!!! 2012-01-01 00:32:13 +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
kaelima b10477a166 Core/SmartAI: Fixed crashes when using timed actionlist for gameobjects. 2011-12-10 13:44:06 +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
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
kaelima f2000f3fb5 Core/Misc: Some minor cleanups
Fixed SQL added in prev commit.
2011-10-24 23:33:17 +01:00
kaelima 3a3af64f68 Core/SmartAI:
- Fixed some issues with SMART_ACTION_SET_FLY (#1073)
- Fixed allowing 0 as input for  SMART_EVENT_ACCEPTED_QUEST and SMART_EVENT_REWARD_QUEST (#2680)
- Some cleanup
2011-10-24 23:21:34 +01:00
Nay 8373e6c32e Core/Creature: Do not attack non-combat pets.
Fixes an issue where non-combat pets were aggroing other creatures
2011-10-01 16:57:10 +01:00
Nay 0f7d9e4837 Core/SAI: Fix an issue where SAI was ignoring civilian and passive unit flags
Closes #2526
Disclaimer: This was not thoroughly tested; report any issue caused by this change.
2011-10-01 16:29:23 +01:00
Spp b16d2245bb Cosmetic: Multiple cosmetic changes
- Added missing space to 'if', 'for', 'while' and 'switch' when it's followed by '('
- Added missing space after a comma and remove space before comma (with some exceptions)
- Remove trailing spaces
- Convert tab to spaces

Note: Only affects files with extension "cpp" and "h" under /src/server
2011-09-29 12:43:05 +02:00
Nay dc123820ad Core/Spells: Correct a DBC mistake in Improved Stings (R2) 2011-09-06 18:12:09 +01:00
Spp- aa85553bfd Core: Crash fix (TemporarySummon), remove some warnings and some other minor changes
- "const uint64" and "uint64 const" --> uint64
 - Add some info in LFGDungeonEntry
 - Move some definitions from ".h" files and move to ".cpp"
2011-08-30 13:46:36 +02: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 78e10e9cd0 Core/AI: Cleaning up hungarian notation 2011-08-20 20:31:31 -03:00
Fredi Machado 0b64d726c2 Core/AI: Code style and cleanups 2011-08-18 14:55:59 -03:00
Spp- acd0fc79f6 Core: Pass by const reference for simple objects replaced with pass by value 2011-08-01 14:23:27 +02: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
Shauren 1df876c3ec Core/SAI: Fixed crashes in AttackStart related to movement
Closes #1670
2011-06-15 17:32:31 +02:00
kaelima b9e8694540 Core: Continued cleanup
If and for whitespaces.
2011-06-12 02:30:32 +02:00
leak 1003f30448 Add spaces after commas 2011-04-29 20:47:02 +02:00
leak 6d1924cee8 Removing SQLStorage class leftovers 2011-04-28 23:03:02 +02:00
Shauren 0fbde67824 Core/AI: Some code style cleanup 2011-03-27 12:54:42 +02:00
Shauren 2f79b0f266 Core: Removed all double (and more) empty lines 2011-03-21 10:52:14 +01:00
Rat 8b37ac4688 Core/SAI: Fix invoker logic and possible crashes
Signed-off-by: Rat <gmstreetrat@gmail.com>
2011-02-21 22:23:43 +01:00