void OnDied(Unit* mKiller)
	{
		if (mKiller->IsPlayer()) 
		{
			QuestLogEntry *en = (TO_PLAYER(mKiller))->GetQuestLogForEntry(11096);
			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();
				return;
			}
		}
	}
        void GossipSelectOption(Object* pObject, Player* pPlayer, uint32 Id, uint32 IntId, const char* EnteredCode)
        {
            if(pPlayer == NULL)
                return;

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

            switch(IntId)
            {
                case 0:
                    GossipHello(pObject, pPlayer);
                    break;
                case 1:
                    {
                        int32 i = -1;
                        Creature* pPrisoner = static_cast<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;
            }
        }
bool PreparationForBattle(uint32 i, Spell* pSpell)
{
	if ( pSpell == NULL || pSpell->u_caster == NULL || !pSpell->u_caster->IsPlayer() )
	return true;

	Player* pPlayer = TO_PLAYER( pSpell->u_caster );
	QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry( 12842 );
	if ( pQuest != NULL )
	{
		if ( pQuest->GetMobCount(0) < pQuest->GetQuest()->required_mobcount[0] )
		{
			pQuest->SetMobCount( 0, pQuest->GetMobCount( 0 ) + 1 );
			pQuest->SendUpdateAddKill( 0 );
			pQuest->UpdatePlayerFields();
			pQuest->SendQuestComplete();
		}
	}
	return true;
};
Exemple #4
0
	void OnActivate( Player *p ){
		
		QuestLogEntry *qle = p->GetQuestLogForEntry(5097);
		
		if(qle == NULL){
			qle = p->GetQuestLogForEntry(5098);
			if(qle == NULL)
				return;
		}
		
		if(qle->GetMobCount(2) < qle->GetQuest()->required_mobcount[2]){
			qle->SetMobCount(2, qle->GetMobCount(2)+1);
			qle->SendUpdateAddKill(2);
			qle->UpdatePlayerFields();
		}
	}
	void OnActivate(PlayerPointer pPlayer)
	{
		if(!pPlayer)
			return;

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

		if(qle->GetMobCount(1) < qle->GetQuest()->required_mobcount[1])
		{
			qle->SetMobCount(1, qle->GetMobCount(1)+1);
			qle->SendUpdateAddKill(1);
			qle->UpdatePlayerFields();
		}
	}
Exemple #6
0
	void OnActivate(Player* pPlayer)
	{
		if(!pPlayer)
			return;

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

		if(qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0])
		{
			qle->SetMobCount(0, qle->GetMobCount(0)+1);
			qle->SendUpdateAddKill(0);
			qle->UpdatePlayerFields();
		}
		return;
	}
bool UnlockKarynakuChains(uint32 i, SpellPointer pSpell) // Becoming a Shadoweave Tailor
{
	if(pSpell->u_caster->IsPlayer() == false)
		return true;

	PlayerPointer	pPlayer= TO_PLAYER(pSpell->u_caster);
	QuestLogEntry	 *pQuest	= pPlayer->GetQuestLogForEntry(10872);
	if(pQuest == NULL)
		return true;

	if ( pQuest && pQuest->GetMobCount(0) < pQuest->GetQuest()->required_mobcount[0] )
	{
		pQuest->SetMobCount(0, pQuest->GetMobCount(0)+1);
		pQuest->SendUpdateAddKill(0);
		pQuest->UpdatePlayerFields();
	}
	return true;
}
Exemple #8
0
   void OnDied(Unit * mKiller)
   {
	      if (mKiller->IsPlayer())
      {
         QuestLogEntry *qle = TO_PLAYER(mKiller)->GetQuestLogForEntry(11230);
         if( qle != NULL )
         {
            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;
            }
         }
      }
   }
		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();
					};
				};
			};
		};
