Commit graph

40 commits

Author SHA1 Message Date
NoFantasy
06b0e7a444 [8326] Check getVictim() before IsInMap check in EventAI EVENT_T_RANGE and prevent possible crash.
Signed-off-by: NoFantasy <nofantasy@nf.no>
2009-08-06 20:51:21 +02:00
VladimirMangos
18ae2de853 [8235] Fixed typos in ACTION_T_SET_INVINCEABILITY_HP_LEVEL.
Thanks to Zor for pointing.
2009-07-23 17:28:06 +04:00
VladimirMangos
dce0941511 [8233] Implement new EventAI action ACTION_T_SET_INVINCEABILITY_HP_LEVEL.
Action set min. health value that can be set for creature in result damage apply.
It can be used in duel like events with creatures to prevent killing creature and other
cases when creature must avoid damage at some health level while it used.
2009-07-23 12:40:21 +04:00
ApoC
1ad013e25b [8146] Fixed handling of eventchance for CreatureEventAI.
Check event chance after timers advances othewise event is
not scheduled to next time period and event chance is again
checked on next AI update.

Signed-off-by: ApoC <apoc@nymfe.net>
2009-07-07 23:01:28 +02:00
NoFantasy
400c110e1f [8057] Move code from Event AI to class Creature function for reuse in other scripting cases.
Also some outdated and wrong checks remove.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-06-21 03:39:43 +04:00
NoFantasy
b91f7c9479 [8046] Use float for store AttackDistance as expected by using calls.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-06-20 01:17:23 +04:00
VladimirMangos
4cbf8e2412 [8045] Cleanup expression. 2009-06-20 00:32:32 +04:00
NoFantasy
68848314e2 [8040] Implement Creature::ForcedDespawn and ACTION_T_FORCE_DESPAWN for EventAI.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-06-18 19:11:57 +04:00
VladimirMangos
5350dbafd9 [8018] Implement EVENT_T_BUFFED and EVENT_T_TARGET_BUFFED for creature EventAI.
Its can be used for check specific spell auras stack size for event triggering.
2009-06-15 02:25:57 +04:00
VladimirMangos
3c9f9e3fa3 [8017] Always reset creature EventAI phase at creature death. 2009-06-15 01:33:43 +04:00
VladimirMangos
08fe4933c5 [8015] More dislpay id selection fixes...
* Allow have only A2 or H2 display ids for less strincted DB field data.
* Check model data existance for all provided display ids atserver startup.
* Avoid explicit access to creature info display fields but use display selection functions.
* Rename GetTaxiMount to more clear for returned value GetTaxiMountDisplayId.
* Check display ids in `creature_model_info` at server load.
2009-06-14 21:57:56 +04:00
NoFantasy
48fee42129 [7951] Mope call for help code to function form Event AI code to allow use it from C++ scripts also.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-06-04 05:01:12 +04:00
VladimirMangos
79dab3dae5 [7922] Implement param2 for ACTION_T_COMBAT_MOVEMENT for allow control start/stop melee combat state for creature at start/stop movement in combat.
Also small fix for avoid unexpected set pet speed to owner speed for non-player case. In player case this hack speed setting still required.
2009-05-31 04:35:38 +04:00
NoFantasy
c7c480f6ba [7914] Fixed variable name typos in creature event AI code.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-05-30 04:44:05 +04:00
tomrus88
42f8ce5f3e [7911] Applied coding style. 2009-05-29 19:07:28 +04:00
VladimirMangos
b83f32fc19 [7905] Implement ACTION_T_SET_SHEATH for creature event ai make possibility set ranged fire state.
Also related cleanup code in field cases and player Player::SetSheath.
2009-05-29 01:05:39 +04:00
Alex
bde5402b40 [7863] Implement for EVENT_T_SPAWNED map/zone/subzone only event conditions.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-05-21 05:26:38 +04:00
Neo2003
fa03b3663a Mobs fleeing and getting assistance feature implementaion.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>

