Commit Graph

98 Commits

Author SHA1 Message Date
Spp
4635fbc020 Code Style (game + scripts only):
"!=" --> " != " (when needed)
"  !=" --> " !="
"!=  " --> "!= "

--HG--
branch : trunk
2010-04-08 08:20:08 +02:00
Spp
2454c290b8 Code Style (game + scripts only):
"==" --> " == " (when needed)

--HG--
branch : trunk
2010-04-07 23:25:02 +02:00
Spp
49d05ba9aa Code style (game + scripts only):
"( " --> "("
" )" --> ")"

--HG--
branch : trunk
2010-04-07 22:59:46 +02:00
Spp
d19e127080 Code style (game + scripts only):
"if(" --> "if ("

--HG--
branch : trunk
2010-04-07 19:14:10 +02:00
n0n4m3
5fe2454b24 Fix one WPE exploit.
When apply more 6 gems, and after  player logout, server crash, also apply code style and cleanup.

--HG--
branch : trunk
2010-03-23 14:38:31 -05:00
thenecromancer
e1542df90c Convert some C style casts to new functions
--HG--
branch : trunk
2010-03-11 20:51:31 +01:00
raczman
7fd1789109 Totem* casts.
--HG--
branch : trunk
2010-03-10 07:58:11 +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
raczman
91b8ee104e Added new type-safe cast functions.
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-03-07 15:20:19 +01:00
Xanadu
f8d1920fa5 Yet more cleanup, mostly in the script system. This should conclude the script integration into core.
--HG--
branch : trunk
2010-02-05 13:01:32 +01:00
Anubisss
d9cb070215 Implement QueryResult_AutoPtr type which is ACE's reference counted 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-23 14:45:58 +01:00
Rat
0cc053ea4d *Integrate Script system to Core
-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-19 11:36:05 +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
_manuel_
ebe7b29987 Implemented function CheckPlayerCondition, it will be used before the player 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-31 17:59:56 -03:00
n0n4m3
772cf54fb5 Update Spell code for 322a. Part 2
--HG--
branch : trunk
2009-12-17 12:23:01 +01:00
maximius
d22768a6b5 *Cleanup
--HG--
branch : trunk
2009-10-18 18:38:46 -07: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
906b00465a *add 11 new event hooks to the OnEvents system, by Hawthorne
--HG--
branch : trunk
2009-09-23 20:19:21 -07:00
maximius
9710187b1a *Better fix to dead player with health exploit..
--HG--
branch : trunk
2009-09-01 10:31:35 -07:00
maximius
55981782f0 *Prevent players from casting spells while getDeathState() == DEAD (this blocks an exploit where players can skip all mobs/doors/etc in an instance and ressurect themselves at boss)
--HG--
branch : trunk
2009-09-01 07:06:42 -07:00
QAston
dc5c054ab9 *Some improvements in Mirrors Image visual - by thenecromancer.
--HG--
branch : trunk
2009-08-29 02:28:02 +02:00
megamage
56bdb0fc6b *Fix a crash caused by possess pet. Thanks to nanouniko
--HG--
branch : trunk
2009-08-27 11:32:46 -05:00
megamage
71860b5024 *A temp fix for the crash caused by creature 28782
--HG--
branch : trunk
2009-08-27 11:08:55 -05:00
megamage
7cb2864d82 *Fix a crash caused by spellclick enter vehicle. Thanks to nanouniko
--HG--
branch : trunk
2009-08-26 23:40:28 -05:00
megamage
785577e170 [8403] Fixed cast spell opcode parsing for some cases with additional data. Author: VladimirMangos
--HG--
branch : trunk
2009-08-24 19:33:34 -05:00
megamage
1ee90e1022 *Update vehicle system. Make vehicle a seperate class from creature.
--HG--
branch : trunk
2009-08-23 22:09:43 -05:00
megamage
dee4a9fd87 *Update flame leviathan script.
--HG--
branch : trunk
2009-08-23 01:08:09 -05:00
Kudlaty
007d3215d4 Revert part of last patch witch should be not pushed. Sorry
--HG--
branch : trunk
2009-08-20 20:16:49 +02:00
Kudlaty
7ccc15ec48 Add script for quest 12864. Script by manuel
--HG--
branch : trunk
2009-08-20 20:09:13 +02:00
megamage
051b383254 [8383] Implement WorldSession::HandleCancelChanneling. Author: VladimirMangos
--HG--
branch : trunk
2009-08-19 16:55:35 -05:00
megamage
edc05f2c19 [8382] Implement ByteArray functions for skip read of fields not needed 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 16:54:52 -05:00
megamage
012d6fa865 [8381] Some refactoring work in Unit::m_currentSpells code. Author: 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 16:52:51 -05:00
megamage
e954904e6d [8378] Use exceptions instead of explicit size checking for each packet 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-19 16:26:22 -05:00
QAston
41c12d173b *Add spell_bonus_data for lightwell - by Elron
*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-08-17 02:53:39 +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
Destalker
ff7a90db5f *Allow Illumination to proc on Holy Shock.
--HG--
branch : trunk
2009-07-11 21:32:41 +02:00
QAston
4dc5242a69 *Fix Desecration.
*Correct a typo which made some of charged auras to be not dropped.

--HG--
branch : trunk
2009-07-11 13:03:06 +02:00
megamage
00f4a31b73 [8016] Work at npc click table data use. Author: VladimirMangos
* 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-15 23:07:43 -05:00
megamage
375641398a [7983] Make static Spell::SendCastResult accessable from script DLL. Author: VladimirMangos
--HG--
branch : trunk
2009-06-10 14:37:30 -05:00
QAston
507b9fb051 *Fix Heart of the Pheonix
*Fix autoshoot rotation with steady shot.
*Make Incanter's Absorption not interrupt other casts.

--HG--
branch : trunk
2009-06-09 19:33:38 +02:00
megamage
4e130dcdfd [7980] Implement item use target requirements store and check (new table 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-06-08 17:25:02 -05:00
megamage
5ed5513ca8 Mangos [7911]. Author: tomrus88
Very big patch. May cause bugs.

--HG--
branch : trunk
2009-05-31 15:56:51 -05:00
Kudlaty
3bd9858417 Add a column to npc_spellclick_spells table to check if quest is completed/rewarded or incompleted
1: completed or rewarded; 3: incompleted; default 3

--HG--
branch : trunk
2009-05-22 17:43:14 +02:00
megamage
833ceee7c5 *Fix a bug that player cannot remove buff which is not casted by self.
--HG--
branch : trunk
2009-05-18 23:07:36 -05:00
megamage
e69d2cbed9 [7776] Completed implementation of CMSG_SPELLCLICK Author: arrai
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-05 16:56:15 -05:00
megamage
48dab8af91 *Merge.
--HG--
branch : trunk
2009-04-30 16:31:05 -05:00
megamage
a9f6f4481d *Do not allow client to interrupt instant spells. By thenecromancer
--HG--
branch : trunk
2009-04-30 09:59:16 -05:00