bool SymbolOfLife(uint32 i, Spell* pSpell) // Alliance ress. quests
{
   Player* plr = pSpell->p_caster; 
   if(!plr)
    return true;

  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(uint8 j = 0; j<3; j++)
  {
    if(target->GetEntry() == targets[j])
    {
      targetOk = true;
      
      break;
    }
  }
  
  if(!targetOk)
    return true;
  
  QuestLogEntry *qle;
  
  for(uint8 j = 0; j<3; j++)
  {
    if(plr->GetQuestLogForEntry(quests[j]) != NULL)
    {
      qle = plr->GetQuestLogForEntry(quests[j]);
      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 #2
0
bool ToLegionHold(uint32 i, Aura* pAura, bool apply)
{
	if ( pAura == NULL || pAura->GetUnitCaster() == NULL || !pAura->GetUnitCaster()->IsPlayer() )
		return true;

	Player* pPlayer = TO_PLAYER( pAura->GetUnitCaster() );

	Creature* pJovaanCheck = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(-3310.743896f, 2951.929199f, 171.132538f, 21633);
	if ( pJovaanCheck != NULL )
		return true;

	QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry( 10563 );
	if ( pQuest == NULL )
	{
		pQuest = pPlayer->GetQuestLogForEntry( 10596 );
		if ( pQuest == NULL )
			return true;
	}

	if ( apply )
	{

		pPlayer->SetUInt32Value( UNIT_FIELD_DISPLAYID, 20366 );
		pPlayer->Root();
		Creature* pJovaan = sEAS.SpawnCreature( pPlayer, 21633, -3310.743896f, 2951.929199f, 171.132538f, 5.054039f, 0 );	// Spawn Jovaan
		if ( pJovaan != NULL )
		{
			pJovaan->SetUInt64Value( UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2 );
			if ( pJovaan->GetAIInterface() != NULL )
			{
				pJovaan->GetAIInterface()->SetAllowedToEnterCombat( false );
			}
		}
		GameObject* pGameObject = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 184834);
		if ( pGameObject != NULL )
		{
			pGameObject->Despawn(60000);
			pPlayer->UpdateNearbyGameObjects();
		}
	}
	else
	{
		if ( pQuest->GetMobCount( 2 ) < pQuest->GetQuest()->required_mobcount[2] )
		{
			pQuest->SetMobCount( 2, pQuest->GetMobCount( 2 ) + 1 );
			pQuest->SendUpdateAddKill( 2 );
			pQuest->UpdatePlayerFields();
		}
	
		pPlayer->SetUInt32Value( UNIT_FIELD_DISPLAYID, pPlayer->GetUInt32Value( UNIT_FIELD_NATIVEDISPLAYID ) );
		pPlayer->UnRoot();
	}

	return true;
}
Example #3
0
	void OnReachWP(uint32 iWaypointId, bool bForwards)
	{
		if(iWaypointId == 72)
		{
			_unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "I appreciate the help you have shown Pao'ka. I hope this covers any misfortunes this deed has cost you.");
			_unit->Despawn(5000,1000);
			sEAS.DeleteWaypoints(_unit);
			if(_unit->m_escorter == NULL)
				return;
			Player* plr = _unit->m_escorter;
			_unit->m_escorter = NULL;
			if( plr->GetQuestLogForEntry(4770) )
				plr->GetQuestLogForEntry(4770)->SendQuestComplete();
		}
	}
bool FilledShimmeringVessel(uint32 i, Spell* pSpell) // Blood Elf ress. quest
{
  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;

  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 DouseEternalFlame(uint32 i, Spell* pSpell)
{
	if (pSpell->p_caster == NULL)
		return true;

	Player* plr = pSpell->p_caster;
	QuestLogEntry *qle = plr->GetQuestLogForEntry(9737);
	if(qle == NULL)
		return true;

	GameObject* Flame = plr->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(3678, -3640, 139, 182068);
	if(Flame != NULL)
	{
		if(plr->CalcDistance(plr, Flame) < 30)
			if(qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0])
			{
				qle->SetMobCount(0, qle->GetMobCount(0)+1);
				qle->SendUpdateAddKill(0);
				qle->UpdatePlayerFields();
				Creature * pCreature = plr->GetMapMgr()->GetInterface()->GetCreatureNearestCoords( plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(), 10917 );
				if ( pCreature != NULL )
				{
					pCreature->SetFaction(11 );
				}
			}
	}
	return true;
}
Example #6
0
bool Carcass(uint32 i, Spell* pSpell) // Becoming a Shadoweave Tailor
{
	if(!pSpell->u_caster->IsPlayer())
		return true;

	Player*	pPlayer = TO_PLAYER(pSpell->u_caster);
	QuestLogEntry	*pQuest = pPlayer->GetQuestLogForEntry( 10804 );
	Creature*	NetherDrake = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 21648);
	GameObject* FlayerCarcass = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 185155);

	if ( FlayerCarcass == NULL )
	{
		FlayerCarcass = sEAS.SpawnGameobject(pPlayer, 185155, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 0, 1, 0, 0, 0, 0);
		FlayerCarcass->Despawn(60000);
	}
	if ( NetherDrake == NULL )
		return true;

	if ( NetherDrake->HasActiveAura(38502) )
		return true;

	if( pQuest!=NULL && pQuest->GetMobCount( 0 ) < pQuest->GetQuest()->required_mobcount[0] )
	{
		NetherDrake->CastSpell(NetherDrake, dbcSpell.LookupEntry( 38502 ), true);
		NetherDrake->GetAIInterface()->m_moveFly = true;
		NetherDrake->GetAIInterface()->MoveTo(pPlayer->GetPositionX(), pPlayer->GetPositionY()+2, pPlayer->GetPositionZ(), 0);
		pQuest->SetMobCount( 0, pQuest->GetMobCount( 0 )+1);
		pQuest->SendUpdateAddKill( 0 );
		pQuest->UpdatePlayerFields();
	}
	return true;
}
bool SpragglesCanteen(uint32 i, Spell* pSpell)
{
  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;

  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;
}
    void OnDied(Unit* /*mKiller*/) override
    {
        if (getCreature()->m_escorter == NULL)
            return;
        Player* plr = getCreature()->m_escorter;
        getCreature()->m_escorter = NULL;

        auto quest_entry = plr->GetQuestLogForEntry(6523);
        if (quest_entry != nullptr)
            quest_entry->Fail(false);
    }
        void OnDied(Unit* mKiller)
        {
            if(_unit->m_escorter == NULL)
                return;
            Player* plr = _unit->m_escorter;
            _unit->m_escorter = NULL;

            auto quest_entry = plr->GetQuestLogForEntry(6523);
            if (quest_entry != nullptr)
                quest_entry->Fail(false);
        }
