Commit Graph

334 Commits

Author SHA1 Message Date
click
697685c3f5 Add support for vendors selling the same items with different extendedCost - original code by Vladimir (thanks mate)
Closes issue #1756

--HG--
branch : trunk
2010-04-30 22:35:37 +02:00
Trazom62
eccf5bf547 Refactor Creature::SelectNearestTarget(float dist)
This function is used in many scripts to find the nearest enemy within the given distance.
However, it had an implicit limit to the ATTACK_DISTANCE. so in many case the "dist" was in fact just ignored.
In other case, the ATTACK_DISTANCE is required. So 2 functions are necessary to avoid ambiguities.

The refactoring is the split of the function in 2: SelectNearestTarget and SelectNearestTargetInAttackDistance.

--HG--
branch : trunk
2010-04-25 12:59:27 +02:00
Rat
b7a44ae2ba *fix visibility for trigger creatures
NOTE: if you see any trigger (in player mode) with a visible model (DB bug), please report creature entry + modelid in bugtracker

--HG--
branch : trunk
2010-04-21 13:55:43 +02:00
Spp
74dd02d024 Remove LOTS of compile warnings
--HG--
branch : trunk
2010-04-19 09:26:37 +02:00
Rat
4a8bf5900d *modified spelldifficulty handler to work with all spell casts for creatures that are in instances thanks to Shauren for help
*modified most of the scripts to use normal_mode spell for casting (code was autogenerated, post errors if any)
*added sql for all modded spells (autogenerated..)

--HG--
branch : trunk
2010-04-10 10:20:01 +02:00
Rat
cbbe587817 *added code for loading Spelldifficulty.dbc + Custom Spelldifficulty from Database
*added spell searcher based on creature's map difficulty, usage is optional and only for scipts for now
*added new table spelldifficulty_dbc

--HG--
branch : trunk
2010-04-09 10:47:11 +02:00
Spp
4635fbc020 Code Style (game + scripts only):
"!=" --> " != " (when needed)
"  !=" --> " !="
"!=  " --> "!= "

--HG--
branch : trunk
2010-04-08 08:20:08 +02:00
Spp
2454c290b8 Code Style (game + scripts only):
"==" --> " == " (when needed)

--HG--
branch : trunk
2010-04-07 23:25:02 +02:00
Spp
49d05ba9aa Code style (game + scripts only):
"( " --> "("
" )" --> ")"

--HG--
branch : trunk
2010-04-07 22:59:46 +02:00
Spp
d19e127080 Code style (game + scripts only):
"if(" --> "if ("

--HG--
branch : trunk
2010-04-07 19:14:10 +02:00
_manuel_
fae77f2621 Add additional field for storage of speed_run rate of creature
This allow independent rate of walk vs run speed. Existing field renamed to explicit speed_walk.

Note that default database rate for run is a result of the most common value seen, 8.0/7.0

Author: NoFantasy.

--HG--
branch : trunk
2010-03-21 14:57:49 -03:00
Trazom62
6fdaf225f3 Fix creature tapped and lootable dynamic flags => fix creature not lootable.
Fixes issue #1067.

--HG--
branch : trunk
2010-03-14 00:22:53 +01:00
Trazom62
ed8c5ef6ff Implement group loot for chest having GroupLootRules (go type=3, data15=1).
Implement round robin loot.
Implement round robin for underthreshold items (group loot and need befor greed).
Fix "all players pass" bug on creature.
Add SMSG_LOOT_LIST message to indicate looter (round robin or master).
And some other minor loot bugs.

Fixes issue #167.
Fixes issue #247.

