Scripts/Eversong Woords: Add cosmetic script for a party (#28308)

This commit is contained in:
Malcrom
2022-10-04 05:24:54 -03:00
committed by GitHub
parent 5ffe5bd43a
commit 0174e6ba80
3 changed files with 279 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
-- Add Missing gossip text
DELETE FROM `gossip_menu` WHERE `MenuID`=7346 AND `TextID`=8760;
INSERT INTO `gossip_menu` (`MenuID`,`TextID`) VALUES (7346,8760);
-- Conditions for gossip text
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=7346;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(14,7346,8759,0,0,8,0,9067,0,0,1,0,0,'','Show gossip text 8759 if quest ''The Party Never Ends'' is not rewarded'),
(14,7346,8760,0,0,8,0,9067,0,0,0,0,0,'','Show gossip text 8760 if quest ''The Party Never Ends'' is rewarded');
-- Remove hack SAI from Fireworks Launchers
UPDATE `gameobject_template` SET `AIName`='' WHERE `entry`=180771;
DELETE FROM `smart_scripts` WHERE `entryorguid`=180771 AND `source_type`=1;
DELETE FROM `smart_scripts` WHERE `entryorguid`=17056 AND `source_type`=0;
-- Correct facing
UPDATE `creature` SET `orientation`=2.14675498 WHERE `guid`=59449;
-- Correct equipment
UPDATE `creature` SET `equipment_id`=0 WHERE `id`=17056;
-- Correct Addon
UPDATE `creature_addon` SET `bytes1`=0,`bytes2`=1,`emote`=0 WHERE `guid` IN (SELECT `guid` FROM `creature` WHERE `id`=17056);
UPDATE `creature_addon` SET `auras`='42386' WHERE `guid` IN (59434);
-- Move start location
UPDATE `creature` SET `position_x`=8679.53,`position_y`=-6342.703,`position_z`=55.914032,`orientation`=6.2308254 WHERE `guid`=59444;
-- Add Missing meat equipment
DELETE FROM `creature_equip_template` WHERE `CreatureID`=17056 AND `ID`=2;
INSERT INTO `creature_equip_template` (`CreatureID`,`ID`,`ItemID1`,`ItemID2`,`ItemID3`,`VerifiedBuild`) VALUES (17056,2,2202,0,0,0);
-- Pathing for Eversong Partygoer Entry: 17056
DELETE FROM `waypoint_data` WHERE `id` IN (594440,594441,594442,594443,594444);
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
(594440,1,8680.874,-6340.5757,55.93538,NULL,0,0,0,100,0),
(594440,2,8685.874,-6338.5757,55.94099,NULL,0,0,0,100,0),
(594440,3,8687.746,-6339.301,55.93539,NULL,0,0,0,100,0),
(594440,4,8687.746,-6339.301,55.93539,4.502949,1000,0,0,100,0),
(594441,1,8689.3545,-6332.7295,55.95669,NULL,0,0,0,100,0),
(594441,2,8691,-6332.577,55.95949,NULL,0,0,0,100,0),
(594441,3,8691,-6332.577,55.95949,5.148721,1000,0,0,100,0),
(594442,1,8681.171,-6329.512,55.948093,NULL,0,0,0,100,0),
(594442,2,8681.171,-6329.512,55.948093,2.303835,1000,0,0,100,0),
(594443,1,8675.356,-6334.1494,55.932705,NULL,0,0,0,100,0),
(594443,2,8675.356,-6334.1494,55.932705,3.124139,1000,0,0,100,0),
(594444,1,8678.709,-6342.523,55.915527,NULL,0,0,0,100,0),
(594444,2,8679.53,-6342.703,55.914032,NULL,0,0,0,100,0),
(594444,3,8679.53,-6342.703,55.914032,6.230825,1000,0,0,100,0);
UPDATE `creature` SET `ScriptName`='npc_partygoer_pather' WHERE `guid`=59444;
UPDATE `creature` SET `ScriptName`='npc_partygoer' WHERE `guid` IN (59435,59436,59437,59438,59439,59440,59441,59442,59443,59445,59446,59447,59448,59449);
-- Sempstress Ambershine SAI
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=16366;
DELETE FROM `smart_scripts` WHERE `entryorguid`=16366 AND `source_type`=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`,`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
(16366,0,0,0,1,0,100,0,8000,15000,8000,15000,0,10,1,5,11,18,24,25,1,0,0,0,0,0,0,0,0,'Sempstress Ambershine - OOC - Random Emote');
-- Botanist Tyniarrel SAI
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=16367;
DELETE FROM `smart_scripts` WHERE `entryorguid`=16367 AND `source_type`=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`,`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
(16367,0,0,0,1,0,100,0,8000,15000,8000,15000,0,10,1,5,11,18,24,25,1,0,0,0,0,0,0,0,0,'Botanist Tyniarrel - OOC - Random Emote');

View File

@@ -179,6 +179,7 @@ void AddSC_blasted_lands();
void AddSC_duskwood();
void AddSC_eastern_plaguelands();
void AddSC_elwynn_forest();
void AddSC_eversong_woods();
//void AddSC_ghostlands();
void AddSC_hinterlands();
void AddSC_isle_of_queldanas();
@@ -357,6 +358,7 @@ void AddEasternKingdomsScripts()
AddSC_duskwood();
AddSC_eastern_plaguelands();
AddSC_elwynn_forest();
AddSC_eversong_woods();
//AddSC_ghostlands();
AddSC_hinterlands();
AddSC_isle_of_queldanas();

View File

@@ -0,0 +1,216 @@
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptMgr.h"
#include "GameObject.h"
#include "MotionMaster.h"
#include "ScriptedCreature.h"
enum Partygoer_Pather
{
EVENT_PATH = 1,
EVENT_RANDOM_ACTION_PATHER,
EVENT_REMOVE_EQUIPMENT_PATHER,
EVENT_STOP_DANCING_PATHER,
PATH_FIRST_PATH = 594440,
PATH_LAST_PATH = 594444,
};
struct npc_partygoer_pather : public ScriptedAI
{
npc_partygoer_pather(Creature* creature) : ScriptedAI(creature), _path(PATH_FIRST_PATH) { }
void JustAppeared() override
{
_path = PATH_FIRST_PATH;
_events.ScheduleEvent(EVENT_RANDOM_ACTION_PATHER, 11s, 14s);
}
void WaypointPathEnded(uint32 /*nodeId*/, uint32 /*pathId*/) override
{
++_path;
if (_path > PATH_LAST_PATH)
_path = PATH_FIRST_PATH;
_events.ScheduleEvent(EVENT_RANDOM_ACTION_PATHER, 11s, 14s);
}
void UpdateAI(uint32 diff) override
{
_events.Update(diff);
while (uint32 eventId = _events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_PATH:
me->GetMotionMaster()->MovePath(_path, false);
break;
case EVENT_RANDOM_ACTION_PATHER:
{
int8 action = urand(1, 5);
switch (action)
{
case 1:
me->HandleEmoteCommand(EMOTE_ONESHOT_TALK);
_events.ScheduleEvent(EVENT_PATH, 11s);
break;
case 2:
me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
_events.ScheduleEvent(EVENT_PATH, 11s);
break;
case 3:
me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH);
_events.ScheduleEvent(EVENT_PATH, 11s);
break;
case 4:
me->LoadEquipment(urand(1, 2));
me->HandleEmoteCommand(EMOTE_ONESHOT_EAT_NO_SHEATHE);
_events.ScheduleEvent(EVENT_REMOVE_EQUIPMENT_PATHER, 4s);
break;
case 5:
me->SetEmoteState(EMOTE_STATE_DANCE);
_events.ScheduleEvent(EVENT_STOP_DANCING_PATHER, 6s);
break;
}
break;
}
case EVENT_REMOVE_EQUIPMENT_PATHER:
me->LoadEquipment(0, true);
_events.ScheduleEvent(EVENT_PATH, 8s);
break;
case EVENT_STOP_DANCING_PATHER:
me->SetEmoteState(EMOTE_ONESHOT_NONE);
_events.ScheduleEvent(EVENT_PATH, 5s);
break;
}
}
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
}
private:
EventMap _events;
uint32 _path;
};
enum Partygoer
{
EVENT_RANDOM_ACTION = 1,
EVENT_REMOVE_EQUIPMENT,
EVENT_STOP_DANCING,
EVENT_THROW_FIREWORKS,
EVENT_RESET_FACING,
GO_FIREWORKS_LAUNCHER = 180771,
SPELL_SMALL_YELLOW_ROCKET = 26295
};
struct npc_partygoer : public ScriptedAI
{
npc_partygoer(Creature* creature) : ScriptedAI(creature), _facing(0.0f) { }
void JustAppeared() override
{
_facing = me->GetOrientation();
_events.ScheduleEvent(EVENT_RANDOM_ACTION, 1s, 20s);
}
void UpdateAI(uint32 diff) override
{
_events.Update(diff);
while (uint32 eventId = _events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_RANDOM_ACTION:
{
int8 action = urand(1, 6);
switch (action)
{
case 1:
me->HandleEmoteCommand(EMOTE_ONESHOT_TALK);
_events.ScheduleEvent(EVENT_RANDOM_ACTION, 13s, 20s);
break;
case 2:
me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
_events.ScheduleEvent(EVENT_RANDOM_ACTION, 13s, 20s);
break;
case 3:
me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH);
_events.ScheduleEvent(EVENT_RANDOM_ACTION, 13s, 20s);
break;
case 4:
me->LoadEquipment(urand(1, 2));
me->HandleEmoteCommand(EMOTE_ONESHOT_EAT_NO_SHEATHE);
_events.ScheduleEvent(EVENT_REMOVE_EQUIPMENT, 4s);
break;
case 5:
me->SetEmoteState(EMOTE_STATE_DANCE);
_events.ScheduleEvent(EVENT_STOP_DANCING, 8s, 16s);
break;
case 6:
if (GameObject* launcher = me->FindNearestGameObject(GO_FIREWORKS_LAUNCHER, 20.0f))
me->SetFacingToObject(launcher);
_events.ScheduleEvent(EVENT_THROW_FIREWORKS, 1s);
break;
}
break;
}
case EVENT_REMOVE_EQUIPMENT:
me->LoadEquipment(0, true);
_events.ScheduleEvent(EVENT_RANDOM_ACTION, 10s, 20s);
break;
case EVENT_STOP_DANCING:
me->SetEmoteState(EMOTE_ONESHOT_NONE);
_events.ScheduleEvent(EVENT_RANDOM_ACTION, 10s, 20s);
break;
case EVENT_THROW_FIREWORKS:
me->CastSpell(me, SPELL_SMALL_YELLOW_ROCKET);
_events.ScheduleEvent(EVENT_RESET_FACING, 3s);
break;
case EVENT_RESET_FACING:
me->SetFacingTo(_facing);
_events.ScheduleEvent(EVENT_RANDOM_ACTION, 12s, 20s);
break;
}
}
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
}
private:
EventMap _events;
float _facing;
};
void AddSC_eversong_woods()
{
RegisterCreatureAI(npc_partygoer_pather);
RegisterCreatureAI(npc_partygoer);
}