Commit graph

546 commits

Author SHA1 Message Date
VladimirMangos
cc0655a402 [10782] Use Team enum types in all appropriate cases and catches bug in result fix.
* Fixed wrong arenaid use at leave arena queue.
* Fixed memory lost and etc at not virtual EndBattleground call
* Fixed crash at arena join with fake data from client.
* Code cleanups.
2010-11-25 01:11:17 +03:00
VladimirMangos
fe5fc994a6 [10776] Not mark reputation_spillover_template empty state as error
Now expected by default data used from dbc fields.
2010-11-22 12:38:58 +03:00
VladimirMangos
c2096380cf [10752] Convert to objetguids map scripts and finally drop IS_PLAYER_GUID. 2010-11-20 02:38:56 +03:00
Ambal
f67d89f109 [10727] Map system re-engineered. Special thanks to Blueboy for tests.
Signed-off-by: Ambal <pogrebniak@gala.net>
2010-11-16 21:08:28 +02:00
VladimirMangos
4aa239ac8c [10720] Implement check gossip_menu_option.npc_option_npcflag.
For cases main menu options used by creature but impossible show in result absent
related npcflags for any creatures used that menu.
2010-11-11 18:08:53 +03:00
VladimirMangos
bfec27707a [10714] Avoid unexpected error at action_menu_id < 0 after recent loading checks adding. 2010-11-10 04:38:27 +03:00
VladimirMangos
a87648c56b [10712] Startup checks for gossip_menu and gosip_menu_option table data.
Existance `gosup_menu` id refercned from gameobject field and unused meni ids
activated only with disabled LogFilter_DbStrictedCheck.
2010-11-10 01:00:14 +03:00
VladimirMangos
534ff29f15 [10711] Check localization data for existance main table entres.
Data will skipped for nonexistent entries, and reported with
disabled LogFilter_DbStrictedCheck filter.
2010-11-09 20:26:59 +03:00
NoFantasy
7032423d6f [10704] Add the option to close gossip window in gossip system
Field action_menu_id in gossip_menu_option table can be set to -1 where close gossip is expected, instead of sending a new menu.

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-11-08 23:18:58 +01:00
blueboy
ee8cc71e38 [10692] Fixed wrongly use %d for guids in DB queries.
This can affect correct result in cases big guid values
(out of range for possitive part of int32 range) at x86 platforms.

Some other cases addded in addition to original patch fixes
where %d wrongly/unsafe used for unsigned values.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-11-07 22:10:37 +03:00
VladimirMangos
10d3d3ce24 [10692] Fixed some GCC warnings and code errors.
Thanks to freghar for provide cleaned list of warning messages.
2010-11-07 21:30:55 +03:00
VladimirMangos
2f144d9d29 [10682] New table 'item_convert' for convertion items.
* Implment vendor at show replace BoA item with reputation requirement
  by identical item without rep. reqs for player that fit this requirements
  of original item.

* Table also can be used for store item convertion data form one team items
  to similar other team items. This case not impement but added function easy
  used for it.

* Note: strict single convert for item not created problem for both way use:
  item converted for same team or all, can't be original item for conversion to
  another team.
2010-11-05 00:41:16 +03:00
VladimirMangos
0bf8b0aa79 [10679] New table npc_vendor_template for comon item data for diff vendors.
In vendor list show own vedor items + template ites if any.
Vendor template item lists selected by id stored in creature_template.vendor_id
2010-11-04 20:22:47 +03:00
VladimirMangos
97ff7e6006 [10668] Implement CONDITION_*ITEM_WITH_BANK conditions.
Similar CONDITION_*ITEM but including character bank content in counting.
2010-11-01 06:26:20 +03:00
Deleterios
549b44d8ec [10664] Rename arena_team_stats fields for better fit to stored values.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-11-01 02:37:10 +03:00
VladimirMangos
f48e768a70 [10662] Implement partly item looting
* Not deleted normal item loot at first loot window close.
* Save current item loot content to DB for later continue looting.
* Cleanup spell effect SPELL_EFFECT_OPEN_LOCK check code
* Cleanup Player::AutoStoreLoot calls
2010-11-01 02:04:08 +03:00
NoFantasy
506e93d15d [10658] Add enum as argument for quest special/flags functions
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-10-30 01:47:37 +02:00
NoFantasy
b6e367bf3c [10657] Separate quest_template.QuestFlags from SpecialFlags
Create enum for SpecialFlags (database flags and internally computed)
Added related functions for specialFlags and update code accordingly.

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-10-30 01:14:17 +02:00
NoFantasy
1210c6d978 [10656] Rename quest function HasFlag to HasQuestFlag
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-10-29 21:19:35 +02:00
NoFantasy
a38f97f71c [10655] Add support for monthly quests
Quest that can repeated each month are set by quest_template.SpecialFlags |0x04 flag
Quest are reset at midnight the first day of each month.
Note: for the time being, quest must also be set repeatable (SpecialFlags |0x01)

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-10-29 20:39:01 +02:00
VladimirMangos
b09838fe3b [10644] Remove wrong check preventing lootable itesm have at-use spell casts.
But note: like at use spells cast at loot open not implemnted yet.

