aboutsummaryrefslogtreecommitdiff
path: root/src/game/CreatureAI.h
AgeCommit message (Collapse)Author
2010-04-25Refactor Creature::SelectNearestTarget(float dist)Trazom62
This function is used in many scripts to find the nearest enemy within the given distance. However, it had an implicit limit to the ATTACK_DISTANCE. so in many case the "dist" was in fact just ignored. In other case, the ATTACK_DISTANCE is required. So 2 functions are necessary to avoid ambiguities. The refactoring is the split of the function in 2: SelectNearestTarget and SelectNearestTargetInAttackDistance. --HG-- branch : trunk
2010-04-19Remove LOTS of compile warningsSpp
--HG-- branch : trunk
2010-04-14*code cleanupRat
*totally destroyed m_creature, use "me" for future coding --HG-- branch : trunk
2010-04-07Code Style (game + scripts only):Spp
">=" --> " >= " (when needed) " >=" --> " >=" ">= " --> ">= " "<=" --> " <= " (when needed) " <=" --> " <=" "<= " --> "<= " " ==" --> " ==" "== " --> "== " --HG-- branch : trunk
2010-04-07Code Style (game + scripts only):Spp
"==" --> " == " (when needed) --HG-- branch : trunk
2010-04-07Code style (game + scripts only):Spp
"( " --> "(" " )" --> ")" --HG-- branch : trunk
2010-03-06prevent stack overflow caused by MoveInLineOfSight callssilver1ce
should close #995 issue --HG-- branch : trunk
2010-02-05A great purge of obsolete macros.Xanadu
--HG-- branch : trunk
2010-01-16Updated copyright for new year.n0n4m3
--HG-- branch : trunk
2010-01-10Update aura system:QAston
* Change system logic - unify Auras, AreaAuras and PersistentAreaAuras: * Aura has now its owner - which is the WorldObject, which applies aura (creates AuraApplication object) dependant on aura radius, and effect type * Owner can be Dynobj (DynObjAura class) for PersistentAreaAuras, or Unit (UnitAura class) for Area and nonArea auras * Aura data is shared for all units which have AuraApplication of the Aura * Because of that AuraEffect handlers , and periodic tick functions can't modify AuraEffect object (they are const now) * Remove spell source and AreaAuraEffect classes * Add AuraEffect::UpdatePeriodic function, to allow periodic aura object modification (target independant) * Add AuraEffect::CalculateAmount and AuraEffect::CalculateSpellMod function, to allow non-default amount calculation * AreaAura updates are done in owner _UpdateSpells cycle * Since now you don't need to wait an aura update cycle to get area aura applied on it's correct target list * And you can access area aura target list * Add basic support for aura amount recalculation * Save recalculation state and base amount of auras to db * Add AuraEffect::CalculatePeriodic function to determine if aura is periodic, and to set correct tick number after aura is loaded from db * Add ChangeAmount function in addition to SetAmount function, to allow easy reapplication of AuraEffect handlers on all targets * Sort aura effect handlers in SpellAuras.cpp and .h by their use * Add check for already existing aura of that type to some AuraEffect handlers, to prevent incorrect effect removal * SPELL_AURA_CONVERT_RUNE and MOD_POWER_REGEN and MOD_REGEN hacky handlers are now implemented correctly * Send aura application client update only once per unit update - prevent unnecesary packet spam * Fix ByteBuffer::appendPackGUID function - it added additionall 0s at the end of the packet * Fix memory leak at player creation (not deleted auras) * Updated some naming conventions (too many to mention) * Added Unit::GetAuraOfRankedSpell() function * Remove procflags on aura remove, use Aura::HandleAuraSpecificMods instead * Added functions to maintain owned auras (GetOwnedAuras, GetOwnedAura, RemoveOwnedAura, etc) * Implement AURA_INTERRUPT_FLAG_LANDING * Implement EffectPlayerNotification (thanks to Spp) * Remove wrong aura 304 handler * Add better handler for death runes * Remove unnecesary variables from DynamicObject class, and cleanup related code, link dynobj duration with aura * Add GetAuraEffectTriggerTarget function in CreatureAi for special target selection for periodic trigger auras used in a script * Add many assert() procection from idiots using some functions in wrong way * I am to lazy to write here anything more Thanks to Visagalis for testing this patch PS: Do not make patches like this, please --HG-- branch : trunk
2009-10-30*Add virtual bool IsEscorted() to escort_ai.hmaximius
*Some minor cleanup and optimization --HG-- branch : trunk
2009-10-17*Massive cleanup redux.maximius
--HG-- branch : trunk
2009-10-17*Backed out changeset 3be01fb200a5maximius
--HG-- branch : trunk
2009-10-17*Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and ↵maximius
some other cleanups by hand) *Fix a possible crash in Spell::DoAllEffectOnTarget --HG-- branch : trunk
2009-10-09*Blackfathom Deeps - Event: Aku'mai, by Tartalomaximius
*Split Personality Achivement, by Destalker *Halls of Lightning Fixes, by Destalker Volkhan fixes + Achievement Ionar Fix - without this he resets each time he is invisible, spamming sparks Arcing Burn - should be a debuff (and stackable, stackable part NYI :/) *Naxxramas - Thaddius - the aura shall affect only the character without the proper aura, by Trazom *Naxxramas - Kelthuzad - some timer adjustments (may need verification or tweaking) by Cass *Merges by Stryker, thanks to all authors and testers. [8458] Re-implement SPELL_AURA_MOD_TARGET_ARMOR_PCT in more porper way for weapon dependent cases. Author: VladimirMangos [8459] Avoid mutiply apply weapon dependent armor penetration bonus for each weapon. Author: VladimirMangos [8529] check rune cost only if spell has PowerType == POWER_RUNE. Patch provided by yavi. Author: Ambal [8532] Fixed situation where some items like 42947 were not giving spell power bonus. By: Ambal [8533] Not remove timed quest and correctly fail when time runs out. Add function to remove timed quest instead of direct access to set. Author: NoFantasy [8536] Fixed spell 62776. By: Ambal [8539] Check pet aura range at area aura update. By: Ambal [8546] Implement battleground bonusweekends call to arms. Also fix typo in auctionmgr. Author: balrok [8547] Implemented scriptcall: CorpseRemoved(uint32 & /*respawnDelay*/) it will be called when the corpse of the scripted creature get's removed, it's possible to adjust the next respawn inside the script. Author: balrok [8561] Replace another auras code call by explicit code [8566] avoid singleton-lock when accessing BattleGroundMGR::isBGWeekend() Proposed by vladimir. Comitter: balrok --HG-- branch : trunk
2009-09-17*Better fix to the waypoint mobs returning to spawn issue, thanks XTElite1maximius
--HG-- branch : trunk
2009-09-17*Backed out changeset f2d288ace33dmaximius
--HG-- branch : trunk
2009-09-14*Waypoint creature fix by DearScorpion - "example: the portal dragon in ↵maximius
Duskwood will basically return to it's spawnpoint and start over without this patch, with it however it will more or less kill you on the spot and continue its waypoint path where it left off" --HG-- branch : trunk
2009-08-29*Make position as a class;megamage
--HG-- branch : trunk
2009-08-28*Update flame levi script. Allow player to shoot down pyrite container and ↵megamage
refill the demolishers. *Other script-related fixes. --HG-- branch : trunk
2009-08-27*Remove function passengerleftmegamage
--HG-- branch : trunk
2009-08-22*Use ai function issummonedby to handle creature trigger spells.megamage
--HG-- branch : trunk
2009-08-15*Add some vehicle ai functions.megamage
--HG-- branch : trunk
2009-07-14*Fix the bug that escorted creatures return to their spawnpoint after ↵QAston
engaging combat. --HG-- branch : trunk
2009-06-05*Still use the old updatevictim functions for most scripts because some old ↵megamage
scripts may cause crash using new function. --HG-- branch : trunk
2009-05-21*Check reactstate in UpdateVictim.megamage
--HG-- branch : trunk
2009-05-20*Update Naxx scripts. Now only Kelthuzad is incompletedmegamage
--HG-- branch : trunk
2009-05-16*Update gluth script.megamage
--HG-- branch : trunk
2009-05-16*Update some instance script functions.megamage
--HG-- branch : trunk
2009-05-13*Update some script functions.megamage
--HG-- branch : trunk
2009-05-11*Try to fix build in Linux.megamage
--HG-- branch : trunk
2009-05-11*Update creature AI functions.megamage
--HG-- branch : trunk
2009-05-10*Fix build.megamage
--HG-- branch : trunk
2009-05-10*Move some AI functions to core. No real change.megamage
--HG-- branch : trunk
2009-05-10*Rename some script functions (no real change).megamage
--HG-- branch : trunk
2009-05-05 [7776] Completed implementation of CMSG_SPELLCLICK Author: arraimegamage
For vehicles, you have to add the correct SPELL_AURA_CONTROL_VEHICLE spells to npc_spellclick_spells, otherwise you won't be able to use them --HG-- branch : trunk
2009-05-03*Add ai function spellclickmegamage
--HG-- branch : trunk
2009-04-29*Update some naxx boss scripts.megamage
--HG-- branch : trunk
2009-04-27[7723] New AI call EnterCombat called at enter creature to combat (and ↵megamage
re-enter if leave by some reason). Author: VladimirMangos --HG-- branch : trunk
2009-04-22*Add a new class for event based scripts. Two examples are given.megamage
--HG-- branch : trunk
2009-04-19Merge SD2 up to r967Machiavelli
--HG-- branch : trunk
2009-04-15 [7672] Move ReceiveEmote from script API to AI API. Author: VladimirMangosmegamage
This is also fix triggering ReceiveEmote for EventAI broken at it move to core. --HG-- branch : trunk
2009-04-15*Merge.megamage
--HG-- branch : trunk
2009-04-15*Fix broken creature ai in 2697.megamage
--HG-- branch : trunk
2009-04-14 [7668] Cleanup In CreatureAI function descriptions and ↵megamage
AttackStart/AttackedBy use. Author: VladimirMangos * Use AI::AttackStart calls only in case explicit request creature attack from core or AI code "attack it if can". Like taunt, pet handler attack command. * Use AI::AttackedBy for reaction at hostile action "do something at hostile action" Like non-dot damage, swing, negative spell landing, or fade fear/etc. And provided by default call AttackStart if no current target. This fix some problems, like: * Civilian will react propertly at attack by another creature (not pet or player). * Will not cases (at least triggred by core) when attack target start run to attacker before any real hostile action apply. *Note: AttackBy is still disabled until proved useful to TC. --HG-- branch : trunk
2009-04-14 [7667] Add to CreatureAI field pointing to creature itself. Use it ↵megamage
instead diff. fields in subclases. Author: VladimirMangos 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. --HG-- branch : trunk
2009-04-13*Call new function InitializeAI() instead of Reset() to do one-time work.megamage
--HG-- branch : trunk
2009-04-07[7622] Added creatureAI with related database tables. Author: AlexDerekamegamage
*Note: three tables are renamed. --HG-- branch : trunk
2009-03-31*Merge.megamage
--HG-- branch : trunk
2009-03-31*Do not call reset in construct funciton of script.megamage
*Add function doaction to safely pass parameters between scripts. --HG-- branch : trunk