Example #1
0
// War is Hell
bool WarIsHell(uint32 i, Spell* pSpell)
{
	if( !pSpell->u_caster->IsPlayer() )
		return true;

	Player* plr = TO_PLAYER(pSpell->u_caster);
	if( plr == NULL )
		return true;

	Creature* target = TO_CREATURE(plr->GetMapMgr()->GetInterface()->GetCreatureNearestCoords( plr->GetPositionX(), plr->GetPositionY() , plr->GetPositionZ(), 24008 ));
	if( target == NULL )
		return true;

	QuestLogEntry *qle = plr->GetQuestLogForEntry(11270);
  
	if( qle == NULL )
		return true;
 
	GameObject* obj = NULL;

	sEAS.KillMobForQuest( plr, qle, 0 );

	obj = sEAS.SpawnGameobject(plr, 183816, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), 1, 0, 0, 0, 0);
	sEAS.GameobjectDelete(obj, 1*30*1000);

	target->Despawn( 2000, 60*1000 );
	plr->UpdateNearbyGameObjects();
	qle->UpdatePlayerFields();
	return true;
}
Example #2
0
bool FilledShimmeringVessel(uint32 i, Spell* pSpell) // Blood Elf ress. quest
{
	if(!pSpell->u_caster->IsPlayer())
		return true;

	Player *plr = (Player*)pSpell->u_caster;

	Creature *target = plr->GetMapMgr()->GetCreature((uint32)plr->GetSelection());
	if(target == NULL)
		return true;

	if(target->GetEntry() != 17768)
		return true;

	QuestLogEntry *qle = plr->GetQuestLogForEntry(9685);
	if(qle == NULL)
		return true;

	target->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
	target->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);

	target->Despawn(10*1000, 1*60*1000);

	target->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Thank you, dear Paladin, you just saved my life.");

	qle->SetMobCount(0, 1);
	qle->SendUpdateAddKill(0);
	qle->UpdatePlayerFields();

	return true;
}
Example #3
0
   void GossipHello(Object *pObject, Player *Plr, bool AutoSend)
   {
      QuestLogEntry *en = Plr->GetQuestLogForEntry(5211);

      if(en && en->GetMobCount(0) < en->GetQuest()->required_mobcount[0])
      {
        uint32 newcount = en->GetMobCount(0) + 1;

        en->SetMobCount(0, newcount);
        en->SendUpdateAddKill(0);
        en->UpdatePlayerFields();
      }
   
      GossipMenu *Menu;
      objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 3873, Plr);

      if(AutoSend)
         Menu->SendTo(Plr);

      if(!pObject->IsCreature())
        return;

      Creature *Spirit = static_cast<Creature*>(pObject);

      Spirit->SetUInt64Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
      
      TimedEvent *te = TimedEvent::Allocate(this, new CallbackP1<Darrowshire_Spirit, Creature*>(this, &Darrowshire_Spirit::DeleteDelay, Spirit), 0, 5000, 1);  
      Spirit->event_AddEvent(te);
      Spirit->Despawn(4000, 0);
   }
