[c12591] Add support for the Rabbit Day

This commit is contained in:
Schmoozerd 2013-05-31 10:47:52 +01:00 committed by Antz
parent de4c1edf9b
commit 93c35f034d
5 changed files with 20 additions and 1 deletions

View file

@ -1363,6 +1363,17 @@ bool Creature::LoadFromDB(uint32 guidlow, Map* map)
if (m_isCreatureLinkingTrigger && isAlive())
GetMap()->GetCreatureLinkingHolder()->DoCreatureLinkingEvent(LINKING_EVENT_RESPAWN, this);
// check if it is rabbit day
if (isAlive() && sWorld.getConfig(CONFIG_UINT32_RABBIT_DAY))
{
time_t rabbit_day = time_t(sWorld.getConfig(CONFIG_UINT32_RABBIT_DAY));
tm rabbit_day_tm = *localtime(&rabbit_day);
tm now_tm = *localtime(&sWorld.GetGameTime());
if (now_tm.tm_mon == rabbit_day_tm.tm_mon && now_tm.tm_mday == rabbit_day_tm.tm_mday)
CastSpell(this, 10710 + urand(0, 2), true);
}
return true;
}

View file

@ -616,6 +616,7 @@ void World::LoadConfigSettings(bool reload)
setConfig(CONFIG_BOOL_CAST_UNSTUCK, "CastUnstuck", true);
setConfig(CONFIG_UINT32_MAX_SPELL_CASTS_IN_CHAIN, "MaxSpellCastsInChain", 10);
setConfig(CONFIG_UINT32_BIRTHDAY_TIME, "BirthdayTime", 1125180000);
setConfig(CONFIG_UINT32_RABBIT_DAY, "RabbitDay", 0);
setConfig(CONFIG_UINT32_INSTANCE_RESET_TIME_HOUR, "Instance.ResetTimeHour", 4);
setConfig(CONFIG_UINT32_INSTANCE_UNLOAD_DELAY, "Instance.UnloadDelay", 30 * MINUTE * IN_MILLISECONDS);

View file

@ -119,6 +119,7 @@ enum eConfigUInt32Values
CONFIG_UINT32_INSTANCE_UNLOAD_DELAY,
CONFIG_UINT32_MAX_SPELL_CASTS_IN_CHAIN,
CONFIG_UINT32_BIRTHDAY_TIME,
CONFIG_UINT32_RABBIT_DAY,
CONFIG_UINT32_MAX_PRIMARY_TRADE_SKILL,
CONFIG_UINT32_TRADE_SKILL_GMIGNORE_MAX_PRIMARY_COUNT,
CONFIG_UINT32_TRADE_SKILL_GMIGNORE_LEVEL,

View file

@ -579,6 +579,11 @@ LogColors = ""
# Set to birthday (date in unix time), By default 28th August 2005, when MaNGOS got its name
# Default: 1125180000
#
# RabbitDay
# Set to Rabbit Day (date in unix time), only the day and month are considered, the year is not important
# Default: 0 (off)
# Suggested: 954547200 (April 1st, 2000)
#
# Instance.IgnoreLevel
# Ignore level requirement to enter instance
# Default: 0 (false)
@ -790,6 +795,7 @@ ActivateWeather = 1
CastUnstuck = 1
MaxSpellCastsInChain = 10
BirthdayTime = 1125180000
RabbitDay = 0
Instance.IgnoreLevel = 0
Instance.IgnoreRaid = 0
Instance.ResetTimeHour = 4

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "12590"
#define REVISION_NR "12591"
#endif // __REVISION_NR_H__