Patch taken from insider's repo.
Also rename DoSummon function to DoSummonPet function.
Signed-off-by: stfx <stfx@hotmail.de>
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
* Allow SCRIPT_COMMAND_KILL_CREDIT to give the kill of an involved npc.
This is marked by datalong (creature-entry) == 0
* Remove immediate execution of commands. This will prevent infinite loops when db-scripts trigger db-scripts which are executed immediately
* Add check for SCRIPT_COMMAND_PLAY_SOUND
* Add check to catch an invalid command
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
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>
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>
This flag is intended to make the process of removing the automatismn gossip.click -> quest-credit easier.
This flag will be removed when the converting is complete
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
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>
* Remove excluding normal repeatable quests not first cases for money/xp
rewards. This is not confirmed functionality and possible related wrong
repeating flag set for "first" repeating quest versions. Whern exist
normal quest and second repeating quest with same details.
* At max level positive RewOrReqMoney already included in RewMoneyMaxLevel
and then not need rewarded\
* When RewOrReqMoney > RewMoneyMaxLevel then RewMoneyMaxLevel values
ignored and always used RewOrReqMoney as money reward.
Thanks to Lynx3d for original problem research.
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.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
Also
* Prevent more one charge use for same spell cast
* Cleanup enum SpellState from unused cases
* Propertly remove spellmod charges at spell finish in case pet/totem caster
Spline movement controls movements of server-side controlled units (monster movement, taxi movement, etc).
Proper implementation of effects such as charge, jump, cyclic movement will rely on it.
However, need improve our states system before.
Technical changes:
1. Added linear, catmullrom and bezier3 splines which based on client's algorthims. They can be reused for proper transport position interpolation.
2. Precission increased. There are no more position desync issues since client's position calculation formulas used.
3. Now possible to move by paths with multiple points, send whole path to client.
As part changes move to int32 list as expected by values:
* CONFIG_INT32_QUEST_HIGH_LEVEL_HIDE_DIFF
* CONFIG_INT32_QUEST_LOW_LEVEL_HIDE_DIFF
Please report if mangosd will report unexpected error (< 0) for some signed config option.
I check manually but maybe miss some...
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
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.
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>