Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum eRaiseTheBarricades
- {
- NPC_EBON_BLADE_MARKER = 31887,
- SPELL_SUMMON_BARRICADE_A = 59922,
- SPELL_SUMMON_BARRICADE_B = 59923,
- SPELL_SUMMON_BARRICADE_C = 59924,
- CREDIT_BARRICADE = 31887
- };
- class spell_q_construct_barricade : public SpellScriptLoader
- {
- public:
- spell_q_construct_barricade() : SpellScriptLoader("spell_q_construct_barricade") { }
- class spell_q_construct_barricade_SpellScript : public SpellScript
- {
- public:
- PrepareSpellScript(spell_q_construct_barricade_SpellScript)
- bool Validate(SpellEntry const * /*spellEntry*/)
- {
- if (!sSpellStore.LookupEntry(SPELL_SUMMON_BARRICADE_A))
- return false;
- if (!sSpellStore.LookupEntry(SPELL_SUMMON_BARRICADE_B))
- return false;
- if (!sSpellStore.LookupEntry(SPELL_SUMMON_BARRICADE_C))
- return false;
- return true;
- }
- void HandleDummy(SpellEffIndex /*effIndex*/)
- {
- Unit* pCaster = GetCaster();
- if (pCaster->FindNearestCreature(NPC_EBON_BLADE_MARKER, 5.0f))
- {
- if (pCaster->GetTypeId() == TYPEID_PLAYER)
- {
- pCaster->ToPlayer()->KilledMonsterCredit(CREDIT_BARRICADE, 0);
- switch(urand(0, 2))
- {
- case 0: pCaster->CastSpell(pCaster, SPELL_SUMMON_BARRICADE_A, true); break;
- case 1: pCaster->CastSpell(pCaster, SPELL_SUMMON_BARRICADE_B, true); break;
- case 2: pCaster->CastSpell(pCaster, SPELL_SUMMON_BARRICADE_C, true); break;
- }
- }
- }
- }
- void Register()
- {
- OnEffect += SpellEffectFn(spell_q_construct_barricade_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
- }
- };
- SpellScript* GetSpellScript() const
- {
- return new spell_q_construct_barricade_SpellScript();
- }
- };
- /*
- -- Raise the Barricades
- DELETE FROM spell_script_names WHERE spell_id = 59925;
- INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
- (59925, 'spell_q_construct_barricade');
- DELETE FROM creature_template_addon WHERE entry = 31887;
- INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
- (31887, 0, 0, 0, 0, 0, '59919 0');
- DELETE FROM creature_addon WHERE guid IN(122959,122960,122961,122962,122963,122964,122965,122966,122967,122968,122970,122971,122972,122975,122976,122977,122978,122979,122980,122981,122982);
- INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
- (122959, 0, 0, 0, 0, 0, '59919 0'),
- (122960, 0, 0, 0, 0, 0, '59919 0'),
- (122961, 0, 0, 0, 0, 0, '59919 0'),
- (122962, 0, 0, 0, 0, 0, '59919 0'),
- (122963, 0, 0, 0, 0, 0, '59919 0'),
- (122964, 0, 0, 0, 0, 0, '59919 0'),
- (122965, 0, 0, 0, 0, 0, '59919 0'),
- (122966, 0, 0, 0, 0, 0, '59919 0'),
- (122967, 0, 0, 0, 0, 0, '59919 0'),
- (122968, 0, 0, 0, 0, 0, '59919 0'),
- (122970, 0, 0, 0, 0, 0, '59919 0'),
- (122971, 0, 0, 0, 0, 0, '59919 0'),
- (122972, 0, 0, 0, 0, 0, '59919 0'),
- (122975, 0, 0, 0, 0, 0, '59919 0'),
- (122976, 0, 0, 0, 0, 0, '59919 0'),
- (122977, 0, 0, 0, 0, 0, '59919 0'),
- (122978, 0, 0, 0, 0, 0, '59919 0'),
- (122979, 0, 0, 0, 0, 0, '59919 0'),
- (122980, 0, 0, 0, 0, 0, '59919 0'),
- (122981, 0, 0, 0, 0, 0, '59919 0'),
- (122982, 0, 0, 0, 0, 0, '59919 0');
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement