Example #1
0
bool DouseEternalFlame(uint32 i, Spell* pSpell)
{
	Player *plr = (Player*)pSpell->u_caster;
	if(!plr)
		return true;

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

	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();
			}
	}
	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->SetStandState(0);
  target->setDeathState(ALIVE);

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

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

  return true;
}
Example #3
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;
}
Example #4
0
bool FilledShimmeringVessel(uint32 i, Spell* pSpell) // Blood Elf ress. quest
{
	if(!pSpell->u_caster->IsPlayer() || !pSpell->GetUnitTarget())
		return true;

	Player *plr = (Player*)pSpell->u_caster;
	
	Unit* u_target = pSpell->GetUnitTarget();
	Creature * c_target = (u_target->IsCreature())?((Creature*)u_target):NULL;
	if(c_target == NULL)
		return true;

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

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

	c_target->SetStandState(0);
	c_target->setDeathState(ALIVE);
	c_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 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 #7
0
// A Lesson in Fear
bool PlantForsakenBanner(uint32 i, Spell* pSpell)
{
	if(pSpell->u_caster->IsPlayer() == false)
		return true;

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

	QuestLogEntry* pQuest = pPlayer->GetQuestLogForEntry(11282);
	if( pQuest == NULL )
		return true;
	
	Creature* target = static_cast<Creature*>(pSpell->GetUnitTarget());
	if ( target == NULL || target->isAlive() )
		return true;

	uint32 cit = target->GetEntry();
	switch(cit)
	{
	case 24161:
		sEAS.KillMobForQuest( pPlayer, 11282, 0 );
		target->Despawn(0, 3*60*1000);
		break;
	case 24016:
		sEAS.KillMobForQuest( pPlayer, 11282, 1 );
		target->Despawn(0, 3*60*1000);
		break;
	case 24162:
		sEAS.KillMobForQuest( pPlayer, 11282, 2 );
		target->Despawn(0, 3*60*1000);
		break;
	}
	return true;
}
Example #8
0
		void OnLoad()
		{
			Player * pPlayer = GetNearestPlayer();

			if(pPlayer)
			{
				uint32 quests[] = { 12667, 12672, 12668, 12674, 12675, 0 };
				QuestLogEntry * en;
				bool has_quest = false;
				for( int i = 0; i < 6; i++ )
				{
					en = pPlayer->GetQuestLogForEntry( quests[i] );

					if(en != NULL)
					{
						has_quest = true;
						break;
					}
				}

				if( !has_quest )
				{
					pPlayer->RemoveAura(51671);
					return;
				}

				pPlayer->CastSpell(pPlayer, 51671, true);
			}
		}
Example #9
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 #10
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 #11
0
// Fumping
bool Fumping(uint32 i, Aura* pAura, bool apply)
{
  if(apply)
    return true;

  if(!pAura->GetUnitCaster()->IsPlayer())
    return true;

  Player *plr = (Player*)pAura->GetUnitCaster();
  QuestLogEntry *qle = plr->GetQuestLogForEntry(10929);
  
  if(qle == NULL)
    return true;

  uint8 chance = RandomUInt(1);
  uint32 entry = 0;

  switch(chance)
  {
    case 0:
      entry = 22482;
      break;
      
    case 1:
      entry = 22483;
      break;
  }

  Creature *creat = sEAS.SpawnCreature(plr, entry, plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(), 5*60*1000);
  
  if(entry == 22483) //Sand Gnomes ;)
    creat->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "YIEEEEEEEAA!");

  return true;
}
Example #12
0
bool Carcass(uint32 i, Spell* pSpell) // Becoming a Shadoweave Tailor
{
	if(!pSpell->u_caster->IsPlayer())
		return true;

	Player			*pPlayer = static_cast< 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);
		FlayerCarcass->Despawn(60000);
	}
	if ( NetherDrake == NULL )
		return true;

	if ( NetherDrake->HasAura(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;
}
 void OnDied(Unit* mKiller)
 {
     if(_unit->m_escorter == NULL)
         return;
     Player* plr = _unit->m_escorter;
     _unit->m_escorter = NULL;
     plr->GetQuestLogForEntry(6523)->Fail(false);
 }
Example #14
0
bool BurnItUp(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( 10087 );
	if ( pQuest == NULL )
		return true;

	if ( pQuest->GetMobCount( 0 ) < pQuest->GetQuest()->required_mobcount[0] )
	{
		GameObject *pEastern = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords( -300.0f, 2407.0f, 50.0f, 183122 );
		if( pEastern == NULL )
			pEastern = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords( -300.0f, 2407.0f, 50.0f, 185122 );

		if ( pEastern != NULL && pPlayer->CalcDistance( pPlayer, pEastern ) < 30 )
		{
			pQuest->SetMobCount( 0, pQuest->GetMobCount( 0 ) + 1 );
			pQuest->SendUpdateAddKill( 0 );
			pQuest->UpdatePlayerFields();
			
			GameObject *pGameobject = sEAS.SpawnGameobject( pPlayer, 183816, -300.0f, 2407.0f, 50.0f, 0, 4 );
			if ( pGameobject != NULL )
			{
     			sEAS.GameobjectDelete( pGameobject, 1 * 60 * 1000 );
			}

			return true;
		}
	}

	if ( pQuest->GetMobCount( 1 ) < pQuest->GetQuest()->required_mobcount[1] )
	{
		GameObject *pWestern = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords( -350.0f, 2708.0f, 35.0f, 183122 );
		if( pWestern == NULL )
			pWestern = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords( -300.0f, 2407.0f, 50.0f, 185122 );

		if ( pWestern != NULL && pPlayer->CalcDistance( pPlayer, pWestern ) < 30 )
		{
			pQuest->SetMobCount( 1, pQuest->GetMobCount( 1 ) + 1 );
			pQuest->SendUpdateAddKill( 1 );
			pQuest->UpdatePlayerFields();
			
			GameObject *pGameobject = sEAS.SpawnGameobject(pPlayer, 183816, -350.0f, 2708.0f, 35.0f, 0, 4);
			if ( pGameobject != NULL )
			{
     			sEAS.GameobjectDelete( pGameobject, 1 * 60 * 1000 );
			}

			return true;
		}
	}

	return true;
}
Example #15
0
bool BalanceMustBePreserved(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(9720);
	if(qle == NULL)
		return true;

    GameObject *lake1 = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(-756, 5926, 19, 300076);
	GameObject *lake2 = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(-213, 6302, 21, 300076);
	GameObject *lake3 = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(498, 8197, 21, 300076);
	GameObject *lake4 = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(566, 6358, 23, 300076);

	if(lake1 != NULL)
	{
		if(qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0])
		{
			qle->SetMobCount(0, qle->GetMobCount(0)+1);
			qle->SendUpdateAddKill(0);
			qle->UpdatePlayerFields();
		}
	}
	if(lake2 != NULL)
	{
		if(qle->GetMobCount(3) < qle->GetQuest()->required_mobcount[3])
		{
			qle->SetMobCount(3, qle->GetMobCount(3)+1);
			qle->SendUpdateAddKill(3);
			qle->UpdatePlayerFields();
		}
	}
	if(lake3 != NULL)
	{
		if(qle->GetMobCount(1) < qle->GetQuest()->required_mobcount[1])
		{
			qle->SetMobCount(1, qle->GetMobCount(1)+1);
			qle->SendUpdateAddKill(1);
			qle->UpdatePlayerFields();
		}
	}
	if(lake4 != NULL)
	{
		if(qle->GetMobCount(2) < qle->GetQuest()->required_mobcount[2])
		{
			qle->SetMobCount(2, qle->GetMobCount(2)+1);
			qle->SendUpdateAddKill(2);
			qle->UpdatePlayerFields();
		}
	}
	return true;
}
Example #16
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 #17
0
bool BurnItUp(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(10087);
	if(qle == NULL)
		return true;

	GameObject *east = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(-300, 2407, 50, 183122);
	GameObject *west = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(-350, 2708, 35, 185122);


	if(east)
	{
		if(pPlayer->CalcDistance(pPlayer, east) < 30)
		if(qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0])
		{
			qle->SetMobCount(0, qle->GetMobCount(0)+1);
			qle->SendUpdateAddKill(0);
			qle->UpdatePlayerFields();
			
			GameObject* obj = 0;

			obj = sEAS.SpawnGameobject(pPlayer, 183816, -300, 2407, 50, 0, 4);
     			sEAS.GameobjectDelete(obj, 1*60*1000);

			return true;
		}
	}

	if(west)
	{
		if(pPlayer->CalcDistance(pPlayer, west) < 30)
		if(qle->GetMobCount(1) < qle->GetQuest()->required_mobcount[1])
		{
			qle->SetMobCount(1, qle->GetMobCount(1)+1);
			qle->SendUpdateAddKill(1);
			qle->UpdatePlayerFields();
			
			GameObject* obj = 0;

			obj = sEAS.SpawnGameobject(pPlayer, 183816, -350, 2708, 35, 0, 4);
     			sEAS.GameobjectDelete(obj, 1*60*1000);

			return true;
		}
	}
	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);
        }
Example #20
0
bool RuneOfDistortion(uint32 i, Spell * pSpell)
{
	if ( pSpell == NULL || pSpell->p_caster == NULL )
		return true;
	
	Player * plr = TO_PLAYER(pSpell->u_caster);
	if( plr == NULL )
		return true;

	Creature * pCreature = sEAS.SpawnCreature(plr, 32162, plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(),0, 0);
	pCreature->Despawn(5*60*1000, 0);
	
	QuestLogEntry *qle = plr->GetQuestLogForEntry(13312);
	if(qle == NULL)
	{
		qle = plr->GetQuestLogForEntry(13337);
		if(qle == NULL)
			return true;
	}
	return true;
}
Example #21
0
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;
}
Example #22
0
	void OnDied(Unit *mKiller)
	{
		if(!mKiller->IsPlayer())
		return;

		Player *plr = (Player*)mKiller;
		uint8 chance = (uint8)RandomUInt(5);
		uint32 spawn = 0;
		
		switch(chance)
		{
		case 0:
		case 1:
			spawn = 22459; //Freed Shat'ar Warrior
			break; 

		case 2:
			spawn = 21661; //Cabal Skirmisher
			break;

		case 3:
			spawn = 16805; //Broken Skeleton
			break;

		case 4:
			spawn = 18470; //Bonelasher
			break;

		case 5:
			spawn = 22045; //Vengeful Husk
			break;
		}

		Creature *creat = sEAS.SpawnCreature(plr, spawn, _unit->GetPositionX(), _unit->GetPositionY(), _unit->GetPositionZ(), 1*60*1000);

		if(spawn != 22459)
			return;

		creat->GetAIInterface()->m_canMove = false;
		creat->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Finally! I'm free!");

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

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

		qle->SetMobCount(0, qle->GetMobCount(0)+1);
		qle->SendUpdateAddKill(0);
		qle->UpdatePlayerFields();
	}
Example #23
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;
}
Example #24
0
	void OnReachWP(uint32 iWaypointId, bool bForwards)
	{
		if(iWaypointId == 28)
		{
			_unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Tr..........");
			_unit->Despawn(5000,1000);
			sEAS.DeleteWaypoints(_unit);
			if(_unit->m_escorter == NULL)
				return;
			Player* plr = _unit->m_escorter;
			_unit->m_escorter = NULL;
			plr->GetQuestLogForEntry(4245)->SendQuestComplete();
		}
	}
Example #25
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();
		}
	}
	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 #27
0
	void OnReachWP(uint32 iWaypointId, bool bForwards)
	{
		if(iWaypointId == 15)
		{
			_unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Thanks, I found the fact that, it searched");
			_unit->Despawn(5000,1000);
			DeleteWaypoints(_unit);
			if(_unit->m_escorter == NULL)
				return;
			Player *plr = _unit->m_escorter;
			_unit->m_escorter = NULLPLR;
			plr->GetQuestLogForEntry(665)->SendQuestComplete();
		}
	}
	void OnReachWP(uint32 iWaypointId, bool bForwards)
	{
		if(iWaypointId == 9)
		{
			_unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Thanks, you helped me to overcome this obstacle");
			_unit->Despawn(5000,1000);
			sEAS.DeleteWaypoints(_unit);
			if(_unit->m_escorter == NULL)
				return;
			Player* plr = _unit->m_escorter;
			_unit->m_escorter = NULL;
			plr->GetQuestLogForEntry(435)->SendQuestComplete();
		}
	}
Example #29
0
bool TheArchmageStaff(uint32 i, Spell * pSpell)
{
	if(!pSpell->u_caster->IsPlayer())
		return true;

	Player *plr = (Player*)pSpell->u_caster;
	
	QuestLogEntry *qle = plr->GetQuestLogForEntry(10173);
	if(!qle)
		return true;

	EAS::SpawnCreature(plr, 19493, plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(),0, 0);
	return true;
}
Example #30
0
bool CallRexxar(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( 10742 );
	if ( pQuest != NULL )
	{
		sEAS.SpawnCreature( pPlayer, 21984, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), pPlayer->GetOrientation(), 2 * 60 * 1000);
		sEAS.SpawnCreature( pPlayer, 20555, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), pPlayer->GetOrientation(), 2 * 60 * 1000);
	}

	return true;
}