Example #4
0
void StrandOfTheAncient::HookOnUnitDied(Unit* victim)
{
    if (victim->IsCreature())
    {

        for (uint32 i = 0; i < SOTA_NUM_DEMOLISHERS; i++)
        {
            Creature *c = demolisher[i];

            if (c == NULL)
                continue;

            if (victim->GetGUID() != c->GetGUID())
                continue;

            demolisher[i] = SpawnCreature(28781, DemolisherLocations[i], TeamFactions[Attackers]);
            c->Despawn(1, 0);
        }

        for (uint32 i = 0; i < SOTA_NUM_CANONS; i++)
        {
            if (canon[i] == NULL)
                continue;

            if (victim->GetGUID() != canon[i]->GetGUID())
                continue;

            canon[i]->Despawn(1, 0);
            canon[i] = NULL;
        }
    }
}
Example #5
0
// Stopping the Spread
bool StoppingTheSpread(uint32 i, Spell* pSpell)
{
  if(!pSpell->u_caster->IsPlayer())
	return true;

  Player *plr = (Player*)pSpell->u_caster;
  Creature *target = (Creature*)plr->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(plr->GetPositionX(), plr->GetPositionY() , plr->GetPositionZ(), 18240);

  if(target == NULL)
	  return true;

  QuestLogEntry *qle = plr->GetQuestLogForEntry(9874);
  
  if(qle == NULL)
    return true;
 
  GameObject *obj = NULL;
 
  if(qle && qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0])
  {
		qle->SetMobCount(0, qle->GetMobCount(0)+1);
		qle->SendUpdateAddKill(0);
		
		obj = sEAS.SpawnGameobject(plr, 183816, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), 1);
		sEAS.GameobjectDelete(obj, 1*30*1000);
  }
  target->Despawn(2000, 60*1000);
  plr->UpdateNearbyGameObjects();
  qle->UpdatePlayerFields();
  return true;
}
		void OnSelectOption(Object* pObject, Player* pPlayer, uint32 Id, const char* EnteredCode)
		{
			switch(Id)
			{
				case 0: OnHello(pObject, pPlayer); break;
				case 1:
					{
						int32 i = -1;
						Creature* pPrisoner = TO_CREATURE(pObject);
						switch(pPrisoner->GetEntry())
						{
							case 20677: i = 0; break;
							case 20678: i = 1; break;
							case 20679: i = 2; break;
						}

						if(i == -1)
							return;

						QuestLogEntry* pQuest = pPlayer->GetQuestLogForEntry(10368);
						if(pQuest != NULL && pQuest->GetMobCount(i) < pQuest->GetQuest()->required_mobcount[i])
						{
							pQuest->SetMobCount(i, pQuest->GetMobCount(i) + 1);
							pQuest->SendUpdateAddKill(i);
							pQuest->UpdatePlayerFields();

							pPrisoner->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "You've freed me! The winds speak to my people one again and grant us their strength. I thank you, stranger.");
							pPrisoner->Despawn(5000, 6 * 60 * 1000);
							pPrisoner->SetStandState(STANDSTATE_STAND);
						}
					}
					break;
			}
		}
Example #7
0
bool SpragglesCanteen(uint32 i, Spell* pSpell)
{
  if(!pSpell->u_caster->IsPlayer())
    return true;

  Player *plr = (Player*)pSpell->u_caster;
  
  Creature *target = plr->GetMapMgr()->GetCreature(GET_LOWGUID_PART(plr->GetSelection()));
  if(target == NULL)
    return true;

  if(target->GetEntry() != 9999)
    return true;

  QuestLogEntry *qle = plr->GetQuestLogForEntry(4492);
  if(qle == NULL)
    return true;

  target->SetStandState(0);
  target->setDeathState(ALIVE);

  target->Despawn(30*1000, 1*60*1000);

  qle->SetMobCount(0, 1);
  qle->SendUpdateAddKill(0);
  qle->UpdatePlayerFields();

  return true;
}
Example #8
0
bool ConvertingSentry(uint32 i, Spell* pSpell)
{
	Player *caster = pSpell->p_caster;
	if(caster == NULL)
		return false;

	Creature *target = static_cast<Creature*>(pSpell->GetUnitTarget());
	if(target == NULL)
		return false;

	if( caster->GetUInt32Value(UNIT_FIELD_SUMMON) == 24981 )
		return false;

	// Erratic Sentry: 24972
	if(target->GetEntry() != 24972)
		return false;

	if(!target->isAlive())
		return false;

	target->Despawn(1, 2*60*1000);

	caster->CastSpell(caster, 45009, true);

	return true;
}
Example #9
0
	void GossipSelectOption(Object* pObject, Player* plr, uint32 Id, uint32 IntId, const char * EnteredCode)
	{
		if(!plr)
			return;

		Creature* spirit = TO_CREATURE(pObject);
		if (spirit == NULL)
			return;

		switch (IntId)
		{
			case 0:
				GossipHello(pObject, plr, true);
				break;

			case 1:
				{
					QuestLogEntry *en = plr->GetQuestLogForEntry(3520);
					if(en && en->GetMobCount(0) < en->GetQuest()->required_mobcount[0])
					{
						en->SetMobCount(0, en->GetMobCount(0) + 1);
						en->SendUpdateAddKill(0);
						en->UpdatePlayerFields();
					}
					if(!spirit)
						return;

					spirit->Despawn(1, 0);
					return;

				}
		}
	}
