#include "ScriptPCH.h"
#define GOSSIP_TEXT_WELCOME 40034
#define GOSSIP_NO_BUFF "Спасибо, проду позже."
#define GOSSIP_BOM "Повысить выносливость на 10%"
#define GOSSIP_BOK "Повысить разум на 10%"
#define GOSSIP_BOW "Повысить ловкость на 10%"
#define GOSSIP_BOS "Повысить силу на 10%"
#define GOSSIP_INT "Повысить дух на 10%"
#define GOSSIP_KIT "Бесплатные баффы"
class Buff : public CreatureScript
{
public:
Buff() : CreatureScript("Buff") { }
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
pPlayer->ADD_GOSSIP_ITEM(4, GOSSIP_BOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
pPlayer->ADD_GOSSIP_ITEM(4, GOSSIP_BOK, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
pPlayer->ADD_GOSSIP_ITEM(4, GOSSIP_BOW, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
pPlayer->ADD_GOSSIP_ITEM(4, GOSSIP_BOS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
pPlayer->ADD_GOSSIP_ITEM(4, GOSSIP_INT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
pPlayer->ADD_GOSSIP_ITEM(4, GOSSIP_KIT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
pPlayer->ADD_GOSSIP_ITEM(4, GOSSIP_NO_BUFF, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXT_WELCOME, pCreature->GetGUID());
return true;
}
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
pPlayer->PlayerTalkClass->ClearMenus();
switch(uiAction)
{
case GOSSIP_ACTION_INFO_DEF + 1:// Buff
if (pPlayer->GetItemCount(29434) < 15)
{
pCreature->MonsterSay("Недостаточно знаков справедливости, требуется 15 !", LANG_UNIVERSAL, NULL);
} else {
pCreature->MonsterSay("Здорово ! А теперь наслождайся !", LANG_UNIVERSAL, NULL);
pPlayer->CastSpell(pPlayer, 23737, true);
pPlayer->DestroyItemCount(29434, 15, true);
}
pPlayer->CLOSE_GOSSIP_MENU();
break;
case GOSSIP_ACTION_INFO_DEF + 2:// Buff
if (pPlayer->GetItemCount(29434) < 15)
{
pCreature->MonsterSay("Недостаточно знаков справедливости, требуется 15 !", LANG_UNIVERSAL, NULL);
} else {
pCreature->MonsterSay("Здорово ! А теперь наслождайся !", LANG_UNIVERSAL, NULL);
pPlayer->CastSpell(pPlayer, 23766, true);
pPlayer->DestroyItemCount(29434, 15, true);
}
pPlayer->CLOSE_GOSSIP_MENU();
break;
case GOSSIP_ACTION_INFO_DEF + 3:// Buff
if (pPlayer->GetItemCount(29434) < 15)
{
pCreature->MonsterSay("Недостаточно знаков справедливости, требуется 15 !", LANG_UNIVERSAL, NULL);
} else {
pCreature->MonsterSay("Здорово ! А теперь наслождайся !", LANG_UNIVERSAL, NULL);
pPlayer->CastSpell(pPlayer, 23736, true);
pPlayer->DestroyItemCount(29434, 15, true);
}
pPlayer->CLOSE_GOSSIP_MENU();
break;
case GOSSIP_ACTION_INFO_DEF + 4:// Buff
if (pPlayer->GetItemCount(29434) < 15)
{
pCreature->MonsterSay("Недостаточно знаков справедливости, требуется 15 !", LANG_UNIVERSAL, NULL);
} else {
pCreature->MonsterSay("Здорово ! А теперь наслождайся !", LANG_UNIVERSAL, NULL);
pPlayer->CastSpell(pPlayer, 23735, true);
pPlayer->DestroyItemCount(29434, 15, true);
}
pPlayer->CLOSE_GOSSIP_MENU();
break;
case GOSSIP_ACTION_INFO_DEF + 5:// Buff
if (pPlayer->GetItemCount(29434) < 15)
{
pCreature->MonsterSay("Недостаточно знаков справедливости, требуется 15 !", LANG_UNIVERSAL, NULL);
} else {
pCreature->MonsterSay("Здорово ! А теперь наслождайся !", LANG_UNIVERSAL, NULL);
pPlayer->CastSpell(pPlayer, 23738, true);
pPlayer->DestroyItemCount(29434, 15, true);
}
pPlayer->CLOSE_GOSSIP_MENU();
break;
case GOSSIP_ACTION_INFO_DEF + 6:// Buff
pPlayer->CastSpell(pPlayer, 69381, true);
pPlayer->CastSpell(pPlayer, 48162, true);
pPlayer->CastSpell(pPlayer, 48170, true);
pPlayer->CastSpell(pPlayer, 48074, true);
pPlayer->CastSpell(pPlayer, 25898, true);
pPlayer->CastSpell(pPlayer, 72484, true);
pPlayer->CLOSE_GOSSIP_MENU();
break;
case GOSSIP_ACTION_INFO_DEF + 7: // end dialog
pPlayer->CLOSE_GOSSIP_MENU();
break;
}
return true;
}
};
void AddSC_Buff()
{
new Buff;
}