Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.46 KB | None | 0 0
  1. enum eRaiseTheBarricades
  2. {
  3. NPC_EBON_BLADE_MARKER = 31887,
  4. SPELL_SUMMON_BARRICADE_A = 59922,
  5. SPELL_SUMMON_BARRICADE_B = 59923,
  6. SPELL_SUMMON_BARRICADE_C = 59924,
  7. CREDIT_BARRICADE = 31887
  8. };
  9.  
  10. class spell_q_construct_barricade : public SpellScriptLoader
  11. {
  12. public:
  13. spell_q_construct_barricade() : SpellScriptLoader("spell_q_construct_barricade") { }
  14.  
  15. class spell_q_construct_barricade_SpellScript : public SpellScript
  16. {
  17. public:
  18. PrepareSpellScript(spell_q_construct_barricade_SpellScript)
  19. bool Validate(SpellEntry const * /*spellEntry*/)
  20. {
  21. if (!sSpellStore.LookupEntry(SPELL_SUMMON_BARRICADE_A))
  22. return false;
  23. if (!sSpellStore.LookupEntry(SPELL_SUMMON_BARRICADE_B))
  24. return false;
  25. if (!sSpellStore.LookupEntry(SPELL_SUMMON_BARRICADE_C))
  26. return false;
  27. return true;
  28. }
  29.  
  30. void HandleDummy(SpellEffIndex /*effIndex*/)
  31. {
  32. Unit* pCaster = GetCaster();
  33. if (pCaster->FindNearestCreature(NPC_EBON_BLADE_MARKER, 5.0f))
  34. {
  35. if (pCaster->GetTypeId() == TYPEID_PLAYER)
  36. {
  37. pCaster->ToPlayer()->KilledMonsterCredit(CREDIT_BARRICADE, 0);
  38. switch(urand(0, 2))
  39. {
  40. case 0: pCaster->CastSpell(pCaster, SPELL_SUMMON_BARRICADE_A, true); break;
  41. case 1: pCaster->CastSpell(pCaster, SPELL_SUMMON_BARRICADE_B, true); break;
  42. case 2: pCaster->CastSpell(pCaster, SPELL_SUMMON_BARRICADE_C, true); break;
  43. }
  44. }
  45. }
  46. }
  47.  
  48. void Register()
  49. {
  50. OnEffect += SpellEffectFn(spell_q_construct_barricade_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
  51. }
  52. };
  53.  
  54. SpellScript* GetSpellScript() const
  55. {
  56. return new spell_q_construct_barricade_SpellScript();
  57. }
  58. };
  59.  
  60. /*
  61. -- Raise the Barricades
  62. DELETE FROM spell_script_names WHERE spell_id = 59925;
  63. INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
  64. (59925, 'spell_q_construct_barricade');
  65. DELETE FROM creature_template_addon WHERE entry = 31887;
  66. INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
  67. (31887, 0, 0, 0, 0, 0, '59919 0');
  68. 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);
  69. INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
  70. (122959, 0, 0, 0, 0, 0, '59919 0'),
  71. (122960, 0, 0, 0, 0, 0, '59919 0'),
  72. (122961, 0, 0, 0, 0, 0, '59919 0'),
  73. (122962, 0, 0, 0, 0, 0, '59919 0'),
  74. (122963, 0, 0, 0, 0, 0, '59919 0'),
  75. (122964, 0, 0, 0, 0, 0, '59919 0'),
  76. (122965, 0, 0, 0, 0, 0, '59919 0'),
  77. (122966, 0, 0, 0, 0, 0, '59919 0'),
  78. (122967, 0, 0, 0, 0, 0, '59919 0'),
  79. (122968, 0, 0, 0, 0, 0, '59919 0'),
  80. (122970, 0, 0, 0, 0, 0, '59919 0'),
  81. (122971, 0, 0, 0, 0, 0, '59919 0'),
  82. (122972, 0, 0, 0, 0, 0, '59919 0'),
  83. (122975, 0, 0, 0, 0, 0, '59919 0'),
  84. (122976, 0, 0, 0, 0, 0, '59919 0'),
  85. (122977, 0, 0, 0, 0, 0, '59919 0'),
  86. (122978, 0, 0, 0, 0, 0, '59919 0'),
  87. (122979, 0, 0, 0, 0, 0, '59919 0'),
  88. (122980, 0, 0, 0, 0, 0, '59919 0'),
  89. (122981, 0, 0, 0, 0, 0, '59919 0'),
  90. (122982, 0, 0, 0, 0, 0, '59919 0');
  91. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement