Merge branch 'master' into Vmaps

This commit is contained in:
sudlud 2025-10-24 12:01:26 +02:00 committed by GitHub
commit c1ce87aee8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
66 changed files with 337 additions and 267 deletions

View File

@ -32,7 +32,7 @@ $SUDO apt-get install -y gdbserver gdb unzip curl \
VAR_PATH="$CURRENT_PATH/../../../../var"
# run noninteractive install for MYSQL 8.4 LTS
wget https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb -P "$VAR_PATH"
DEBIAN_FRONTEND="noninteractive" $SUDO dpkg -i "$VAR_PATH/mysql-apt-config_0.8.32-1_all.deb"
wget https://dev.mysql.com/get/mysql-apt-config_0.8.35-1_all.deb -P "$VAR_PATH"
DEBIAN_FRONTEND="noninteractive" $SUDO dpkg -i "$VAR_PATH/mysql-apt-config_0.8.35-1_all.deb"
$SUDO apt-get update
DEBIAN_FRONTEND="noninteractive" $SUDO apt-get install -y mysql-server libmysqlclient-dev

View File

@ -40,8 +40,10 @@ apt-get -y install ccache clang cmake curl google-perftools libmysqlclient-dev m
# Do not install MySQL if we are in docker (It will be used a docker container instead) or we are explicitly skipping it.
if [[ $DOCKER != 1 && $SKIP_MYSQL_INSTALL != 1 ]]; then
# run noninteractive install for MYSQL 8.4 LTS
wget https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb -P "$VAR_PATH"
DEBIAN_FRONTEND="noninteractive" $SUDO dpkg -i "$VAR_PATH/mysql-apt-config_0.8.32-1_all.deb"
wget https://dev.mysql.com/get/mysql-apt-config_0.8.35-1_all.deb -P "$VAR_PATH"
# resolve expired key issue
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C
DEBIAN_FRONTEND="noninteractive" $SUDO dpkg -i "$VAR_PATH/mysql-apt-config_0.8.35-1_all.deb"
$SUDO apt-get update
DEBIAN_FRONTEND="noninteractive" $SUDO apt-get install -y mysql-server
fi

View File

@ -0,0 +1,7 @@
-- DB update 2025_10_21_00 -> 2025_10_24_00
--
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 29335) AND (`source_type` = 0) AND (`id` IN (0, 1, 2));
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(29335, 0, 0, 0, 0, 0, 100, 2, 2000, 5000, 6000, 8000, 0, 0, 11, 54290, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Anub\'ar Webspinner - In Combat - Cast \'Web Shot\' (Normal Dungeon)'),
(29335, 0, 1, 0, 0, 0, 100, 4, 2000, 5000, 6000, 8000, 0, 0, 11, 59362, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Anub\'ar Webspinner - In Combat - Cast \'Web Shot\' (Heroic Dungeon)'),
(29335, 0, 2, 0, 0, 0, 100, 6, 5000, 12000, 16000, 21000, 0, 0, 11, 52086, 0, 0, 0, 0, 0, 5, 30, 0, 0, 0, 0, 0, 0, 0, 'Anub\'ar Webspinner - In Combat - Cast \'Web Wrap\' (Dungeon)');

View File

@ -0,0 +1,3 @@
-- DB update 2025_10_24_00 -> 2025_10_24_01
--
UPDATE `creature_template` SET `flags_extra` = `flags_extra`|2147483648 WHERE `entry` IN (29306, 31368);

View File

@ -0,0 +1,34 @@
-- DB update 2025_10_24_01 -> 2025_10_24_02
--
DELETE FROM `smart_scripts` WHERE (`entryorguid` = -114830) AND (`source_type` = 0) AND (`id` IN (0));
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(-114830, 0, 0, 0, 38, 0, 100, 0, 1, 1, 0, 0, 0, 0, 11, 52239, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Drakuramas Teleport Bunny 01 - On Data Set 1 1 - Cast \'Drakuramas Teleport Script 02\'');
DELETE FROM `areatrigger_scripts` WHERE `entry` = 5079;
INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES
(5079, 'SmartTrigger');
DELETE FROM `areatrigger_teleport` WHERE `ID` = 5079;
INSERT INTO `areatrigger_teleport` (`ID`, `Name`, `target_map`, `target_position_x`, `target_position_y`, `target_position_z`, `target_orientation`) VALUES
(5079, 'Zul''drak - Voltarus, middle floor -> top', 571, 6242.67, -1972.10, 484.783, 0.6);
DELETE FROM `spell_target_position` WHERE `ID` = 52240;
INSERT INTO `spell_target_position` (`ID`, `EffectIndex`, `MapID`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`, `VerifiedBuild`) VALUES
(52240, 0, 571, 6242.67, -1972.10, 484.783, 0.6, 0);
DELETE FROM `areatrigger_scripts` WHERE `entry` = 5079;
INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES (5079, 'SmartTrigger');
DELETE FROM `smart_scripts` WHERE (`source_type` = 2 AND `entryorguid` = 5079);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(5079, 2, 0, 0, 46, 0, 100, 0, 5079, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 10, 114830, 28617, 0, 0, 0, 0, 0, 0, 'Areatrigger - On Trigger - Set Data 1 1');
DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 13) AND (`SourceGroup` = 1) AND (`SourceEntry` = 52239) AND (`SourceId` = 0) AND (`ElseGroup` = 0) AND (`ConditionTypeOrReference` = 31) AND (`ConditionTarget` = 0) AND (`ConditionValue1` = 4) AND (`ConditionValue2` = 0) AND (`ConditionValue3` = 0);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(13, 1, 52239, 0, 0, 31, 0, 4, 0, 0, 0, 0, 0, '', 'Spell only hits player');
UPDATE `creature` SET `Comment` = 'GUID SAI' WHERE (`id1` = 28617) AND (`guid` = 114830);
DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = 52239;
INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
(52239, 52240, 1, 'Teleport');

View File

@ -0,0 +1,30 @@
-- DB update 2025_10_24_02 -> 2025_10_24_03
-- Add Waypoint
DELETE FROM `waypoint_data` WHERE `id` = 2875000;
INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES
(2875000, 1, 6174.28, -2017.25, 245.116, NULL, 0, 1, 0, 100, 0);
-- Set SmartAI
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28750;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 28750);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(28750, 0, 0, 3, 8, 0, 100, 512, 52245, 0, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 20, 190716, 25, 0, 0, 2, 0, 0, 0, 'Blight Geist - On Spellhit \'Harvest Blight Crystal\' - Store Targetlist'),
(28750, 0, 1, 3, 8, 0, 100, 512, 52245, 0, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 20, 190939, 25, 0, 0, 2, 0, 0, 0, 'Blight Geist - On Spellhit \'Harvest Blight Crystal\' - Store Targetlist'),
(28750, 0, 2, 3, 8, 0, 100, 512, 52245, 0, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 20, 190940, 25, 0, 0, 2, 0, 0, 0, 'Blight Geist - On Spellhit \'Harvest Blight Crystal\' - Store Targetlist'),
(28750, 0, 3, 0, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 2, 0, 0, 0, 'Blight Geist - On Spellhit \'Harvest Blight Crystal\' - Move To Stored'),
(28750, 0, 4, 0, 34, 0, 100, 512, 8, 1, 0, 0, 0, 0, 80, 2875000, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Geist - On Reached Point 1 - Run Script'),
(28750, 0, 5, 0, 8, 0, 100, 512, 52244, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Geist - On Spellhit \'Charm Geist\' - Say Line 0'),
(28750, 0, 6, 0, 8, 0, 100, 512, 52252, 0, 0, 0, 0, 0, 11, 52243, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Geist - On Spellhit \'Charm Channel\' - Cast \'Orange Radiation, Small\''),
(28750, 0, 7, 8, 109, 0, 100, 512, 0, 2875000, 0, 0, 0, 0, 11, 61456, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Geist - On Path 2875000 Finished - Cast \'Evil Teleport Visual Only\''),
(28750, 0, 8, 9, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 11, 52248, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Geist - On Path 2875000 Finished - Cast \'Kill Credit - Blighted Geist\''),
(28750, 0, 9, 0, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 41, 2000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Geist - On Path 2875000 Finished - Despawn In 2000 ms');
-- Set Action List
DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 2875000);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(2875000, 9, 0, 0, 0, 0, 100, 512, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 0, 'Blight Geist - Actionlist - Set Orientation Stored'),
(2875000, 9, 1, 0, 0, 0, 100, 512, 2000, 2000, 0, 0, 0, 0, 5, 25, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Geist - Actionlist - Play Emote 25'),
(2875000, 9, 2, 0, 0, 0, 100, 512, 2000, 2000, 0, 0, 0, 0, 5, 35, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Geist - Actionlist - Play Emote 35'),
(2875000, 9, 3, 0, 0, 0, 100, 512, 2000, 2000, 0, 0, 0, 0, 99, 3, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 0, 'Blight Geist - Actionlist - Set Lootstate Deactivated'),
(2875000, 9, 4, 0, 0, 0, 100, 512, 1000, 1000, 0, 0, 0, 0, 232, 2875000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Geist - Actionlist - Start Path 2875000');

View File

@ -35,8 +35,8 @@ CU_GET_GLOBAL("AC_ADD_SCRIPTS_INCLUDE")
set("AC_SCRIPTS_INCLUDES" "")
set("AC_MODULE_LIST" "")
set("AC_SCRIPTS_LIST" "")
set(MOD_ELUNA_FOUND 0)
set(MOD_ELUNA_PATH "")
set(MOD_ALE_FOUND 0)
set(MOD_ALE_PATH "")
foreach(include ${AC_ADD_SCRIPTS_INCLUDE})
set("AC_SCRIPTS_INCLUDES" "#include \"${include}\"\n${AC_SCRIPTS_INCLUDES}")
@ -50,12 +50,12 @@ foreach(scriptName ${AC_ADD_SCRIPTS_LIST})
set("AC_SCRIPTS_LIST" " ${scriptName};\n${AC_SCRIPTS_LIST}")
endforeach()
function(ConfigureElunaModule moduleName)
set(MOD_ELUNA_FOUND 1 PARENT_SCOPE)
function(ConfigureALEModule moduleName)
set(MOD_ALE_FOUND 1 PARENT_SCOPE)
GetPathToModuleSource(${SOURCE_MODULE} MODULE_SOURCE_PATH)
set(MOD_ELUNA_PATH ${MODULE_SOURCE_PATH} PARENT_SCOPE)
set(MOD_ALE_PATH ${MODULE_SOURCE_PATH} PARENT_SCOPE)
# Define eluna compile options
# Define ALE compile options
target_compile_options(game-interface
INTERFACE
-DAZEROTHCORE
@ -76,9 +76,9 @@ foreach(SOURCE_MODULE ${MODULES_MODULE_LIST})
set(${MODULE_MODULE_VARIABLE} "static")
endif()
# Use only static for mod-eluna
if (SOURCE_MODULE MATCHES "mod-eluna")
ConfigureElunaModule(${SOURCE_MODULE})
# Use only static for mod-ALE
if (SOURCE_MODULE MATCHES "mod-ale")
ConfigureALEModule(${SOURCE_MODULE})
endif()
# Build the Graph values
@ -267,9 +267,9 @@ ConfigureScriptLoader("static" SCRIPT_MODULE_PRIVATE_SCRIPTLOADER OFF ${STATIC_S
list(REMOVE_DUPLICATES SCRIPT_MODULE_PRIVATE_SCRIPTLOADER)
if (MOD_ELUNA_FOUND)
list(REMOVE_ITEM PRIVATE_SOURCES_MODULES ${MOD_ELUNA_PATH}/lualib/lua.c)
list(REMOVE_ITEM PRIVATE_SOURCES_MODULES ${MOD_ELUNA_PATH}/lualib/luac.c)
if (MOD_ALE_FOUND)
list(REMOVE_ITEM PRIVATE_SOURCES_MODULES ${MOD_ALE_PATH}/lualib/lua.c)
list(REMOVE_ITEM PRIVATE_SOURCES_MODULES ${MOD_ALE_PATH}/lualib/luac.c)
endif()
add_library(modules STATIC
@ -277,7 +277,7 @@ add_library(modules STATIC
${SCRIPT_MODULE_PRIVATE_SCRIPTLOADER}
${PRIVATE_SOURCES_MODULES})
if (MOD_ELUNA_FOUND)
if (MOD_ALE_FOUND)
target_link_libraries(modules PUBLIC lualib)
endif()
@ -358,7 +358,7 @@ target_compile_options(modules
INTERFACE
-DCONFIG_FILE_LIST=$<1:"${CONFIG_LIST}">)
if (MOD_ELUNA_FOUND)
if (MOD_ALE_FOUND)
if (APPLE)
target_compile_definitions(modules
PUBLIC
@ -377,10 +377,10 @@ if (MOD_ELUNA_FOUND)
add_custom_command(TARGET modules
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/bin/${MSVC_CONFIGURATION_NAME}lua_scripts/extensions/"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${MOD_ELUNA_PATH}/LuaEngine/extensions" "${CMAKE_BINARY_DIR}/bin/${MSVC_CONFIGURATION_NAME}lua_scripts/extensions/")
COMMAND ${CMAKE_COMMAND} -E copy_directory "${MOD_ALE_PATH}/LuaEngine/extensions" "${CMAKE_BINARY_DIR}/bin/${MSVC_CONFIGURATION_NAME}lua_scripts/extensions/")
endif()
install(DIRECTORY "${MOD_ELUNA_PATH}/LuaEngine/extensions" DESTINATION "${CMAKE_INSTALL_PREFIX}/bin/lua_scripts/")
install(DIRECTORY "${MOD_ALE_PATH}/LuaEngine/extensions" DESTINATION "${CMAKE_INSTALL_PREFIX}/bin/lua_scripts/")
endif()
message("")

View File

@ -552,11 +552,6 @@ void ScriptedAI::SetEquipmentSlots(bool loadDefault, int32 mainHand /*= EQUIP_NO
}
}
void ScriptedAI::SetRun(bool run)
{
me->SetWalk(!run);
}
enum eNPCs
{
NPC_BROODLORD = 12017,

View File

@ -227,8 +227,6 @@ struct ScriptedAI : public CreatureAI
// Called when AI is temporarily replaced or put back when possess is applied or removed
void OnPossess(bool /*apply*/) {}
void SetRun(bool run);
enum class Axis
{
AXIS_X,

View File

@ -49,6 +49,8 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c)
mForcedPaused = false;
mForcedMovement = FORCED_MOVEMENT_NONE;
mEscortQuestID = 0;
mDespawnTime = 0;
@ -205,6 +207,7 @@ void SmartAI::StartPath(ForcedMovement forcedMovement, uint32 path, bool repeat,
{
AddEscortState(SMART_ESCORT_ESCORTING);
mCanRepeatPath = repeat;
mForcedMovement = forcedMovement;
if (invoker && invoker->IsPlayer())
{
@ -215,7 +218,7 @@ void SmartAI::StartPath(ForcedMovement forcedMovement, uint32 path, bool repeat,
Movement::PointsArray pathPoints;
GenerateWayPointArray(&pathPoints);
me->GetMotionMaster()->MoveSplinePath(&pathPoints, forcedMovement);
me->GetMotionMaster()->MoveSplinePath(&pathPoints, mForcedMovement);
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_START, nullptr, wp->id, GetScript()->GetPathId());
}
}
@ -373,7 +376,7 @@ void SmartAI::ResumePath()
Movement::PointsArray pathPoints;
GenerateWayPointArray(&pathPoints);
me->GetMotionMaster()->MoveSplinePath(&pathPoints);
me->GetMotionMaster()->MoveSplinePath(&pathPoints, mForcedMovement);
}
}

View File

@ -241,6 +241,7 @@ private:
bool mCanAutoAttack;
bool mForcedPaused;
uint32 mInvincibilityHpLevel;
ForcedMovement mForcedMovement;
bool AssistPlayerInCombatAgainst(Unit* who);

View File

@ -41,7 +41,7 @@
#include "UpdateFields.h"
class ElunaEventProcessor;
class ALEEventProcessor;
enum TempSummonType
{
@ -727,7 +727,7 @@ public:
ObjectVisibilityContainer const& GetObjectVisibilityContainer() const { return _objectVisibilityContainer; }
// Event handler
ElunaEventProcessor* elunaEvents;
ALEEventProcessor* ALEEvents;
EventProcessor m_Events;
protected:

View File

@ -2107,7 +2107,7 @@ void InstanceMap::CreateInstanceScript(bool load, std::string data, uint32 compl
if (instance_data)
isOtherAI = true;
// if Eluna AI was fetched succesfully we should not call CreateInstanceData nor set the unused scriptID
// if ALE AI was fetched succesfully we should not call CreateInstanceData nor set the unused scriptID
if (!isOtherAI)
{
InstanceTemplate const* mInstance = sObjectMgr->GetInstanceTemplate(GetId());
@ -2121,7 +2121,7 @@ void InstanceMap::CreateInstanceScript(bool load, std::string data, uint32 compl
if (!instance_data)
return;
// use mangos behavior if we are dealing with Eluna AI
// use mangos behavior if we are dealing with ALE AI
// initialize should then be called only if load is false
if (!isOtherAI || !load)
{

View File

@ -15,12 +15,12 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ElunaScript.h"
#include "ALEScript.h"
#include "ScriptMgr.h"
ElunaScript::ElunaScript(const char* name) : ScriptObject(name)
ALEScript::ALEScript(const char* name) : ScriptObject(name)
{
ScriptRegistry<ElunaScript>::AddScript(this);
ScriptRegistry<ALEScript>::AddScript(this);
}
template class AC_GAME_API ScriptRegistry<ElunaScript>;
template class AC_GAME_API ScriptRegistry<ALEScript>;

View File

@ -15,15 +15,15 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SCRIPT_OBJECT_ELUNA_SCRIPT_H_
#define SCRIPT_OBJECT_ELUNA_SCRIPT_H_
#ifndef SCRIPT_OBJECT_ALE_SCRIPT_H_
#define SCRIPT_OBJECT_ALE_SCRIPT_H_
#include "ScriptObject.h"
class ElunaScript : public ScriptObject
class ALEScript : public ScriptObject
{
protected:
ElunaScript(const char* name);
ALEScript(const char* name);
public:
/**

View File

@ -39,7 +39,7 @@
#include "CreatureScript.h"
#include "DatabaseScript.h"
#include "DynamicObjectScript.h"
#include "ElunaScript.h"
#include "ALEScript.h"
#include "FormulaScript.h"
#include "GameEventScript.h"
#include "GameObjectScript.h"

View File

@ -16,7 +16,7 @@
*/
#include "AreaTriggerScript.h"
#include "ElunaScript.h"
#include "ALEScript.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "ScriptMgrMacros.h"
@ -26,7 +26,7 @@ bool ScriptMgr::OnAreaTrigger(Player* player, AreaTrigger const* trigger)
ASSERT(player);
ASSERT(trigger);
auto ret = IsValidBoolScript<ElunaScript>([&](ElunaScript* script)
auto ret = IsValidBoolScript<ALEScript>([&](ALEScript* script)
{
return script->CanAreaTrigger(player, trigger);
});

View File

@ -16,7 +16,7 @@
*/
#include "WeatherScript.h"
#include "ElunaScript.h"
#include "ALEScript.h"
#include "ScriptMgr.h"
#include "ScriptMgrMacros.h"
@ -24,7 +24,7 @@ void ScriptMgr::OnWeatherChange(Weather* weather, WeatherState state, float grad
{
ASSERT(weather);
ExecuteScript<ElunaScript>([&](ElunaScript* script)
ExecuteScript<ALEScript>([&](ALEScript* script)
{
script->OnWeatherChange(weather, state, grade);
});

View File

@ -127,7 +127,7 @@ void ScriptMgr::Unload()
SCR_CLEAR<CreatureScript>();
SCR_CLEAR<DatabaseScript>();
SCR_CLEAR<DynamicObjectScript>();
SCR_CLEAR<ElunaScript>();
SCR_CLEAR<ALEScript>();
SCR_CLEAR<FormulaScript>();
SCR_CLEAR<GameEventScript>();
SCR_CLEAR<GameObjectScript>();

View File

@ -359,6 +359,7 @@ public:
case 0:
Talk(SAY_TEXT5);
HandleGameObject(DATA_ARENA4, false);
me->SetWalk(true);
Start(false);
eventTimer = 0;
break;
@ -604,7 +605,10 @@ public:
creature->CastSpell(creature, SPELL_DRUNKEN_RAGE, false);
if (npc_escortAI* escortAI = CAST_AI(npc_rocknot::npc_rocknotAI, creature->AI()))
{
creature->SetWalk(true);
escortAI->Start(false);
}
}
}

View File

@ -170,6 +170,7 @@ public:
if (m_uiEventId == EVENT_OZ)
instance->SetData(DATA_OPERA_OZ_DEATHCOUNT, IN_PROGRESS);
me->SetWalk(true);
Start(false);
}

View File

@ -980,6 +980,7 @@ public:
{
carGUID = who->GetVehicleBase()->GetGUID();
InitWaypoint();
me->SetWalk(true);
Start(false, who->GetGUID());
SetDespawnAtFar(false);
}
@ -998,7 +999,7 @@ public:
car->SetFaction(FACTION_FRIENDLY);
}
Talk(SAY_SCARLET_MINER_0);
SetRun(true);
me->SetWalk(false);
IntroTimer = 4000;
IntroPhase = 1;
break;

View File

@ -78,7 +78,7 @@ public:
break;
case 11:
Talk(SAY_PROGRESS_6, player);
SetRun(true);
me->SetWalk(false);
break;
case 19:
Talk(SAY_PROGRESS_7, player);
@ -106,7 +106,8 @@ public:
if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE)
{
Talk(SAY_PROGRESS_1, player);
npc_escortAI::Start(false, player->GetGUID(), quest);
me->SetWalk(true);
Start(false, player->GetGUID(), quest);
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
}
}

View File

@ -113,7 +113,8 @@ struct npc_ranger_lilatha : public npc_escortAI
if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS)
{
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
npc_escortAI::Start(true, player->GetGUID());
me->SetWalk(true);
Start(true, player->GetGUID());
}
}
};

View File

@ -132,7 +132,8 @@ public:
if (GameObject* go = me->FindNearestGameObject(GO_RINJI_CAGE, INTERACTION_DISTANCE))
go->UseDoorOrButton();
npc_escortAI::Start(false, player->GetGUID(), quest);
me->SetWalk(true);
Start(false, player->GetGUID(), quest);
}
}
@ -156,7 +157,7 @@ public:
case 17:
Talk(SAY_RIN_COMPLETE, player);
player->GroupEventHappens(QUEST_RINJI_TRAPPED, me);
SetRun(true);
me->SetWalk(false);
postEventCount = 1;
break;
}

View File

@ -61,7 +61,8 @@ public:
if (quest->GetQuestId() == QUEST_MISSING_IN_ACTION)
{
Talk(SAY_CORPORAL_1, player);
npc_escortAI::Start(true, player->GetGUID(), quest);
me->SetWalk(true);
Start(true, player->GetGUID(), quest);
me->SetImmuneToNPC(false);
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE);
}

View File

@ -111,7 +111,10 @@ public:
creature->AI()->Talk(SAY_QUESTACCEPT, player);
if (npc_escortAI* pEscortAI = CAST_AI(npc_deathstalker_erland::npc_deathstalker_erlandAI, creature->AI()))
{
creature->SetWalk(true);
pEscortAI->Start(true, player->GetGUID());
}
}
return true;

View File

@ -406,6 +406,7 @@ public:
{
if (Player* player = GetPlayerForEscort())
{
pLescovar->SetWalk(true);
CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, pLescovar->AI())->Start(false, player->GetGUID());
CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, pLescovar->AI())->SetMaxPlayerDistance(200.0f);
}
@ -448,6 +449,7 @@ public:
{
if (Creature* pSpybot = creature->FindNearestCreature(NPC_TYRION_SPYBOT, 5.0f, true))
{
pSpybot->SetWalk(true);
CAST_AI(npc_tyrion_spybot::npc_tyrion_spybotAI, pSpybot->AI())->Start(false, player->GetGUID());
CAST_AI(npc_tyrion_spybot::npc_tyrion_spybotAI, pSpybot->AI())->SetMaxPlayerDistance(200.0f);
}

View File

@ -916,7 +916,6 @@ public:
if (auto ai = CAST_AI(npc_varian_wrynn::npc_varian_wrynnAI, creature->AI()))
{
creature->SetWalk(false);
ai->Start(true, player->GetGUID());
if (Creature* jaina = GetClosestCreatureWithEntry(creature, NPC_JAINA, 50.0f))
ai->jainaGUID = jaina->GetGUID();

View File

@ -56,7 +56,6 @@ public:
if (quest->GetQuestId() == QUEST_TOME_VALOR)
{
creature->AI()->Talk(SAY_DS_START);
creature->SetWalk(false);
if (npc_escortAI* pEscortAI = CAST_AI(npc_daphne_stilwell::npc_daphne_stilwellAI, creature->AI()))
pEscortAI->Start(true, player->GetGUID());
}
@ -117,7 +116,7 @@ public:
me->SummonCreature(NPC_DEFIAS_RAIDER, -11438.14f, 1607.6f, 70.94f, 4.38f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
break;
case 10:
SetRun(false);
me->SetWalk(true);
break;
case 11:
Talk(SAY_DS_PROLOGUE);

View File

@ -138,7 +138,10 @@ public:
pSlim->CastSpell(pSlim, SPELL_STEALTH, true);
if (npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI* pEscortAI = CAST_AI(npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI, pSlim->AI()))
{
pSlim->SetWalk(true);
pEscortAI->Start(false, player->GetGUID(), quest);
}
}
return false;
}

View File

@ -424,7 +424,7 @@ public:
{
Talk(SAY_PHASE201);
actionEvents.ScheduleEvent(EVENT_ACTION_PHASE2, 12s);
SetRun(false);
me->SetWalk(true);
eventInRun = true;
me->SummonCreature(NPC_CITY_MAN, EventPos[EVENT_SRC_TOWN_CITYMAN1]);
@ -434,14 +434,14 @@ public:
{
waveGroupId = 10;
eventInRun = true;
SetRun(true);
me->SetWalk(false);
actionEvents.ScheduleEvent(EVENT_ACTION_PHASE2 + 9, 10s);
}
else if (param == ACTION_START_TOWN_HALL)
{
Talk(SAY_PHASE301);
SetEscortPaused(false);
SetRun(false);
me->SetWalk(true);
if (Creature* cr = me->SummonCreature(NPC_CITY_MAN3, EventPos[EVENT_SRC_HALL_CITYMAN1]))
{
@ -460,13 +460,13 @@ public:
{
Talk(SAY_PHASE401);
SetEscortPaused(false);
SetRun(false);
me->SetWalk(true);
}
else if (param == ACTION_START_LAST_CITY)
{
Talk(SAY_PHASE404);
SetEscortPaused(false);
SetRun(true);
me->SetWalk(false);
}
else if (param == ACTION_START_MALGANIS)
{
@ -480,7 +480,7 @@ public:
}
Talk(SAY_PHASE501);
SetEscortPaused(false);
SetRun(true);
me->SetWalk(false);
}
else if (param == ACTION_KILLED_MALGANIS)
{
@ -533,7 +533,7 @@ public:
break;
// After intro, in front of bridge
case 3:
SetRun(true);
me->SetWalk(false);
Talk(SAY_PHASE118);
summons.DespawnAll(); // uther, jaina and horses
break;
@ -574,7 +574,7 @@ public:
if (pInstance)
pInstance->SetData(DATA_ARTHAS_EVENT, COS_PROGRESS_REACHED_TOWN_HALL);
me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
SetRun(false);
me->SetWalk(true);
SetEscortPaused(true);
break;
// Inside Town Hall first scene pos
@ -600,7 +600,7 @@ public:
break;
// Town Hall, upper floor third fight
case 31:
SetRun(false);
me->SetWalk(true);
SpawnTimeRift();
SpawnTimeRift();
Talk(SAY_PHASE312);
@ -616,14 +616,14 @@ public:
break;
// Reached book shelf
case 36:
SetRun(true);
me->SetWalk(false);
if (pInstance)
if (GameObject* pGate = pInstance->instance->GetGameObject(pInstance->GetGuidData(DATA_SHKAF_GATE)))
pGate->SetGoState(GO_STATE_ACTIVE);
break;
// Behind secred passage
case 45:
SetRun(true);
me->SetWalk(false);
me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
SetEscortPaused(true);
if (pInstance)
@ -631,11 +631,11 @@ public:
break;
// Some walk talk
case 47:
SetRun(false);
me->SetWalk(true);
Talk(SAY_PHASE405);
break;
case 48:
SetRun(true);
me->SetWalk(false);
Talk(SAY_PHASE406);
break;
case 53:
@ -674,7 +674,7 @@ public:
switch (uint32 currentEvent = actionEvents.ExecuteEvent())
{
case EVENT_ACTION_PHASE1:
SetRun(false);
me->SetWalk(true);
me->SummonCreature(NPC_JAINA, EventPos[EVENT_SRC_JAINA], TEMPSUMMON_DEAD_DESPAWN, 180000);
if (Creature* uther = me->SummonCreature(NPC_UTHER, EventPos[EVENT_SRC_UTHER], TEMPSUMMON_DEAD_DESPAWN, 180000))
{
@ -690,6 +690,7 @@ public:
break;
case EVENT_ACTION_PHASE1+1:
// Start Event
me->SetWalk(true);
Start(true);
SetDespawnAtEnd(false);
SetDespawnAtFar(false);
@ -958,7 +959,7 @@ public:
break;
// After waypoint 23
case EVENT_ACTION_PHASE3+3:
SetRun(true);
me->SetWalk(false);
if (Creature* cr = GetEventNpc(NPC_CITY_MAN3))
me->CastSpell(cr, SPELL_ARTHAS_CRUSADER_STRIKE, true);
ScheduleNextEvent(currentEvent, 2s);

View File

@ -316,12 +316,12 @@ public:
events.ScheduleEvent(EVENT_THRALL_EMOTE, 1300ms);
break;
case 9:
SetRun(false);
me->SetWalk(true);
events.ScheduleEvent(EVENT_KILL_ARMORER, 500ms);
events.ScheduleEvent(EVENT_TALK_KILL_ARMORER, 3s);
break;
case 10:
SetRun(true);
me->SetWalk(false);
events.ScheduleEvent(EVENT_DRESSING_KNEEL, 500ms);
events.ScheduleEvent(EVENT_DRESSING_ARMOR, 3s);
events.ScheduleEvent(EVENT_DRESSING_STAND, 4s);
@ -374,7 +374,7 @@ public:
}
UnMountSelf();
_mounted = false;
SetRun(false);
me->SetWalk(true);
me->SetFacingTo(6.0388f);
break;
case 60:
@ -386,12 +386,12 @@ public:
}
Talk(SAY_EMOTE_HORSE);
SetEscortPaused(true);
SetRun(true);
me->SetWalk(false);
me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
me->SetFacingTo(4.1364f);
break;
case 64:
SetRun(false);
me->SetWalk(true);
break;
case 67:
events.ScheduleEvent(EVENT_LOOK_1, 1200ms);
@ -418,12 +418,12 @@ public:
summon->AI()->Talk(SAY_LOOKOUT_INN);
break;
case 92:
SetRun(false);
me->SetWalk(true);
break;
case 94:
summons.DespawnAll();
SetEscortPaused(true);
SetRun(true);
me->SetWalk(false);
instance->SetData(DATA_ESCORT_PROGRESS, ENCOUNTER_PROGRESS_TARETHA_MEET);
if (Creature* Taretha = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_TARETHA_GUID)))
{
@ -664,7 +664,7 @@ public:
me->SetFacingTo(2.0071f);
break;
case EVENT_SUMMON_GUARDS:
SetRun(true);
me->SetWalk(false);
me->SummonCreature(NPC_TM_PROTECTOR, 2501.5708f, 699.38086f, 55.64138f, 3.8571f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30 * IN_MILLISECONDS);
me->SummonCreature(NPC_TM_LOOKOUT, 2500.7002f, 698.26746f, 55.618248f, 3.7350f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30 * IN_MILLISECONDS);
if (Creature* guardsman = me->SummonCreature(NPC_TM_GUARDSMAN, 2500.0908f, 699.9389f, 55.629555f, 4.2935f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30 * IN_MILLISECONDS))
@ -1018,7 +1018,7 @@ public:
{
if (waypointId == 7)
{
SetRun(false);
me->SetWalk(true);
Talk(SAY_TARETHA_FREE);
me->HandleEmoteCommand(EMOTE_ONESHOT_CHEER);
if (Creature* thrall = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_THRALL_GUID)))

View File

@ -209,7 +209,6 @@ struct npc_general_andorov : public npc_escortAI
_initialAttackTimer = 5 * IN_MILLISECONDS;
_paused = false;
me->SetWalk(false);
Start(false);
me->SetImmuneToNPC(true);

View File

@ -121,7 +121,8 @@ public:
{
Talk(SAY_MUG_START1);
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
npc_escortAI::Start(true, player->GetGUID());
me->SetWalk(true);
Start(true, player->GetGUID());
}
}

View File

@ -258,7 +258,7 @@ public:
case 28:
player->GroupEventHappens(QUEST_A_CRY_FOR_HELP, me);
_events.ScheduleEvent(EVENT_TALK_END, 2s);
SetRun(true);
me->SetWalk(false);
break;
case 29:
if (Creature* cowlen = me->FindNearestCreature(NPC_COWLEN, 50.0f, true))
@ -289,7 +289,8 @@ public:
case EVENT_START_ESCORT:
if (Player* player = ObjectAccessor::GetPlayer(*me, _player))
{
npc_escortAI::Start(true, player->GetGUID());
me->SetWalk(true);
Start(true, player->GetGUID());
}
_events.ScheduleEvent(EVENT_STAND, 2s);
break;

View File

@ -397,7 +397,10 @@ public:
if (quest->GetQuestId() == QUEST_ABSENT_MINDED_PT2)
{
if (npc_escortAI* pEscortAI = CAST_AI(npc_prospector_remtravel::npc_prospector_remtravelAI, creature->AI()))
{
creature->SetWalk(true);
pEscortAI->Start(false, player->GetGUID());
}
creature->SetFaction(FACTION_ESCORTEE_A_NEUTRAL_PASSIVE);
}

View File

@ -396,7 +396,6 @@ public:
case EVENT_RESTART_ESCORT:
CheckCaravan();
SetDespawnAtEnd(false);
SetRun(true);
Start(true, ObjectGuid::Empty, 0, false, false, true);
break;
}

View File

@ -384,6 +384,7 @@ public:
AddWaypoint(i, Clintar_spirit_WP[i][0], Clintar_spirit_WP[i][1], Clintar_spirit_WP[i][2], (uint32)Clintar_spirit_WP[i][4]);
}
PlayerGUID = player->GetGUID();
me->SetWalk(true);
Start(true, PlayerGUID);
}
return;

View File

@ -137,7 +137,10 @@ public:
if (quest->GetQuestId() == QUEST_PROTECT_KAYA)
{
if (npc_escortAI* pEscortAI = CAST_AI(npc_kaya_flathoof::npc_kaya_flathoofAI, creature->AI()))
{
creature->SetWalk(true);
pEscortAI->Start(true, player->GetGUID());
}
creature->AI()->Talk(SAY_START);
creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);

View File

@ -260,6 +260,7 @@ public:
float Radius = 10.0f;
if (me->IsWithinDistInMap(who, Radius))
{
me->SetWalk(true);
Start(false, who->GetGUID());
}
}

View File

@ -55,7 +55,10 @@ public:
creature->AI()->Talk(SAY_GIL_START, player);
if (npc_giltharesAI* pEscortAI = CAST_AI(npc_gilthares::npc_giltharesAI, creature->AI()))
{
creature->SetWalk(true);
pEscortAI->Start(false, player->GetGUID(), quest);
}
}
return true;
}
@ -499,7 +502,7 @@ public:
Talk(SAY_STARTUP1);
break;
case 9:
SetRun(false);
me->SetWalk(true);
break;
case 17:
if (Creature* temp = me->SummonCreature(NPC_MERCENARY, 1128.489f, -3037.611f, 92.701f, 1.472f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000))
@ -528,7 +531,7 @@ public:
break;
case 18:
Talk(SAY_PROGRESS_1, player);
SetRun(true);
me->SetWalk(false);
break;
}
}
@ -594,7 +597,10 @@ public:
creature->SetFaction(FACTION_RATCHET);
creature->AI()->Talk(SAY_START);
if (npc_escortAI* pEscortAI = CAST_AI(npc_wizzlecrank_shredder::npc_wizzlecrank_shredderAI, creature->AI()))
{
creature->SetWalk(true);
pEscortAI->Start(true, player->GetGUID());
}
}
return true;
}

View File

@ -66,7 +66,10 @@ public:
creature->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE); //guessed
if (npc_lakota_windsongAI* pEscortAI = CAST_AI(npc_lakota_windsong::npc_lakota_windsongAI, creature->AI()))
{
creature->SetWalk(true);
pEscortAI->Start(false, player->GetGUID(), quest);
}
}
return true;
}
@ -148,7 +151,10 @@ public:
creature->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE); // guessed
if (npc_paoka_swiftmountainAI* pEscortAI = CAST_AI(npc_paoka_swiftmountain::npc_paoka_swiftmountainAI, creature->AI()))
{
creature->SetWalk(true);
pEscortAI->Start(false, player->GetGUID(), quest);
}
}
return true;
}

View File

@ -48,6 +48,7 @@ public:
{
if (quest->GetQuestId() == QUEST_CHASING_AME)
{
creature->SetWalk(true);
CAST_AI(npc_escortAI, (creature->AI()))->Start(false, player->GetGUID());
creature->AI()->Talk(SAY_READY, player);
creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);

View File

@ -286,7 +286,10 @@ public:
creature->SetFaction(FACTION_ESCORT_A_NEUTRAL_PASSIVE);
if (npc_ranshallaAI* escortAI = dynamic_cast<npc_ranshallaAI*>(creature->AI()))
{
creature->SetWalk(true);
escortAI->Start(false, player->GetGUID(), quest);
}
return true;
}

View File

@ -339,7 +339,6 @@ public:
void Reset() override
{
me->SetWalk(false);
Start(false, ObjectGuid::Empty, nullptr);
SetDespawnAtEnd(true);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);

View File

@ -549,7 +549,6 @@ public:
return;
}
me->SetWalk(false);
Start(false);
}

View File

@ -49,175 +49,124 @@ enum Yells
enum Events
{
EVENT_STAMPEDE = 1,
EVENT_WHIRLING_SLASH = 2,
EVENT_PUNCTURE = 3,
EVENT_ENRAGE = 4,
EVENT_IMPALING_CHARGE = 5,
EVENT_UNSUMMON_RHINO = 6,
EVENT_STOMP = 7,
EVENT_KILL_TALK = 8
EVENT_KILL_TALK = 1
};
class boss_gal_darah : public CreatureScript
struct boss_gal_darah : public BossAI
{
public:
boss_gal_darah() : CreatureScript("boss_gal_darah") { }
boss_gal_darah(Creature* creature) : BossAI(creature, DATA_GAL_DARAH) { }
CreatureAI* GetAI(Creature* creature) const override
void Reset() override
{
return GetGundrakAI<boss_gal_darahAI>(creature);
BossAI::Reset();
DoCastSelf(SPELL_START_VISUAL);
impaledList.clear();
_stampedeVictim.Clear();
}
struct boss_gal_darahAI : public BossAI
void JustReachedHome() override
{
boss_gal_darahAI(Creature* creature) : BossAI(creature, DATA_GAL_DARAH)
BossAI::JustReachedHome();
DoCastSelf(SPELL_START_VISUAL);
}
void SpellHit(Unit* /*caster*/, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == SPELL_TRANSFORM_TO_RHINO)
{
ScheduleTimedEvent(8s, 11s, [&] {
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 100.0f, true))
{
DoCast(target, SPELL_IMPALING_CHARGE);
impaledList.insert(target->GetGUID());
}
}, 16s, 17s);
ScheduleTimedEvent(6s, 8s, [&] {
DoCastSelf(SPELL_ENRAGE);
}, 16s, 17s);
ScheduleTimedEvent(7s, 10s, [&] {
DoCastAOE(SPELL_STOMP);
}, 10s, 12s);
me->m_Events.AddEventAtOffset([&] {
scheduler.CancelAll();
DoCastSelf(SPELL_TRANSFORM_TO_TROLL);
}, 32s);
}
uint8 phaseCounter;
GuidSet impaledList;
void Reset() override
else if (spellInfo->Id == SPELL_TRANSFORM_TO_TROLL)
{
BossAI::Reset();
impaledList.clear();
phaseCounter = 0;
ScheduleEvents();
}
}
void InitializeAI() override
{
BossAI::InitializeAI();
me->CastSpell(me, SPELL_START_VISUAL, false);
}
void JustReachedHome() override
{
BossAI::JustReachedHome();
me->CastSpell(me, SPELL_START_VISUAL, false);
}
void ScheduleEvents(bool troll)
{
events.Reset();
if (troll)
void ScheduleEvents()
{
ScheduleTimedEvent(10s, [&] {
Talk(SAY_SUMMON_RHINO);
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f))
{
events.RescheduleEvent(EVENT_STAMPEDE, 10s);
events.RescheduleEvent(EVENT_WHIRLING_SLASH, 21s);
_stampedeVictim = target->GetGUID();
DoCast(target, SPELL_STAMPEDE);
}
else
{
events.RescheduleEvent(EVENT_PUNCTURE, 10s);
events.RescheduleEvent(EVENT_ENRAGE, 15s);
events.RescheduleEvent(EVENT_IMPALING_CHARGE, 21s);
events.RescheduleEvent(EVENT_STOMP, 5s);
}
}
}, 15s);
void JustEngagedWith(Unit* who) override
ScheduleTimedEvent(10s, 16s, [&] {
DoCastVictim(SPELL_PUNCTURE);
}, 15s, 18s);
ScheduleTimedEvent(11s, 19s, [&] {
DoCastAOE(SPELL_WHIRLING_SLASH);
}, 17s, 19s);
me->m_Events.AddEventAtOffset([&] {
scheduler.CancelAll();
DoCastSelf(SPELL_TRANSFORM_TO_RHINO);
}, 32s);
}
void JustEngagedWith(Unit* who) override
{
Talk(SAY_AGGRO);
BossAI::JustEngagedWith(who);
ScheduleEvents();
me->RemoveAurasDueToSpell(SPELL_START_VISUAL);
me->InterruptNonMeleeSpells(true);
}
void JustSummoned(Creature* summon) override
{
if (Unit* target = ObjectAccessor::GetUnit(*me, _stampedeVictim))
summon->CastSpell(target, SPELL_STAMPEDE_DMG, true);
summons.Summon(summon);
}
uint32 GetData(uint32 /*type*/) const override
{
return impaledList.size();
}
void JustDied(Unit* killer) override
{
Talk(SAY_DEATH);
BossAI::JustDied(killer);
}
void KilledUnit(Unit*) override
{
if (!events.HasTimeUntilEvent(EVENT_KILL_TALK))
{
Talk(SAY_AGGRO);
BossAI::JustEngagedWith(who);
ScheduleEvents(true);
me->RemoveAurasDueToSpell(SPELL_START_VISUAL);
me->InterruptNonMeleeSpells(true);
Talk(SAY_SLAY);
events.ScheduleEvent(EVENT_KILL_TALK, 6s);
}
}
void JustSummoned(Creature* summon) override
{
uint32 despawnTime = 0;
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 60.0f, true))
{
summon->CastSpell(target, SPELL_STAMPEDE_DMG, true);
despawnTime = (summon->GetDistance(target) / 40.0f * 1000) + 500;
}
summon->DespawnOrUnsummon(Milliseconds(despawnTime));
}
uint32 GetData(uint32 /*type*/) const override
{
return impaledList.size();
}
void JustDied(Unit* killer) override
{
Talk(SAY_DEATH);
BossAI::JustDied(killer);
}
void KilledUnit(Unit*) override
{
if (!events.HasTimeUntilEvent(EVENT_KILL_TALK))
{
Talk(SAY_SLAY);
events.ScheduleEvent(EVENT_KILL_TALK, 6s);
}
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING | UNIT_STATE_CHARGING))
return;
switch (events.ExecuteEvent())
{
case EVENT_STAMPEDE:
Talk(SAY_SUMMON_RHINO);
me->CastSpell(me->GetVictim(), SPELL_STAMPEDE, false);
events.ScheduleEvent(EVENT_STAMPEDE, 15s);
break;
case EVENT_WHIRLING_SLASH:
if (++phaseCounter >= 3)
{
ScheduleEvents(false);
me->CastSpell(me, SPELL_TRANSFORM_TO_RHINO, false);
Talk(SAY_TRANSFORM_1);
phaseCounter = 0;
return;
}
events.ScheduleEvent(EVENT_WHIRLING_SLASH, 21s);
me->CastSpell(me, SPELL_WHIRLING_SLASH, false);
break;
case EVENT_PUNCTURE:
me->CastSpell(me->GetVictim(), SPELL_PUNCTURE, false);
events.ScheduleEvent(EVENT_PUNCTURE, 8s);
break;
case EVENT_ENRAGE:
me->CastSpell(me, SPELL_ENRAGE, false);
events.ScheduleEvent(EVENT_ENRAGE, 20s);
break;
case EVENT_STOMP:
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
me->CastSpell(target, SPELL_STOMP, false);
events.ScheduleEvent(EVENT_STOMP, 20s);
break;
case EVENT_IMPALING_CHARGE:
if (++phaseCounter >= 3)
{
ScheduleEvents(true);
me->CastSpell(me, SPELL_TRANSFORM_TO_TROLL, false);
Talk(SAY_TRANSFORM_2);
phaseCounter = 0;
return;
}
events.ScheduleEvent(EVENT_IMPALING_CHARGE, 21s);
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true, false))
{
me->CastSpell(target, SPELL_IMPALING_CHARGE, false);
impaledList.insert(target->GetGUID());
}
break;
}
DoMeleeAttackIfReady();
}
};
private:
GuidSet impaledList;
ObjectGuid _stampedeVictim;
};
class spell_galdarah_impaling_charge : public SpellScript
@ -265,9 +214,7 @@ class spell_galdarah_transform : public SpellScript
class achievement_share_the_love : public AchievementCriteriaScript
{
public:
achievement_share_the_love() : AchievementCriteriaScript("achievement_share_the_love")
{
}
achievement_share_the_love() : AchievementCriteriaScript("achievement_share_the_love") { }
bool OnCheck(Player* /*player*/, Unit* target, uint32 /*criteria_id*/) override
{
@ -280,7 +227,7 @@ public:
void AddSC_boss_gal_darah()
{
new boss_gal_darah();
RegisterGundrakCreatureAI(boss_gal_darah);
RegisterSpellScript(spell_galdarah_impaling_charge);
RegisterSpellScript(spell_galdarah_transform);
new achievement_share_the_love();

View File

@ -71,4 +71,6 @@ inline AI* GetGundrakAI(T* obj)
return GetInstanceAI<AI>(obj, GundrakScriptName);
}
#define RegisterGundrakCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetGundrakAI)
#endif

View File

@ -934,7 +934,6 @@ public:
case EVENT_START_PATHING:
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToAll(false);
me->SetWalk(false);
Start(true);
break;
case EVENT_SCOURGE_STRIKE:

View File

@ -128,6 +128,7 @@ struct boss_bjarngrim : public npc_escortAI
AddWaypoint(13, 1281.2f, -26.8f, 33.5f, 0);
AddWaypoint(14, 1262, -26.9f, 33.5f, 0);
me->SetWalk(true);
Start(true, ObjectGuid::Empty, nullptr, false, true);
}

View File

@ -391,7 +391,6 @@ public:
switch (action)
{
case ACTION_START_ESCORT_EVENT:
me->SetWalk(false);
Start(false, ObjectGuid::Empty, 0, true, false);
Talk(SAY_BRANN_ESCORT_START);
me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
@ -457,7 +456,6 @@ public:
door->SetGoState(GO_STATE_READY);
break;
case ACTION_OPEN_DOOR:
me->SetWalk(false);
Start(false, ObjectGuid::Empty, 0, true, false);
SetNextWaypoint(34, false);
SetEscortPaused(false);

View File

@ -1089,6 +1089,7 @@ public:
{
summons.DespawnAll();
_spellTimer = 0;
me->SetWalk(true);
Start(false, ObjectGuid::Empty, nullptr, false, true);
if (Aura* aur = me->AddAura(SPELL_FREYA_DUMMY_YELLOW, me))
{

View File

@ -934,7 +934,6 @@ public:
{
InitWaypoint();
Reset();
me->SetWalk(false);
Start(false);
}
@ -1021,7 +1020,6 @@ public:
{
InitWaypoint();
Reset();
me->SetWalk(false);
Start(false);
SetDespawnAtEnd(false);
}

View File

@ -937,7 +937,6 @@ public:
{
InitWaypoint();
Reset();
me->SetWalk(false);
Start(false, ObjectGuid::Empty, nullptr, false, true);
}

View File

@ -372,7 +372,6 @@ struct violet_hold_trashAI : public npc_escortAI
break;
}
SetDespawnAtEnd(false);
me->SetWalk(false);
Start(true);
}
@ -1112,7 +1111,6 @@ public:
break;
}
SetDespawnAtEnd(false);
me->SetWalk(false);
Start(true);
}

View File

@ -464,7 +464,10 @@ public:
go->UseDoorOrButton();
if (npc_escortAI* pEscortAI = CAST_AI(npc_lurgglbr::npc_lurgglbrAI, creature->AI()))
{
creature->SetWalk(true);
pEscortAI->Start(true, player->GetGUID());
}
creature->SetFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A_PASSIVE : FACTION_ESCORTEE_H_PASSIVE);
return true;
@ -914,6 +917,7 @@ public:
creature->SetFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A_PASSIVE : FACTION_ESCORTEE_H_PASSIVE);
creature->SetStandState(UNIT_STAND_STATE_STAND);
creature->AI()->Talk(SAY_1, player);
creature->SetWalk(true);
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, player->GetGUID());
}
return true;
@ -959,7 +963,7 @@ public:
Talk(SAY_5);
me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
player->GroupEventHappens(QUEST_ESCAPING_THE_MIST, me);
SetRun(true);
me->SetWalk(false);
break;
}
}
@ -995,7 +999,6 @@ public:
{
creature->SetStandState(UNIT_STAND_STATE_STAND);
creature->AI()->Talk(SAY_BONKER_2, player);
creature->SetWalk(false);
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, player->GetGUID());
}
return true;

View File

@ -191,6 +191,7 @@ public:
if (quest->GetQuestId() == QUEST_TRAIL_OF_FIRE)
{
creature->SetFaction(player->GetTeamId() == TEAM_ALLIANCE ? FACTION_ESCORTEE_A_PASSIVE : FACTION_ESCORTEE_H_PASSIVE);
creature->SetWalk(true);
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, player->GetGUID());
}
return true;
@ -238,7 +239,7 @@ public:
{
case 1:
me->SetReactState(REACT_AGGRESSIVE);
SetRun(true);
me->SetWalk(false);
break;
case 23:
player->GroupEventHappens(QUEST_TRAIL_OF_FIRE, me);
@ -247,32 +248,32 @@ public:
case 5:
if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER, 10.0f))
Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false);
SetRun(false);
me->SetWalk(true);
break;
case 6:
if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER, 10.0f))
Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false);
SetRun(true);
me->SetWalk(false);
break;
case 8:
if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER, 10.0f))
Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false);
SetRun(false);
me->SetWalk(true);
break;
case 9:
if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER, 10.0f))
Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false);
break;
case 10:
SetRun(true);
me->SetWalk(false);
break;
case 13:
SetRun(false);
me->SetWalk(true);
break;
case 14:
if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER, 10.0f))
Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false);
SetRun(true);
me->SetWalk(false);
break;
}
}

View File

@ -715,6 +715,7 @@ public:
Talk(0);
events.Reset();
summons.DespawnAll();
me->SetWalk(true);
Start(false);
int8 i = -1;

View File

@ -605,6 +605,7 @@ public:
creature->GetMotionMaster()->MoveJumpTo(0, 0.4f, 0.4f);
creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
creature->SetWalk(true);
pEscortAI->Start(false, player->GetGUID());
creature->AI()->Talk(SAY_WP_1);
}

View File

@ -57,7 +57,6 @@ struct npc_frosthound : public npc_escortAI
{
me->SetFaction(who->GetFaction());
me->CastSpell(me, SPELL_SUMMON_PURSUERS_PERIODIC, true);
me->SetWalk(false);
Start(false, who->GetGUID());
Talk(TALK_EMOTE_FROSTHOUND_SNIFF, me);
}
@ -247,7 +246,6 @@ public:
void RollPath()
{
me->SetEntry(NPC_TIME_LOST_PROTO_DRAKE);
me->SetWalk(false);
Start(true, ObjectGuid::Empty, 0, false, true, true);
SetNextWaypoint(urand(0, 250), true);
me->UpdateEntry(roll_chance_i(25) ? NPC_TIME_LOST_PROTO_DRAKE : NPC_VYRAGOSA, 0, false);

View File

@ -171,7 +171,10 @@ public:
npc_ancestral_wolfAI(Creature* creature) : npc_escortAI(creature)
{
if (creature->GetOwner() && creature->GetOwner()->IsPlayer())
{
creature->SetWalk(true);
Start(false, creature->GetOwner()->GetGUID());
}
creature->SetSpeed(MOVE_WALK, 1.5f);
DoCast(SPELL_GUIDED_BY_THE_SPIRITS);
Reset();
@ -312,7 +315,8 @@ public:
{
me->SetReactState(REACT_AGGRESSIVE);
me->SetFaction(FACTION_ESCORTEE_H_PASSIVE);
npc_escortAI::Start(true, player->GetGUID());
me->SetWalk(true);
Start(true, player->GetGUID());
}
}

View File

@ -65,6 +65,7 @@ public:
{
creature->SetStandState(UNIT_STAND_STATE_STAND);
creature->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE);
creature->SetWalk(true);
EscortAI->Start(true, player->GetGUID(), quest);
creature->AI()->Talk(SAY_MAG_START);
@ -133,7 +134,7 @@ public:
if (Player* player = GetPlayerForEscort())
player->GroupEventHappens(QUEST_TOTEM_KARDASH_H, me);
SetRun(true);
me->SetWalk(false);
break;
}
}
@ -306,6 +307,7 @@ public:
void SetGUID(ObjectGuid const& guid, int32 /*questId*/) override
{
me->SetStandState(UNIT_STAND_STATE_STAND);
me->SetWalk(true);
Start(true, guid);
Talk(SAY_KUR_START);
@ -361,7 +363,7 @@ public:
if (Player* player = GetPlayerForEscort())
player->GroupEventHappens(QUEST_TOTEM_KARDASH_A, me);
SetRun(true);
me->SetWalk(false);
break;
}
}

View File

@ -103,7 +103,6 @@ public:
{
if (type == DATA_START_ENCOUNTER)
{
me->SetWalk(false);
Start(true, playerGUID);
SetEscortPaused(true);
started = true;
@ -606,6 +605,7 @@ public:
creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
creature->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
creature->AI()->Talk(SAY_BESSY_0);
creature->SetWalk(true);
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, player->GetGUID());
}
return true;
@ -772,6 +772,7 @@ public:
if (npc_maxx_a_million_escortAI* pEscortAI = CAST_AI(npc_maxx_a_million_escort::npc_maxx_a_million_escortAI, creature->AI()))
{
creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
creature->SetWalk(true);
pEscortAI->Start(false, player->GetGUID());
}
}

View File

@ -246,7 +246,10 @@ public:
Player* player = summoner->ToPlayer();
if (player && player->GetQuestStatus(10211) == QUEST_STATUS_INCOMPLETE)
{
me->SetWalk(true);
Start(false, summoner->GetGUID());
}
}
void Reset() override { }

View File

@ -473,6 +473,7 @@ public:
{
if (quest->GetQuestId() == QUEST_EFTW_H || quest->GetQuestId() == QUEST_EFTW_A)
{
creature->SetWalk(true);
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, player->GetGUID());
creature->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE);
}