Commit graph

590 commits

Author SHA1 Message Date
Schmoozerd
e32b9953a1 Cleanup Operator padding 2012-07-20 17:38:23 +02:00
Lillecarl
9141299127 [12063] Fix Typo in SpellTemplate storage checks 2012-07-19 23:04:33 +02:00
Schmoozerd
94795f2bff Various Cleanups (game N-O) 2012-07-19 21:51:08 +02:00
Xfurry
2a4b8f2cb0 [12061] Assert correct loading of GO_TYPE_CAPTURE_POINT
This will assert controlled behaviour when loading a `gameobject_template` entry of type Capture Point with bad data
Patch improved by stfx

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
2012-07-19 21:37:31 +02:00
Schmoozerd
f24fa870c5 [12057] Add some static wrappers for Lookup access to SQLStorages 2012-07-19 01:14:02 +02:00
Schmoozerd
1c7e46a4a8 [12055] Add some defines for hard-coded field-indexes that need special convertion on SQL-Storage loading - Idea by Vladimir 2012-07-18 13:50:54 +02:00
stfx
754634fe42 [12054] Add grayard linking/ unlinking support 2012-07-18 01:32:23 +02:00
codels
a3faf136bc [12044] Add CONDITION_NOT (-3) to conditions system
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
2012-07-15 16:56:16 +02:00
NeatElves
ffd060d400 [12007] Add new CONDITION_REPUTATION_RANK_MAX (30)
Rename old CONDITION_REPUTATION_RANK to CONDITION_REPUTATION_RANK_MIN

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
2012-06-13 22:35:01 +02:00
Kid10
acc27152eb [12000] Implement server side spells
Add exemplarily support for spells 21387(used with Ragnaros) and 62388(related to Demonic Circle)
Further table columns can be added as required.

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
2012-06-12 23:16:56 +02:00
virusav
ab9b37bf3b [11982] Fix DB_STRICTED_CHECK output for gossip
This fixes to integrity check to report unused gossip_menu entries. Before only menus used by creatures with gossip_menu_items were reported

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
2012-05-04 16:42:16 +02:00
stfx
f3f3349661 [11973] Various Cleanups
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
2012-04-22 19:48:05 +02:00
Schmoozerd
7fd1f64319 [11971] Add wrapper HasAttribute to check if a spell has an attribute
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
2012-04-21 02:02:34 +02:00
Schmoozerd
8c29893310 [11964] Implement new conditions system
Tree-like design idea by Faramir118, thanks for that!

* Add `conditions` table to store conditions.
* REPLACE current handling of conditions for the *_loot_template tables
  Convert the old conditions in *_loot_template to the new system by SQL-Queries
* ADD support for new conditions to gossip_menu and gossip_menu_option.
  If for these tables no condition_id (new system) is provided, the old conditions will still be used
* Add a small helper python script to contrib/convertConditions, see README there for details
* Add new command to reload the `conditions` table (.reload conditions)
* Add two Meta-Condition types CONDITION_AND (-1) and CONDITION_OR (-2) which are used as:
  value1 (as condition_entry) AND / OR value2 (as condition_entry)

  With these meta-conditions it is possible to create tree like and very complicated combined conditions (like HasAura && (HasItem || HasQuest))

NOTE about conversion:
For easier convertion all the old table data is still preserved, but will be removed eventually (within a circle of the moon approximately)
The python script will not create an optimal initial fill of the `conditions` table. You might want to tweak it manually or suggest some optimized algorithm :)

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
2012-04-15 23:06:00 +02:00
Schmoozerd
8e0edc0383 [11940] Rewrite and cleanup DB Script Engine
* Moved actual script processing code to ScriptMgr
* Unifed and improved log output. Now table-name is passed to each script execution
* Added the "buddy concept" to all commands (except the outdated direct field change commands):
Now all commands support to search a creature (or go for some commands) in a radius, with which to do some stuff.
See doc/script_commands.txt for more details and information

Attention DB Devs:
Current DB-Scripts are converted automatically as far as possible, but some old target selecting mechanics were not reasonable to do automated.
For such cases the command is marked with data_flags & 0x10 (==16), which will throw DB-Errors to track them down faster

