Commit graph

427 commits

Author SHA1 Message Date
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
NoFantasy
7bdf05901d [10296] Move ChooseDisplayId to Creature class for access from script side
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-07-30 21:08:58 +02:00
NoFantasy
25d9fd265b [10293] Correct a not exitan...non-existin... a word that is often spelled wrong
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-07-30 18:26:08 +02:00
NoFantasy
ccd8f4f825 [10290] Simplify startup check for creature models
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-07-30 17:32:45 +02:00
NoFantasy
2ae0badf48 [10289] Adjust creature models system
This change will:
* make it easier to use cached data directly without any modifications
* correct issues regarding invisible models
* simplify certain aspects of model selection itself and make it somehow easier to control and maintain special cases.

Two new fields added to creature_model_info, to store modelid_alternative and modelid_other_team
* _alternative holds an alt. model, for cases where gender are the same, or is not male/female.
* _other_team is generally used for totem models, but may have future use.

This commit will possibly break a few things (visually) and will require DB projects to update their creature_template models data.
It is advised to use cache data as-is, and in addition fill creature_model_info for certain models, totems in particular, for expected appearance.

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-07-30 16:40:17 +02:00
VladimirMangos
c6b52bf285 Clarify related table in error message for unknown mangos string entries 2010-07-29 16:08:35 +04:00
Toinan67
6302659d58 [10281] Send proper account amount in guild in SMSG_GUILD_INFO packet.
Data seen for example in client command /guildinfo output.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-07-28 23:34:50 +04:00
NoFantasy
fb1e8c01ef [10270] Implement basic system for reputation spillover
* Database table needs data for each faction that should give spillover to other faction(s). One faction may give spillover to max 4 other spillover factions.
* The spillover rate is multiplied with the points after bonuses and reward rate is set, Rate is given as: 0.5 for 50% gain, -1.0 for 100% loss, etc
* It is possible to restrict spillover faction by rank. If player has a higher rank with the spillover faction given in database, no spillover will be given towards this faction

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-07-25 17:05:34 +02:00
Patman64
647acd8caa [10269] Fixed typo in CONDITION_QUESTAVAILABLE fail case.
Not affect mostly code work, because used only for not existed quest data,
that checked at loading. So only possible at reload quest templates with
drop related quest.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-07-25 11:21:57 +04:00
VladimirMangos
d9a7a2ba12 [10266] Implement CONDITION_ACHIEVEMENT and CONDITION_ACHIEVEMENT_REALM 2010-07-25 00:02:25 +04:00
VladimirMangos
e3befa2072 [10254] Remove dependence auction data from auctioneer guid.
* Field `auctioneerguid` replaced by `houseid` and table reanmed to `auction`
  (it list auctions and `id` is auction id).
* Update related code.

* SQL update fill `houseid` field by old `auctioneerguid`
  BUT: SQL update expect that you world DB named `mangos`.
  If this not true for your case you need modify SQL update BEFORE APPLY
  in 2 placed in part "mangos.creature AS c, mangos.creature_template AS ct"

* Another small possitive result: now possible easy select auctions related
  to some auction store (1-3 is one team actions, 4-6 another team auction,
  and 7 is neutral auction store for both teams
2010-07-24 01:45:59 +04:00
NoFantasy
61990de6dd [10252] Implement reputation_reward_rate for quests and creatures
* In addition, implement "flat" reputation for quests, where a value in RewRepValueN is given. Human diplomacy will not affect the total. The rate however will be applied, where a faction is defined with a rate for quests. Value in database are expected to be *100 of the actual value given (before rate are applied).
* New database storage can contain rates for quest/creature/spell reputation and will affect the base value given as reward. When for example the quest reward for a faction should receive 30% more reputation points, the rate can be set to 1.3.
* This will fix issues with certain quests that are using the expected RewRepValueId but where the outcome has been lower than expected.
* Note that if the rate is set to 0.0 it will disable reputation gain for the faction and type.
* Reputation rate for spells (spell effect) is not yet implemented

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-07-23 17:50:36 +02:00
VladimirMangos
20a5551739 [10207] Implement ITEM_FLAGS2_EXT_COST_REQUIRES_GOLD use instead sign of ExtendedCost field. 2010-07-17 19:23:38 +04:00
VladimirMangos
9882bc811f [10206] Implement ITEM_FLAGS2_HORDE_ONLY and ITEM_FLAGS2_ALLIANCE_ONLY
* Check item_template data
* Check at equip/use
* Skip at loot if not compatible
* Skip in vendor list if not compatible
2010-07-17 08:21:23 +04:00
VladimirMangos
f8efc2b5b3 [10197] Add to playercreateinfo original player orientation field.
It still not filled. Patch with correct values welcomed ;)
2010-07-15 22:25:27 +04:00
Laise
a32b3063a2 [10156] Add shared object for auras of same spell and move spell proc code to its own file, also spread procs by auras and effect indexes. 2010-07-07 19:08:26 +03:00
crackm
52e4c0ab17 [10146] Implement SCRIPT_COMMAND_PLAY_MOVIE (19)
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-07-03 23:58:41 +04:00
VladimirMangos
d81c9175d8 Update build checks for mangosd/realmd. 2010-07-02 05:34:27 +04:00
VladimirMangos
fdcbd7d5f5 [10120] Check expected creature_model_info data for player races 2010-06-29 12:06:02 +04:00
VladimirMangos
cd0bbabf9a [10118] Check gameobject scale at loading (strict DB error filter)
This let avoid check scale value at it
2010-06-29 11:02:37 +04:00