aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellHandler.cpp
AgeCommit message (Collapse)Author
2010-04-08Code Style (game + scripts only):Spp
"!=" --> " != " (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-04-07Code style (game + scripts only):Spp
"if(" --> "if (" --HG-- branch : trunk
2010-03-23Fix one WPE exploit.n0n4m3
When apply more 6 gems, and after player logout, server crash, also apply code style and cleanup. --HG-- branch : trunk
2010-03-11Convert some C style casts to new functionsthenecromancer
--HG-- branch : trunk
2010-03-10Totem* casts.raczman
--HG-- branch : trunk
2010-03-07Some Creature* casts moved to new ToCreature.raczman
Added const Creature* ToCreature() --HG-- branch : trunk
2010-03-07Added new type-safe cast functions.raczman
This, when properly used, should get rid of most memory corruption issues, currently, casting types C-style with no checks leads to some abstract crashing. Functionality is same as with dynamic_cast<>, but with no RTTI check - so when casting into invalid type you will receive NULL, and most probably crash. At the same time, i took the liberty to convert most Player* casts to ToPlayer(). Still needs crapload of casts being moved to new facility. --HG-- branch : trunk
2010-02-05Yet more cleanup, mostly in the script system. This should conclude the ↵Xanadu
script integration into core. --HG-- branch : trunk
2010-01-23Implement QueryResult_AutoPtr type which is ACE's reference counted ↵Anubisss
auto_ptr(ACE_Refcounted_Auto_Ptr) for QueryResult pointers. Use this auto_ptr for every DB queries(except QueryNamedResult yet). This patch guarantees NO memory leaks from QueryResult pointers. Thanks to raczman for the idea and for the helping to make this patch. --HG-- branch : trunk
2010-01-19*Integrate Script system to CoreRat
-added ScriptMgr for loading scripts -removed bindings -moved script system to src/game -moved scripts to src/scripts -VC project files updated -cmakes updated (not 100% done yet) NOTE to Devs: -file locations changed -precompiled renamed to ScriptedPch -ecsort_ai renamed to ScriptedEscortAI -follower_ai renamed to ScriptedFollowerAI -guard_ai renamed to ScriptedGuardAI -simple_ai renamed to ScriptedSimpleAI -sc_creature renamed to ScriptedCreature -sc_gossip renamed to ScriptedGossip -sc_instance renamed to ScriptedInstance *use the new headers in scripts, thank you NOTE to ALL: cmake not fully tested, please report any errors with it could make creashes, incompability USE AT YOUR OWN RISK before further tests!! --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-12-31Implemented function CheckPlayerCondition, it will be used before the player ↵_manuel_
enters in vehicles. Now vehicles Argent Warhorse and Argent Battleworg can't be used if the player dosen't have Argent Lance eqquiped. --HG-- branch : trunk
2009-12-17Update Spell code for 322a. Part 2n0n4m3
--HG-- branch : trunk
2009-10-18*Cleanupmaximius
--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-09-23*add 11 new event hooks to the OnEvents system, by Hawthornemaximius
--HG-- branch : trunk
2009-09-01*Better fix to dead player with health exploit..maximius
--HG-- branch : trunk
2009-09-01*Prevent players from casting spells while getDeathState() == DEAD (this ↵maximius
blocks an exploit where players can skip all mobs/doors/etc in an instance and ressurect themselves at boss) --HG-- branch : trunk
2009-08-29*Some improvements in Mirrors Image visual - by thenecromancer.QAston
--HG-- branch : trunk
2009-08-27*Fix a crash caused by possess pet. Thanks to nanounikomegamage
--HG-- branch : trunk
2009-08-27*A temp fix for the crash caused by creature 28782megamage
--HG-- branch : trunk
2009-08-26*Fix a crash caused by spellclick enter vehicle. Thanks to nanounikomegamage
--HG-- branch : trunk
2009-08-24[8403] Fixed cast spell opcode parsing for some cases with additional data. ↵megamage
Author: VladimirMangos --HG-- branch : trunk
2009-08-23*Update vehicle system. Make vehicle a seperate class from creature.megamage
--HG-- branch : trunk
2009-08-23*Update flame leviathan script.megamage
--HG-- branch : trunk
2009-08-20Revert part of last patch witch should be not pushed. SorryKudlaty
--HG-- branch : trunk
2009-08-20Add script for quest 12864. Script by manuelKudlaty
--HG-- branch : trunk
2009-08-19[8383] Implement WorldSession::HandleCancelChanneling. Author: VladimirMangosmegamage
--HG-- branch : trunk
2009-08-19 [8382] Implement ByteArray functions for skip read of fields not needed ↵megamage
for server in received packets. Author: VladimirMangos * Use this fucntions in some case. * Change some packets to form: read fields first check later for better control recieved packets structure. * Fix CMSG_STAND_STATE_CHANGE packet structure to more correct. --HG-- branch : trunk
2009-08-19 [8381] Some refactoring work in Unit::m_currentSpells code. Author: ↵megamage
VladimirMangos * Restrict access, use enum args, move some repeated code parts to function. * Make m_selfContainer set only part of Unit::SetCurrentCastedSpell --HG-- branch : trunk
2009-08-19 [8378] Use exceptions instead of explicit size checking for each packet ↵megamage
Author: arrai CHECK_PACKET_SIZE was pretty error prone; once it was forgotten mangosd could crash due to the asserts in ByteBuffer.h. That was exploitable by malicious players. Furthermore, there were duplicate checks: Additionally to CHECK_PACKET_SIZE, the ByteBuffer assertions keept an eye on not exceeding the packet boundaries - just to crash the server for sure in such a case. To prevent memory leaks or other undesirable states, please read in every handler all variables _before_ doing any concrete handling. --HG-- branch : trunk
2009-08-17*Add spell_bonus_data for lightwell - by ElronQAston
*Add aura_required, aura_forbidden, user_type columns to npc_spellclick_spells table for additional requirement checks *Remove workarounds from lightwell code and use new npc_spellclick_spells fields instead. --HG-- branch : trunk
2009-07-22*Implement Aura Type 247 (SPELL_AURA_CLONE_CASTER) and 279 ↵QAston
(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-11*Allow Illumination to proc on Holy Shock.Destalker
--HG-- branch : trunk
2009-07-11*Fix Desecration.QAston
*Correct a typo which made some of charged auras to be not dropped. --HG-- branch : trunk
2009-06-15 [8016] Work at npc click table data use. Author: VladimirMangosmegamage
* New fields in `npc_spellclick_spells` for allow set npc spell click mode from quest to infinity or to another quest, or from reward quest. * Not expect (and forbid set UNIT_NPC_FLAG_SPELLCLICK in DB and set it at `npc_spellclick_spells` loading. * Apply some speedups for creature checks affected by spel click state *Also add target position of 51852. By Roland --HG-- branch : trunk
2009-06-10[7983] Make static Spell::SendCastResult accessable from script DLL. Author: ↵megamage
VladimirMangos --HG-- branch : trunk
2009-06-09*Fix Heart of the PheonixQAston
*Fix autoshoot rotation with steady shot. *Make Incanter's Absorption not interrupt other casts. --HG-- branch : trunk
2009-06-08 [7980] Implement item use target requirements store and check (new table ↵megamage
`item_required_target`). Author: NoFantasy Signed-off-by: VladimirMangos <vladimir@getmangos.com> * Also implement this table reload * Static Spell::SendCastResult function for call not from spell code. Can be also used in scripts where need send explicitly spell cast error to client. --HG-- branch : trunk
2009-05-31Mangos [7911]. Author: tomrus88megamage
Very big patch. May cause bugs. --HG-- branch : trunk
2009-05-22Add a column to npc_spellclick_spells table to check if quest is ↵Kudlaty
completed/rewarded or incompleted 1: completed or rewarded; 3: incompleted; default 3 --HG-- branch : trunk
2009-05-18*Fix a bug that player cannot remove buff which is not casted by self.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-04-30*Merge.megamage
--HG-- branch : trunk
2009-04-30*Do not allow client to interrupt instant spells. By thenecromancermegamage
--HG-- branch : trunk