Thanks to NeatElves and especially Grz3s for testing!

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
2012-04-06 22:04:30 +02:00
zergtmn
c6a751134c [11928] Some warning fixes 2012-02-16 20:32:17 +06:00
Schmoozerd
6aab5c1022 [11892] Really fix [11890]. This basicly reverts commit 11890
Remove the actually not required faction check in Player::GetNPCIfCanInteractWith - this is done by IsHostileTo a line before
Improve the Player-login AtWar selection to also consider forced reactions

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
2012-01-31 00:16:21 +01:00
Schmoozerd
3e552fc739 [11890] Fix Player::GetNPCIfCanInteractWith to consider forced reactions
This will fix ie quest 9410 A Spirit Guide

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
2012-01-27 00:20:14 +01:00
virusav
16b244373a [11877] Remove check for quest_template if QuestSort and SkillId match
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
2012-01-16 18:27:01 +01:00
Schmoozerd
8068dcf6dd [11875] Update Copyright notice to year 2012
Start timemachine and a Happy new year to all!
2012-01-16 17:43:59 +01:00
Klark20
a8e3c9ac4d [11873] Enable gossip_menu_option scripts for all gossip options
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
2011-12-22 12:12:09 +01:00
Vinolentus
ad5755f8ef [11863] Fix possible SQL injection for .tele add command. Close pull request #22
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
2011-12-12 21:41:16 +01:00
Schmoozerd
adfa88d236 [11857] Fix sent level in trainer spell list - this fixes problems especially with druid trainers
* This allows to really  overwrite required level for spells
* Adds proper checks when buying
* Fixes default level requirement

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
2011-12-05 22:58:24 +01:00
Schmoozerd
4c82458874 [11852] Add support for db scripts assigned to gossip menus 2011-11-30 20:30:52 +01:00
Schmoozerd
e19943b907 [11849] Implement Condition CONDITION_SKILL_BELOW to be able to check if a player has a skill lower than a given value
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
2011-11-27 19:12:30 +01:00
stfx
09e331767d [11833] remove trailing whitespaces
Signed-off-by: SilverIce <slifeleaf@gmail.com>
2011-10-18 15:17:54 +03:00
PSZ
1606bb2e45 [11822] Add more functionality to CONDITION_QUESTTAKEN
Add options 1/ 2 in second argument to check if a quest is INCOMPLETE/ COMPLETE, default will behave like currently

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
2011-10-14 18:05:30 +02:00
SilverIce
4ad879a3da [11821] ger rid of useless now SplineType, SplineMode etc enums 2011-10-14 15:24:43 +03:00
Schmoozerd
241445aeeb [11808] Fix an old bug related to GO spawnmask check
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
2011-09-26 01:37:13 +02:00
SilverIce
3567e69a3d [11807] Add gameobject_addon table
table holds additional per-guid gameobject data.
currently it contains path rotation info that required for some elevators and transports
2011-09-26 02:34:29 +03:00
SilverIce
7a67f27ab3 [11806] A bit gameobject code refactoring 2011-09-26 00:12:12 +03:00
Shauren
8e4c46ff2a [11785] Implement dungeon encounters (DBC part), thanks to rsa for porting it to mangos
Signed-off-by: Laise <fenrisse@gmail.com>
2011-09-04 13:15:22 +03:00
VladimirMangos
3e0cacbdaf [11743] Fixed auction crash in case missing localization for only some items
Source crash in missing locale strings array size check before access
to it in locale structure.

Also move repeating code for access to wide used localization string arrays to ObjectMgr functions.
2011-07-19 02:34:16 +04:00
VladimirMangos
8e48e44c22 [11730] Move empty guid check into GetPlayerAccountIdByGUID code.
This cleanup small code and let catch some missing check cases
when 0 guid attempt searched by real DB query.

This also make function call more safe if it used with non-player guid by
some reason.
2011-07-10 05:57:37 +04:00
VladimirMangos
cc11366d6b [11702] Alsways attempt generate randomProperty for item in at create if value not pre-selected.
This resolve all existed cases when we miss assign random property id.

Also move random property/suffix check from item creating to server load time.
2011-06-30 19:19:02 +04:00
VladimirMangos
04a469f393 [11670] Implement in proper way ITEM_SPELLTRIGGER_ON_STORE (5)
Item spells with this trigger mode expected casted at item add
to inventory/equip slots (exclude bank), and spell auras (if any)
applied while item in like slots. Item expected destroyed at aura
remove by some reason.

