Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Wolves : public CreatureScript
- {
- public:
- Wolves() : CreatureScript("Wolves") { }
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
- {
- //if(quest->GetQuestId() != 19005)
- //return false;
- Creature* Tevelvka = Unit::GetCreature(*creature, MAKE_NEW_GUID(280753, 11115, HIGHGUID_UNIT));
- Creature* Axchorak = Unit::GetCreature(*creature, MAKE_NEW_GUID(277762, 54676, HIGHGUID_UNIT));
- Creature* Dimka = Unit::GetCreature(*creature, MAKE_NEW_GUID(280752, 111162, HIGHGUID_UNIT));
- Creature* E = Unit::GetCreature(*creature, MAKE_NEW_GUID(277764, 87787, HIGHGUID_UNIT));
- std::list<Creature*> list;
- creature->GetCreatureListWithEntryInGrid(list, 46457, 500); // get all creatures with entry within 500 yards
- if(E)
- list.push_back(E);
- /*
- Creature* D = Unit::GetCreature(*creature, MAKE_NEW_GUID(280771, 46457, HIGHGUID_UNIT));
- Creature* C = Unit::GetCreature(*creature, MAKE_NEW_GUID(280763, 46457, HIGHGUID_UNIT));
- Creature* B = Unit::GetCreature(*creature, MAKE_NEW_GUID(280761, 46457, HIGHGUID_UNIT));
- Creature* A = Unit::GetCreature(*creature, MAKE_NEW_GUID(280775, 46457, HIGHGUID_UNIT));
- */
- if (!Tevelvka) return false;
- if (!Axchorak) return false;
- if (!Dimka) return false;
- /*
- if (!E) return false;
- if (!D) return false;
- if (!C) return false;
- if (!B) return false;
- if (!A) return false;
- */
- // add timed events to the creatures:
- new TimedMessage(Axchorak, "Theyre coming..", CHAT_TYPE_SAY, 1000);
- new TimedAction(Axchorak, 12166, 1000);
- new TimedMessage(Axchorak, "Their forces has crossed the road of Bronze, time is up the essence Captains", CHAT_TYPE_SAY, 4000);
- new TimedMessage(Tevelvka, "Well then SLUGS!... are you ready to chop some human's head?", CHAT_TYPE_SAY, 7000);
- new TimedAction(Tevelvka, 8574, 7000);
- new TimedMessage(Dimka , "Ready boys! we ride for glory and honour... LOKTAR OGAR!", CHAT_TYPE_SAY, 9000);
- new TimedAction(Dimka, 6943, 9000);
- new TimedAction(Dimka, 8574, 9000);
- for (std::list<Creature*>::const_iterator it = list.begin(); it != list.end(); ++it)
- new TimedMessage(*it, "LOKTAR OGAR", CHAT_TYPE_SAY, 10000);
- new TimedMessage(Dimka, "RIDE WITH ME, RIDE TO OUR DEATH, FOR THE HORDE!", CHAT_TYPE_SAY, 14000);
- return true;
- }
- bool OnQuestSelect(Player* player, Creature* creature, Quest const* quest)
- {
- //if (quest->GetQuestId() != 19005)
- // return false;
- return true;
- }
- bool OnQuestComplete(Player* player, Creature* creature, Quest const* quest)
- {
- //if (quest->GetQuestId() != 19005)
- //return false;
- player->SetPhaseMask(16, true);
- return true;
- }
- struct TimedMessage : public BasicEvent
- {
- TimedMessage(Creature* creature, const char* text, ChatType type, uint32 delay) : _creature(creature), _text(text), _type(type)
- {
- creature->m_Events.AddEvent(this, creature->m_Events.CalculateTime(delay));
- }
- bool Execute(uint64 time, uint32 diff)
- {
- switch (_type)
- {
- case CHAT_TYPE_SAY:
- _creature->MonsterSay(_text, LANG_UNIVERSAL, 0);
- break;
- case CHAT_TYPE_YELL:
- _creature->MonsterYell(_text, LANG_UNIVERSAL, 0);
- break;
- }
- return true;
- }
- Creature* _creature;
- const char* _text;
- ChatType _type;
- };
- struct TimedAction : public BasicEvent
- {
- TimedAction(Creature* creature, uint32 sound_id, uint32 delay) : _creature(creature), _sound_id(sound_id)
- {
- creature->m_Events.AddEvent(this, creature->m_Events.CalculateTime(delay));
- }
- bool Execute(uint64 time, uint32 diff)
- {
- _creature->PlayDirectSound(_sound_id);
- return true;
- }
- Creature* _creature;
- uint32 _sound_id;
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement