Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
SpellItemMetadata.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#include "SpellItemMetadata.h"
7#include "SharedDefines.h"
8
9namespace Skyfire
10{
11namespace Spells
12{
13 namespace
14 {
15 uint32 const SPELL_DISARM_TRAP = 1842;
16 uint32 const SPELL_MIND_NUMBING_POISON = 38615;
17 uint32 const SPELL_GLOW_WORM = 64401;
18 uint32 const SPELL_TEMP_ENCHANT_FIVE_MINUTES_1 = 29702;
19 uint32 const SPELL_TEMP_ENCHANT_FIVE_MINUTES_2 = 37360;
20
21 uint32 const SPELL_VISUAL_THIRTY_MINUTE_ENCHANT = 215;
22 uint32 const SPELL_VISUAL_FISHING_POLE_BONUS = 563;
23 uint32 const SPELL_VISUAL_SHAMAN_ROCKBITER = 0;
24
25 uint32 const DURATION_FIVE_MINUTES = 300;
26 uint32 const DURATION_TEN_MINUTES = 600;
27 uint32 const DURATION_THIRTY_MINUTES = 1800;
28 uint32 const DURATION_ONE_HOUR = 3600;
29 }
30
31 bool ShouldDeactivateOwnedTrapOnOpenLock(uint32 spellId, uint32 gameObjectType, bool hasOwner)
32 {
33 return spellId == SPELL_DISARM_TRAP && gameObjectType == GAMEOBJECT_TYPE_TRAP && hasOwner;
34 }
35
36 uint32 GetTemporaryItemEnchantDurationSeconds(uint32 spellId, uint32 spellFamilyName, uint32 spellVisual)
37 {
38 if (spellId == SPELL_MIND_NUMBING_POISON)
39 return DURATION_THIRTY_MINUTES;
40
41 if (spellFamilyName == SPELLFAMILY_ROGUE)
42 return DURATION_ONE_HOUR;
43
44 if (spellFamilyName == SPELLFAMILY_SHAMAN)
45 return DURATION_THIRTY_MINUTES;
46
47 if (spellVisual == SPELL_VISUAL_THIRTY_MINUTE_ENCHANT)
48 return DURATION_THIRTY_MINUTES;
49
50 if (spellVisual == SPELL_VISUAL_FISHING_POLE_BONUS && spellId != SPELL_GLOW_WORM)
51 return DURATION_TEN_MINUTES;
52
53 if (spellVisual == SPELL_VISUAL_SHAMAN_ROCKBITER)
54 return DURATION_THIRTY_MINUTES;
55
56 if (spellId == SPELL_TEMP_ENCHANT_FIVE_MINUTES_1)
57 return DURATION_FIVE_MINUTES;
58
59 if (spellId == SPELL_TEMP_ENCHANT_FIVE_MINUTES_2)
60 return DURATION_FIVE_MINUTES;
61
62 return DURATION_ONE_HOUR;
63 }
64}
65}
std::uint32_t uint32
Definition Define.h:77
@ GAMEOBJECT_TYPE_TRAP
@ SPELLFAMILY_ROGUE
@ SPELLFAMILY_SHAMAN
uint32 GetTemporaryItemEnchantDurationSeconds(uint32 spellId, uint32 spellFamilyName, uint32 spellVisual)
bool ShouldDeactivateOwnedTrapOnOpenLock(uint32 spellId, uint32 gameObjectType, bool hasOwner)