Also fixed typo in ITEM_DYNFLAG_READABLE.
2010-10-26 10:43:38 +04:00
VladimirMangos
46d740bbf4 [10641] Fixed use item dynamic/item proto flags.
* List its independelty. Each from this 2 fields have own flags. Cleanup lists.
* Not copy proto flags to item flags update field. This fix heroic item versions
  show in client in result mixed use ITEM_DYNFLAG_WRAPPED (0x8) with ITEM_FLAG_HEROIC (0x8)
* Update uses to proto case use for some cases where before wrongly has been used item dyn.flags
* For ITEM_DYNFLAG_UNLOCKED (0x4) set for item at unlock and check for prevent re-unlocking.
  This mostly for future case when will be implemented partly loting items support.
* For ITEM_FLAG_LOOTABLE (0x4) check loot absent or conflicting setting with containers/casted at use items.
  Report wrong cases art loading.
* Better check related loot tables content using ITEM_FLAG_PROSPECTABLE and ITEM_FLAG_MILLABLE
2010-10-25 16:27:14 +04:00
Tasssadar
d53fe93e9d [10640] Implement instance guids with proper HIGHGUID_INSTANCE use.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-10-24 14:54:11 +04:00
NoFantasy
77b064e19a [10621] Add new field RequiredClasses for quest_template
* SkillOrClass is converted to RequiredSkill (and then field can contain skill id only)
* Field ZoneOrSort has no longer a function in quest requirement, and RequiredClasses must be used instead where class limits are expected.