Example #10
0
		void GossipSelectOption(Object* pObject, Player* plr, uint32 Id, uint32 IntId, const char* EnteredCode)
		{
			if(!plr)
				return;

			Creature* windwatcher = TO_CREATURE(pObject);
			if(windwatcher == NULL)
				return;

			switch(IntId)
			{
				case 0:
					GossipHello(pObject, plr);
					break;

				case 1:
					{
						Creature* whirlwind = plr->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(), 6239);
						if(whirlwind != NULL)
						{
							if(!whirlwind->isAlive())
							{
								whirlwind->Delete();
							}
							else
								return;
						}

						whirlwind = sEAS.SpawnCreature(plr, 6239, plr->GetPositionX() + 7, plr->GetPositionY() + 7, plr->GetPositionZ(), plr->GetOrientation(), 0);
						whirlwind->Despawn(5 * 60 * 1000, 0);
					}
					break;
			}
		}
Example #11
0
bool ChickenNet( uint32 i, Spell * pSpell )
{
	if( !pSpell->u_caster->IsPlayer() )
        return true;

	Player * pPlayer = TO_PLAYER( pSpell->u_caster );

	QuestLogEntry *qle = pPlayer->GetQuestLogForEntry( 12532 );
	if( qle == NULL )
	{
		QuestLogEntry *qle = pPlayer->GetQuestLogForEntry( 12702 );
		if( qle == NULL )
			return true;
	}

	
	if( !pSpell->GetUnitTarget()->IsCreature() )
		return true;

	Creature * Chicken = TO_CREATURE( pSpell->GetUnitTarget() );

	if( Chicken != NULL && Chicken->GetEntry() == 28161 )
	{
		Chicken->Despawn( 5000, 360000 );
		pPlayer->CastSpell( pSpell->u_caster, dbcSpell.LookupEntry( 51037 ), true );
	}

   return true;
}
	void GossipSelectOption(Object* pObject, Player* plr, uint32 Id, uint32 IntId, const char * EnteredCode)
	{
		if(!plr)
			return;

		Creature* doctor = TO_CREATURE(pObject);
		if (doctor == NULL)
			return;

		switch (IntId)
		{
			case 0:
				GossipHello(pObject, plr, true);
				break;

			case 1:
			{
				plr->GetItemInterface()->RemoveItemAmt(2799, 1);
				doctor->CastSpell(doctor, dbcSpell.LookupEntry(12380), true);
				if( !plr || !plr->GetMapMgr() || !plr->GetMapMgr()->GetInterface() )
					return;
				Creature* firstenemy = sEAS.SpawnCreature(plr, 1511, -13770.5, -6.79, 42.8, 5.7 , 0);
				firstenemy->GetAIInterface()->MoveTo(-13727.8, -26.2, 46.15, 4.07);
				firstenemy->Despawn(10*60*1000, 0);
			}break;
		}
	}
Example #13
0
	  void OnQuestStart(Player * mTarget, QuestLogEntry * qLogEntry)
	  {
		if( mTarget == NULL || mTarget->GetMapMgr() == NULL || mTarget->GetMapMgr()->GetInterface() == NULL )
			return;
		 Creature * brokentoe = mTarget->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(mTarget->GetPositionX(), mTarget->GetPositionY(), 0, 18398);
			if(brokentoe)
			{
			   brokentoe->Despawn(1000,0);
			}

			Unit * Qgiver = NULL;
				Qgiver = mTarget->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(mTarget->GetPositionX(), mTarget->GetPositionY(), 0, 18471);

				if(Qgiver)
				{
				char msg[256];
				snprintf((char*)msg, 256, "Get in the Ring of Blood, %s . The fight is about to start!", mTarget->GetName());
				Qgiver->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, msg);
				string msg2 = "The battle is about to begin! The unmerciful Murkblood twins versus ";
				msg2 += mTarget->GetName();
				sEventMgr.AddEvent(static_cast< Unit* >(Qgiver), &Unit::SendChatMessage, (uint8)CHAT_MSG_MONSTER_YELL, (uint32)LANG_UNIVERSAL, msg2.c_str(), EVENT_UNIT_CHAT_MSG, 4000, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
				mTarget->GetMapMgr()->GetInterface()->SpawnCreature(18399, -704.669f, 7871.08f, 45.0387f, 1.59531f, true, false, 0, 0);
				mTarget->GetMapMgr()->GetInterface()->SpawnCreature(18399, -708.076f, 7870.41f, 44.8457f, 1.59531f, true, false, 0, 0);
				}
	  }