Exemple #10
0
bool PrayerBeads(uint32 i, Spell * pSpell)
{
 if( !pSpell->p_caster )
  return true;

 Unit * target = pSpell->GetUnitTarget();
 if( !target || target->GetEntry() != 22431 )
  return true;

 Player * pPlayer = pSpell->p_caster;
 QuestLogEntry * en = pPlayer->GetQuestLogForEntry( 10935 );
 if( en && en->GetMobCount( 0 ) < en->GetQuest()->required_mobcount[0] )
	{
  en->SetMobCount( 0, en->GetMobCount( 0 ) + 1 );
  en->SendUpdateAddKill( 0 );
  en->UpdatePlayerFields();
	}
 return true;
}
Exemple #11
0
bool EyesAbove(uint32 i, Spell * pSpell)
{
 if( !pSpell->p_caster )
  return true;

 Unit * target = pSpell->GetUnitTarget();
 if( !target || target->GetEntry() != 25432 || !target->isAlive())
  return true;
  
 Player * pPlayer = pSpell->p_caster;
 QuestLogEntry * en = pPlayer->GetQuestLogForEntry( 12453 );
 if( en && en->GetMobCount( 0 ) < en->GetQuest()->required_mobcount[0] )
	{
  en->SetMobCount( 0, en->GetMobCount( 0 ) + 1 );
  en->SendUpdateAddKill( 0 );
  en->UpdatePlayerFields();
	}
 return true;
}
Exemple #12
0
	void OnActivate(Player* pPlayer)
	{
		if(pPlayer->HasFinishedQuest(4284))
		{
			QuestLogEntry *en = pPlayer->GetQuestLogForEntry(4287);
			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();
				return;
			}
		}
		else if(pPlayer->HasFinishedQuest(4284) == false)
		{
			pPlayer->BroadcastMessage("You need to have completed the quest : Crystals of Power");
		}
	}
Exemple #13
0
bool OrbOfMurlocControl(uint32 i, Spell* pSpell)
{
	if(pSpell->m_caster->IsPlayer() == false)
		return true;

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

	QuestLogEntry *pQuest = plr->GetQuestLogForEntry(11541);
	if(pQuest == NULL)
		return true;

	Unit* mTarget;
	Creature* cTarget;

	for(ObjectSet::iterator itr = pSpell->m_caster->GetInRangeSetBegin(); itr != pSpell->m_caster->GetInRangeSetEnd(); itr++)
	{
		if((*itr)->IsUnit())
			mTarget = TO_UNIT(*itr);
		else
			continue;

		if(pSpell->m_caster->CalcDistance(mTarget) > 5 )
			continue;

		cTarget = TO_CREATURE(mTarget);

		if(cTarget->GetEntry() == 25084)
		{
		  if(pQuest->GetMobCount(0) < pQuest->GetQuest()->required_mobcount[0])
		  {
			pQuest->SetMobCount(0, pQuest->GetMobCount(0) + 1);
			pQuest->SendUpdateAddKill(0);		
			Creature* FreedGreengill = sEAS.SpawnCreature(plr, 25085, cTarget->GetPositionX(), cTarget->GetPositionY(), cTarget->GetPositionZ(), cTarget->GetOrientation(), 0);
			FreedGreengill->Despawn(6*60*1000, 0);
			cTarget->Despawn(0, 6*60*1000);
			pQuest->UpdatePlayerFields();
			return true;
		  }  
		}
  }
  return true;
}
		void OnActivate(Player* pPlayer)
		{
			QuestLogEntry* qle = pPlayer->GetQuestLogForEntry(9667);
			if(qle == NULL)
				return;

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

			Creature* princess = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 17682);
			if(!princess)
				return;

			princess->Despawn(1000, 6 * 60 * 1000);
			return;
		}