To restrict a quest to one class or more, use bitmask of class in RequiredClasses. RequiredSkill works like before.

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-10-19 00:33:16 +02:00
VladimirMangos
d3c1780f55 [10617] Fixed array access in SCRIPT_COMMAND_TALK loading check. 2010-10-18 04:56:27 +04:00
zerg
2fa5fa43bd [10594] Use equal_range instead of lower_bound/upper_bound pairs
(based on zergtmn's repo commit 0499169)

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-10-09 01:37:57 +04:00
NoFantasy
0caa0e32dd [10593] Cleaning up code a bit, in related functions for recent commits
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-10-08 22:11:26 +02:00
NoFantasy
795c3e1f2f [10592] Make GO type 2 activate/deactivate
As with similar GO's that are not interactable (gameobject_template.flags|4) as default, GO's of type 2 becomes active when player can take a quest (or deliver quest).

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-10-08 20:48:51 +02:00
kamikazetg
8bb27ebd8e [10591] Simplify LoadGameObjectForQuests for case GO type 3
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-10-08 12:45:36 +02:00
NoFantasy
b0d5e3e51a [10589] Always activate GO type 3 when quest id is defined (and active)
GO may be "lootless", but events at looting can happen

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-10-08 10:21:52 +02:00
NoFantasy
fc2e66231b [10588] Make GO type 8 activate and sparkle at related quest active
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-10-08 09:40:28 +02:00
NoFantasy
657894786a [10587] Make GO type 5 sparkle at related quest active
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-10-08 09:10:38 +02:00
virusav
9f2e36c7f0 [10520] Implement CONDITION_QUEST_NONE
For case when need check that quest not taken and not completed in past.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-09-23 12:33:43 +04:00
NoFantasy
8ccf9c7464 [10508] Arrange case SCRIPT_COMMAND_ in correct order, also in ObjectMgr
Some additional code style corrections.

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-09-20 00:20:41 +02:00
NoFantasy
29a723e41e [10507] Extend SCRIPT_COMMAND_TALK with option to set language for text
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-09-19 20:50:18 +02:00
NoFantasy
a1fd19b6b3 [10506] Implement 5 new SCRIPT_COMMAND_*
All commands can only have creature as the affected by command
*_SET_ACTIVEOBJECT - switch activeObject state on/off
*_SET_FACTION - changes faction
*_MORPH_TO_ENTRY_OR_MODEL - changes model to model from creature_template entry or model id explicit
*_MOUNT_TO_ENTRY_OR_MODEL - mounts on model from creature_template entry or model id explicit
*_SET_RUN - switch walkmode on/off

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-09-19 19:27:33 +02:00
zergtmn
20f4a16f01 [10503] Move *_respawn tables to characters DB.
This allow have in `mangos` DB only world static state data.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-09-19 00:45:21 +04:00
NoFantasy
0245efecb7 [10500] Extend SCRIPT_COMMAND_TALK to support random selected text
In addition to adding fields for text id storage (in total 4 text id's), also added a comments field for developers notes in scripts (it may help those being old of age to remember what goes on in a script).

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-09-18 01:55:29 +02:00
NoFantasy
cb877e1281 [10496] Re-work struct ScriptInfo and use union for data fields.
Enumerate SCRIPT_COMMAND_* and move it away from world.h

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-09-17 23:33:22 +02:00
NoFantasy
8b10ac9474 [10487] Implement SCRIPT_COMMAND_MOVEMENT(20) to start/change movement
datalong can be 0:idle, 2:random, 3:waypoint. In case 3, creature must have a existing creature_movement_template.
Command start movement for source of script. If source is not creature but target is, it will apply to target.
Optionally creature entry can be defined (datalong2) and start movement for this if found nearby (search radius defined in datalong3).

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-09-15 11:48:51 +02:00
VladimirMangos
acd0716297 [10432] Rename ASSERT -> MANGOS_ASSERT and related fixes
ASSERT hard use in predictable way because diff. 3rd party libs code
redefine it inf different ways and hard make sure that used in end
of mangos define version. This is real detected problem make some
expected assert checks ignored and so bugs not detected as expected from code.

In addition made related changes:
* Common.h header expected to be first include in any src/game/header except most simple cases.
* Related FILE.h header expected to be first include in FILE.cpp
* Fixed some absent includes and type forwards for safe build without PCH enabled.
* Avoid using MANGOS_ASSERT in src/framework code
2010-09-02 05:13:16 +04:00
arrai
055c6b4184 [10429] some format string fixes 2010-08-31 12:51:45 +02:00
NoFantasy
d0df25fd8c [10381] Implement generic system for racial model selection
Table creature_model_info store creature entry to use model from (or explicit model). The selection is based on a base modelId and racemask.

Hacks for shapeshift models removed (data included in SQL update)
Dropped no longer needed creature_model_info.modelid_other_team, as creature_model_info can and should be used instead (sorry, this is what happen when author doesn't do full research :) )

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-08-19 16:58:53 +02:00
VladimirMangos
5fd06abf44 [10379] More wide use ObjectGuid in arena team code.
As always in this commits line fixes for uint32->uint64 guid assigns.
2010-08-19 12:22:45 +04:00
VladimirMangos
9b3d37f0cf [10378] Avoid double lookup member slot in guild operations.
Also more wide use ObjectGuid in guild code
and fixed some uint32->uint64 guid assigns.
2010-08-19 11:17:33 +04:00
NoFantasy
a15b0916b6 [10373] Drop unused team-argument in ChooseDisplayId -function
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-08-18 18:09:56 +02:00
VladimirMangos
dbe9c6f190 [10371] More wide use ObjectGuid in group code.
Also drop some unused functions.
And fix some uint32 -> uint6 guid assigns.
2010-08-18 13:43:55 +04:00
VladimirMangos
5f44c4da21 [10363] More wide use ObjectGuid in way remove MAKE_NEW_GUID uses.
Also
* Fixed some amount wrong uses low guids as full player guids.
* Add private without body ObjectGuid(uint32 const&) for catch wrong assigns low guids to ObjectGuid.
  In some cases need assign "0" guid, then use ObjectGuid() instead.
* Fixed .pdump commands work.
2010-08-17 08:22:28 +04:00
NoFantasy
c6f2f16e05 [10307] Rename two tables to prefix scripted_, making the tables have consistent names
Both tables (areatrigger / event_id) are used explicit to store ScriptName for script library use.
In addition rename to ScriptName in instance_template

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-08-01 23:10:37 +02:00
NoFantasy
2ad9cd34b2 [10299] Add new script call ProcessEventId
Let script library know when some event is about to start. Event id's may be found in several sources, such as spells, GO's and transport/taxi paths.
Database scripts may be prevented by returning true from script side whenever needed. If false, DB script will run like normal.
New database table event_id_scripts will need a ScriptName for the event id, in same way as for example areatrigger_scripts.

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-07-31 17:52:38 +02:00