Example #14
0
   void GossipHello(Object * pObject, Player * plr, bool AutoSend)
   {
      QuestLogEntry *en = plr->GetQuestLogForEntry(5211);

      if(en && en->GetMobCount(0) < en->GetQuest()->required_mobcount[0])
      {
        uint32 newcount = en->GetMobCount(0) + 1;

        en->SetMobCount(0, newcount);
        en->SendUpdateAddKill(0);
        en->UpdatePlayerFields();
      }
   
      GossipMenu *Menu;
      objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 3873, plr);

      if(AutoSend)
         Menu->SendTo(plr);

      if(!pObject || !pObject->IsCreature())
        return;

      Creature * Spirit = TO_CREATURE(pObject);

      Spirit->SetUInt64Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
      sEventMgr.AddEvent(Spirit, &Creature::SafeDelete, EVENT_CREATURE_REMOVE_CORPSE,5000, 1, 0);
      Spirit->Despawn(4000, 0);
   }
bool AnAmbitiousPlan(uint32 i, Spell* pSpell)
{
	if ( pSpell == NULL || pSpell->u_caster == NULL || !pSpell->u_caster->IsPlayer() )
		return true;

	Player *pPlayer = static_cast< Player* >( pSpell->u_caster );
	QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry( 9383 );
	if ( pQuest == NULL )
		return true;

	Creature *pTarget = pPlayer->GetMapMgr()->GetCreature( GET_LOWGUID_PART( pPlayer->GetSelection() ) );
	if ( pTarget == NULL || pTarget->GetEntry() != 16975 )
		return true;

	float SSx = pTarget->GetPositionX();
	float SSy = pTarget->GetPositionY();
	float SSz = pTarget->GetPositionZ();
	pTarget->GetAIInterface()->SetAllowedToEnterCombat( false );
	pTarget->GetAIInterface()->StopMovement( 0 );
	pTarget->GetAIInterface()->setCurrentAgent( AGENT_NULL );
	pTarget->GetAIInterface()->SetAIState( STATE_IDLE );
	pTarget->Despawn( 0, 0 );

	GameObject *pGameobject = sEAS.SpawnGameobject( pPlayer, 183816, SSx, SSy, SSz, 0, 1 );
	if ( pGameobject != NULL )
	{
		sEAS.GameobjectDelete( pGameobject, 1 * 60 * 1000 );
		pPlayer->UpdateNearbyGameObjects();
	}

	return true;
}
Example #16
0
bool FilledShimmeringVessel(uint32 i, Spell* pSpell) // Blood Elf ress. quest
{
  if(!pSpell->u_caster->IsPlayer())
    return true;

  Player *plr = (Player*)pSpell->u_caster;
  
  Creature *target = plr->GetMapMgr()->GetCreature((uint32)plr->GetSelection());
  if(target == NULL)
    return true;

  if(target->GetEntry() != 17768)
    return true;

  QuestLogEntry *qle = plr->GetQuestLogForEntry(9685);
  if(qle == NULL)
    return true;

  target->SetStandState(0);
  target->setDeathState(ALIVE);

  target->Despawn(30*1000, 1*60*1000);

  qle->SetMobCount(0, 1);
  qle->SendUpdateAddKill(0);
  qle->UpdatePlayerFields();

  return true;
}
bool TheSeersRelic(uint32 i, Spell * pSpell)
{
	if ( pSpell == NULL || pSpell->u_caster == NULL || !pSpell->u_caster->IsPlayer() )
		return true;

	Player * pPlayer = static_cast< Player* >( pSpell->u_caster );
	QuestLogEntry * qle = pPlayer->GetQuestLogForEntry( 9545 );
	if ( qle == NULL || qle->GetMobCount( 0 ) >= qle->GetQuest()->required_mobcount[0] )
		return true;

	Creature * pTarget = pPlayer->GetMapMgr()->GetCreature( GET_LOWGUID_PART( pPlayer->GetSelection() ) );
	if ( pTarget == NULL )
		return true;

	if ( pTarget->GetEntry() != 16852 )
		return true;

	pTarget->SetStandState( 0 );
	pTarget->setDeathState( ALIVE );
	pTarget->Despawn( 30 * 1000, 1 * 60 * 1000 );
  
	qle->SetMobCount( 0, 1 );
	qle->SendUpdateAddKill( 0 );
	qle->UpdatePlayerFields();

	return true;
}
bool ConvertingSentry(uint32 i, Spell* pSpell)
{
  Player* pCaster = pSpell->p_caster;
  if( pCaster == NULL )
    return true;

  Creature* pTarget = TO_CREATURE(pSpell->GetUnitTarget());
  if( pTarget == NULL || pTarget->GetEntry() != 24972 || pTarget->isAlive() ) // Erratic Sentry: 24972
    return true;

  QuestLogEntry *qle = NULL;
  qle = pCaster->GetQuestLogForEntry(11525);
  if(qle == NULL)
  {
	qle = pCaster->GetQuestLogForEntry(11524);
	if(qle == NULL)
       return true;
  }

  if(qle->GetMobCount(0) == qle->GetQuest()->required_mobcount[0])
    return true;

  qle->SetMobCount(0, qle->GetMobCount(0)+1);
  qle->SendUpdateAddKill(0);
  qle->UpdatePlayerFields();

  pTarget->Despawn(500, 2*60*1000);

  return true;
}
Example #19
0
		void GossipSelectOption(Object* pObject, Player* plr, uint32 Id, uint32 IntId, const char* EnteredCode)
		{
			if(!plr)
				return;

			Creature* general = TO_CREATURE(pObject);
			if(general == NULL)
				return;

			switch(IntId)
			{
				case 0:
					GossipHello(pObject, plr);
					break;

				case 1:
					{
						Creature* spawncheckcr = plr->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(), 7750);

						if(!spawncheckcr)
						{
							general = sEAS.SpawnCreature(plr, 7750, -10619, -2997, 28.8f, 4, 0);
							general->Despawn(3 * 60 * 1000, 0);
						}

						GameObject* spawncheckgobj = plr->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(), 141980);

						if(!spawncheckgobj)
						{
							GameObject* generalsbox = sEAS.SpawnGameobject(plr, 141980, -10622, -2994, 28.6f, 4, 4, 0, 0, 0, 0);
							sEAS.GameobjectDelete(generalsbox, 3 * 60 * 1000);
						}
					}
			}
		}
