Commit Graph

418 Commits

Author SHA1 Message Date
ariel-
2335b9de1a Core/AI: segregate GameObject ReportUse from normal Use (lock open/normal click)
Closes #19819
2017-06-06 17:57:04 -03:00
ForesterDev
abea8bf4cb Core/Defines: define faction templates and replace magic numbers from scripts 2017-05-23 12:30:27 +02:00
ariel-
f913f3bb89 Core/Scripts: unified scripted gossip/quest api
- Changed self-accessor on GameObjectAI to "me", like UnitAI
- Moved all related functions to AI, now Unit and GameObject have the same function names with identical behaviour
- Remove "OnUpdate" from CreatureScript/GameObjectScript, was never used and we already have AI Update method
- Quest methods no longer return a bool, the return value was used to call the AI version if the ScriptMgr one returned false
- Implemented GameObjectAI::Destroyed hook (was never called), implemented Damaged method
- Rename OnStateChanged to OnLootStateChanged to reflect when it's really called, and created a new hook OnStateChanged that only gets called on GOState change
- Since the functions are now only getting called from AI, made GetAI methods full virtual. (CanSpawn method is anyways going to be used on creatures with AI)
2017-05-01 18:19:36 -03:00
ariel-
4c4dca6d69 Core/Misc: camelize GetFaction/SetFaction properly 2017-04-28 18:37:38 -03:00
ccrs
229444b74a Core/Misc: cleanup SetInFront uses
Set in front modifies only the serverside orientation, use with care.
Also check for current focus to prevent things like incorrect damage on casting creatures (ie dragon breath direction change in your face because of some taunt missclick)
2017-04-27 15:34:01 +02:00
Chaouki Dhib
a1f2f30c14 Core/Spells: fix wrong distance calculations in AoE spells [Needs testing] (#16290)
Core/Spells: Fix wrong distance calculations in AoE spells.
Pull request #16290 by chaodhib.
God bless, finally.
2017-03-23 00:43:04 +01:00
ariel-
804257b99a Core/Scripts: converted Argent Tournament pennants to AI
Closes #14616
2017-03-07 13:33:19 -03:00
Shauren
a1b622e9cc Core/Unit: reduce differences between branches
Very partial cherry pick of:

Core/Units: Updated melee/spell hit chance calculation
(cherry picked from commit 61c7161a10)
2017-03-06 21:37:46 -03:00
xinef1
7567cafec8 Ensure that all actions are compared to fixed point in time (ie. world update start) (#18910)
- Actions will not be dependent on processing moment
- Increased GameObjects cooldown resolution to milliseconds, fixes arming time of traps to be exactly one second and not something from range (1000, 1999)
- Created GameTime namespace and UpdateTime class and moved there some code out of world
2017-03-01 22:19:25 -03:00
jackpoz
6940071994 Core/Misc: Fix static analysis issues 2017-02-25 15:54:11 +01:00
ariel-
eac9c1f0b9 Core/Scripts: fix Nightfall proc chance and reduce it for victims with level above 60
Closes #15734
2017-02-21 22:38:30 -03:00
Kittnz
495339a2c7 Script/GO: Alliance Bell, Horde Bell and Karazhan Bell will now send a bell sound on the start of each hour. (#19145)
* Script/GO: Alliance Bell, Horde Bell and Karazhan Bell will now send a bell sound on the start of each hour.

How many times it rings depence on the hour.

* fix little things from pr comments

* Added OnGameEvent

* Fix braces

* almost finished

* fix enum

* Add gameobjects to the game event

Fix override for InitializeAI

* enum squash

* remove braces

* Rename 9999_99_99_99_world.sql to 2017_02_19_01_world.sql
2017-02-19 20:47:40 +01:00
xinef1
b0ae5fadd1 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-17 21:33:18 +01:00
tkrokli
6a51a88767 Update Copyright notice for 2017
Happy new year!
2017-01-02 19:52:45 +01:00
sirikfoll
75df296bb6 Scripts/Events Implement Pilgrim's Bounty Bountiful Table 2016-12-19 12:30:43 -02:00
Gustavo
7e0a616657 Core/Misc Remove WhiteSpaces (#18379) 2016-12-02 02:23:02 +01:00
ccrs
4bc60e650d Scripts/BlackTemple: minor cleanup and corrections after recent PRs
plus a ninja tabs to spaces cleanup
2016-11-30 14:05:07 +01:00
Kittnz
e0c2482fa1 Core/Event: Change Midsummer Music container to vector 2016-10-14 18:37:49 +02:00
Kittnz
30a3a93ef9 Core/Event: Change Midsummer Music to search grid only 2016-10-14 18:05:06 +02:00
Kittnz
eee7fa3fa7 Core/Scripts: Initialize rnd and remove where it was not needed 2016-10-08 16:43:08 +02:00
Kittnz
963278459a Core/Event: Pirate Day Music during the event 2016-10-08 15:49:18 +02:00
Kittnz
e3560f3f51 Core/Event: Add Darkmoon Fair Music during the event 2016-10-08 15:43:13 +02:00
Kittnz
19f8acdb61 Core/Event: Add Midsummer Music during the event 2016-10-08 15:38:17 +02:00
Kittnz
3eacc25e5d Core/Event: Fix Brewfest Music
Was only playing the same song over and over again.
2016-10-06 20:14:53 +02:00
SnapperRy
81d4c02f34 Fix non PCH build. 2016-10-06 00:17:28 +02:00
Kittnz
002b0a7a65 Core/Event: Add Brewfest Music during the event
Note: Dark Iron invasion music can be added with a trigger at a later stage
2016-10-05 22:34:04 +02:00
tkrokli
3ad76dea7b Core/Scripts: move npc_lunaclaw_spirit to SAI
This PR moves the core script `npc_lunaclaw_spirit` to SAI, removing hardcoded text.
The quests 6001 + 6002 are druid class quests to get bear form, removed in patch 4.0.3a

Changes in this PR:
- remove core script, including hardcoded text (with typo)
- use gossip_menu_option for each faction (Alliance & Horde)
- add SAI script to complete quest 6001 or 6002 based on option
- add gossip option conditions for team A (469) or team H (67)
- add gossip option conditions for quest 6001/6002 not completed
2016-09-24 02:26:04 +02:00
tkrokli
a475033c76 Core/Scripts: simplified npc_pet_trainer gossip script
This is what the script changes should have been in PR #17746
(also updates issue #14719 with a correct solution).

- remove OnGossipHello() to use DB conditions
- replace OnGossipSelect() with sGossipSelect()
- focus script on the confirming gossip option
- let the other gossip menus be handled in DB
2016-09-17 05:20:40 +02:00
treeston
ac62d7156f Scripts/Events: Globally fix all ExecuteEvent loops to check UNIT_STATE_CASTING after each iteration, instead of just checking it once initially.
Fixes and closes #17892.
2016-09-03 17:21:22 +02:00
treeston
d55426f5b4 Entities/Gossip: The Big One™ that gets rid of all uses of The Bad™ and The Ugly™, e.g. gossip preprocessor macros, and replaces them with the new-and-shiny gossip functions. 2016-08-31 00:59:04 +02:00
tkrokli
8df4706992 Core/Scripts: move npc_experience hardcoded text to DB 2016-08-25 09:07:45 +02:00
Gustavo
989aaaa8b5 Scripts/Pet Implemented Argent Squire/Gruntling and Argent Pony Bridle 2016-08-25 08:31:48 +02:00
tkrokli
8a0990376d Core/Scripts: npc_wormhole #define text moved to DB (#17805)
Another core script hardcoded text removal:
- removed #define text from script
- added the text to gossip_menu_option
- added and renamed enum to match DB entries
- minor additional adjustments and comments

Closes #6841
2016-08-23 13:30:27 +02:00
tkrokli
03bafe334c Core/Scripts: move Pet Trainer gossip to DB
SQL content based  on issue 14719 by Killyana,
conditions output from Malcrom's Condition Creator

- remove hardcoded #define gossip options
- enum gossip menu IDs from DB
- remove outdated SD comments at the top of the file

Closes #14719
2016-08-15 03:17:53 +02:00
tkrokli
2507b9f8af Core/Scripts: remove 2 unused scripts (#17759)
These scripts are no longer in use:
- generic_creature
- trigger_death
2016-08-11 13:29:28 +02:00
ariel-
62bfee37cb Core/Entities: debloat SummonGameObject parameter list using proper wrappers and enable GO rotation in scripts
- There's still an overload allowing for x, y, z, o to be passed directly
- Fixed default animstate for GameObject creation in many places, it should be 255, not 100 (checked in sniffs)
2016-07-30 18:50:44 -03:00
SnapperRy
03b15d968b Event/Midsummer: improve pole ribbon functionality (#17464)
Event/Midsummer: improve pole ribbon functionality:

- Bunny creature should hover, which puts it in the intended position.
- Use correct visual and internal spells to handle cosmetics and timers.
2016-07-05 15:19:30 +02:00
treeston
c6606b7615 Merge remote-tracking branch 'tkrokli/npc_locksmith' into 3.3.5 (PR #17099) 2016-06-09 13:19:17 +02:00
tkrokli
582af02509 Core/Scripts: remove hardcoded text from npc_sayge
- remove hardcoded (and wrong) text from the script
- copy valid text from broadcast_text to gossip_menu_option
- gossip_menu / npc_text is already correct in TDB 335.61
- sort + clean up core script enum list and add new entries
- keep gossip handling unchanged in the script (low prio)
2016-06-03 17:43:45 +02:00
tkrokli
e6ee6e2ae8 Core/Scripts: remove hardcoded text from npc_locksmith
- remove hardcoded text from script
- move the gossip handling to DB SQL
- move the script conditions to DB SQL
- use correct gossip from broadcast_text
- remove options not existing in broadcast_text
- add Key to Searing Gorge option (related spell)
- add The Eye of Haramad option (related spell)
2016-06-03 17:42:55 +02:00
Shauren
bee6525d1b Core/Misc: Fixed -Wmisleading-indentation warnings
(cherry picked from commit 3ac33163db)

# Conflicts:
#	src/server/game/Server/Protocol/PacketLog.cpp
2016-04-28 16:22:51 +01:00
Chaouki Dhib
dc3327f9c5 Core/Movement: Clean up and improvements on Unit::SetSpeed (#16843)
- Clean up of Unit::SetSpeed (mostly cherry picks from the 6.x branch):
- the opcode sent depends on the unit. until now, MSG_MOVE_SET_* were sent for every units which isn't like retail behavior.
- Removed the unused method parameter "forced" from Unit::SetSpeed
- Renamed Unit::SetSpeed to SetSpeedRate
- Removed the unused method parameter "forced" from Unit::UpdateSpeed
- Added utility method Unit::SetSpeed which take the new flat value.
2016-04-16 01:36:32 +02:00
Shauren
e52878b6b5 Core/Spells: Renamed EnsureSpellInfo to AssertSpellInfo to minimize differences between branches 2016-04-02 17:05:46 +02:00
Vincent-Michael
5e74c2223b Core: Remove whitespaces 2016-03-16 21:40:15 +01:00
Naios
9e43365b3d Core/Scripts: Split the huge scriptloader into smaller pieces
* Each subdirectory contains it's own translation unit now
  which is responsible for loading it's directory
* Improves merging & decoupling between 3.3.5 <-> 6.x
* Removes unused Battleground loader
* Ref #15671

(cherry picked from commit 5534915f74)
2016-02-22 16:25:54 +01:00
Kittnz
542f5264d3 Core/Pets: Move Egbert & Pandaren Monk into pet_generic.cpp 2016-02-18 21:30:49 +01:00
Kittnz
af5f4ae85b Pet/Misc: Improve Egbert's AI even more 2016-02-13 12:31:29 +01:00
Kittnz
2322ef3f50 Pet/Misc: Improve Egbert's AI 2016-02-13 12:06:19 +01:00
Keader
8130de1b9a Fix multiple summon of Omen (Lunar Festival) 2016-02-11 19:08:50 -03:00
Vincent-Michael
96cb26de28 Scripts: Fixed warning 2016-02-06 22:12:44 +01:00