Commit Graph

59 Commits

Author SHA1 Message Date
Shauren
f2fdcdf8f3 Core/Scripts: Added enum for generic script texts, fixed one broken text
Scripts/Icecrown Citadel: Blood-Queen Lana'Thel will no longer spawn for Blood Princes intro if they were already killed

--HG--
branch : trunk
2010-11-03 16:44:34 +01:00
Rat
51f17678de Typo O.o
--HG--
branch : trunk
2010-11-02 17:47:47 +01:00
Rat
f27b6f6097 Core/SmartAI: do not report not used smart scripts as error
--HG--
branch : trunk
2010-11-02 17:29:36 +01: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
613b81f36f REALLY fix the CRLF-crap...
--HG--
branch : trunk
2010-10-07 15:54:07 +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
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
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
Spp
cdef980af4 Core: Fix some warnings
--HG--
branch : trunk
2010-09-06 15:23:08 +02:00
silinoron
2dae023649 Core/[Mail, WorldPacket]: Pull mail packet handlers out of Mail.cpp into MailHandler.cpp
Core/ScriptSystem: Remove unneeded TODO.

--HG--
branch : trunk
2010-09-04 13:46:01 -07: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
silinoron
34384a3832 Spell 62124 should allow critical hits.
Based on patch by Toni.Shocker (yes, again).
Fixes issue #3554
Also get rid of GuildScript in TODO, as it already exists.

--HG--
branch : trunk
2010-08-23 15:51:34 -07: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
Spp
572f7bbd1d Core: Remove "may be used uninitialized in this function", "unused parameter ‘xxx’" and "'xxx' defined but not used" warnings
--HG--
branch : trunk
2010-08-21 23:08:54 +02:00
Spp
c3343638cb Core: Remove lots warnings:
- All "'xxx' will be initialized after 'yyy' when initialized here"
- Some "unused variable"
- Some "enumeration value 'xxx' not handled in switch"

--HG--
branch : trunk
2010-08-21 20:08:47 +02:00
Machiavelli
96144752be Return proper default quest status from ScriptMgr::GetDialogStatus if a creature/gameobject script was present but GetDialogStatus was not overridden.
This should fix problems with creature/gameobject quest givers not giving appropriate quest (update)s

--HG--
branch : trunk
2010-08-15 14:00:51 +02:00
silinoron
8d0a058411 Add a GuildScript class with a handful of hooks.
--HG--
branch : trunk
2010-08-14 12:17:05 -07:00
Machiavelli
d201cdd72c Fix ConditionScript, AreatriggerScript and AuctionHouseScript hook functions.
--HG--
branch : trunk
2010-08-14 11:00:13 +02: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
ce29cfa7f7 Fixed linker errors caused by my foolishness.
--HG--
branch : trunk
2010-08-11 21:24:09 -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
click
1f80c7b3c0 Sourcefile sleanups -> tabs to spaces, remove whitespace - also update the cleanupscripts very slightly
--HG--
branch : trunk
2010-08-08 19:45:53 +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
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
XTZGZoReX
ed4e49a4e7 * OutdoorPvP implementations now reside in the script library.
--HG--
branch : trunk
rename : src/server/game/OutdoorPvP/Zones/OutdoorPvPEP.cpp => src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp
rename : src/server/game/OutdoorPvP/Zones/OutdoorPvPEP.h => src/server/scripts/OutdoorPvP/OutdoorPvPEP.h
rename : src/server/game/OutdoorPvP/Zones/OutdoorPvPHP.cpp => src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp
rename : src/server/game/OutdoorPvP/Zones/OutdoorPvPHP.h => src/server/scripts/OutdoorPvP/OutdoorPvPHP.h
rename : src/server/game/OutdoorPvP/Zones/OutdoorPvPNA.cpp => src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp
rename : src/server/game/OutdoorPvP/Zones/OutdoorPvPNA.h => src/server/scripts/OutdoorPvP/OutdoorPvPNA.h
rename : src/server/game/OutdoorPvP/Zones/OutdoorPvPSI.cpp => src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp
rename : src/server/game/OutdoorPvP/Zones/OutdoorPvPSI.h => src/server/scripts/OutdoorPvP/OutdoorPvPSI.h
rename : src/server/game/OutdoorPvP/Zones/OutdoorPvPTF.cpp => src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp
rename : src/server/game/OutdoorPvP/Zones/OutdoorPvPTF.h => src/server/scripts/OutdoorPvP/OutdoorPvPTF.h
rename : src/server/game/OutdoorPvP/Zones/OutdoorPvPZM.cpp => src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp
rename : src/server/game/OutdoorPvP/Zones/OutdoorPvPZM.h => src/server/scripts/OutdoorPvP/OutdoorPvPZM.h
2010-08-07 16:38:22 +02:00
XTZGZoReX
14aeb09945 * This should help with the Linux build; thanks to Machiavelli/click.
* VehicleScript is now bound to the database (`creature_template`.`ScriptName`) and only works for creature vehicles.