Also rename ACTION_T_FLEE to ACTION_T_FLEE_FOR_ASSIST for clear use
2009-05-21 01:33:28 +04:00
VladimirMangos
f332c000d1 [7860] Implement creature event ai ACTION_T_CALL_FOR_HELP for explicit call for help in some script cases. 2009-05-20 22:15:41 +04:00
NoFantasy
83beb6ec1d [7854] Fixed typo in random text selection code.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-05-19 23:24:35 +04:00
VladimirMangos
72b4ff2fac [7852] Use union of per-event type structures, more checks at creature event ai loading.
Including:
* Fixed check for EVENT_T_SPELLHIT school field. Add check at loading. Note: this event expect before and now schol _mask_ in param2.
* In EVENT_T_RECEIVE_EMOTE use original player condition check code instead copy of related code.
2009-05-19 22:20:36 +04:00
VladimirMangos
07d00c3927 [7847] Replace paramter unions by uniton of event ai action type structures. Add/fix some loading checks.
* Also send to process function reference to strucutre instead large amount fields.
* Specially note that fixed check for first arg of action type 27 that before wrongly test as quest id,
when by using code expected creature id. Possible some used data wrongly can be quest ids....
2009-05-18 22:45:20 +04:00
evilstar
4617ac1dc1 [7845] Implement reload support for creature eventAI tables.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-05-18 12:28:45 +04:00
VladimirMangos
45b209df50 [7836] Fixes for distance range checks.
* ignore 0.0f min range limit (this correct case when 2 object overlapped)
* typo in CreatureEventAI::CanCast

Also use int32 for temporary store GetSessionDbLocaleIndex result.
2009-05-16 10:25:11 +04:00
VladimirMangos
788cdf9b3a [7826] Avoid use GetDistance* that used slow sqrt call where possible, other related speedups. 2009-05-14 18:51:13 +04:00
VladimirMangos
512c015dc2 [7731] Some code cleanups, warrning fixes. 2009-04-29 04:03:59 +04:00
VladimirMangos
73db1cbe01 [7723] New AI call EnterCombat called at enter creature to combat (and re-enter if leave by some reason). 2009-04-27 03:40:50 +04:00
VladimirMangos
f2f817883a [7722] Fixed cast allow check in EventAI. 2009-04-27 03:32:46 +04:00
VladimirMangos
9dd305b457 [7717] Use more safe code in EventAI. 2009-04-26 19:19:36 +04:00
AlexDereka
c9d51a6dc7 [7716] Fixed some typos and possible crashes. 2009-04-26 18:49:07 +04:00
NoFantasy
727f590f6e [7712] Fixed typo in EventAI for preventing aggro from civilians.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-04-25 02:24:19 +04:00
VladimirMangos
ecb5a0328a [7710] Fixed problem with stuck in combat creatures with EventAI. Remove redundent AI field. 2009-04-24 18:56:26 +04:00
NoFantasy
07310ff6c1 [7698] Remove redundent call InterruptNonMeleeSpells.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-04-22 18:10:16 +04:00
VladimirMangos
d910610600 [7697] Interrupt casting at enter to evade mode. 2009-04-22 18:05:59 +04:00
NoFantasy
ee9ea143d1 [7689] Batter EventAI loading checks and fix one from possible crash cases.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-04-19 23:51:05 +04:00
NoFantasy
f926232efb [7679] More checks for creature EventAI loading at server startup.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-04-17 15:47:51 +04:00
VladimirMangos
78dd259c38 [7672] Move ReceiveEmote from script API to AI API.
This is also fix triggering ReceiveEmote for EventAI broken at it move to mangos sources.
2009-04-15 06:08:52 +04:00
VladimirMangos
69fb9736cc [7667] Add to CreatureAI field pointing to creature itself. Use it instead diff. fields in subclases.
Also send pointer to AI constructors ans mark constructors as explicit.

This changes allow move now some generic often used AI code to CreatureAI helper functions.
2009-04-14 06:52:16 +04:00
VladimirMangos
721e005b84 [7666] For heroic mode creature use AIName from normal mode version in same way as done for ScriptName.
Also at creature templates loading check that AIName/ScriptName not set for heroic mode creature versions.
2009-04-14 02:28:45 +04:00
AlexDereka
6bb6ff0f7e [7622] Added creatureAI with related database tables.
Code and concept (also known as EventAI) by ScriptDev2.
Note: database table layout are compatible with original db-scripts.
2009-04-05 23:05:44 +04:00