Commit Graph

65 Commits

Author SHA1 Message Date
Shauren
18995661a7 Core/Scripts: Reverted part of 00f343af52, that is not a typo and fixed the hook properly 2011-03-26 09:19:54 +01:00
Machiavelli
31a2c9b82b Core: Fix crash in ~ScriptMgr
Fixes: #854
Fixes: #918
Fixes: #917
2011-03-14 09:44:02 +01:00
Machiavelli
df97ce7625 Core/Vehicles: Remove redundant Vehicle::Die. All vehicle auras are already removed on Unit::RemoveAllAurasOnDeath.
Addresses ticket:869 - please reconfirm
2011-03-06 10:31:25 +01:00
Machiavelli
e07e20ffca Core/Log: Implement log masks for debug log level, to allow selective debug output. Update your worldserver.conf. 2011-02-20 20:16:34 +01:00
leak
137b079eea Core: Generic cleanup (tab2spaces/trailing whitespace removal) 2011-01-26 01:03:35 +01:00
Machiavelli
957c69de83 Update copyright note for 2011.
Happy new year.
2011-01-01 15:01:13 +01:00
Shauren
928443d899 Core: Removed more operator workarounds for ACE_Singleton (missed previously because of inconsistent naming)
--HG--
branch : trunk
2010-12-23 23:25:44 +01:00
Spp
0c8b07d3e5 Core/ScriptMgr: Add OnBindToInstance Player hook
--HG--
branch : trunk
2010-12-23 06:06:21 +01:00
Shauren
0f3b9019a8 Core: Get rid of dirty operator workaround for ACE_Singleton class implementation
--HG--
branch : trunk
2010-12-22 21:25:23 +01:00
leak
6115b0bd5f Removing ProgressBars as they are performing badly on startup.
[**************************************************] 100%
R.I.P

--HG--
branch : trunk
2010-12-22 00:12:03 +01:00
leak
fd694cd232 Streamlining loading functions for server startup
- Added a couple of timer outputs
- Improved code consistency between loading functions
- Progess bars should look and behave similar on all OS now (sLog.outString() is not needed anymore to replace the progress bar in log files)

--HG--
branch : trunk
2010-12-19 17:06:33 +01:00
click
2642894342 Core: Add new system for parallelizing client packet processing. Handle WorldSession updates in Map::Update() where we are safe to proceed. Patch by Ambal.
(And clean up tabs and whitespace while rummaging around in there)
Closes issue 5084.

--HG--
branch : trunk
2010-12-13 22:37:56 +01:00
azazel
3cb4a52d59 Core/Misc: fix some warnings. As a result removed one redundant hook from FormulaScript.
--HG--
branch : trunk
2010-11-29 15:50:38 +06:00
Spp
d3c9478153 Core/Groups: Add kicker and kick reason to RemoveMember
--HG--
branch : trunk
2010-11-23 20:49:36 +01:00
azazel
4fb572015a Core/Scripts: pass message parameter by reference in OnChat methods to make it possible to be modified inside the script.
--HG--
branch : trunk
2010-11-17 18:14:35 +06:00
Shocker
48d90fab32 Misc: Some engrish fixes, thanks to ZxBiohazardZx, closes issue 4740
--HG--
branch : trunk
2010-11-14 23:46:34 +02:00
azazel
c0faed2251 Core/Guilds: guild code was completely refactored and rewritten.
* OOP desing and implementation;
* all the queries are moved to prepared statements;
* guild loading is optimized;
* all the possible interaction with guild's data is done inside the guild class;
* added more hooks to GuildScript class;

WARNING: Make sure you backup your characters database before applying this change (just in case).

Known problems with guilds:
* when new member is added to the guild, MOTD is not displayed for him in guild tab of social window;
* if you add item with random property to guild bank visual representation of item below it becomes wrong (it displays wrong stack number);
* packets order differs from official: currently guild bank packet traffic is twice as more than on offy.

--HG--
branch : trunk
2010-10-17 19:54:13 +06:00
click
f0c4241ea4 Remove the accidental additions of CRLF-crap from the header updates
--HG--
branch : trunk
2010-10-07 15:35:36 +02:00
click
8ea4b32fab Update copyright headers (following the same standard in all files = good)
--HG--
branch : trunk
2010-10-07 12:41:56 +02:00
QAston
caaa77deb2 Core/ScriptSystem:
Add basic code for runtime checks of function calls in AuraScripts
 Make AuraScript::PreventDefaultAction() do not take parameters and add description for the function
 Remove PreventDefaultEffect() from aura script, use PreventDefaultAction() instead
 Unload aura scripts memory on aura delete

