Commit Graph
482 Commits
Author SHA1 Message Date
ariel- 72b14ea028 Core/Spell: implement SPELL_FAILED_AURA_BOUNCED on DR spells 2017-12-26 16:58:53 +01:00
Aokromes 19ddf3e8a5 Core/Creatures: fixed school immunity unapply when updating entry and unified code 2017-12-18 15:49:44 +01:00
Aokromes 38c6eaf2d5 Core/Creature: implement school immunity for creatures in creature_template 2017-12-17 20:47:48 +01:00
Aokromes 4b48d0dfdc Core/Misc: minor typo and codestyle fixes 2017-12-14 13:41:06 +01:00
Erik Strandberg a3b16c040b Port https://github.com/TrinityCore/TrinityCore/commit/f913f3bb8977c127d200d5d4a608ab434b21bbcd 2017-12-10 00:37:21 +00:00
Ovalord 6ecb9746b1 Core/Creature: merged creature extra flag for offhand attacks 2017-12-09 20:37:54 +01:00
Aokromes 5efa54d11c Core/Misc: Fix static analysis issues 2017-12-09 00:00:27 +01:00
Ovalord 9374b07963 Core/Creature: reworked aggro radius calculation *merged from master 2017-12-08 10:03:26 +01:00
Teppic1 0e706b28b9 Core/Creatures: Remove duplicate check for evade from Creature::CanAssistTo (#20722) 2017-10-26 14:16:47 +02:00
Aokromes 1a5c0f5c3b Core/Grids: Ported cmangos/mangos-wotlk@ea99457
(cherry picked from commit 9299e9b)
2017-06-19 20:20:26 +02:00
joschiwald 28de675dd9 Core/Misc: Added Creature::CanGiveExperience helper function
(cherry picked from commit c1cc0e9949a73e1cbb2640032d5d038cca051954)
2017-06-19 07:54:58 +02:00
Aokromes f8d9d954d1 Get zone/area IDs from vmap data in the liquid update
* Add new method Map::getFullVMapDataForPosition to get area info and liquid info in a single vmap lookup
* Use this lookup in Map:: relocation methods to update m_areaId and m_zoneId fields on WorldObject
* Adjust GetZoneId/GetAreaId on WorldObject to always return these cached fields
* Clean up liquid state handling on Unit and Player
* Hand floor's Z coord up through GetFullTerrainStatusForPosition, use it to update a new field in WorldObject, and use that to feed a new GetFloorZ call on WorldObject.
2017-06-09 13:20:37 +02:00
Aokromes 1c6021ba96 Core/AI: Factory functions cleanup
- Get rid of fugly void pointers
- Streamlined AI selection code, using Permissible as it should've been instead of harcoded checks on the selector code
- Moved IdleMovementGenerator singleton to factory code
2017-06-01 13:22:24 +02:00
Treeston 16e60ba408 Partial revert of 15a207f, which was causing issues (ref #4943 and #19768). Instead, fix the underlying issue from 15a207f one level further down - Unit::getAttackerForHelper() shouldn't return units that we aren't in combat with (victim can be such a unit for players/player pets, which can startattack from a distance without entering combat). (#19814)
Fixes the following issues:
- Player pets would aggro neutral mobs as soon as they start autocasting (Imp's Firebolt) if they're in react range (due to victim != null, autocast counts as autoattack and sets victim)
- Neutral mobs would randomly evade when aggro switched between targets.

Closes #19768, #19485 and #10921.

(from PR #19814)
2017-05-30 09:21:38 +02:00
Ryan 20726edec2 Merge branch '4.3.4' of https://gitlab.com/trinitycore/TrinityCore_434 into 4.3.4 2017-05-19 23:49:46 +01:00
Aokromes 0fbcdca05e Core/Collision: Replaced phasemask with proper phases in GameObject c…
…ollision calculation
2017-05-06 01:55:17 +02:00
ariel- 6e62130e96 Core/Spell: improved immunity logic for dispels 2017-05-04 03:26:54 +01:00
Aokromes c015a5cf10 Core/Misc: camelize GetFaction/SetFaction properly 2017-05-02 02:02:31 +02:00
Aokromes c42aea1bce Coding style 2017-05-01 14:54:49 +02:00
ccrs a17849bcfe Core/Unit: 2170541a51 followup
use true as default value since pretty much all the script calls will expect that
2017-04-28 12:57:38 +02:00
Aokromes f1aeff5390 Core/Creature: Fixed ForcedDespawn
By Malcrom
2017-04-14 17:50:14 +02:00
Aokromes adae2fec26 Ensure that all actions are compared to fixed point in time (ie. world update start) 2017-04-14 15:02:49 +02:00
ariel- 0d6c2978ae Core/Creature: fix integer overflow in Creature::Update leading to endless thrashing of characters database
Closes #19182
2017-04-14 13:45:57 +02:00
Aokromes 2f1d6d5597 Core/Scripts: Fix a logic fail that overriden the script of an entity…
… that changed entry
2017-04-01 07:11:25 +02:00
xinef1 8221acd90e Added new creature extra flag which makes npc visible only to dead units
closes #19333

* Rename 9999_99_99_99_world.sql to 2017_99_99_99_world_335.sql

- file affects creature removed in patch 4.0.3a

* Update Creature.cpp
2017-04-01 07:05:39 +02:00
ccrs 5d79ac9275 Core/Unit: cleanup UnitState enum 2017-03-26 06:15:09 +02:00
Aokromes 55914733a0 Core/Scripts: Add support for spawn specific C++ scripts
By Krudor.
2017-03-25 10:27:51 +01:00
Aokromes fd349a493c Core/Creature: Load template immunities into m_spellImmune container.
- Fixes sending SMSG_SPELL_START data
2017-03-20 17:33:51 +01:00
ariel- 553ae42111 Core/Creature: restore previous behavior of random gender on respawn
Little regression added with 253c0f3d07e05557daa3ffdd4e2a2af4256fb65e
2017-03-13 10:10:08 +01:00
ariel- d99739cd8c Core/Creature: remove some redundant code
- Display Ids are already initialized in InitEntry, no need to duplicate logic
- ModelInfo is already checked too
2017-03-13 10:09:33 +01:00
ariel- c3aaf501ab Core/Creature: don't override display id if addon tables load a morph aura
Ref #7337
2017-03-13 10:09:07 +01:00
ariel- 96816e1e76 Core/Creature: redo some logical checks in _IsTargetAcceptable
- Check against current creature victim, don't check potential victim attacking list.
- Neutral creatures with aggressive reactstate were triggered to attack from MoveInLineOfSight because of this check
- Prevents attack from a distance after right clicking an npc

Closes #19235
2017-03-13 10:04:00 +01:00
ariel- 7544544cf1 Core/Entities: spawned movementtype should override template movementtype
Core/SmartAI: pass the CreatureData pointer (if any) on updating template

Closes #19223
2017-03-03 01:30:25 +01:00
treeston 8d06064897 Core/Creature: Fix SetSpawnHealth so it cooperates with the colossal hack that is Battleground::AddCreature. *puke* 2017-03-03 01:21:26 +01:00
xinef1 62111a8c4a Core/SmartAI: Various fixes and extensions for smart scripts: (#18673)
- Possible crashes fixed
- Memory leak fixed
- Implemented checking of vehicle conditions
- Extended eventphasemask to 12 bits (sql required to change DB field type)
- SMART_EVENT_GOSSIP_HELLO - added possibility to detect for gameobject reportUse call
- Renamed action SMART_ACTION_SET_FLY to SMART_ACTION_SET_DISABLE_GRAVITY (to reflect actual functionality)
- Added targetsLimit to action SMART_ACTION_CAST and SMART_ACTION_INVOKER_CAST to limit max amount of targets (selected randomly)
- Action SMART_ACTION_TALK corrected to always work as intended
- Properly call GroupEventHappens in action SMART_ACTION_CALL_GROUPEVENTHAPPENS if invoker was charmed or owned by the player
- Properly utilize followAngle in action SMART_ACTION_FOLLOW (db orientation should be in degrees), but keep backward compatibility
- Added action SMART_ACTION_SET_CAN_FLY (119) 0/1
- Added action SMART_ACTION_REMOVE_AURAS_BY_TYPE (120) AuraType, can be used to exit vehicle for example
- Added action SMART_ACTION_SET_SIGHT_DIST (121) sightDist
- Added action SMART_ACTION_FLEE (122) fleeTime
- Added action SMART_ACTION_ADD_THREAT (123) +threat, -threat
- Added action SMART_ACTION_LOAD_EQUIPMENT (124) equipmentId
- Added action SMART_ACTION_TRIGGER_RANDOM_TIMED_EVENT (125) minId, maxId
- Added action SMART_ACTION_REMOVE_ALL_GAMEOBJECTS (126), removes all owned gameobjects
- Added action SMART_ACTION_STOP_MOTION (127), stopMoving, movementExpired
- Extended target SMART_TARGET_HOSTILE_SECOND_AGGRO with following parameters maxdist, playerOnly, powerType + 1
- Extended target SMART_TARGET_HOSTILE_LAST_AGGRO with following parameters maxdist, playerOnly, powerType + 1
- Extended target SMART_TARGET_HOSTILE_RANDOM with following parameters maxdist, playerOnly, powerType + 1
- Extended target SMART_TARGET_HOSTILE_RANDOM_NOT_TOP with following parameters maxdist, playerOnly, powerType + 1
- Extended target SMART_TARGET_THREAT_LIST with maxdist
- Extended target SMART_TARGET_OWNER_OR_SUMMONER to be able to get charmer/owner of current owner
- Added new target SMART_TARGET_FARTHEST with maxDist, playerOnly, isInLos restrictions
- Added SpellHit hook to GameObjectAI and extended SmartGameObjectAI to call SMART_EVENT_SPELLHIT when gameobject is hit by spell
- Call GameObjectAI Reset hook on gameobject respawn (for ex. to reset one time events in smart scripts)
- Fixed some logic errors in code
- SmartAI Escorts properly despawn escortee if no players are in range
- Disable Evading while charming creature with SmartAI
- Don't call SMART_EVENT_RESPAWN for dead units before they actually respawn
- Don't call SMART_EVENT_RESPAWN for not spawned gameobjects
- Properly call SMART_EVENT_RESPAWN for gameobject respawn
- Allow action SMART_ACTION_SET_IN_COMBAT_WITH_ZONE to utilize targetlist
- Allow action SMART_ACTION_CALL_FOR_HELP to utilize targetList
- Allow action SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL to utilize targetList
- Allow action SMART_ACTION_SET_VISIBILITY to utilize targetList
- Allow action SMART_ACTION_SET_ACTIVE to utilize targetList
- Allow action SMART_ACTION_ATTACK_START to select random attack target instead of first on the list
- Allow gameobjects to summon gameobjects with action SMART_ACTION_SUMMON_GO
- Properly store action invokers for action SMART_ACTION_WP_START, if no player invokers are found, distance despawn check won't be used
- Allow action SMART_ACTION_WP_RESUME to compensate for the state the unit actually is in (eg. combat)
- Allow action SMART_ACTION_MOVE_TO_POS to select random of the avaiable targets, not only the first one.
- Allow action SMART_ACTION_MOVE_TO_POS to utilize x, y, z parameters as an offset to calculated coordinates
- Action SMART_ACTION_RESPAWN_TARGET should never modify respawntime of already spawned gameobjects, use dedicated function
- Properly delete ontime events created by SMART_ACTION_CREATE_TIMED_EVENT
- If action could not be started because conditions were not satisfied, do not recalculate the waittime to action repeattime, use smaller value to recheck more frequently
- Allow target SMART_TARGET_CLOSEST_PLAYER to be used by gameobjects
- Allow target SMART_TARGET_OWNER_OR_SUMMONER to be used by gameobjects
- Fixed SMART_EVENT_COUNTER_SET to be only called for the id that was incremented
- Changed the way counters work
- Protect PhaseInc from surpassing maximum phase
- Added loading checks for missing NON_REPEATABLE flag if no repeatmin, repeatmax is set
- Added spell validation for SMART_ACTION_CROSS_CAST
2017-02-19 09:10:29 +01:00
treeston f1681c75b1 Core/Creature: Prevent boss creatures from ever respawning naturally. 2017-02-10 05:25:45 +01:00
xinef1 2c05a59815 Core/Misc: Fix various crashes, also related to multithreading (#19012)
* When iterating groups we have to either do it not in multithreaded context (map updates) or start with checking maps (they are guaranteed to change in single thread update).
* Properly clear ComboPoint references on player remove 
* remove some possible references item may have when it is deleted during save. 
* Also clear all hostile references when unit is removed from map.
2017-02-05 01:58:11 +01:00
Aokromes 8bb777ef5c Few small optimizations here and there 2017-02-01 16:51:21 +01:00
xinef1 608ef8f09c Core/Pets: Fixed bug where pets tamed from large npcs had too big combat reach (#18909) 2017-02-01 01:30:08 +01:00
xinef1 ac3a9d6112 Core/Creatures: Stop falling if corpse is removed (can happen when alive unit is despawned instantly in air) (#18995)
Do not allow to start waypoint movement when unit is dead
2017-02-01 01:29:59 +01:00
Keader cf88bcfa16 Core/Entities: Implemented CREATURE_FLAG_EXTRA_NO_MOVE_FLAGS_UPDATE (#18980) 2017-02-01 01:26:01 +01:00
ariel- 191e277741 Core/Creature: revert turning state apply
partial revert of 6b55faba065cd5d0519fb6e3e070a4a41d305cca

Simply removing the unit state in Creature::ReleaseFocus causes #18549 again
2017-01-23 00:17:08 +01:00
ariel- 04df42ba78 Core/Creature: don't allow turning if spell would cancel due to turning to face target
Closes #18549
2017-01-23 00:16:58 +01:00
Aokromes b7432bc39a Compile fix try 2017-01-18 15:09:57 +01:00
Aokromes 719a317a67 Update copyright note for 2017 2017-01-02 07:26:38 +01:00
Aokromes 949ce2d576 Core/Units: Cleanup hardcoded magic numbers for byte field offsets
(cherry picked from commit ac1dc75)
2016-12-16 19:54:22 +01:00
Aokromes b76aec422d typo fix
by ccrs
2016-12-06 11:03:34 +01:00
ccrs 1e9b740ce5 Core/Pets: Pet Attack Distance 2016-12-06 11:03:22 +01:00
treeston c91f195554 Core/Creature: Correctly reset pathfinding capability on respawn. Prevents evade chains on some bosses. Closes #18188. 2016-11-03 16:14:09 +01:00
treeston 5d0a5951a1 Entities/Creature: Fix an edge case issue where creatures would re-acquire target after respawn if they despawned while spell focusing.
Instance/AzjolNerub: Fix Anub'arak wall and add sequence break info. Fixes and closes #18013.
2016-10-24 13:54:20 +02:00