72 SF_LOG_ERROR(
"spells",
"EffectTriggerRitualOfSummoning of spell %u: triggering unknown spell id %i",
m_spellInfo->Id, triggered_spell_id);
151 player->
BankItem(dest, pNewItem,
true);
195 SF_LOG_ERROR(
"spells",
"EffectSummonType: Unhandled summon type %u",
m_spellInfo->Effects[effIndex].MiscValueB);
222 if (properties->
Flags & 512)
227 switch (properties->
Type)
245 if (!summon || !summon->
IsTotem())
295 float radius =
m_spellInfo->Effects[effIndex].CalcRadius();
299 for (
uint32 count = 0; count < numSummons; ++count)
308 summon =
m_originalCaster->SummonCreature(entry, pos, summonType, duration);
342 spellId = spellInfo->
Id;
378 if (creatureTarget->
IsPet())
414 m_caster->ToPlayer()->PetSpellInitialize();
446 if (petentry == 0 || OldSummon->
GetEntry() == petentry)
484 if (
m_caster->ToCreature()->IsTotem())
493 std::string new_name =
sObjectMgr->GeneratePetName(petentry);
494 if (!new_name.empty())
518 if (!learn_spellproto)
555 for (
auto phase :
m_caster->GetPhases())
577 for (
auto phase :
m_caster->GetPhases())
623 unitTarget->ToPlayer()->GetSession()->SendPacket(&data);
672 m_caster->CastCustomSpell(pet,
m_spellInfo->Effects[effIndex].TriggerSpell, &benefit, NULL, NULL,
true);
704 m_caster->RemoveGameObject(obj,
true);
730 for (
auto phase :
m_caster->GetPhases())
823 SF_LOG_ERROR(
"sql.sql",
"Gameobject (Entry: %u) not exist and not created at spell (ID: %u) cast", name_id,
m_spellInfo->Id);
848 float dis = (float)
rand_norm() * (max_dis - min_dis) + min_dis;
869 for (
auto phase :
m_caster->GetPhases())
872 switch (goinfo->
type)
882 switch (std::rand() % 3)
884 case 0: lastSec = 3;
break;
885 case 1: lastSec = 7;
break;
886 case 2: lastSec = 13;
break;
887 case 3: lastSec = 17;
break;
921 SF_LOG_DEBUG(
"spells",
"AddObject at SpellEfects.cpp EffectTransmitted");
928 m_caster->TrackGameObject(pGameObj);
936 for (
auto phase :
m_caster->GetPhases())
1006 if ((casterFaction && targetFaction && !casterFaction->
IsFriendlyTo(*targetFaction)) || !targetFaction)
1050 level = skill202 / 5;
1052 float radius = 5.0f;
1061 for (
uint32 count = 0; count < numGuardians; ++count)
1074 ((
Guardian*)summon)->InitStatsForLevel(level);
1128 float radius =
m_spellInfo->Effects[effIndex].CalcRadius(caster);
1189 uint8 const percent =
uint8(std::min<int32>(std::max<int32>(effectValue, 0), 100));
@ SPELL_REVIVE_BATTLE_PETS
@ SPELL_BATTLE_PET_TRAINING_PASSIVE
DBCStorage< SummonPropertiesEntry > sSummonPropertiesStore(SummonPropertiesfmt)
DBCStorage< FactionTemplateEntry > sFactionTemplateStore(FactionTemplateEntryfmt)
@ DYNAMIC_OBJECT_AREA_SPELL
#define FISHING_BOBBER_READY_TIME
@ EQUIP_ERR_CLIENT_LOCKED_OUT
#define SF_LOG_DEBUG(filterType__,...)
#define SF_LOG_ERROR(filterType__,...)
@ TEMPSUMMON_TIMED_DESPAWN
@ TEMPSUMMON_DEAD_DESPAWN
#define DEFAULT_WORLD_OBJECT_SIZE
@ SCRIPT_COMMAND_ACTIVATE_OBJECT
std::vector< ItemPosCount > ItemPosCountVec
@ PLAYER_FLAGS_BATTLE_PET_ENABLED
@ EQUIPMENT_SLOT_MAINHAND
#define MAX_PLAYER_SUMMON_DELAY
@ GAMEOBJECT_TYPE_SPELL_FOCUS
@ GAMEOBJECT_TYPE_DUEL_ARBITER
@ GAMEOBJECT_TYPE_SUMMONING_RITUAL
@ GAMEOBJECT_TYPE_FISHINGHOLE
@ GAMEOBJECT_TYPE_FLAGDROP
@ GAMEOBJECT_TYPE_FISHINGNODE
@ SPELL_EFFECT_SUMMON_OBJECT_SLOT1
GameObjectDestructibleState
@ SUMMON_CATEGORY_VEHICLE
@ SPELL_EFFECT_HANDLE_HIT
@ SPELL_EFFECT_HANDLE_HIT_TARGET
@ SPELL_AURA_CONTROL_VEHICLE
#define SUMMON_SLOT_TOTEM
@ UNIT_FLAG_IMMUNE_TO_NPC
@ UNIT_FIELD_VIRTUAL_ITEM_ID
@ UNIT_FIELD_CHANNEL_OBJECT
@ UNIT_FIELD_SHAPESHIFT_FORM
@ UNIT_FIELD_BATTLE_PET_COMPANION_NAME_TIMESTAMP
@ UNIT_FIELD_WILD_BATTLE_PET_LEVEL
@ UNIT_FIELD_BATTLE_PET_COMPANION_GUID
@ UNIT_FIELD_CREATED_BY_SPELL
@ OBJECT_FIELD_DYNAMIC_FLAGS
@ ITEM_FIELD_MAX_DURABILITY
@ GAMEOBJECT_FIELD_FACTION_TEMPLATE
@ PLAYER_FIELD_SUMMONED_BATTLE_PET_GUID
@ PLAYER_FIELD_VISIBLE_ITEMS
@ PLAYER_FIELD_PLAYER_FLAGS
@ PLAYER_FIELD_CURRENT_BATTLE_PET_BREED_QUALITY
T ApplyPct(T &base, U pct)
@ VEHICLE_SPELL_RIDE_HARDCODED
uint16 GetCurrentHealth() const
uint16 GetMaxHealth() const
uint32 GetTimestamp() const
void SetCurrentSummon(TempSummon *summon)
uint64 GetCurrentSummonId() const
BattlePet * GetBattlePet(uint64 id) const
void HealBattlePets(uint8 percent)
void UnlockLoadoutSlot(uint8 slot)
void WriteGuidBytes(const ObjectGuid &guid, Offsets... offsets)
void WriteGuidMask(const ObjectGuid &guid, Offsets... offsets)
virtual void EnterEvadeMode()
void SetDisplayId(uint32 modelId) OVERRIDE
void DespawnOrUnsummon(uint32 msTimeToDespawn=0)
void SetReactState(ReactStates st)
CreatureTemplate const * GetCreatureTemplate() const
bool CreateDynamicObject(uint32 guidlow, Unit *caster, SpellInfo const *spell, Position const &pos, float radius, DynamicObjectType type)
GameObjectTemplate const * GetGOInfo() const
void SetOwnerGUID(uint64 owner)
bool Create(uint32 guidlow, uint32 name_id, Map *map, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state, uint32 artKit=0)
void SetRespawnTime(int32 respawn)
GameobjectTypes GetGoType() const
bool SetPhased(uint32 id, bool update, bool apply) OVERRIDE
void AddUniqueUse(Player *player)
void SetSpellId(uint32 id)
void SetEnchantment(EnchantmentSlot slot, uint32 id, uint32 duration, uint32 charges, uint64 caster=0)
ItemTemplate const * GetTemplate() const
static Item * CreateItem(uint32 itemEntry, uint32 count, Player const *player=NULL)
void CreatureRelocation(Creature *creature, float x, float y, float z, float ang, bool respawnRelocationOnFail=true)
TempSummon * SummonCreature(uint32 entry, Position const &pos, SummonPropertiesEntry const *properties=NULL, uint32 duration=0, Unit *summoner=NULL, uint32 spellId=0, uint32 vehId=0)
float GetFollowAngle() const OVERRIDE
void MoveFollow(Unit *target, float dist, float angle, MovementSlot slot=MOTION_SLOT_ACTIVE)
void Clear(bool reset=true)
uint32 GetUInt32Value(uint16 index) const
void SetFlag(uint16 index, uint32 newFlag)
void RemoveFlag(uint16 index, uint32 oldFlag)
bool HasFlag(uint16 index, uint32 flag) const
void SetUInt32Value(uint16 index, uint32 value)
void SetUInt64Value(uint16 index, uint64 value)
Player * GetOwner() const
void setDeathState(DeathState s)
void InitTalentForLevel()
void SavePetToDB(PetSaveMode mode)
PetType getPetType() const
bool isControlled() const
uint32 GetCurrentFoodBenefitLevel(uint32 itemlevel) const
bool learnSpell(uint32 spell_id)
static bool IsEquipmentPos(uint16 pos)
InventoryResult CanEquipItem(uint8 slot, uint16 &dest, Item *pItem, bool swap, bool not_loading=true) const
uint16 GetSkillValue(uint32 skill) const
Item * BankItem(ItemPosCountVec const &dest, Item *pItem, bool update)
BattlePetMgr * GetBattlePetMgr()
InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pItem, bool swap=false) const
void PetSpellInitialize()
Item * StoreItem(ItemPosCountVec const &pos, Item *pItem, bool update)
void SendSpellCooldown(uint32 spellId, uint32 cooldown)
void DestroyItem(uint8 bag, uint8 slot, bool update)
static bool IsInventoryPos(uint16 pos)
void RemovePet(Pet *pet, PetSaveMode mode, bool returnreagent=false)
void DurabilityLoss(Item *item, double percent)
void AutoUnequipOffhandIfNeed(bool force=false)
Item * EquipItem(uint16 pos, Item *pItem, bool update)
Pet * SummonPet(uint32 entry, float x, float y, float z, float ang, PetType petType, uint32 despwtime)
void learnSpell(uint32 spell_id, bool dependent)
void DestroyItemCount(uint32 item, uint32 count, bool update, bool unequip_check=false)
uint32 GetSpellCooldownDelay(uint32 spell_id) const
InventoryResult CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pItem, bool swap, bool not_loading=true) const
static bool IsBankPos(uint16 pos)
SpellInfo const * GetSpellInfo() const
void EffectSummonRaFFriend(SpellEffIndex effIndex)
void EffectDismissPet(SpellEffIndex effIndex)
GameObject * gameObjTarget
void EffectTriggerRitualOfSummoning(SpellEffIndex effIndex)
void EffectTameCreature(SpellEffIndex effIndex)
void SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const *properties, uint32 numSummons)
void EffectSummonType(SpellEffIndex effIndex)
SpellCastTargets m_targets
void EffectLearnSpell(SpellEffIndex effIndex)
void EffectSummonPet(SpellEffIndex effIndex)
void ExecuteLogEffectSummonObject(uint8 effIndex, WorldObject *obj)
SpellEffectHandleMode effectHandleMode
void EffectActivateObject(SpellEffIndex effIndex)
void EffectSummonPlayer(SpellEffIndex effIndex)
void EffectCreateAreaTrigger(SpellEffIndex effIndex)
void EffectSummonDeadPet(SpellEffIndex effIndex)
void EffectGameObjectDamage(SpellEffIndex effIndex)
void EffectLearnPetSpell(SpellEffIndex effIndex)
void EffectSummonChangeItem(SpellEffIndex effIndex)
void ExecuteLogEffectUnsummonObject(uint8 effIndex, WorldObject *obj)
void EffectRenamePet(SpellEffIndex effIndex)
void EffectGameObjectRepair(SpellEffIndex effIndex)
void EffectFeedPet(SpellEffIndex effIndex)
void EffectDestroyAllTotems(SpellEffIndex effIndex)
WorldLocation * destTarget
void EffectCreateTamedPet(SpellEffIndex effIndex)
void EffectHealBattlePetPct(SpellEffIndex effIndex)
void EffectBattlePetsUnlock(SpellEffIndex effIndex)
void EffectSummonObject(SpellEffIndex effIndex)
void ExecuteLogEffectDestroyItem(uint8 effIndex, uint32 entry)
void EffectSummonObjectWild(SpellEffIndex effIndex)
void EffectGameObjectSetDestructionState(SpellEffIndex effIndex)
void finish(bool ok=true)
SpellInfo const *const m_spellInfo
void EffectTransmitted(SpellEffIndex effIndex)
bool HasAura(AuraType aura) const
void UnSummon(uint32 msTime=0) OVERRIDE
void ClearUnitState(uint32 f)
void setFaction(uint32 faction)
uint32 getFaction() const
FactionTemplateEntry const * GetFactionTemplateEntry() const
void SetCreateHealth(uint32 val)
void SetCreatorGUID(uint64 creator)
MotionMaster * GetMotionMaster()
void SetFacingToObject(WorldObject *object)
void NearTeleportTo(float x, float y, float z, float orientation, bool casting=false)
void SetHealth(uint32 val)
void SetOwnerGUID(uint64 owner)
virtual float GetFollowAngle() const
uint32 HasUnitTypeMask(uint32 mask) const
uint32 CountPctFromMaxHealth(int32 pct) const
void SetMaxHealth(uint32 val)
void SetName(std::string const &newname)
void GetClosePoint(float &x, float &y, float &z, float size, float distance2d=0, float angle=0) const
float GetObjectSize() const
@ CONFIG_BATTLE_PET_LOADOUT_UNLOCK_COUNT
uint32 GetSummonCountForProperty(uint32 summonPropertyId, int32 damage)
uint32 GetTotemSummonHealthPct(uint32 spellId)
bool IsFriendlyTo(FactionTemplateEntry const &entry) const
uint32 GetLinkedGameObjectEntry() const
float GetOrientation() const
void GetPosition(float &x, float &y) const
void Relocate(float x, float y)