--HG--
branch : trunk
2010-10-04 17:44:49 +02:00
Shocker
78803c9f09 Magic numbers cleanup:
- Replace many magic numbers with constants
- Use enum for vehicle flags/seat flags
- Correct structure for ItemRandomSuffixEntry

--HG--
branch : trunk
2010-09-28 08:21:51 +03:00
click
461590832a Core: Generic cleanup (tab2spaces/whitespace removal)
--HG--
branch : trunk
2010-09-25 22:03:57 +02:00
Rat
d2af10618f Core/ConditionMgr: added placeholder for CONDITION_GUID
renamed targetOverride to invoker
removed targetOverride code (had no use)

--HG--
branch : trunk
2010-09-24 18:16:29 +02:00
Spp
cc3d4cc823 Core/Scripts: Add OnPlayerLogin, OnPlayerLogout, OnPlayerCreate and OnPlayerDelete
--HG--
branch : trunk
2010-09-15 13:23:07 +02:00
Spp
e12c01950a Code style (remove double blank line)
--HG--
branch : trunk
2010-09-14 20:10:48 +02:00
Spp
80051c6d3c Core/Scripts: Add GroupScript class
--HG--
branch : trunk
2010-09-14 16:37:54 +02:00
Spp
8c74993a43 Core: Fix includes in ScriptMgr files
--HG--
branch : trunk
2010-09-14 16:37:40 +02:00
Shocker
4908187578 Core/ScriptMgr: Add hooks for duel phases: OnDuelRequest, OnDuelStart, OnDuelEnd
--HG--
branch : trunk
2010-09-13 01:42:14 +03:00
click
5f6b73fcec Core/ScriptMgr: Remove incorrect assertion in OnGameObjectDestroyed, and clean up code style (fix by Zor)
--HG--
branch : trunk
2010-09-11 16:11:07 +02:00
silinoron
0f997162ee Core/ScriptSystem: Refactor ScriptMgr::OnPlayerChat to no longer accept a C-style parameter of type void*.
Instead, use overloaded methods for the different types.

