From 93c35f034db623e86dae7475074b35fdf80ee760 Mon Sep 17 00:00:00 2001 From: Schmoozerd Date: Fri, 31 May 2013 10:47:52 +0100 Subject: [PATCH] [c12591] Add support for the Rabbit Day --- src/game/Creature.cpp | 11 +++++++++++ src/game/World.cpp | 1 + src/game/World.h | 1 + src/mangosd/mangosd.conf.dist.in | 6 ++++++ src/shared/revision_nr.h | 2 +- 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index ef3139f75..4005c3a5c 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -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; } diff --git a/src/game/World.cpp b/src/game/World.cpp index bb09c2a30..8120e80df 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -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); diff --git a/src/game/World.h b/src/game/World.h index d5702608c..5e43cdfd7 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -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, diff --git a/src/mangosd/mangosd.conf.dist.in b/src/mangosd/mangosd.conf.dist.in index df07bd588..5a25e9e7c 100644 --- a/src/mangosd/mangosd.conf.dist.in +++ b/src/mangosd/mangosd.conf.dist.in @@ -579,6 +579,11 @@ LogColors = "" # Set to birthday (date in unix time), By default 28th August 2005, when MaNGOS got it’s 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 diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 94d681608..5ed8f2b83 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "12590" + #define REVISION_NR "12591" #endif // __REVISION_NR_H__