Exemple #15
0
bool PlagueSpray(uint32 i, Spell * pSpell)
{
 if( !pSpell->p_caster )
  return true;

 Unit * target = pSpell->GetUnitTarget();
 if( !target || target->GetEntry() != 23652 || !target->isAlive())
  return true;
 else if(!target || target->GetEntry() != 23652 || !target->HasAura(40467)) 
  return false;
 
 Player * pPlayer = pSpell->p_caster;
 QuestLogEntry * en = pPlayer->GetQuestLogForEntry( 11307 );
 if( en && en->GetMobCount( 0 ) < en->GetQuest()->required_mobcount[0] )
 {
  en->SetMobCount( 0, en->GetMobCount( 0 ) + 1 );
  en->SendUpdateAddKill( 0 );
 en->UpdatePlayerFields();
   }
 return true;
}
Exemple #16
0
bool HodirsHorn(uint32 i, Spell * pSpell)
{
 if( !pSpell->p_caster )
  return true;

 Unit * target = pSpell->GetUnitTarget();
  if( !target || ( target->GetEntry() != 29974 && target->GetEntry() != 30144 && target->GetEntry() != 30135)  || !target->IsDead())
  return true;

 TO_CREATURE(target)->Despawn(500, 360000);

 Player * pPlayer = pSpell->p_caster;
 QuestLogEntry * en = pPlayer->GetQuestLogForEntry( 12977 );
 if( en && en->GetMobCount( 0 ) < en->GetQuest()->required_mobcount[0] )
 {
  en->SetMobCount( 0, en->GetMobCount( 0 ) + 1 );
  en->SendUpdateAddKill( 0 );
  en->UpdatePlayerFields();
   }
 return true;
}
Exemple #17
0
bool PoweringOurDefenses(uint32 i, Spell* pSpell)
{
    if(pSpell->u_caster->IsPlayer() == false)
        return true;

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

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

    // Angelis : Need to script the scourge attack

    if( qle && qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0] )
    {
        qle->SetMobCount(0, qle->GetMobCount(0)+1);
        qle->SendUpdateAddKill(0);
        qle->UpdatePlayerFields();
    }
    return true;
}
Exemple #18
0
bool RagefistTorch(uint32 i, Spell * pSpell)
{
 if( !pSpell->p_caster )
  return true;

 Unit * target = pSpell->GetUnitTarget();
 if( !target || ( target->GetEntry() != 25342 && target->GetEntry() != 25343))
  return true;

 ((Creature*)target)->Despawn(500, 360000);

 Player * pPlayer = pSpell->p_caster;
 QuestLogEntry * en = pPlayer->GetQuestLogForEntry( 11593 );
 if( en && en->GetMobCount( 0 ) < en->GetQuest()->required_mobcount[0] )
 {
  en->SetMobCount( 0, en->GetMobCount( 0 ) + 1 );
  en->SendUpdateAddKill( 0 );
  en->UpdatePlayerFields();
   }
 return true;
 }
Exemple #19
0
bool TelluricPoultice(uint32 i, Spell * pSpell)
{
 if( !pSpell->p_caster )
  return true;

 Unit * target = pSpell->GetUnitTarget();
 if( !target || target->GetEntry() != 30035)
  return true;

 ((Creature*)target)->Despawn(500, 360000);

 Player * pPlayer = pSpell->p_caster;
 QuestLogEntry * en = pPlayer->GetQuestLogForEntry( 12937 );
 if( en && en->GetMobCount( 0 ) < en->GetQuest()->required_mobcount[0] )
 {
	en->SetMobCount( 0, en->GetMobCount( 0 ) + 1 );
	en->SendUpdateAddKill( 0 );
	en->UpdatePlayerFields();
   }
 return true;
}
Exemple #20
0
bool FindingTheSource(uint32 i, Spell * pSpell)
{
   if(pSpell->u_caster == NULL || !pSpell->u_caster->IsPlayer())
      return true;

   Player *plr = (Player*)pSpell->u_caster;
   QuestLogEntry *qle = plr->GetQuestLogForEntry(974);
   
   if( !qle )
      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;
}
Exemple #21
0
bool StoppingtheSpread(uint32 i, Spell* pSpell)
{
  Player *pPlayer = (Player*)pSpell->u_caster;
  if(!pPlayer)
	return true;

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

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

  if(qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0])
  {
	  qle->SetMobCount(0, qle->GetMobCount(0)+1);
	  qle->SendUpdateAddKill(0);
	  qle->UpdatePlayerFields();
  }
  return true;
}
// 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;
}
Exemple #23
0
bool Screwdriver(uint32 i, Spell * pSpell)
{
 if( !pSpell->p_caster )
  return true;

 Unit * target = pSpell->GetUnitTarget();
 if( !target || target->GetEntry() != 25753 || !target->IsDead())
  return true;

 ((Creature*)target)->Despawn(500, 360000);

 Player * pPlayer = pSpell->p_caster;
 QuestLogEntry * en = pPlayer->GetQuestLogForEntry( 11730 );
 if( en && en->GetMobCount( 0 ) < en->GetQuest()->required_mobcount[0] )
 {
  en->SetMobCount( 0, en->GetMobCount( 0 ) + 1 );
  en->SendUpdateAddKill( 0 );
  en->UpdatePlayerFields();
   }
 return true;
}
	void OnActivate(PlayerPointer pPlayer)
	{
		if(!pPlayer)
			return;

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

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

		CreaturePointer prisoner = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 17375);
		if(!prisoner)
			return;

		prisoner->Despawn(1, 6*60*1000);
	}