bool FindingTheSource(uint32 i, Spell* pSpell)
{
	Player* pPlayer = TO_PLAYER (pSpell->u_caster);
	if(!pPlayer)
		return true;

	if(!pSpell->u_caster->IsPlayer())
		return true;

	QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(974);
	if(qle == NULL)
		return true;

	GameObject* place1 = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(-7163, -1149, -264, 148503);
	GameObject* place2 = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(-7281, -1244, -248, 148503);
	GameObject* place3 = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(-7140, -1465, -242, 148503);
	GameObject* place4 = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(-7328, -1461, -242, 148503);
	GameObject* place5 = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(-7092, -1305, -187, 148503);

	if(place1 != NULL)
	{
		if(pPlayer->CalcDistance(pPlayer, place1) < 11)
			pPlayer->CastSpell(pPlayer, 14797, true);		
	}
	if(place2 != NULL)
	{
		if(pPlayer->CalcDistance(pPlayer, place2) < 11)
			pPlayer->CastSpell(pPlayer, 14797, true);
	}
	if(place3 != NULL)
	{
		if(pPlayer->CalcDistance(pPlayer, place3) < 11)
			pPlayer->CastSpell(pPlayer, 14797, true);
	}
	if(place4 != NULL)
	{
		if(pPlayer->CalcDistance(pPlayer, place4) < 11)
			pPlayer->CastSpell(pPlayer, 14797, true);
	}
	if(place5 != NULL)
	{
		if(pPlayer->CalcDistance(pPlayer, place5) < 11)
		{
			if(qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0])
			{
				qle->SetMobCount(0, qle->GetMobCount(0)+1);
				qle->SendUpdateAddKill(0);
				qle->UpdatePlayerFields();
			}
		}
	}
	return true;
}
	void OnReachWP(uint32 iWaypointId, bool bForwards)
	{
		if(iWaypointId == 13)
		{
			_unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Thanks, these orcs wanted me to weld in the boiler");
			_unit->Despawn(5000,1000);
			sEAS.DeleteWaypoints(_unit);
			if(_unit->m_escorter == NULL)
				return;
			Player* plr = _unit->m_escorter;
			_unit->m_escorter = NULL;
			plr->GetQuestLogForEntry(1440)->SendQuestComplete();
		}
	}
