Commit Graph

30 Commits

Author SHA1 Message Date
Trazom62
eccf5bf547 Refactor Creature::SelectNearestTarget(float dist)
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-25 12:59:27 +02:00
Spp
74dd02d024 Remove LOTS of compile warnings
--HG--
branch : trunk
2010-04-19 09:26:37 +02:00
Spp
65c3e979e2 Tab to Spaces and remove of trailing spaces
--HG--
branch : trunk
2010-04-11 20:20:38 +02:00
Trazom62
9d3c7c4ab0 Fix Crash in FoS.
Fixes issue #1566.

+ add support of minimum distance criteria in SelectTarget.

--HG--
branch : trunk
2010-04-10 13:52:33 +02:00
Rat
4a8bf5900d *modified spelldifficulty handler to work with all spell casts for creatures that are in instances thanks to Shauren for help
*modified most of the scripts to use normal_mode spell for casting (code was autogenerated, post errors if any)
*added sql for all modded spells (autogenerated..)

--HG--
branch : trunk
2010-04-10 10:20:01 +02:00
Rat
cbbe587817 *added code for loading Spelldifficulty.dbc + Custom Spelldifficulty from Database
*added spell searcher based on creature's map difficulty, usage is optional and only for scipts for now
*added new table spelldifficulty_dbc

--HG--
branch : trunk
2010-04-09 10:47:11 +02:00
Spp
d19e127080 Code style (game + scripts only):
"if(" --> "if ("

--HG--
branch : trunk
2010-04-07 19:14:10 +02:00
Spp
8034a6c48e Rename 'Hostil' to 'Hostile'
Credits to NoFantasy (Mangos)
Closes issue #411

--HG--
branch : trunk
2010-03-09 11:11:10 +01:00
raczman
07f3b91426 Some Creature* casts moved to new ToCreature.
Added const Creature* ToCreature()

--HG--
branch : trunk
2010-03-07 18:30:53 +01:00
Trazom62
d9056adc8a refactor UnitAI::SelectTarget to allow having a predicate function (1st step).
--HG--
branch : trunk
2010-02-27 16:29:58 +01:00
Trazom62
4732618c22 Fix crash in SelectTargetList
Fixes issue #578.

--HG--
branch : trunk
2010-01-30 22:42:04 +01:00
Trazom62
3c9c950c5f Fix UnitAI::SelectTarget: avoid erasing player from the threadlist.
--HG--
branch : trunk
2010-01-29 19:46:30 +01:00
n0n4m3
99f66a6bc9 Updated copyright for new year.
--HG--
branch : trunk
2010-01-16 20:19:18 +03:00
QAston
8e9d2cdf01 Update aura system:
* 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
2010-01-10 01:23:15 +01:00
Kudlaty
3b4159e1e3 Apply #212
New functions: void DoAddAuraToAllHostilePlayers & void DoCastToAllHostilePlayers
patch by Maanuel

--HG--
branch : trunk
2009-11-13 16:34:04 +01:00
maximius
3f338cc1c3 *Massive cleanup redux.
--HG--
branch : trunk
2009-10-17 16:20:24 -07:00
maximius
e585187b24 *Backed out changeset 3be01fb200a5
--HG--
branch : trunk
2009-10-17 15:51:44 -07:00
maximius
26b5e033ff *Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and some other cleanups by hand)
*Fix a possible crash in Spell::DoAllEffectOnTarget

--HG--
branch : trunk
2009-10-17 15:35:07 -07:00
maximius
771341992f *Ahn'Khalet: Partial Herald Volazj script, by Tartalo
*Check for null pointers in SelectTargetHelper, thanks to Spp
*Remove rank aura from last battle (possibly there due to crash), by Spp

--HG--
branch : trunk
2009-09-20 19:07:53 -07:00
megamage
2a4c9bcaf9 *Make position as a class;
--HG--
branch : trunk
2009-08-29 14:58:45 -05:00
megamage
b35fe879ad *Some update of spell target selection.
--HG--
branch : trunk
2009-08-23 00:46:21 -05:00
megamage
189d9fdd51 *Some cleanup of Kalecgos script.
--HG--
branch : trunk
2009-08-21 23:38:04 -05:00
megamage
6701d3d24f *Script for quest "An End To All Things..."
--HG--
branch : trunk
2009-08-17 22:34:18 -05:00
QAston
50c73d433c *Add SpellCasterAI as a framework for casting only units (like ebon gargoyle or mirror image.
--HG--
branch : trunk
2009-08-06 23:10:36 +02:00
QAston
2ff21d4cef *Implement Aura Type 247 (SPELL_AURA_CLONE_CASTER) and 279 (SPELL_AURA_INITIALIZE_IMAGES)
*Handle CMSG_GET_MIRRORIMAGE_DATA opcode.
*Save Minions follow angle to allow themmoving in a formation
*Improvements in SpellAI: correctly evade and select attack target for creatures without threat list
*Use SpellAI instead of PetAI for not controllable guardians
*Only guardians with SUMMON_TYPE_PET are controllable now
*Add script and template data for Mirror Image.
*Thanks to Drahy for help.

--HG--
branch : trunk
2009-07-22 17:10:30 +02:00
megamage
6473e94358 *Update Naxx scripts. Now only Kelthuzad is incompleted
--HG--
branch : trunk
2009-05-20 11:44:38 -05:00
megamage
2024577488 *Try to fix build in Linux.
--HG--
branch : trunk
2009-05-12 00:52:16 -05:00
megamage
91558b8b29 *Try to fix build in Linux.
--HG--
branch : trunk
2009-05-11 13:15:16 -05:00
megamage
82f886e3c1 *Update AI scripts. Use better default AI.
--HG--
branch : trunk
2009-05-10 22:48:22 -05:00
megamage
dcf41256dd *Move some AI functions to core. No real change.
--HG--
branch : trunk
2009-05-10 16:07:49 -05:00