Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
SpellEffectsItems.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 "AccountMgr.h"
7#include "AreaTrigger.h"
8#include "Battleground.h"
9#include "BattlegroundMgr.h"
10#include "BattlePetMgr.h"
11#include "CellImpl.h"
12#include "Common.h"
13#include "Creature.h"
14#include "CreatureAI.h"
15#include "DatabaseEnv.h"
16#include "DynamicObject.h"
17#include "Formulas.h"
18#include "GameObject.h"
19#include "GameObjectAI.h"
20#include "GossipDef.h"
21#include "GridNotifiers.h"
22#include "GridNotifiersImpl.h"
23#include "Group.h"
24#include "Guild.h"
25#include "GuildMgr.h"
26#include "InstanceScript.h"
27#include "Language.h"
28#include "Log.h"
29#include "MapManager.h"
30#include "ObjectAccessor.h"
31#include "ObjectMgr.h"
32#include "Opcodes.h"
33#include "OutdoorPvPMgr.h"
34#include "PathGenerator.h"
35#include "Pet.h"
36#include "Player.h"
37#include "ReputationMgr.h"
38#include "ScriptMgr.h"
39#include "SharedDefines.h"
40#include "SkillDiscovery.h"
41#include "SkillExtraItems.h"
42#include "SocialMgr.h"
43#include "Spell.h"
44#include "SpellAuraEffects.h"
45#include "SpellAuras.h"
46#include "SpellItemMetadata.h"
47#include "SpellMgr.h"
48#include "SpellValidation.h"
49#include "TemporarySummon.h"
50#include "Totem.h"
51#include "Unit.h"
52#include "UpdateData.h"
53#include "UpdateMask.h"
54#include "Util.h"
55#include "Vehicle.h"
56#include "VMapFactory.h"
57#include "World.h"
58#include "WorldPacket.h"
59
61{
63 return;
64
65 DoCreateItem(effIndex, m_spellInfo->Effects[effIndex].ItemType);
66 ExecuteLogEffectCreateItem(effIndex, m_spellInfo->Effects[effIndex].ItemType);
67
68 if (m_researchData && m_caster->GetTypeId() == TypeID::TYPEID_PLAYER && m_spellInfo->ResearchProject)
69 m_caster->ToPlayer()->SolveResearchProject(this);
70}
71
73{
75 return;
76
77 if (!unitTarget || unitTarget->GetTypeId() != TypeID::TYPEID_PLAYER)
78 return;
79
80 Player* player = unitTarget->ToPlayer();
81
82 uint32 item_id = m_spellInfo->Effects[effIndex].ItemType;
83
84 if (item_id)
85 DoCreateItem(effIndex, item_id);
86
87 // special case: fake item replaced by generate using spell_loot_template
88 if (m_spellInfo->IsLootCrafting())
89 {
90 if (item_id)
91 {
92 if (!player->HasItemCount(item_id))
93 return;
94
95 // remove reagent
96 uint32 count = 1;
97 player->DestroyItemCount(item_id, count, true);
98
99 // create some random items
101 }
102 else
103 player->AutoStoreLoot(m_spellInfo->Id, LootTemplates_Spell); // create some random items
104 }
106
107 // Pandaria archaeology projects use CREATE_ITEM_2; still need to consume fragments / advance the project.
108 if (m_researchData && m_caster->GetTypeId() == TypeID::TYPEID_PLAYER && m_spellInfo->ResearchProject)
109 m_caster->ToPlayer()->SolveResearchProject(this);
110}
111
113{
115 return;
116
117 if (!unitTarget || unitTarget->GetTypeId() != TypeID::TYPEID_PLAYER)
118 return;
119 Player* player = unitTarget->ToPlayer();
120
121 // create some random items
124}
125
127{
129 return;
130
131 if (m_caster->GetTypeId() != TypeID::TYPEID_PLAYER)
132 {
133 SF_LOG_DEBUG("spells", "WORLD: Open Lock - No Player Caster!");
134 return;
135 }
136
137 Player* player = m_caster->ToPlayer();
138
139 uint32 lockId = 0;
140 uint64 guid = 0;
141
142 // Get lockId
143 if (gameObjTarget)
144 {
145 GameObjectTemplate const* goInfo = gameObjTarget->GetGOInfo();
146 // Arathi Basin banner opening. /// @todo Verify correctness of this check
147 if ((goInfo->type == GAMEOBJECT_TYPE_BUTTON && goInfo->button.noDamageImmune) ||
148 (goInfo->type == GAMEOBJECT_TYPE_GOOBER && goInfo->goober.losOK))
149 {
150 //CanUseBattlegroundObject() already called in CheckCast()
151 // in battleground check
152 if (Battleground* bg = player->GetBattleground())
153 {
154 bg->EventPlayerClickedOnFlag(player, gameObjTarget);
155 return;
156 }
157 }
158 else if (goInfo->type == GAMEOBJECT_TYPE_FLAGSTAND)
159 {
160 //CanUseBattlegroundObject() already called in CheckCast()
161 // in battleground check
162 if (Battleground* bg = player->GetBattleground())
163 {
164 if (bg->GetTypeID(true) == BattlegroundTypeId::BATTLEGROUND_EY)
165 bg->EventPlayerClickedOnFlag(player, gameObjTarget);
166 return;
167 }
168 }
170 m_spellInfo->Id, gameObjTarget->GetGOInfo()->type, gameObjTarget->GetOwner()))
171 {
173 return;
174 }
176 // handle outdoor pvp object opening, return true if go was registered for handling
177 // these objects must have been spawned by outdoorpvp!
178 else if (gameObjTarget->GetGOInfo()->type == GAMEOBJECT_TYPE_GOOBER && sOutdoorPvPMgr->HandleOpenGo(player, gameObjTarget->GetGUID()))
179 return;
180 lockId = goInfo->GetLockId();
181 guid = gameObjTarget->GetGUID();
182 }
183 else if (itemTarget)
184 {
185 lockId = itemTarget->GetTemplate()->LockID;
186 guid = itemTarget->GetGUID();
187 }
188 else
189 {
190 SF_LOG_DEBUG("spells", "WORLD: Open Lock - No GameObject/Item Target!");
191 return;
192 }
193
194 SkillType skillId = SKILL_NONE;
195 int32 reqSkillValue = 0;
196 int32 skillValue;
197
198 SpellCastResult res = CanOpenLock(effIndex, lockId, skillId, reqSkillValue, skillValue);
200 {
201 SendCastResult(res);
202 return;
203 }
204
205 if (gameObjTarget)
206 {
207 // Archaeology finds: claim fragments here. Avoid opening empty chest loot after
208 // GAMEOBJECT_USE already processed the same node (Delete is deferred).
210 return;
211
213 }
214 else if (itemTarget)
216
217 // not allow use skill grow at item base open
218 if (!m_CastItem && skillId != SKILL_NONE)
219 {
220 // update skill if really known
221 if (uint32 pureSkillValue = player->GetPureSkillValue(skillId))
222 {
223 if (gameObjTarget)
224 {
225 // Allow one skill-up until respawned
226 if (!gameObjTarget->IsInSkillupList(player->GetGUIDLow()) &&
227 player->UpdateGatherSkill(skillId, pureSkillValue, reqSkillValue))
228 gameObjTarget->AddToSkillupList(player->GetGUIDLow());
229 }
230 else if (itemTarget)
231 {
232 // Do one skill-up
233 player->UpdateGatherSkill(skillId, pureSkillValue, reqSkillValue);
234 }
235 }
236 }
238}
239
241{
243 return;
244
245 if (m_caster->GetTypeId() != TypeID::TYPEID_PLAYER)
246 return;
247
248 // victim must be creature and attackable
249 if (!unitTarget || unitTarget->GetTypeId() != TypeID::TYPEID_UNIT || m_caster->IsFriendlyTo(unitTarget))
250 return;
251
252 // victim have to be alive and humanoid or undead
253 if (unitTarget->IsAlive() && (unitTarget->GetCreatureTypeMask() & CREATURE_TYPEMASK_HUMANOID_OR_UNDEAD) != 0)
254 m_caster->ToPlayer()->SendLoot(unitTarget->GetGUID(), LootType::LOOT_PICKPOCKETING);
255}
256
258{
260 return;
261
262 if (m_caster->GetTypeId() != TypeID::TYPEID_PLAYER)
263 return;
264 // uint32 skillid = m_spellInfo->Effects[i].MiscValue;
265 // uint16 skillmax = unitTarget->ToPlayer()->(skillid);
266 // m_caster->ToPlayer()->SetSkill(skillid, skillval?skillval:1, skillmax+75);
267}
268
270{
272 return;
273
274 if (!itemTarget)
275 return;
276
277 Player* player = m_caster->ToPlayer();
278 if (!player)
279 return;
280
281 // Handle vellums
282 if (itemTarget->IsVellum())
283 {
284 // destroy one vellum from stack
285 uint32 count = 1;
286 player->DestroyItemCount(itemTarget, count, true);
287 unitTarget = player;
288 // and add a scroll
289 DoCreateItem(effIndex, m_spellInfo->Effects[effIndex].ItemType);
290 itemTarget = NULL;
291 m_targets.SetItemTarget(NULL);
292 }
293 else
294 {
295 // do not increase skill if vellum used
296 if (!(m_CastItem && m_CastItem->GetTemplate()->Flags & ITEM_PROTO_FLAG_TRIGGERED_CAST))
297 player->UpdateCraftSkill(m_spellInfo->Id);
298
299 uint32 enchant_id = m_spellInfo->Effects[effIndex].MiscValue;
300 if (!enchant_id)
301 {
302 SF_LOG_ERROR("spells", "Spell %u Effect %u (SPELL_EFFECT_ENCHANT_ITEM_PERMANENT) have 0 as enchanting id", m_spellInfo->Id, effIndex);
303 return;
304 }
305
306 SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
307 if (!pEnchant)
308 {
309 SF_LOG_ERROR("spells", "Spell %u Effect %u (SPELL_EFFECT_ENCHANT_ITEM_PERMANENT) have non-existing enchant_id %u ", m_spellInfo->Id, effIndex, enchant_id);
310 return;
311 }
312
313 // item can be in trade slot and have owner diff. from caster
314 Player* item_owner = itemTarget->GetOwner();
315 if (!item_owner)
316 return;
317
318 if (item_owner != player && player->GetSession()->HasPermission(rbac::RBAC_PERM_LOG_GM_TRADE))
319 {
320 sLog->outCommand(player->GetSession()->GetAccountId(), "GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)",
321 player->GetName().c_str(), player->GetSession()->GetAccountId(),
322 itemTarget->GetTemplate()->Name1.c_str(), itemTarget->GetEntry(),
323 item_owner->GetName().c_str(), item_owner->GetSession()->GetAccountId());
324 }
325
326 // remove old enchanting before applying new if equipped
328
329 itemTarget->SetEnchantment(PERM_ENCHANTMENT_SLOT, enchant_id, 0, 0, m_caster->GetGUID());
330
331 // add new enchanting if equipped
333
334 item_owner->RemoveTradeableItem(itemTarget);
335 itemTarget->ClearSoulboundTradeable(item_owner);
336 }
337}
338
340{
342 return;
343
344 if (!itemTarget)
345 return;
346
347 Player* player = m_caster->ToPlayer();
348 if (!player)
349 return;
350
351 uint32 enchantId = m_spellInfo->Effects[effIndex].MiscValue;
352 if (!enchantId)
353 return;
354
355 SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(enchantId);
356 if (!enchant)
357 return;
358
359 // support only enchantings with add socket in this slot
360 {
361 bool add_socket = false;
362 for (uint8 i = 0; i < MAX_ITEM_ENCHANTMENT_EFFECTS; ++i)
363 {
365 {
366 add_socket = true;
367 break;
368 }
369 }
370 if (!add_socket)
371 {
372 SF_LOG_ERROR("spells", "Spell::EffectEnchantItemPrismatic: attempt apply enchant spell %u with SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC (%u) but without ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET (%u), not suppoted yet.",
374 return;
375 }
376 }
377
378 // item can be in trade slot and have owner diff. from caster
379 Player* item_owner = itemTarget->GetOwner();
380 if (!item_owner)
381 return;
382
383 if (item_owner != player && player->GetSession()->HasPermission(rbac::RBAC_PERM_LOG_GM_TRADE))
384 {
385 sLog->outCommand(player->GetSession()->GetAccountId(), "GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)",
386 player->GetName().c_str(), player->GetSession()->GetAccountId(),
387 itemTarget->GetTemplate()->Name1.c_str(), itemTarget->GetEntry(),
388 item_owner->GetName().c_str(), item_owner->GetSession()->GetAccountId());
389 }
390
391 // remove old enchanting before applying new if equipped
393
394 itemTarget->SetEnchantment(PRISMATIC_ENCHANTMENT_SLOT, enchantId, 0, 0, m_caster->GetGUID());
395
396 // add new enchanting if equipped
398
399 item_owner->RemoveTradeableItem(itemTarget);
400 itemTarget->ClearSoulboundTradeable(item_owner);
401}
402
404{
406 return;
407
408 Player* player = m_caster->ToPlayer();
409 if (!player)
410 return;
411
412 if (!itemTarget)
413 return;
414
415 uint32 enchant_id = m_spellInfo->Effects[effIndex].MiscValue;
416
417 if (!enchant_id)
418 {
419 SF_LOG_ERROR("spells", "Spell %u Effect %u (SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY) have 0 as enchanting id", m_spellInfo->Id, effIndex);
420 return;
421 }
422
423 SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
424 if (!pEnchant)
425 {
426 SF_LOG_ERROR("spells", "Spell %u Effect %u (SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY) have not existed enchanting id %u ", m_spellInfo->Id, effIndex, enchant_id);
427 return;
428 }
429
430 // select enchantment duration
431 uint32 duration;
432
434 m_spellInfo->Id, m_spellInfo->SpellFamilyName, m_spellInfo->SpellVisual[0]);
435
436 // item can be in trade slot and have owner diff. from caster
437 Player* item_owner = itemTarget->GetOwner();
438 if (!item_owner)
439 return;
440
441 if (item_owner != player && player->GetSession()->HasPermission(rbac::RBAC_PERM_LOG_GM_TRADE))
442 {
443 sLog->outCommand(player->GetSession()->GetAccountId(), "GM %s (Account: %u) enchanting(temp): %s (Entry: %d) for player: %s (Account: %u)",
444 player->GetName().c_str(), player->GetSession()->GetAccountId(),
445 itemTarget->GetTemplate()->Name1.c_str(), itemTarget->GetEntry(),
446 item_owner->GetName().c_str(), item_owner->GetSession()->GetAccountId());
447 }
448
449 // remove old enchanting before applying new if equipped
451
452 itemTarget->SetEnchantment(TEMP_ENCHANTMENT_SLOT, enchant_id, duration * 1000, 0, m_caster->GetGUID());
453
454 // add new enchanting if equipped
456}
457
459{
461 return;
462
463 // this is only item spell effect applied to main-hand weapon of target player (players in area)
464 if (!unitTarget || unitTarget->GetTypeId() != TypeID::TYPEID_PLAYER)
465 return;
466
467 Player* item_owner = unitTarget->ToPlayer();
469
470 if (!item)
471 return;
472
473 // must be equipped
474 if (!item->IsEquipped())
475 return;
476
477 if (m_spellInfo->Effects[effIndex].MiscValue)
478 {
479 uint32 enchant_id = m_spellInfo->Effects[effIndex].MiscValue;
480 int32 duration = m_spellInfo->GetDuration(); //Try duration index first ..
481 if (!duration)
482 duration = damage;//+1; //Base points after ..
483 if (!duration)
484 duration = 10; //10 seconds for enchants which don't have listed duration
485
486 SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
487 if (!pEnchant)
488 return;
489
490 // Always go to temp enchantment slot
492
493 // Enchantment will not be applied if a different one already exists
494 if (item->GetEnchantmentId(slot) && item->GetEnchantmentId(slot) != enchant_id)
495 return;
496
497 // Apply the temporary enchantment
498 item->SetEnchantment(slot, enchant_id, duration * IN_MILLISECONDS, 0, m_caster->GetGUID());
499 item_owner->ApplyEnchantment(item, slot, true);
500 }
501}
502
504{
506 return;
507
508 if (!itemTarget || !itemTarget->GetTemplate()->DisenchantID)
509 return;
510
511 if (Player* caster = m_caster->ToPlayer())
512 {
513 caster->UpdateCraftSkill(m_spellInfo->Id);
514 caster->SendLoot(itemTarget->GetGUID(), LootType::LOOT_DISENCHANTING);
515 }
516
517 // item will be removed at disenchanting end
518}
519
521{
523 return;
524
525 if (unitTarget->GetTypeId() != TypeID::TYPEID_UNIT)
526 return;
527 if (m_caster->GetTypeId() != TypeID::TYPEID_PLAYER)
528 return;
529
530 Creature* creature = unitTarget->ToCreature();
531 int32 targetLevel = creature->getLevel();
532
533 uint32 skill = creature->GetCreatureTemplate()->GetRequiredLootSkill();
534
535 m_caster->ToPlayer()->SendLoot(creature->GetGUID(), LootType::LOOT_SKINNING);
537
538 int32 reqValue = targetLevel < 10 ? 0 : targetLevel < 20 ? (targetLevel - 10) * 10 : targetLevel * 5;
539
540 int32 skillValue = m_caster->ToPlayer()->GetPureSkillValue(skill);
541
542 // Double chances for elites
543 m_caster->ToPlayer()->UpdateGatherSkill(skill, skillValue, reqValue, creature->isElite() ? 2 : 1);
544}
545
547{
549 return;
550
551 if (!unitTarget || unitTarget->GetTypeId() != TypeID::TYPEID_PLAYER)
552 return;
553
554 int32 slot = m_spellInfo->Effects[effIndex].MiscValue;
555
556 // -1 means all player equipped items and -2 all items
557 if (slot < 0)
558 {
559 unitTarget->ToPlayer()->DurabilityPointsLossAll(damage, (slot < -1));
561 return;
562 }
563
564 // invalid slot value
565 if (slot >= INVENTORY_SLOT_BAG_END)
566 return;
567
568 if (Item* item = unitTarget->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, slot))
569 {
570 unitTarget->ToPlayer()->DurabilityPointsLoss(item, damage);
571 ExecuteLogEffectDurabilityDamage(effIndex, unitTarget, item->GetEntry(), slot);
572 }
573}
574
576{
578 return;
579
580 if (!unitTarget || unitTarget->GetTypeId() != TypeID::TYPEID_PLAYER)
581 return;
582
583 int32 slot = m_spellInfo->Effects[effIndex].MiscValue;
584
585 // FIXME: some spells effects have value -1/-2
586 // Possibly its mean -1 all player equipped items and -2 all items
587 if (slot < 0)
588 {
589 unitTarget->ToPlayer()->DurabilityLossAll(float(damage) / 100.0f, (slot < -1));
590 return;
591 }
592
593 // invalid slot value
594 if (slot >= INVENTORY_SLOT_BAG_END)
595 return;
596
597 if (damage <= 0)
598 return;
599
600 if (Item* item = unitTarget->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, slot))
601 unitTarget->ToPlayer()->DurabilityLoss(item, float(damage) / 100.0f);
602}
603
605{
607 return;
608
609 Player* player = m_caster->ToPlayer();
610 if (!player)
611 return;
612
613 if (!itemTarget || !(itemTarget->GetTemplate()->Flags & ITEM_PROTO_FLAG_PROSPECTABLE))
614 return;
615
616 if (itemTarget->GetCount() < 5)
617 return;
618
620 {
621 uint32 SkillValue = player->GetPureSkillValue(SKILL_JEWELCRAFTING);
622 uint32 reqSkillValue = itemTarget->GetTemplate()->RequiredSkillRank;
623 player->UpdateGatherSkill(SKILL_JEWELCRAFTING, SkillValue, reqSkillValue);
624 }
625
627}
628
630{
632 return;
633
634 Player* player = m_caster->ToPlayer();
635 if (!player)
636 return;
637
638 if (!itemTarget || !(itemTarget->GetTemplate()->Flags & ITEM_PROTO_FLAG_MILLABLE))
639 return;
640
641 if (itemTarget->GetCount() < 5)
642 return;
643
645 {
646 uint32 SkillValue = player->GetPureSkillValue(SKILL_INSCRIPTION);
647 uint32 reqSkillValue = itemTarget->GetTemplate()->RequiredSkillRank;
648 player->UpdateGatherSkill(SKILL_INSCRIPTION, SkillValue, reqSkillValue);
649 }
650
651 player->SendLoot(itemTarget->GetGUID(), LootType::LOOT_MILLING);
652}
653
655{
657 return;
658
659 if (!unitTarget || unitTarget->GetTypeId() != TypeID::TYPEID_PLAYER)
660 return;
661
662 Player* player = unitTarget->ToPlayer();
663 uint32 itemId = m_spellInfo->Effects[effIndex].ItemType;
664
665 if (Item* item = player->GetItemByEntry(itemId))
666 player->DestroyItem(item->GetBagSlot(), item->GetSlot(), true);
667}
668
670{
672 return;
673
674 if (!unitTarget || unitTarget->GetTypeId() != TypeID::TYPEID_PLAYER)
675 return;
676
677 Player* player = m_caster->ToPlayer();
678
679 if (!player)
680 return;
681
682 uint32 item_id = m_spellInfo->Effects[EFFECT_0].ItemType;
683
684 ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(item_id);
685 if (!pProto)
686 {
687 player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL);
688 return;
689 }
690
691 if (Item* pItem = player->GetItemByEntry(item_id))
692 {
693 for (int x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x)
694 pItem->SetSpellCharges(x, pProto->Spells[x].SpellCharges);
695 pItem->SetState(ITEM_CHANGED, player);
696 }
697}
698
700{
702 return;
703
704 // Safety checks done in Spell::CheckCast
705 Player* caster = m_caster->ToPlayer();
706 if (Guild* guild = caster->GetGuild())
707 guild->HandleBuyBankTab(caster->GetSession(), m_spellInfo->Effects[effIndex].BasePoints - 1); // Bank tabs start at zero internally
708}
@ IN_MILLISECONDS
Definition Common.h:125
@ ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET
Definition DBCEnums.h:417
DBCStorage< SpellItemEnchantmentEntry > sSpellItemEnchantmentStore(SpellItemEnchantmentfmt)
#define MAX_ITEM_ENCHANTMENT_EFFECTS
std::int32_t int32
Definition Define.h:73
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
std::uint64_t uint64
Definition Define.h:76
@ GO_JUST_DEACTIVATED
Definition GameObject.h:619
EnchantmentSlot
Definition Item.h:149
@ PERM_ENCHANTMENT_SLOT
Definition Item.h:150
@ TEMP_ENCHANTMENT_SLOT
Definition Item.h:151
@ PRISMATIC_ENCHANTMENT_SLOT
Definition Item.h:156
@ EQUIP_ERR_ITEM_NOT_FOUND
Definition Item.h:51
@ ITEM_CHANGED
Definition Item.h:192
@ ITEM_PROTO_FLAG_TRIGGERED_CAST
@ ITEM_PROTO_FLAG_MILLABLE
@ ITEM_PROTO_FLAG_PROSPECTABLE
#define MAX_ITEM_PROTO_SPELLS
@ ITEM_FLAG_UNLOCKED
#define SF_LOG_DEBUG(filterType__,...)
Definition Log.h:134
#define SF_LOG_ERROR(filterType__,...)
Definition Log.h:143
#define sLog
Definition Log.h:106
LootStore LootTemplates_Spell("spell_loot_template", "spell id (random item creating)", false)
@ LOOT_PROSPECTING
Definition LootMgr.h:73
@ LOOT_DISENCHANTING
Definition LootMgr.h:70
@ LOOT_SKINNING
Definition LootMgr.h:72
@ LOOT_PICKPOCKETING
Definition LootMgr.h:68
@ LOOT_MILLING
Definition LootMgr.h:74
@ TYPEID_PLAYER
Definition Object.h:55
@ TYPEID_UNIT
Definition Object.h:54
#define sObjectMgr
Definition ObjectMgr.h:1617
#define sOutdoorPvPMgr
@ INVENTORY_SLOT_BAG_END
Definition Player.h:714
@ EQUIPMENT_SLOT_MAINHAND
Definition Player.h:704
#define INVENTORY_SLOT_BAG_0
Definition Player.h:684
@ GAMEOBJECT_TYPE_BUTTON
@ GAMEOBJECT_TYPE_FLAGSTAND
@ GAMEOBJECT_TYPE_GOOBER
SpellEffIndex
@ EFFECT_0
@ SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC
uint32 const CREATURE_TYPEMASK_HUMANOID_OR_UNDEAD
SkillType
@ SKILL_INSCRIPTION
@ SKILL_NONE
@ SKILL_JEWELCRAFTING
SpellCastResult
@ SPELL_EFFECT_HANDLE_HIT
Definition Spell.h:276
@ SPELL_EFFECT_HANDLE_HIT_TARGET
Definition Spell.h:277
@ UNIT_FLAG_SKINNABLE
Definition Unit.h:651
@ UNIT_FIELD_FLAGS
@ ITEM_FIELD_DYNAMIC_FLAGS
CreatureTemplate const * GetCreatureTemplate() const
Definition Creature.h:524
bool isElite() const
Definition Guild.h:324
Definition Item.h:202
void SetEnchantment(EnchantmentSlot slot, uint32 id, uint32 duration, uint32 charges, uint64 caster=0)
Definition Item.cpp:856
uint32 GetEnchantmentId(EnchantmentSlot slot) const
Definition Item.h:287
bool IsEquipped() const
Definition Item.cpp:739
uint64 GetGUID() const
Definition Object.h:119
uint32 GetGUIDLow() const
Definition Object.h:120
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition Object.cpp:1280
void SendEquipError(InventoryResult msg, Item *pItem, Item *pItem2=NULL, uint32 itemid=0)
void AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore const &store, bool broadcast=false)
Definition Player.cpp:20654
Item * GetItemByEntry(uint32 entry) const
bool HasItemCount(uint32 item, uint32 count=1, bool inBankAlso=false) const
bool UpdateCraftSkill(uint32 spellid)
Definition Player.cpp:6162
void ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool apply_dur=true, bool ignore_condition=false)
Definition Player.cpp:11168
Guild * GetGuild()
Definition Player.cpp:22662
uint16 GetPureSkillValue(uint32 skill) const
Definition Player.cpp:6631
void RemoveTradeableItem(Item *item)
WorldSession * GetSession() const
Definition Player.h:2417
Item * GetItemByPos(uint16 pos) const
void DestroyItem(uint8 bag, uint8 slot, bool update)
Battleground * GetBattleground() const
Definition Player.cpp:19212
bool OnArchaeologyFindUsed(GameObject *go)
Definition Player.cpp:23358
void DestroyItemCount(uint32 item, uint32 count, bool update, bool unequip_check=false)
void SendLoot(uint64 guid, LootType loot_type, bool isAoE=false)
Definition Player.cpp:9346
bool UpdateGatherSkill(uint32 SkillId, uint32 SkillValue, uint32 RedLevel, uint32 Multiplicator=1)
Definition Player.cpp:6194
GameObject * gameObjTarget
Definition Spell.h:628
void EffectDurabilityDamage(SpellEffIndex effIndex)
void EffectMilling(SpellEffIndex effIndex)
void EffectEnchantItemTmp(SpellEffIndex effIndex)
static void SendCastResult(Player *caster, SpellInfo const *spellInfo, uint8 cast_count, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE, Opcodes opcode=SMSG_CAST_FAILED)
Definition Spell.cpp:3874
SpellCastTargets m_targets
Definition Spell.h:535
void EffectOpenLock(SpellEffIndex effIndex)
void EffectDisEnchant(SpellEffIndex effIndex)
int32 damage
Definition Spell.h:630
SpellCastResult CanOpenLock(uint32 effIndex, uint32 lockid, SkillType &skillid, int32 &reqSkillValue, int32 &skillValue)
Definition Spell.cpp:7597
SpellEffectHandleMode effectHandleMode
Definition Spell.h:631
SpellResearchData const * m_researchData
Definition Spell.h:538
void EffectEnchantItemPerm(SpellEffIndex effIndex)
Unit *const m_caster
Definition Spell.h:581
void EffectPickPocket(SpellEffIndex effIndex)
void EffectProspecting(SpellEffIndex effIndex)
void EffectEnchantHeldItem(SpellEffIndex effIndex)
void EffectDurabilityDamagePCT(SpellEffIndex effIndex)
void ExecuteLogEffectOpenLock(uint8 effIndex, Object *obj)
Definition Spell.cpp:4952
Item * itemTarget
Definition Spell.h:627
void EffectEnchantItemPrismatic(SpellEffIndex effIndex)
void EffectCreateItem2(SpellEffIndex effIndex)
void EffectRechargeManaGem(SpellEffIndex effIndex)
void EffectDestroyItem(SpellEffIndex effIndex)
void EffectUnlockGuildVaultTab(SpellEffIndex effIndex)
Unit * unitTarget
Definition Spell.h:626
void EffectCreateItem(SpellEffIndex effIndex)
void ExecuteLogEffectCreateItem(uint8 effIndex, uint32 entry)
Definition Spell.cpp:4958
void EffectCreateRandomItem(SpellEffIndex effIndex)
void SendLoot(uint64 guid, LootType loottype)
Item * m_CastItem
Definition Spell.h:531
void DoCreateItem(uint32 i, uint32 itemtype)
void ExecuteLogEffectDurabilityDamage(uint8 effIndex, Unit *victim, int32 itemId, int32 slot)
Definition Spell.cpp:4946
void EffectSkinning(SpellEffIndex effIndex)
SpellInfo const *const m_spellInfo
Definition Spell.h:530
void EffectTradeSkill(SpellEffIndex effIndex)
uint8 getLevel() const
Definition Unit.h:1528
std::string const & GetName() const
Definition Object.h:664
bool HasPermission(uint32 permissionId)
uint32 GetAccountId() const
#define sWorld
Definition World.h:910
@ CONFIG_SKILL_MILLING
Definition World.h:110
@ CONFIG_SKILL_PROSPECTING
Definition World.h:109
uint32 GetTemporaryItemEnchantDurationSeconds(uint32 spellId, uint32 spellFamilyName, uint32 spellVisual)
bool ShouldDeactivateOwnedTrapOnOpenLock(uint32 spellId, uint32 gameObjectType, bool hasOwner)
@ RBAC_PERM_LOG_GM_TRADE
Definition RBAC.h:51
int32 SpellCharges
SkillType GetRequiredLootSkill() const
Definition Creature.h:136
uint32 GetLockId() const
Definition GameObject.h:415
struct GameObjectTemplate::@046065176235271051340241126110345143267101032070::@336060043160212225074214221232260020127013174055 goober
struct GameObjectTemplate::@046065176235271051340241126110345143267101032070::@035305233304037036156142147071371001131016202245 button
_Spell Spells[MAX_ITEM_PROTO_SPELLS]
uint32 type[MAX_ITEM_ENCHANTMENT_EFFECTS]