Example #12
0
	void OnReachWP(uint32 iWaypointId, bool bForwards)
	{
		if(iWaypointId == 19)
		{
			_unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Tell your master that this is where Van Cleef is hiding. I'm outta here!");
			_unit->Despawn(5000,1000);
			sEAS.DeleteWaypoints(_unit);
			if(_unit->m_escorter == NULL)
				return;
			Player* plr = _unit->m_escorter;
			_unit->m_escorter = NULL;
			plr->GetQuestLogForEntry(155)->SendQuestComplete();
		}
	}
Example #13
0
	void OnReachWP(uint32 iWaypointId, bool bForwards)
	{
		if(iWaypointId == 7)
		{
			_unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Thanks, I'm outta here!");
			_unit->Despawn(5000,1000);
			sEAS.DeleteWaypoints(_unit);
			if(_unit->m_escorter == NULL)
				return;
			Player* plr = _unit->m_escorter;
			_unit->m_escorter = NULL;
			plr->GetQuestLogForEntry(309)->SendQuestComplete();
		}
	}
Example #14
0
	void OnDied(Unit* mKiller)
	{
		fulborgskilled++;
		if(mKiller->IsPlayer())
		{
			Player* mPlayer = TO_PLAYER(mKiller);

			if(fulborgskilled > 8&& mPlayer->GetQuestLogForEntry( 9667 ))
			{
				_unit->GetMapMgr()->GetInterface()->SpawnCreature(17702, -2419, -12166, 33, 3.45f, true, false, 0, 0)->Despawn(18000000, 0);
				fulborgskilled = 0;
				_unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "Chief, we need your help!");
			}
		}
	}
		void OnDied(Unit* mKiller)
		{
			if(!mKiller->IsPlayer())
				return;

			Player* pPlayer = TO_PLAYER(mKiller);
			QuestLogEntry* pQuest = pPlayer->GetQuestLogForEntry(10502);
			if(pQuest == NULL)
			{
				pQuest = pPlayer->GetQuestLogForEntry(10505);
				if(pQuest == NULL)
				{
					return;
				}
			}

			if(pQuest->GetMobCount(0) < pQuest->GetQuest()->required_mobcount[0])
			{
				uint32 NewCount = pQuest->GetMobCount(0) + 1;
				pQuest->SetMobCount(0, NewCount);
				pQuest->SendUpdateAddKill(0);
				pQuest->UpdatePlayerFields();
			}
		}
