mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
fix(Scripts/Quest): Use Correct Summon Spells for Webbed Creature in Bloodmyst Isle (#26838)
This commit is contained in:
@@ -0,0 +1,18 @@
|
|||||||
|
--
|
||||||
|
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 17681;
|
||||||
|
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 17681);
|
||||||
|
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
|
||||||
|
(17681, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 0, 0, 80, 1768100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Expedition Researcher - On Just Summoned - Run Script'),
|
||||||
|
(17681, 0, 1, 0, 34, 0, 100, 0, 8, 1, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Expedition Researcher - On Reached Point - Despawn Instant');
|
||||||
|
|
||||||
|
DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 1768100);
|
||||||
|
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
|
||||||
|
(1768100, 9, 0, 0, 0, 0, 100, 0, 1200, 1200, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Expedition Researcher - Actionlist - Say Line'),
|
||||||
|
(1768100, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 69, 1, 0, 0, 0, 1, 0, 8, 0, 0, 0, 0, -1592.8748, -10851.978, 57.814125, 0, 'Expedition Researcher - Actionlist - Move To Position');
|
||||||
|
|
||||||
|
DELETE FROM `creature_text` WHERE (`CreatureID` = 17681);
|
||||||
|
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
|
||||||
|
(17681, 0, 0, 'We\'re free! We\'re free!', 12, 7, 100, 0, 0, 0, 14346, 0, 'Expedition Researcher'),
|
||||||
|
(17681, 0, 1, 'Woot! Thanks!', 12, 7, 100, 0, 0, 0, 14347, 0, 'Expedition Researcher'),
|
||||||
|
(17681, 0, 2, 'By the forehead signet of Velen, I am saved!', 12, 7, 100, 0, 0, 0, 14348, 0, 'Expedition Researcher'),
|
||||||
|
(17681, 0, 3, 'I knew Cornelius wouldn\'t leave us behind!', 12, 7, 100, 0, 0, 0, 14349, 0, 'Expedition Researcher');
|
||||||
@@ -23,12 +23,13 @@
|
|||||||
## npc_webbed_creature
|
## npc_webbed_creature
|
||||||
######*/
|
######*/
|
||||||
|
|
||||||
//possible creatures to be spawned
|
|
||||||
uint32 const possibleSpawns[32] = {17322, 17661, 17496, 17522, 17340, 17352, 17333, 17524, 17654, 17348, 17339, 17345, 17353, 17336, 17550, 17330, 17701, 17321, 17325, 17320, 17683, 17342, 17715, 17334, 17341, 17338, 17337, 17346, 17344, 17327};
|
|
||||||
|
|
||||||
enum WebbedCreature
|
enum WebbedCreature
|
||||||
{
|
{
|
||||||
NPC_EXPEDITION_RESEARCHER = 17681
|
SPELL_FREE_WEBBED_CREATURE_HOSTILE_START = 30954,
|
||||||
|
SPELL_FREE_WEBBED_CREATURE_HOSTILE_END = 30963,
|
||||||
|
SPELL_FREE_WEBBED_CREATURE_RESEARCHER = 31010,
|
||||||
|
|
||||||
|
NPC_EXPEDITION_RESEARCHER = 17681
|
||||||
};
|
};
|
||||||
|
|
||||||
class npc_webbed_creature : public CreatureScript
|
class npc_webbed_creature : public CreatureScript
|
||||||
@@ -44,39 +45,20 @@ public:
|
|||||||
|
|
||||||
void JustEngagedWith(Unit* /*who*/) override { }
|
void JustEngagedWith(Unit* /*who*/) override { }
|
||||||
|
|
||||||
void JustDied(Unit* killer) override
|
void JustDied(Unit* /*killer*/) override
|
||||||
{
|
{
|
||||||
uint32 spawnCreatureID = 0;
|
|
||||||
|
|
||||||
switch (urand(0, 2))
|
switch (urand(0, 2))
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
if (Player* player = killer->ToPlayer())
|
me->CastSpell(me, SPELL_FREE_WEBBED_CREATURE_RESEARCHER, true);
|
||||||
{
|
if (Player* player = me->GetLootRecipient())
|
||||||
player->KilledMonsterCredit(NPC_EXPEDITION_RESEARCHER);
|
player->RewardPlayerAndGroupAtEvent(NPC_EXPEDITION_RESEARCHER, player);
|
||||||
}
|
|
||||||
else if (killer->IsPet())
|
|
||||||
{
|
|
||||||
if (Unit* owner = killer->GetOwner())
|
|
||||||
{
|
|
||||||
if (owner->IsPlayer())
|
|
||||||
{
|
|
||||||
owner->ToPlayer()->KilledMonsterCredit(NPC_EXPEDITION_RESEARCHER);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
spawnCreatureID = NPC_EXPEDITION_RESEARCHER;
|
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
spawnCreatureID = possibleSpawns[urand(0, 30)];
|
me->CastSpell(me, urand(SPELL_FREE_WEBBED_CREATURE_HOSTILE_START, SPELL_FREE_WEBBED_CREATURE_HOSTILE_END), true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spawnCreatureID)
|
|
||||||
{
|
|
||||||
me->SummonCreature(spawnCreatureID, 0.0f, 0.0f, 0.0f, me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user