--HG--
branch : trunk
2010-03-11 22:55:02 +01:00
silver1ce
9a8f10fa30 avoid send movement packet at death twice, cleanup
--HG--
branch : trunk
2010-03-07 18:17:37 +02:00
thenecromancer
7e99e2f9cc Send movement packet on creature/player death (expected for animation display, don't ask me why)
Don't bother in case of flying creatures, as there's already something sent

--HG--
branch : trunk
2010-03-06 13:14:51 +01:00
silver1ce
f748ea34e3 changes in creature base stats storage
* speedup stats searching
  * no more default stat generation for each class-level pair, there is only one default stat
  * CreatureBaseStats does not contain level and class

--HG--
branch : trunk
2010-03-03 04:32:47 +02:00
silver1ce
9e63454b63 store unit's level in uint8 format
TODO: may be change db format too

--HG--
branch : trunk
2010-03-03 02:48:31 +02:00
Trazom62
4c16bff8e6 Fix mana set to 0 when mob dies. Thanks Malcrom.
--HG--
branch : trunk
2010-02-28 21:34:31 +01:00
Trazom62
3ffeb5f5dd Fix initialization of UnitMovementFlag from InhabitType.
--HG--
branch : trunk
2010-02-28 20:30:20 +01:00
silver1ce
fcaa318fb3 Update visibility system
*visibility updates and ai relocations processed simultaneously for each grid
  *these operations now are not synchronized for different grids
  *some changes into structure of visibility notifiers

--HG--
branch : trunk
2010-02-27 15:25:14 +02:00
Brian
8ba75526b5 * Properly fix bogus pet trainers error message
--HG--
branch : trunk
2010-02-17 02:17:17 -07:00
Brian
d2acbbd616 * Added chack for TRAINER_TYPE_PETS, to prevent bogus error that was generated
* since pet trainers no longer train spells.

--HG--
branch : trunk
2010-02-17 02:08:11 -07:00
Brian
486c00891b * Core switch to client 3.3.2 (11403)
* Credits (in no particular order) to:
* n0n4m3, raczman, manuel, Spp, Malcrom, Teacher, QAston, Tartalo,
* thenecromancer, Xanadu, Trazom, Zor, kiper
* Additional credits to:
* TOM_RUS and NoFantasy from MaNGOS
* Thanks for testing Aokromes and XTElite1
* SoTA still needs some work, but is very playable (huge thanks to raczman and
* kiper)
* To upgrade, you need to apply all SQL from sql/updates/3.2.2a_old from the
* last rev you are on
* and then apply all SQL from sql/updates/3.3.2_old to char / realmd / world
* DBs
* Known problem with guild banks.

--HG--
branch : trunk
2010-02-14 19:13:14 -07:00
silver1ce
a307ba784c *Move object's field\visibility update functions to object from accessor
removed useless SendUpdateObjectToAllExcept - anyway fields will be updated, there is no sense to force update them

--HG--
branch : trunk
2010-02-03 16:53:40 +02:00
Brian
cfa8ff7bd6 * Set the default spawntimesecs for creatures / gameobjects added in game to 5 minutes
* Was 25 seconds
* Thanks Paradox

--HG--
branch : trunk
2010-01-30 08:05:08 -07:00
XTZGZoReX
9f00ca3eb8 * Remove CellLock class and all cell-level thread locking.
** It was wasting CPU power as cell-level locking is not needed.
** Our multithreading is on map-level, not cell-level.
** CellLock was just a 'proxy' between Cell and CellPair and in some cases carried redundant data.
** Some minor cleanup in Cell::Visit/Map::Visit.

--HG--
branch : trunk
2010-01-23 22:24:41 +01:00
Brian
7162dcd475 * Backed out changeset c7c6faf26cbd
* A different solution to damage will be implemented
* You will need data from your DB provider if you don't have a backup

--HG--
branch : trunk
2010-01-21 18:38:49 -07:00
win32
2572e9ef8e * Add support for basedmg and baserangeddmg values in creature_classlevelstats.
* Remove mindmg, maxdmg, attackpower and ranged field in creature_template and add Dmg_Mod, Rangeddmg_Mod field.

--HG--
branch : trunk
2010-01-21 13:48:27 +02:00
thenecromancer
fbe09a92f9 Allow spells with effect mechanic to allow apply other effects when effect with mechanic would be fail due to effect/state immunity.
--HG--
branch : trunk
2010-01-20 21:10:18 +01:00
n0n4m3
99f66a6bc9 Updated copyright for new year.
--HG--
branch : trunk
2010-01-16 20:19:18 +03:00
n0n4m3
720318e856 Implement option to use delay in ForcedDespawn for creature, allow use delayed forced despawn also in EAI, by NoFantasy.
--HG--
branch : trunk
2010-01-16 19:51:59 +03:00
n0n4m3
c9a3698a11 Implement speed reduction at creatures DoFleeToGetAssistance, by NoFantasy.
--HG--
branch : trunk
2010-01-16 19:35:30 +03:00
thenecromancer
8dd67e8bb3 Allow state/effect immunities ignore whole spell when one effect is immuned
(Fixes getting part of CC auras with some immunities)

--HG--
branch : trunk
2010-01-13 10:20:00 +01:00
XTZGZoReX
a66152215e * Add support for base armor values in creature_classlevelstats.
* Change the table structure to be more core-friendly.
* Remove armor field in creature_template and add Armor_mod field.
* Also add static CreatureBaseStats::GetBaseStats() function for scripts.

--HG--
branch : trunk
2010-01-10 22:02:03 +01:00
QAston
8e9d2cdf01 Update aura system:
* Change system logic - unify Auras, AreaAuras and PersistentAreaAuras:
  * Aura has now its owner - which is the WorldObject, which applies aura (creates AuraApplication object) dependant on aura radius, and effect type
  * Owner can be Dynobj (DynObjAura class) for PersistentAreaAuras, or Unit (UnitAura class) for Area and nonArea auras
  * Aura data is shared for all units which have AuraApplication of the Aura
   * Because of that AuraEffect handlers , and periodic tick functions can't modify AuraEffect object (they are const now)
  * Remove spell source and AreaAuraEffect classes
  * Add AuraEffect::UpdatePeriodic function, to allow periodic aura object modification (target independant)
  * Add AuraEffect::CalculateAmount and AuraEffect::CalculateSpellMod function, to allow non-default amount calculation
  * AreaAura updates are done in owner _UpdateSpells cycle
  * Since now you don't need to wait an aura update cycle to get area aura applied on it's correct target list
  * And you can access area aura target list
  * Add basic support for aura amount recalculation
  * Save recalculation state and base amount of auras to db
  * Add AuraEffect::CalculatePeriodic function to determine if aura is periodic, and to set correct tick number after aura is loaded from db
  * Add ChangeAmount function in addition to SetAmount function, to allow easy reapplication of AuraEffect handlers on all targets
  * Sort aura effect handlers in SpellAuras.cpp and .h by their use
  * Add check for already existing aura of that type to some AuraEffect handlers, to prevent incorrect effect removal
  * SPELL_AURA_CONVERT_RUNE and MOD_POWER_REGEN and MOD_REGEN hacky handlers are now implemented correctly
  * Send aura application client update only once per unit update - prevent unnecesary packet spam
 * Fix ByteBuffer::appendPackGUID function - it added additionall 0s at the end of the packet
 * Fix memory leak at player creation (not deleted auras)
 * Updated some naming conventions (too many to mention)
 * Added Unit::GetAuraOfRankedSpell() function
 * Remove procflags on aura remove, use Aura::HandleAuraSpecificMods instead
 * Added functions to maintain owned auras (GetOwnedAuras, GetOwnedAura, RemoveOwnedAura, etc)
 * Implement AURA_INTERRUPT_FLAG_LANDING
 * Implement EffectPlayerNotification (thanks to Spp)
 * Remove wrong aura 304 handler
 * Add better handler for death runes
 * Remove unnecesary variables from DynamicObject class, and cleanup related code, link dynobj duration with aura
 * Add GetAuraEffectTriggerTarget function in CreatureAi for special target selection for periodic trigger auras used in a script
 * Add many assert() procection from idiots using some functions in wrong way
 * I am to lazy to write here anything more
Thanks to Visagalis for testing this patch
PS: Do not make patches like this, please

--HG--
branch : trunk
2010-01-10 01:23:15 +01:00
Brian
fd26ad5611 * Hopefully fix creature so they swim if InhabitType|2
--HG--
branch : trunk
2010-01-07 22:49:06 -07:00
silver1ce
f82d5cb3fc fixed the bug that GetVmapHeight returns incorrect height on terrains(flying units fall below map etc)
also unlocked max ray lenght for getHeight, by default it's 10 yards

--HG--
branch : trunk
2010-01-06 12:15:02 +02:00
_manuel_
0e18bc37c2 Removed moveflags column from creature_addon and creature_template_addon. Thanks to Zor and raczman.
--HG--
branch : trunk
2010-01-02 19:52:08 -03:00
_manuel_
57206499fb The core should add the movementflags depending on the InhabitType.
--HG--
branch : trunk
2010-01-02 13:15:29 -03:00
n0n4m3
250a00cc1c Temporary revert 6743 commit. I fix this patch across 1-2 days.
--HG--
branch : trunk
2009-12-24 10:20:15 +01:00
n0n4m3
3fe0bc5254 Replaced time(NULL) on sGameTime.GetGameTime() this is used for better performance.
Original Timer.h divided into 2 parts. Shared project has no need to know about GameTime Singleton.
2 Identical structures with different types are now replaced with one generic templated structure and 2 typedefs.

--HG--
branch : trunk
2009-12-23 08:04:10 +01:00
Brian
36d30faabf * Add support for RewSpellCast=-1. If -1 remove all auras applied to player at
* quest start.
* Patch by Kudlaty -- THANK YOU!

--HG--
branch : trunk
2009-12-21 14:48:30 -07:00
Brian
5300226fee * Added support for using a lookup table for creature mana / health
* As long as creature level, class, and the proper expansion they are from are
* set in creature_template, you will have 100% accurate health and mana.
* Research and base stats table done by Malcrom -- THANK YOU!
* Original patch by Kudlaty -- THANK YOU!
* Updated and enhanced by Machiavelli - THANK YOU!
* Optimizations by w12x, MrSmite, and XTZGZoReX -- THANK YOU!
* Final code updating for current rev by XTZGZoReX -- THANK YOU!

--HG--
branch : trunk
2009-12-20 20:23:18 -07:00
Rat
6fe36efe0f *apply trinity style to whole source
*comment out all mangos to trinity defines
*this will make merging a little harder, but code will be more clear

--HG--
branch : trunk
2009-12-20 15:20:04 +01:00
win32
7c9f6b4bc3 Merge MaNGOS, Gossip System. Autor NoFantasy.
* DB support required
* Closes #859

--HG--
branch : trunk
2009-12-20 13:35:08 +02:00
n0n4m3
12dd4b709c Set creatures PvP state flag based on creature faction and renamerelated enum. by NoFantasy
--HG--
branch : trunk
2009-12-19 19:10:14 +01:00
n0n4m3
2925dfcfc4 Add own function to send AI_Reaction packet. by NoFantasy
--HG--
branch : trunk
2009-12-19 17:43:47 +01:00
n0n4m3
7971bda0ea Now TrinityCore2 support 3.2.2a client, need extract new maps and dbc files. thx TOM_RUS, Win32, Machiavelli, VladimirMangos and all trinitycore team
--HG--
branch : trunk
2009-12-18 08:01:29 +01:00
n0n4m3
304f59f2bb [8667] Correctly respawn pooled object in case the same object is selected for respawn
[8701] Fixes and inprovements in pool system. thx Frankir

--HG--
branch : trunk
2009-12-18 06:54:49 +01:00
n0n4m3
40255a660b Some fixes for GameObject, Chat, Creature, update DuelHandler for 322a
--HG--
branch : trunk
2009-12-17 11:06:50 +01:00