Example #16
0
bool CrystalOfDeepShadows(uint32 i, Spell* pSpell) // Becoming a Shadoweave Tailor
{
    if(!pSpell->u_caster->IsPlayer())
        return true;

    Player *plr = (Player*)pSpell->u_caster;
    QuestLogEntry *qle = plr->GetQuestLogForEntry(10833);

    if(qle == NULL)
        return true;

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

    return true;
}
Example #17
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 #18
0
    void OnDied(Unit* pKiller) override
    {
        Player* QuestHolder = NULL;
        if (pKiller->isPlayer())
            QuestHolder = static_cast<Player*>(pKiller);
        else if (pKiller->isPet() && static_cast<Pet*>(pKiller)->getPlayerOwner() != nullptr)
            QuestHolder = dynamic_cast<Player*>(static_cast<Pet*>(pKiller)->getPlayerOwner());

        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* qle = QuestHolder->GetQuestLogForEntry(9670);
        LocationVector pos = getCreature()->GetPosition();
        Creature* RandomCreature = NULL;
        if (qle == nullptr)
        {
            // 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 = getCreature()->GetMapMgr()->GetInterface()->SpawnCreature(Id[Util::getRandomUInt(50)], pos.x, pos.y, pos.z, pos.o, true, false, 0, 0);
            if (RandomCreature != NULL)
            {
                RandomCreature->m_noRespawn = true;
                RandomCreature->Despawn(60000, 0);
            }
        }
        else
        {
            uint32 Id[8] = { 17681, 17321, 17330, 17522, 17673, 17336, 17346, 17589 };
            RandomCreature = getCreature()->GetMapMgr()->GetInterface()->SpawnCreature(Id[Util::getRandomUInt(7)], pos.x, pos.y, pos.z, pos.o, true, false, 0, 0);
            if (RandomCreature != NULL)
            {
                RandomCreature->m_noRespawn = true;
                RandomCreature->Despawn(60000, 0);
                if (RandomCreature->getEntry() == 17681)
                {
                    QuestHolder->AddQuestKill(9670, 0, 0);
                }
            }
        }
    }
Example #19
0
// Protecting Our Own
bool ProtectingOurOwn(uint32 i, Spell* pSpell)
{
    if(pSpell->u_caster == NULL || !pSpell->u_caster->IsPlayer())
        return true;

    Player* plr = TO_PLAYER(pSpell->u_caster);
    QuestLogEntry *qle = plr->GetQuestLogForEntry(10488);

    if(qle == NULL)
        return true;

    if ( qle->GetMobCount( 0 ) < qle->GetQuest()->required_mobcount[0] )
    {
        uint32 NewCount = qle->GetMobCount( 0 ) + 1;
        qle->SetMobCount( 0, NewCount );
        qle->SendUpdateAddKill( 0 );
        qle->UpdatePlayerFields();
    }

    return true;
}
Example #20
0
 void OnReachWP(uint32 iWaypointId, bool /*bForwards*/) override
 {
     switch (iWaypointId)
     {
         case 1:
         {
             SetWaypointMoveType(Movement::WP_MOVEMENT_SCRIPT_WANTEDWP);
             SetWaypointToMove(2);
             for (const auto& itr : getCreature()->getInRangeObjectsSet())
             {
                 if (itr && itr->isPlayer())
                 {
                     Player* pPlayer = static_cast<Player*>(itr);
                     if (pPlayer != nullptr)
                     {
                         QuestLogEntry* pQuest = pPlayer->GetQuestLogForEntry(10097);
                         if (pQuest != nullptr && pQuest->GetMobCount(1) < 1)
                         {
                             pQuest->SetMobCount(1, 1);
                             pQuest->SendUpdateAddKill(1);
                             pQuest->UpdatePlayerFields();
                         }
                     }
                 }
             }
         }
         break;
         case 3:
         {
             despawn(100, 0);
         }
         break;
         default:
         {
             SetWaypointMoveType(Movement::WP_MOVEMENT_SCRIPT_WANTEDWP);
             SetWaypointToMove(1);
         }
     }
 }
    void OnReachWP(uint32 iWaypointId, bool /*bForwards*/) override
    {
        switch (iWaypointId)
        {
            case 15:
            {
                getCreature()->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Thanks for your help. I'll continue from here!");
                if (getCreature()->m_escorter == NULL)
                    return;
                Player* plr = getCreature()->m_escorter;
                getCreature()->m_escorter = NULL;

                auto quest_entry = plr->GetQuestLogForEntry(6523);
                if (quest_entry == nullptr)
                    return;
                quest_entry->SendQuestComplete();
            }break;
            case 17:
            {
                getCreature()->Despawn(5000, 1000);
            }break;
        }
    }