Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as C++ by Aggi ( 17 years ago )
/////////////////////////////////////////////
// Master of Duels - The NPC
// by Aggi
// - Reset von Cooldowns -
/////////////////////////////////////////////
#include "precompiled.h"
bool GossipHello_MODNPC(Player *player, Creature *_Creature)
{
player->ADD_GOSSIP_ITEM(0, "Bitte setzt meine Abklingzeiten zurueck, Meister!" , GOSSIP_SENDER_MAIN, 1000);
_Creature->sendPreparedGossip( player);
return true;
}
void SendDefaultMenu_MODNPC(Player *player, Creature *_Creature, uint32 action )
{
//Während eines Kampfes ist ein Reset nicht erlaubt
if (player->isInCombat())
{
_Creature->MonsterWhisper("Du bist in einem Kampf beteiligt!", player->GetGUID(), NULL);
player->CLOSE_GOSSIP_MENU();
return;
}
switch(action)
{
case 1000: // Standard-Reset
player->CLOSE_GOSSIP_MENU();
//Cooldowns zurücksetzten!
//remove all cooldowns <= 15 minutes - rejected
//player->RemoveArenaSpellCooldowns();
// remove cooldowns on spells that has CD between 2 and 10 minutes
// ->MaNGOS @ player.cpp
player->RemoveDuelSpellCooldowns();
//Bestätigungsmeldung
_Creature->MonsterWhisper("Die Abklingzeiten deiner Faehigkeiten wurden zurueckgesetzt!", player->GetGUID(), NULL);
break;
}
}
bool GossipSelect_MODNPC(Player *player, Creature *_Creature, uint32 sender, uint32 action)
{
//Hauptmenü
if (sender == GOSSIP_SENDER_MAIN)
SendDefaultMenu_MODNPC( player, _Creature, action );
return true;
}
void AddSC_masterofduelsnpc()
{
Script *newscript;
newscript = new Script;
newscript->Name="masterofduelsnpc";
newscript->pGossipHello = &GossipHello;_MODNPC;
newscript->pGossipSelect = &GossipSelect;_MODNPC;
newscript->RegisterSelf();
}
Revise this Paste
Parent: 10854