Example #20
0
	void OnQuestComplete( Player* mTarget, QuestLogEntry * qLogEntry)
	{
		if( mTarget == NULL || mTarget->GetMapMgr() == NULL || mTarget->GetMapMgr()->GetInterface() == NULL )
			return;
		Creature* creat = mTarget->GetMapMgr()->GetInterface()->SpawnCreature(1946, 2467.314f, 14.8471f, 23.5950f, 0, true, false, 0, 0);
		creat->Despawn(60000,0);
		creat->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "You have disturbed my rest. Now face my wrath!");
	}
Example #21
0
    void OnActivate(Player* pPlayer) override
    {
        pPlayer->AddQuestKill(9667, 0, 0);

        Creature* princess = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 17682);
        if (princess != nullptr)
            princess->Despawn(1000, 6 * 60 * 1000);
    }
Example #22
0
void ZuluhedtheWhackedCancel(Player* pPlayer)
{
    Creature* Zuluhed = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(-4206.199219f, 313.5462f, 122.907f, 11980);
    if (Zuluhed != NULL)
    {
        Zuluhed->Despawn(0,0);
    }
}
    void OnDied(Unit* mKiller)
    {
        if (!mKiller->isPlayer())
            return;

        Creature* creat = getCreature()->GetMapMgr()->GetInterface()->SpawnCreature(11064, getCreature()->GetPositionX(), getCreature()->GetPositionY(), getCreature()->GetPositionZ(), getCreature()->GetOrientation(), true, false, 0, 0);
        if (creat)
            creat->Despawn(60000, 0);
    }
