All pastes #621036 Raw Edit

Mine

public text v1 · immutable
·published 2007-07-15 22:06 UTC
rendered paste body
/* Copyright (C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

Script for Blessings of the Ancients quest(9785)
mobs 17900 & 17901
*/

#include "../sc_defines.h"
/*
#define MARK_OF_LORE_R1		31808;
#define MARK_OF_LORE_R2		31810;
#define MARK_OF_LORE_R3		31811;
#define MARK_OF_LORE_R4		31815;
#define MARK_OF_WAR_R1		31807;
#define MARK_OF_WAR_R2		31812;
#define MARK_OF_WAR_R3		31813;
#define MARK_OF_WAR_R4		31814;
*/

bool GossipHello_sc_mob_q9785(Player *player, Creature *_Creature )

{
player->ADD_GOSSIP_ITEM( 7, "I ask for your blessing", GOSSIP_SENDER_MAIN, 1203);
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetGUID());
return true;
}

void SendDefaultMenu_sc_mob_q9785(Player *player, Creature *_Creature, uint32 action )
{

if(player->isAttacked())
  {
	_Creature->Say("You are in combat!", LANG_UNIVERSAL, NULL);
   return;
}
	if( player->getLevel() < 58  )  
  
   {
	  
	  _Creature->Say("You should not be in outlands", LANG_UNIVERSAL, NULL);
	  return;
   }
switch(action)
{
case 1203: 
player->CLOSE_GOSSIP_MENU();


if ( _Creature->GetEntry() == 17900) 
{
	if ( player->GetReputationRank(942)==REP_FRIENDLY )
	{
		_Creature->CastSpell(player, 31808, NULL, NULL, NULL, NULL);
		_Creature->Say("You have my blessing", LANG_UNIVERSAL, NULL);
	}
	if ( player->GetReputationRank(942) == REP_HONORED )
	{
		_Creature->CastSpell(player, 31810, NULL, NULL, NULL, NULL);
		_Creature->Say("You have my blessing", LANG_UNIVERSAL, NULL);
	}
	if ( player->GetReputationRank(942) == REP_REVERED )
	{
		_Creature->CastSpell(player, 31811, NULL, NULL, NULL, NULL);
		_Creature->Say("You have my blessing", LANG_UNIVERSAL, NULL);
	}
	if ( player->GetReputationRank(942) == REP_EXALTED )
	{
		_Creature->CastSpell(player, 31815, NULL, NULL, NULL, NULL);
		_Creature->Say("You have my blessing", LANG_UNIVERSAL, NULL);
	}
	if ( player->GetReputationRank(942) < REP_FRIENDLY )
	{
		_Creature->Say("You need higher standing with Cenarion Expedition to recive my blessing.", LANG_UNIVERSAL, NULL);
	}
	if ( player->HasAura(31808,0) && player->GetQuestStatus(9785) == QUEST_STATUS_INCOMPLETE )
	{
	player->CompleteQuest(9785);
	}
	if ( player->HasAura(31810,0) && player->GetQuestStatus(9785) == QUEST_STATUS_INCOMPLETE )
	{
	player->CompleteQuest(9785);
	}
	if ( player->HasAura(31811,0) && player->GetQuestStatus(9785) == QUEST_STATUS_INCOMPLETE )
	{
	player->CompleteQuest(9785);
	}
	if ( player->HasAura(31814,0) && player->GetQuestStatus(9785) == QUEST_STATUS_INCOMPLETE )
	{
	player->CompleteQuest(9785);
	}
}
else if ( _Creature->GetEntry() == 17901) 
{
	if ( player->GetReputationRank(942)==REP_FRIENDLY )
	{
		_Creature->CastSpell(player, 31807, NULL, NULL, NULL, NULL);
		_Creature->Say("You have my blessing", LANG_UNIVERSAL, NULL);
	}
	if ( player->GetReputationRank(942) == REP_HONORED )
	{
		_Creature->CastSpell(player, 31812, NULL, NULL, NULL, NULL);
		_Creature->Say("You have my blessing", LANG_UNIVERSAL, NULL);
	}
	if ( player->GetReputationRank(942) == REP_REVERED )
	{
		_Creature->CastSpell(player, 31813, NULL, NULL, NULL, NULL);
		_Creature->Say("You have my blessing", LANG_UNIVERSAL, NULL);
	}
	if ( player->GetReputationRank(942) == REP_EXALTED )
	{
		_Creature->CastSpell(player, 31814, NULL, NULL, NULL, NULL);
		_Creature->Say("You have my blessing", LANG_UNIVERSAL, NULL);
	}
	if ( player->GetReputationRank(942) < REP_FRIENDLY )
	{
		_Creature->Say("You need friendly or higher standing with Cenarion Expedition to recive my blessing.", LANG_UNIVERSAL, NULL);
	}
	if ( player->HasAura(31807,0) && player->GetQuestStatus(9785) == QUEST_STATUS_INCOMPLETE )
	{
	player->CompleteQuest(9785);
	}
	if ( player->HasAura(31812,0) && player->GetQuestStatus(9785) == QUEST_STATUS_INCOMPLETE )
	{
	player->CompleteQuest(9785);
	}
	if ( player->HasAura(31813,0) && player->GetQuestStatus(9785) == QUEST_STATUS_INCOMPLETE )
	{
	player->CompleteQuest(9785);
	}
	if ( player->HasAura(31814,0) && player->GetQuestStatus(9785) == QUEST_STATUS_INCOMPLETE )
	{
	player->CompleteQuest(9785);
	}
}
else
{
_Creature->Say("Speak to your server admin they added script to wrong NPC", LANG_UNIVERSAL, NULL);
}
break;
}
}

bool GossipSelect_sc_mob_q9785(Player *player, Creature *_Creature, uint32 sender, uint32 action )
{
// Main menu
if (sender == GOSSIP_SENDER_MAIN)
SendDefaultMenu_sc_mob_q9785(player, _Creature, action   );
return true;
}

void AddSC_sc_mob_q9785()
{

Script *newscript;

newscript = new Script;
newscript->Name="sc_mob_q9785";
newscript->pGossipHello = &GossipHello_sc_mob_q9785;
newscript->pGossipSelect = &GossipSelect_sc_mob_q9785;
m_scripts[nrscripts++] = newscript;
}