[Spells] Added IsNightTime() for Dance of the Fireflies (#3667)

* Added IsNightOnly for Dance of the Fireflies spell which should only be cast at night from 7pm to 4pm.

* Update to include IsDayTime and replace magic numbers.
This commit is contained in:
regneq
2023-11-04 10:58:08 -07:00
committed by GitHub
parent d25cc35f1b
commit 1420983700
5 changed files with 45 additions and 0 deletions
+12
View File
@@ -711,6 +711,18 @@ bool Mob::DoCastingChecksZoneRestrictions(bool check_on_casting, int32 spell_id)
Message(Chat::Red, "You cannot cast detrimental spells here.");
return false;
}
/*
Zones where you can not cast a spell that is for daytime or nighttime only
*/
if (spells[spell_id].time_of_day == SpellTimeRestrictions::Day && !zone->zone_time.IsDayTime()) {
MessageString(Chat::Red, CAST_DAYTIME);
return false;
}
if (spells[spell_id].time_of_day == SpellTimeRestrictions::Night && !zone->zone_time.IsNightTime()) {
MessageString(Chat::Red, CAST_NIGHTTIME);
return false;
}
if (check_on_casting) {
/*
+2
View File
@@ -63,6 +63,8 @@
#define SAC_TOO_HIGH 204 //This being is too powerful to be a sacrifice.
#define CANNOT_SAC_SELF 205 //You cannot sacrifice yourself.
#define SILENCED_STRING 207 //You *CANNOT* cast spells, you have been silenced!
#define CAST_DAYTIME 208 //Spell can only be cast during the day.
#define CAST_NIGHTTIME 209 //Spell can only be cast during the night.
#define CANNOT_AFFECT_PC 210 //That spell can not affect this target PC.
#define SPELL_NEED_TAR 214 //You must first select a target for this spell!
#define SUMMON_ONLY_GROUP_CORPSE 215 //You must first target a living group member whose corpse you wish to summon.