Example #24
0
		void OnDied(Unit* mKiller)
		{
			if(mKiller->IsPlayer())
			{
				Creature* NewCreature = _unit->GetMapMgr()->GetInterface()->SpawnCreature(7729, _unit->GetPositionX() + 2, _unit->GetPositionY() + 2, _unit->GetPositionZ(), _unit->GetOrientation(), true, false, 0, 0);
				if(NewCreature != NULL)
					NewCreature->Despawn(3 * 6 * 1000, 0);
			}
		}
Example #25
0
        void OnQuestComplete(Player* mTarget, QuestLogEntry* qLogEntry)
        {
            Creature* mogor = mTarget->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(mTarget->GetPositionX(), mTarget->GetPositionY(), 0, 18069);

            if(mogor != NULL)
                mogor->Despawn(1000, 0);

            mTarget->GetMapMgr()->GetInterface()->SpawnCreature(18069, -712.443115f, 7932.182129f, 59.430191f, 4.515952f, true, false, 0, 0);
        }
		void OnDied(Unit* pKiller)
		{
			Player* QuestHolder = NULL;
			if(pKiller->IsPlayer())
				QuestHolder = TO_PLAYER(pKiller);
			else if(pKiller->IsPet() && TO_PET(pKiller)->GetPetOwner() != NULL)
				QuestHolder = TO_PET(pKiller)->GetPetOwner();

			if(QuestHolder == NULL)
				return;

			// M4ksiu: I don't think the method is correct, but it can stay the way it was until someone gives proper infos
			QuestLogEntry* Quest = QuestHolder->GetQuestLogForEntry(9670);
			Creature* RandomCreature = NULL;
			if(Quest == NULL)
			{
				// Creatures from Bloodmyst Isle
				uint32 Id[ 51 ] = { 17681, 17887, 17550, 17323, 17338, 17341, 17333, 17340, 17353, 17320, 17339, 17337, 17715, 17322, 17494, 17654, 17342, 17328, 17331, 17325, 17321, 17330, 17522, 17329, 17524, 17327, 17661, 17352, 17334, 17326, 17324, 17673, 17336, 17346, 17589, 17609, 17608, 17345, 17527, 17344, 17347, 17525, 17713, 17523, 17348, 17606, 17604, 17607, 17610, 17358, 17588 };
				RandomCreature = _unit->GetMapMgr()->GetInterface()->SpawnCreature(Id[ RandomUInt(50) ], _unit->GetPositionX(), _unit->GetPositionY(), _unit->GetPositionZ(), _unit->GetOrientation(), true, false, 0, 0);
				if(RandomCreature != NULL)
				{
					RandomCreature->m_noRespawn = true;
					RandomCreature->Despawn(60000, 0);
				};

				return;
			}
			else
			{
				uint32 Id[ 8 ] = { 17681, 17321, 17330, 17522, 17673, 17336, 17346, 17589 };
				RandomCreature = _unit->GetMapMgr()->GetInterface()->SpawnCreature(Id[ RandomUInt(7) ], _unit->GetPositionX(), _unit->GetPositionY(), _unit->GetPositionZ(), _unit->GetOrientation(), true, false, 0, 0);
				if(RandomCreature != NULL)
				{
					RandomCreature->m_noRespawn = true;
					RandomCreature->Despawn(60000, 0);
					if(RandomCreature->GetEntry() == 17681 && Quest->GetMobCount(0) < Quest->GetQuest()->required_mobcount[ 0 ])
					{
						Quest->SetMobCount(0, Quest->GetMobCount(0) + 1);
						Quest->SendUpdateAddKill(0);
						Quest->UpdatePlayerFields();
					};
				};
			};
		};