Implementation note: because 2 step way item moves from slot to slot
related auras not removed at internal RemoveItem call and removed only
at directly item destroy/remove from player function calles, or at StoreItem
(if item added to not appropriate slot). So need in future careful with new
RemoveItem call cases.
2011-06-24 22:55:58 +04:00
cmaranec
2d7768a5ab [11646] Implement support item converting at expire
Example: items 44623->44625->44627 convertion chain

* New table `item_enchantment_template` store original->final item pairs
  Original item must have duration setup.
* Small change in GetItemConvert for consistence (now 0 returned if no convert pair instead original entry id)

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2011-06-18 21:15:20 +04:00
VladimirMangos
02cbb905fa [11591] Apply spellLevel as reqlevel for non-prof. training spell only. 2011-06-03 12:28:01 +04:00
VladimirMangos
c870ef324d [11590] Cleanups for barGoLink
* Rename barGoLink -> BarGoLink as expected by mangos code style
* Add uint32/uint6 constructor versions for BarGoLink,
  and remove lot casts required before for BarGoLink use
2011-06-03 12:02:49 +04:00
VladimirMangos
108a167c46 [11587] Use SkillRaceClassInfo.dbc data for check spell training.
* Show race/class specific min level in trainer list (for weapon master for example)
  and use it for check spell traing possibility.
* Hide for specific race/class some spells marked by flag  ABILITY_SKILL_NONTRAINABLE
  This possible in cases when spell available for race/class but learned from talent/etc
  and then don't must be show for race/calss pair in trainer list. Single case in 3.3.5a.
* Add to code tables for profession ranks for seelct correct rank related reqlevel
  and check DB side data for it. Note: DB reqlevel values redundant for profession rank
  spells now.
* Use for reqlevel selection (if DB value not provided) learned spell insteed cast-spell
  spellLevel field. This let in more cases select training reqlevel without provided DB value.
  For LogFilter_DbStrictedCheck = 0 mode output data about like redundant reqlevel values
  in traner tables.
2011-06-02 09:55:25 +04:00
zergtmn
5cae1c2211 [11539] Implement group guids with HIGHGUID_GROUP 2011-05-25 19:55:35 +06:00
SilverIce
7d889c0821 [11527] Check rotation0 and rotation1 fields at gameobject data loading 2011-05-24 02:27:45 +03:00
VladimirMangos
719e298795 [11470] Final cleanup uint64 guid cases
Also drop logout player update fields cleanup that in any cases not saved.
2011-05-11 21:36:27 +04:00
zergtmn
6498941ead [11430] Introduce GuildMgr
Move all guild-related functions from our overpowered ObjectMgr to GuildMgr.
Thx leak for idea.
2011-05-06 19:27:36 +06:00
zergtmn
2835aa5f20 [11385] Add support for static vehicle spawns
Signed-off-by: zergtmn <zerg@myisp.com>
2011-04-20 23:23:47 +06:00
DasBlub
7b2308e483 [11372] Convert tabs to 4 spaces
Thanks to Darkknight900 for pointing out!

Used this script on sql/ and src/: find . -iname *.h -o -iname *.cpp -o -iname *.inc -o -iname *.sql | xargs sed -i 's/\t/    /g'
2011-04-17 01:34:51 +02:00
NoFantasy
187a1916e3 [11371] Drop not needed MAX_CONDITION define
Signed-off-by: NoFantasy <nofantasy@nf.no>
2011-04-16 23:41:23 +02:00
NoFantasy
b39877f24a [11370] Implement CONDITION_LEARNABLE_ABILITY, check by spell and optionally item
The primary use are intended for items that teach spell, typically for primary/secondary tradeskills.

Condition is true when player does not know the spell already, has the needed corresponding skill (and skill level) and does not have the item already (when item is defined).

Signed-off-by: NoFantasy <nofantasy@nf.no>
2011-04-16 23:26:15 +02:00
VladimirMangos
6c8efb4458 [11343] Check creature*_addon.auras duplicates at loading.
This already checked at apply to creature but startup check more helpful for DB devs.
Also remove use single field structure use for store addon.auras data
2011-04-13 15:27:14 +04:00
zergtmn
0ceb42ff9a [11315] Fix typos in recent commit 2011-04-05 12:42:43 +06:00