--HG--
branch : trunk
2010-08-07 15:26:24 +02:00
click
f296addc47 Correction on previous commit: use uint32 and not simple ints
--HG--
branch : trunk
2010-08-07 15:04:28 +02:00
click
f2ddd5d067 Force script-template to build nicely under GCC (thanks to Machiavelli and Zor)
--HG--
branch : trunk
2010-08-07 14:57:54 +02:00
XTZGZoReX
f1c571a79e * Added new World::OnStartup/OnShutdown hooks.
--HG--
branch : trunk
2010-08-07 14:30:10 +02:00
XTZGZoReX
360e028331 * Add new TransportScript::OnRelocate hook.
* TransportScript::OnUpdate is now called on every tick, not just on movement update.

--HG--
branch : trunk
2010-08-07 14:17:32 +02:00
XTZGZoReX
87483be1e7 * Rename some more functions for consistency.
* Added missing call to FormulaScript::OnZeroDifferenceCalculation.
* Pass GridMap pointer into MapScript::OnLoadGridMap/OnUnloadGridMap.
* Fire map hooks for all map types, not only instances.

--HG--
branch : trunk
2010-08-07 13:07:18 +02:00
silinoron
bef8372fe2 Rename ScriptMgr::OnRemoveAuction to ScriptMgr:OnAuctionRemove for consistency. Thanks Paradox for pointing it out.
--HG--
branch : trunk
2010-08-06 21:49:39 -07:00
XTZGZoReX
c2ca2e1c98 * Converted example scripts to the new format.
--HG--
branch : trunk
2010-08-07 00:06:55 +02:00
XTZGZoReX
0993b1fcb5 * Fixes for Linux build.
--HG--
branch : trunk
2010-08-06 23:21:58 +02:00
XTZGZoReX
731eaf72cb * Example on AI script conversion (and minor correction in CreatureScript).
--HG--
branch : trunk
2010-08-06 20:42:42 +02:00
XTZGZoReX
946adf469c *** New core <-> script library interface - complete rewrite of the old one.
* Removed the misdesigned on_events script/hooks.
* Lots of related cleanups and assertions.
* The interface is now fully object-oriented.
** Scripts no longer use function pointers.
** Scripts no longer use the general-purpose Script struct for everything.
** Script types are split into separate classes which must be inherited depending on what functionality is desired.
* Several script types have been added to allow extending functionality in a code-only manner (some script types require
  assignment in the recently added ScriptName columns in the database, though).
** SpellHandlerScript: Wrapper around spell scripts (returns new SpellScript objects (`spell_script_names`.`ScriptName`)).
** ServerScript: Allows scripting events that occur in the network layer.
** WorldScript: Allows scripting certain world-global events.
** FormulaScript: Allows hooking and interfering with core formulas.
** *MapScript: Allows hooking different map types (including world, instance, and battleground maps (`instance_template`.`ScriptName`)).
** ItemScript: Allows scripting of items (like the old interface (`item_template`.`ScriptName`)).
** CreatureScript: Allows scripting of creatures/AI (like the old interface (`creature_template`.`ScriptName`)).
** GameObjectScript: Allows scripting of gameobjects (like the old interface (`gameobject_template`.`ScriptName`)).
** AreaTriggerScript: Allows scripting triggered area triggers (like the old interface (`areatrigger_scripts`.`ScriptName`)).
** OutdoorPvPScript: Script which should return OutdoorPvP objects for use by OutdoorPvPMgr (`outdoorpvp_template`.`ScriptName`).
** CommandScript: Allows extending the in-core command table.
** WeatherScript: Allows scripting of weather changes (`game_weather`.`ScriptName`).
** AuctionHouseScript: Allows scripting of auction events.
** ConditionScript: Allows scripting of conditions (`conditions`.`ScriptName`).
** DynamicObjectScript: Allows scripting of dynamicobjects.
** TransportScript: Allows scripting of transport events (`transports`.`ScriptName`).
* OutdoorPvP objects are now created through scripts. This effectively means that they'll need to be moved to scripts
  before the they're functional again.
* The whole idea with this new interface is to allow expanding core functionality without touching core code. If further
  hooks are needed to expand functionality of the core, let us know; we'll add them, if we agree that it is appropriate
  to do so.
*** NOTE: The scripts project will _not_ build before it has been adapted to the new interface.
*** Thanks to everyone who helped out with related preparations and suggestions!

--HG--
branch : trunk
2010-08-06 19:23:43 +02:00
XTZGZoReX
a0b5921bfa * (Very) minor cleanups.
--HG--
branch : trunk
2010-08-04 00:24:04 +02:00