Example #27
0
bool SymbolOfLife(uint32 i, Spell* pSpell) // Alliance ress. quests
{
    if(!pSpell->u_caster->IsPlayer())
        return true;

    Player* plr = TO_PLAYER(pSpell->u_caster);
    Creature* target = plr->GetMapMgr()->GetCreature(GET_LOWGUID_PART(plr->GetSelection()));

    if(target == NULL)
        return true;

    const uint32 targets[] = {17542, 6177, 6172};
    const uint32 quests[] =  {9600,  1783, 1786};
    bool questOk = false;
    bool targetOk = false;

    for(int i = 0; i<3; i++)
    {
        if(target->GetEntry() == targets[i])
        {
            targetOk = true;

            break;
        }
    }

    if(!targetOk)
        return true;

    QuestLogEntry *qle;

    for(int i = 0; i<3; i++)
    {
        if(plr->GetQuestLogForEntry(quests[i]) != NULL)
        {
            qle = plr->GetQuestLogForEntry(quests[i]);
            questOk = true;

            break;
        }
    }

    if(!questOk)
        return true;

    target->SetStandState(0);
    target->setDeathState(ALIVE);

    target->Despawn(10*1000, 1*60*1000);

    qle->SetMobCount(0, 1);
    qle->SendUpdateAddKill(0);
    qle->UpdatePlayerFields();

    return true;
}
Example #28
0
bool ShatariTorch(uint32 i, Spell* pSpell)
{
  if(pSpell->u_caster->IsPlayer() == false)
    return true;

  Player* plr = TO_PLAYER(pSpell->u_caster);
  Unit* unit_target = TO_UNIT(plr->GetMapMgr()->GetCreature(GET_LOWGUID_PART(plr->GetSelection())));
  
  if(unit_target == NULL)
    return true;
	
  if ( plr->CalcDistance( unit_target->GetPositionX(), unit_target->GetPositionY(), unit_target->GetPositionZ(), plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ() ) > 5 )
	return true;
   
  if(!unit_target->IsCreature())
    return true;

  Creature* target = TO_CREATURE(unit_target);

  QuestLogEntry *qle = plr->GetQuestLogForEntry(10913);
  if(qle == NULL)
    return true;
  
  GameObject* obj = NULL;

  if(target->GetEntry() == 21859)
  {
    if(qle->GetMobCount(0) == qle->GetQuest()->required_mobcount[0])
      return true;

    qle->SetMobCount(0, qle->GetMobCount(0)+1);
    qle->SendUpdateAddKill(0);

    obj = sEAS.SpawnGameobject(plr, 183816, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), 1, 0, 0, 0, 0);
    sEAS.GameobjectDelete(obj, 1*60*1000);
  } 
  else if(target->GetEntry() == 21846)
  {
    if(qle->GetMobCount(1) == qle->GetQuest()->required_mobcount[1])
      return true;

    qle->SetMobCount(1, qle->GetMobCount(1)+1);
    qle->SendUpdateAddKill(1);

    obj = sEAS.SpawnGameobject(plr, 183816, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), 1, 0, 0, 0, 0);
    sEAS.GameobjectDelete(obj, 1*60*1000);
  }
  else 
    return true; 

  target->Despawn(0, 1*60*1000);
  qle->UpdatePlayerFields();
  plr->UpdateNearbyGameObjects();

  return true;
}
Example #29
0
bool UnyieldingBattleHorn(uint32 i, Spell * pSpell)
{
  if(pSpell->p_caster == NULL) 
    return true;

  Creature *creat = pSpell->p_caster->GetMapMgr()->GetInterface()->SpawnCreature(19862, -1190.856079f, 2261.246582f, 46.625797f, 1.705882f, true, false, 0, 0);
  creat->Despawn(300000, 0); // 5 mins delay

  return true;
}
Example #30
0
    void OnActivate(Player* player)
    {
        QuestLogEntry* qle = player->GetQuestLogForEntry(10915);
        if (qle == nullptr)
            return;

        Creature* exarch = player->GetMapMgr()->CreateAndSpawnCreature(22452, -3365.9f, 5143.19f, -9.00132f, 3.05f);
        if (exarch != nullptr)
            exarch->Despawn(6 * 60 * 1000, 0);
    }