--HG--
branch : trunk
2010-09-04 12:49:39 -07:00
Shauren
0f9fe8dbeb Core/Players: Don't set instanceId to 0 when player is on transport during loading, there CAN be transports inside instances
Core/Scripts: Added waypoint id to OnRelocate transport hook
Core/Scripts: Make use of ZoneScript::GetGameObjectEntry at gameobject creation (makes it possible to override gameobject entries in instances)
Core/Transports: Call InstanceScript::EventInform for transport events
Core/Transports: Use guid from db for transports, not just its entry - adds partial support for instancing them (still cannot use transports table for it, but can spawn manually now)
Scripts/Icecrown Citadel: Fixed crash in Deathbringer Saurfang when event is started by more than one person (can't do this anymore)

Closes isssue #3749.

--HG--
branch : trunk
2010-09-02 10:40:32 +02:00
silinoron
d2c259fe76 Core/ScriptSystem: Add a PlayerScript::OnSpellCast(Player *player, Spell *spell, bool skipCheck) function.
Requested by Zor.

--HG--
branch : trunk
2010-09-03 19:58:16 -07:00
Spp
405f312918 Core: Fix more warnings
--HG--
branch : trunk
2010-08-30 15:25:15 +02:00
Liberate
f67441b863 Fixes gossip scripts or points of interests of npc's with a Scriptname assigned to them.
This fixes guards in Major cities.
Thanks to Aokromes for testing.
Thanks to click for converting all the scripts to work with this change.

--HG--
branch : trunk
2010-08-29 00:57:51 +02:00
azazel
fd5ab90170 Scripts: fix area trigger scripts. Thanks yavi. Closes issue #3634
--HG--
branch : trunk
2010-08-26 16:22:59 +06:00
QAston
07a3a1254b *Add AuraScript class for scripting aura objects - scripts are registered same way as SpellScripts, bound to SpellScriptNames table. For more details see example_spell.cpp and SpellScript.h
*Rename SpellHandlerScript to SpellScriptLoader, EffectHandlerFn to SpellEffectFn, HitHandlerFn to SpellHitFn, SpellScript::EffectHandlers to SpellScript::OnEffect, these changes were neccesary to prevent namespace collisions, happily you can solve these by simple find and replace
*Make spells 66244 and 5581 example scripts.

--HG--
branch : trunk
2010-08-24 00:10:49 +02:00
silinoron
f3b93df6b7 Clear player scripts and guild scripts on ScriptMgr deletion.
--HG--
branch : trunk
2010-08-14 12:44:54 -07:00
silinoron
791a45768f Add in a forgotten change from ra5af596979e4 .
--HG--
branch : trunk
2010-08-14 12:42:05 -07:00
silinoron
8d0a058411 Add a GuildScript class with a handful of hooks.
--HG--
branch : trunk
2010-08-14 12:17:05 -07:00
azazel
ed08bedc6e * Modify PlayerScript::OnChat hook. Now it takes one optional parameter of type void *. Value of this parameter depends on chat type.
* Modify chat and emote hook in PlayerScript to take Player parameter insted on WorldSession (this is player script, isn't it?)
* Move calls of OnChat hooks after validation of parameters and before actual call to chat methods. It's more logical because otherwise it will be necessary to repeat validation inside hooks.
* Make use of new PlayeScript hooks. Move chat logging logic into separate script.
* Add one path to scripts CMakeLists to make ChatLogScript happy.

--HG--
branch : trunk
2010-08-12 22:33:45 +06:00
silinoron
c7b48c1ca9 Add PlayerScript hooks:
* OnMoneyChanged
* OnGiveXP
* OnReputationChange
* OnChat
* OnEmote
* OnTextEmote

--HG--
branch : trunk
2010-08-11 22:53:31 -07:00
silinoron
0963cb3aea Implement a PlayerScript class with a handful of new hooks:
* OnPVPKill
* OnCreatureKill
* OnPlayerKilledByCreature
* OnPlayerLevelChanged
* OnPlayerFreeTalentPointsChanged
* OnPlayerTalentsReset
* More hooks may be added in the future

--HG--
branch : trunk
2010-08-11 19:52:58 -07:00
XTZGZoReX
cecb8117d5 Aaand, finally, scripting is working. Thanks to Derex for helping with debugging/suggestions.
--HG--
branch : trunk
2010-08-09 16:07:03 -05:00
XTZGZoReX
70fc93da7b * Get rid of virtual function calls completely, seeing as they weren't necessary. Thanks to Ge0rG and Derex for enlightening me about this.....
* Also add map ID for EoE instance script (thanks Silinoron).

--HG--
branch : trunk
2010-08-09 19:53:21 +02:00
XTZGZoReX
a038772b3e * Remove Player::SetSession (obsolete and dangerous function).
* Speed up map script searches (avoid redundant loops).
* Fix linking errors for ScriptObject::RegisterSelf.

--HG--
branch : trunk
extra : rebase_source : 2ba48fdab4e119c6de7fe64e47c5b8115fdac1b5
2010-08-09 11:07:23 +02:00
azazel
590199d8e1 * Rename InstanceData to InstanceScript
* Rename *mgr to their new names in scripts project
* Mass convert all the scripts (NEEDS THOROUGH TESTING, because it was done automatically) Please, report bugs on issue tracker.

--HG--
branch : trunk
rename : src/server/game/Instances/InstanceData.cpp => src/server/game/Instances/InstanceScript.cpp
rename : src/server/game/Instances/InstanceData.h => src/server/game/Instances/InstanceScript.h
2010-08-08 22:54:58 +06:00
XTZGZoReX
9083271a2f * Some singleton renames for consistency:
accmgr -> AccountMgr
objmgr -> ObjectMgr
auctionmgr -> sAuctionMgr
spellmgr -> sSpellMgr
CreatureEAI_Mgr -> sEventAIMgr
achievementmgr -> sAchievementMgr
gameeventmgr -> sGameEventMgr
sInstanceSaveManager -> sInstanceSaveMgr
poolhandler -> sPoolMgr

--HG--
branch : trunk
2010-08-08 05:25:45 +02:00
XTZGZoReX
909e332579 * Rename: BattleGround -> Battleground.
--HG--
branch : trunk
2010-08-08 04:37:24 +02:00
XTZGZoReX
9794e99d8a * Some fixes and cleanups.
--HG--
branch : trunk
2010-08-07 17:58:45 +02:00
Shauren
431301c1b2 Added support for scripting achievement criteria checks using ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT (11)
--HG--
branch : trunk
2010-08-07 16:48:34 +02:00