Created
February 11, 2017 18:23
-
-
Save MRezaSafari/06774b8ea0bd4c2d96ebc32c3df80224 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Error C2143 syntax error: missing ';' before ')' | |
Error C2143 syntax error: missing ';' before ')' | |
Error C2143 syntax error: missing ';' before ')' | |
Error C2143 syntax error: missing ';' before ')' | |
Error C2143 syntax error: missing ';' before ')' | |
Error C2143 syntax error: missing ';' before ')' | |
Error C2061 syntax error: identifier 'DelayedSpellCastEvent' | |
Error C2061 syntax error: identifier 'DelayedSpellCastEvent' | |
Error C2061 syntax error: identifier 'DelayedSpellCastEvent' | |
Error C2061 syntax error: identifier 'DelayedSpellCastEvent' | |
Error C2061 syntax error: identifier 'DelayedSpellCastEvent' | |
Error C2061 syntax error: identifier 'DelayedSpellCastEvent' | |
Error C2059 syntax error: ')' | |
Error C2059 syntax error: ')' | |
Error C2059 syntax error: ')' | |
Error C2059 syntax error: ')' | |
Error C2059 syntax error: ')' | |
Error C2059 syntax error: ')' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void HandleOnCast() | |
{ | |
Player* _player = GetCaster()->ToPlayer(); | |
if (!GetCaster()->HasAura(AURA_1)) | |
return; | |
switch (GetSpellInfo()->Id) | |
{ | |
case 8867: | |
_player->m_Events.AddEvent(new DelayedSpellCastEvent(_player, GetExplTargetUnit(), 1050), _player->m_Events.CalculateTime(200)); | |
_player->m_Events.AddEvent(new DelayedSpellCastEvent(_player, GetExplTargetUnit(), 1050), _player->m_Events.CalculateTime(400)); | |
break; | |
case 8868: | |
_player->m_Events.AddEvent(new DelayedSpellCastEvent(_player, GetExplTargetUnit(), 1051), _player->m_Events.CalculateTime(200)); | |
_player->m_Events.AddEvent(new DelayedSpellCastEvent(_player, GetExplTargetUnit(), 1051), _player->m_Events.CalculateTime(400)); | |
break; | |
case 8869: | |
_player->m_Events.AddEvent(new DelayedSpellCastEvent(_player, GetExplTargetUnit(), 1052), _player->m_Events.CalculateTime(200)); | |
_player->m_Events.AddEvent(new DelayedSpellCastEvent(_player, GetExplTargetUnit(), 1052), _player->m_Events.CalculateTime(400)); | |
break; | |
} | |
} | |
------------- | |
class DelayedSpellCastEvent : public BasicEvent | |
{ | |
public: | |
DelayedSpellCastEvent(Player* player, Unit* target, uint32 spellId) : | |
_caster(player), _target(target), _spellId(spellId) { } | |
bool Execute(uint64 /*time*/, uint32 /*diff*/) | |
{ | |
if (_caster && _target) | |
_caster->CastSpell(_target, _spellId, true); | |
return true; | |
} | |
private: | |
Player* _caster; | |
Unit* _target; | |
uint32 _spellId; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment