Advertisement
Guest User

Untitled

a guest
Jan 30th, 2015
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. class go_blastenheimer_5000 : public GameObjectScript
  2. {
  3. public:
  4. go_blastenheimer_5000() : GameObjectScript("go_blastenheimer_5000") { }
  5.  
  6. struct go_blastenheimer_5000AI : public GameObjectAI
  7. {
  8. go_blastenheimer_5000AI(GameObject* gameObject) : GameObjectAI(gameObject) { }
  9.  
  10. void OnStateChanged(uint32 state, Unit* /*unit*/)
  11. {
  12. if (state == GO_ACTIVATED)
  13. {
  14. if (Player* player = go->FindNearestPlayer(10.0f))
  15. {
  16. player->CastSpell(player, 24832, true);
  17. player->SetMovement(MOVE_ROOT);
  18. player->NearTeleportTo(-1326.711914f, 86.301125f, 133.093918f, 3.510725f, true);
  19. respawnInFlow = true;
  20. }
  21. _respawnTimer = 2500;
  22. }
  23. }
  24.  
  25. void UpdateAI(uint32 diff)
  26. {
  27. if (!respawnInFlow)
  28. return;
  29.  
  30. if (_respawnTimer <= diff)
  31. {
  32. if (Player* player = go->FindNearestPlayer(10.0f))
  33. {
  34. player->SetMovement(MOVE_UNROOT);
  35. player->CastSpell(player, 42867, true);
  36. respawnInFlow = false;
  37. }
  38. }
  39. else _respawnTimer -= diff;
  40. }
  41. private:
  42. uint32 _respawnTimer;
  43. bool respawnInFlow;
  44. };
  45.  
  46. GameObjectAI* GetAI(GameObject* go) const
  47. {
  48. return new go_blastenheimer_5000AI(go);
  49. }
  50. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement