Likes: 0
Results 1 to 1 of 1
Thread: Duel Reset + Config
-
16-01-15, 02:31 AM #1
Duel Reset + Config
Register to remove this adPHP Code:/*******************************************************
# 2015 #
* Duel Reset+Config *
# Release by Ghostcrawler336 #
* Add Config By : H.NoRRt *
# Worked : 100% #
********************************************************/
#include "ScriptPCH.h"
#include "Config.h"
#include "Language.h"
bool Duel_Resets;
class Duel_Reset : public PlayerScript
{
public:
Duel_Reset() : PlayerScript("Duel_Reset"){}
void OnDuelEnd(Player* pWinner, Player* pLoser, DuelCompleteType /*type*/)
{
if (pWinner->GetZoneId() == 33 && pLoser->GetZoneId() == 33)
pWinner->RemoveAllSpellCooldown();
pLoser->RemoveAllSpellCooldown();
pWinner->SetHealth(pWinner->GetMaxHealth());
if ( pWinner->getPowerType() == POWER_MANA )
pWinner->SetPower(POWER_MANA, pWinner->GetMaxPower(POWER_MANA));
if (Duel_Resets)
pLoser->SetHealth(pLoser->GetMaxHealth());
if ( pLoser->getPowerType() == POWER_MANA )
pLoser->SetPower(POWER_MANA, pLoser->GetMaxPower(POWER_MANA));
}
};
class Duel_Reset_WorldScript : public WorldScript
{
public:
Duel_Reset_WorldScript() : WorldScript("Script_npc_changer_WorldScript") { }
void OnConfigLoad(bool /*reload*/)
{
Duel_Resets = sConfigMgr->GetBoolDefault("Duel.Reset", true);
}
};
void AddSC_Duel_Reset()
{
new Duel_Reset();
new Duel_Reset_WorldScript();
}
PHP Code:#######################################################
##### Duel Reset ##### Add Config By : H.NoRRt
###########################################################
#
# Duel.Reset
# 1 = Enable
# 0 = Disable
#
# Default = 0
Duel.Reset = 0
#######################################################################
Credits: norrt
› See More: Duel Reset + Config
Related Threads - Scroll Down after related threads if you are only interested to view replies for above post/thread
Visitors found this page by searching for:
Nobody landed on this page from a search engine, yet!
SEO Blog