Exemple #25
0
        void GossipSelectOption(Object* pObject, Player* plr, uint32 Id, uint32 IntId, const char* Code)
        {
            if(!pObject->IsCreature())
                return;

            switch(IntId)
            {
                case 1:
                    {
                        GossipMenu* Menu;
                        objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 10614, plr);
                        Menu->AddItem(0, "But you are dragons! How could orcs do this to you?", 2);
                        Menu->SendTo(plr);
                    }
                    break;
                case 2:
                    {
                        GossipMenu* Menu;
                        objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 10615, plr);
                        Menu->AddItem(0, "Your mate?", 3);
                        Menu->SendTo(plr);
                    }
                    break;
                case 3:
                    {
                        GossipMenu* Menu;
                        objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 10616, plr);
                        Menu->AddItem(0, "I have battled many beasts, dragon. I will help you.", 4);
                        Menu->SendTo(plr);
                    }
                    break;
                case 4:
                    {
                        QuestLogEntry* pQuest = plr->GetQuestLogForEntry(10814);
                        if(pQuest && pQuest->GetMobCount(0) < pQuest->GetQuest()->required_mobcount[0])
                        {
                            pQuest->SetMobCount(0, 1);
                            pQuest->SendUpdateAddKill(0);
                            pQuest->UpdatePlayerFields();
                        }
                    }
                    break;
            }
        }
bool HealingTheLake(uint32 i, SpellPointer pSpell)
{
	if ( pSpell == NULL || pSpell->u_caster == NULL || !pSpell->u_caster->IsPlayer() )
		return true;

	PlayerPointer pPlayer = TO_PLAYER( pSpell->u_caster );

	QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry( 9294 );
	if ( pQuest == NULL )
		return true;

	if ( pQuest->GetMobCount( 0 ) < pQuest->GetQuest()->required_mobcount[0] )
	{
		pQuest->SetMobCount( 0, pQuest->GetMobCount( 0 ) + 1 );
		pQuest->SendUpdateAddKill( 0 );
		pQuest->UpdatePlayerFields();
		
		return true;
	}
	
	return true;
}
Exemple #27
0
bool ConvertingSentry(uint32 i, Spell* pSpell)
{
  Player *caster = pSpell->p_caster;
  if(caster == NULL)
    return true;

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

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

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

  QuestLogEntry *qle = NULL;
  qle = caster->GetQuestLogForEntry(11525);
  if(qle == NULL)
  {
	qle = caster->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();

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

  return true;
}
Exemple #28
0
bool ADireSituation(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(10506);
  if(qle == NULL)
    return true;

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

  return true;
}
Exemple #29
0
bool IncineratingOil(uint32 i, Spell * pSpell)

{
 if( !pSpell->p_caster )
  return true;

 Unit * target = pSpell->GetUnitTarget();
 if( !target || target->GetEntry() != 28156 )
  return true;

 TO_CREATURE(target)->Despawn(500, 360000);

 Player * pPlayer = pSpell->p_caster;
 QuestLogEntry * en = pPlayer->GetQuestLogForEntry( 12568 );
 if( en && en->GetMobCount( 0 ) < en->GetQuest()->required_mobcount[0] )
	{
  en->SetMobCount( 0, en->GetMobCount( 0 ) + 1 );
  en->SendUpdateAddKill( 0 );
  en->UpdatePlayerFields();
	}
 return true;
}
Exemple #30
0
//Ruthless Cunning
bool RuthlessCunning(uint32 i, Spell * pSpell)
{
	if(!pSpell->u_caster->IsPlayer())
		return true;
	
	Player *plr = (Player*)pSpell->u_caster;
	Creature * kilsorrow = plr->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(plr->GetPositionX(), plr->GetPositionY() , plr->GetPositionZ());

	if(!kilsorrow || kilsorrow->isAlive())
		return true;

	QuestLogEntry *qle = plr->GetQuestLogForEntry(9927);

	if(qle && qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0])
	{
		kilsorrow->Despawn(0, 60000);
		qle->SetMobCount(0, qle->GetMobCount(0)+1);
		qle->SendUpdateAddKill(0);
		qle->UpdatePlayerFields();
	}
	return true;
}