Script/Creature: implement spell effect for the item Prototype Neural Needler used on Imprisoned Beryl Sorcerer (#23349)

* Script/Creature: implement spell effect for the item Prototype Neural Needler used on Imprisoned Beryl Sorcerer.

* Rename 9999_99_99_99_world.sql to 2019_06_03_02_world.sql

(cherry picked from commit eb5d1d3248)
This commit is contained in:
Wyrserth
2019-06-03 19:49:35 +02:00
committed by Shauren
parent 34b52c6d26
commit 647893597c
2 changed files with 50 additions and 44 deletions

View File

@@ -0,0 +1,24 @@
DELETE FROM `creature_text` WHERE `CreatureID`=25478;
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
(25478, 0, 0, "Pathetic fool! A servant of Malygos would sooner die than aid an enemy....", 15, 0, 100, 0, 0, 0, 24735, 0, "Imprisoned Beryl Sorcerer"),
(25478, 1, 0, "Aargh! Do your worst, $c! I'll tell you NOTHING!", 15, 0, 100, 0, 0, 0, 24736, 0, "Imprisoned Beryl Sorcerer"),
(25478, 2, 0, "Aahhhh! Release me! I am of no use to you. I swear it!", 15, 0, 100, 0, 0, 0, 24737, 0, "Imprisoned Beryl Sorcerer"),
(25478, 3, 0, "Stop! I beg you, please stop. Please....", 15, 0, 100, 0, 0, 0, 24738, 0, "Imprisoned Beryl Sorcerer"),
(25478, 4, 0, "Alright! I am beaten. Your precious archmage is held in a prison, elevated and sealed. Even if you manage to reach her, Salrand herself holds the key. Your mission is folly!", 15, 0, 100, 0, 0, 0, 24739, 0, "Imprisoned Beryl Sorcerer"),
(25478, 5, 0, "Enough! I've told you all that I know. Your continued abuse is senseless!", 15, 0, 100, 0, 0, 0, 24740, 0, "Imprisoned Beryl Sorcerer"),
(25478, 6, 0, "Noooo! This torture is inhumane! You have what you want... why don't you just kill me?", 15, 0, 100, 0, 0, 0, 24755, 0, "Imprisoned Beryl Sorcerer"),
(25478, 7, 0, "I've given you the information, $r! You're wasting your time....", 15, 0, 100, 0, 0, 0, 24756, 0, "Imprisoned Beryl Sorcerer"),
(25478, 8, 0, "What more can you possibly want, $r?", 15, 0, 100, 0, 0, 0, 26307, 0, "Imprisoned Beryl Sorcerer"),
(25478, 9, 0, "Aargh!!", 15, 0, 100, 0, 0, 0, 26308, 0, "Imprisoned Beryl Sorcerer"),
(25478, 10, 0, "Stop! Please...", 15, 0, 100, 0, 0, 0, 26309, 0, "Imprisoned Beryl Sorcerer"),
(25478, 11, 0, "Why are you here?", 15, 0, 100, 0, 0, 0, 26310, 0, "Imprisoned Beryl Sorcerer"),
(25478, 12, 0, "How can you possibly bring me lower?", 15, 0, 100, 0, 0, 0, 26311, 0, "Imprisoned Beryl Sorcerer"),
(25478, 13, 0, "What more can you take away from me?", 15, 0, 100, 0, 0, 0, 26312, 0, "Imprisoned Beryl Sorcerer"),
(25478, 14, 0, "You've got a darkness in you, $r.", 15, 0, 100, 0, 0, 0, 26313, 0, "Imprisoned Beryl Sorcerer"),
(25478, 15, 0, "You aren't even asking me questions...", 15, 0, 100, 0, 0, 0, 26314, 0, "Imprisoned Beryl Sorcerer"),
(25478, 16, 0, "Are you trying to meet the real me?", 15, 0, 100, 0, 0, 0, 26315, 0, "Imprisoned Beryl Sorcerer"),
(25478, 17, 0, "You have shown me the face of true evil, $n.", 15, 0, 100, 0, 0, 0, 26316, 0, "Imprisoned Beryl Sorcerer");
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=9488 AND `SourceEntry`=0;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(15, 9488, 0, 0, 0, 8, 0, 11648, 0, 0, 0, 0, 0, "", "Gossip option 0 is only available if quest 'The Art of Persuasion' is rewarded");

View File

@@ -1526,17 +1526,14 @@ public:
######*/
enum ImprisionedBerylSorcerer
{
SPELL_NEURAL_NEEDLE = 45634,
SPELL_NEURAL_NEEDLE = 45634,
SPELL_PROTOTYPE_NEURAL_NEEDLE = 48252,
SPELL_NEURAL_NEEDLE_IMPACT = 45702,
SPELL_PROTOTYPE_NEURAL_NEEDLE_IMPACT = 48254,
NPC_IMPRISONED_BERYL_SORCERER = 25478,
NPC_IMPRISONED_BERYL_SORCERER = 25478,
SAY_IMPRISIONED_BERYL_1 = 0,
SAY_IMPRISIONED_BERYL_2 = 1,
SAY_IMPRISIONED_BERYL_3 = 2,
SAY_IMPRISIONED_BERYL_4 = 3,
SAY_IMPRISIONED_BERYL_5 = 4,
SAY_IMPRISIONED_BERYL_6 = 5,
SAY_IMPRISIONED_BERYL_7 = 6
QUEST_THE_ART_OF_PERSUASION = 11648
};
class npc_imprisoned_beryl_sorcerer : public CreatureScript
@@ -1573,9 +1570,7 @@ public:
if (rebuff <= diff)
{
if (!me->HasAura(SPELL_COSMETIC_ENSLAVE_CHAINS_SELF))
{
DoCast(me, SPELL_COSMETIC_ENSLAVE_CHAINS_SELF);
}
rebuff = 180000;
}
else
@@ -1590,42 +1585,29 @@ public:
void SpellHit(Unit* unit, SpellInfo const* spell) override
{
if (spell->Id == SPELL_NEURAL_NEEDLE && unit->GetTypeId() == TYPEID_PLAYER)
if (Player* player = unit->ToPlayer())
GotStinged(player->GetGUID());
if ((spell->Id == SPELL_NEURAL_NEEDLE || spell->Id == SPELL_PROTOTYPE_NEURAL_NEEDLE) && unit->GetTypeId() == TYPEID_PLAYER)
GotStinged(unit->ToPlayer(), spell->Id);
}
void GotStinged(ObjectGuid casterGUID)
void GotStinged(Player* caster, uint32 spellId)
{
if (Player* caster = ObjectAccessor::GetPlayer(*me, casterGUID))
{
uint32 step = caster->GetAuraCount(SPELL_NEURAL_NEEDLE) + 1;
switch (step)
{
case 1:
Talk(SAY_IMPRISIONED_BERYL_1);
break;
case 2:
Talk(SAY_IMPRISIONED_BERYL_2, caster);
break;
case 3:
Talk(SAY_IMPRISIONED_BERYL_3);
break;
case 4:
Talk(SAY_IMPRISIONED_BERYL_4);
break;
case 5:
Talk(SAY_IMPRISIONED_BERYL_5);
caster->KilledMonsterCredit(NPC_IMPRISONED_BERYL_SORCERER);
break;
case 6:
Talk(SAY_IMPRISIONED_BERYL_6, caster);
break;
case 7:
Talk(SAY_IMPRISIONED_BERYL_7);
break;
}
}
DoCastSelf(spellId == SPELL_NEURAL_NEEDLE ? SPELL_NEURAL_NEEDLE_IMPACT : SPELL_PROTOTYPE_NEURAL_NEEDLE_IMPACT);
// Event cannot happen if quest is not accepted/completed/rewarded
if (caster->GetQuestStatus(QUEST_THE_ART_OF_PERSUASION) == QUEST_STATUS_NONE)
return;
uint32 step = 0;
if (spellId == SPELL_NEURAL_NEEDLE)
step = caster->GetAuraCount(SPELL_NEURAL_NEEDLE); // Text IDs 0-6
else
step = caster->GetAuraCount(SPELL_PROTOTYPE_NEURAL_NEEDLE) + 7; // Text IDs 7-18
if (spellId == SPELL_NEURAL_NEEDLE && step == 4)
caster->KilledMonsterCredit(NPC_IMPRISONED_BERYL_SORCERER);
Talk(step, caster);
}
};